diff --git a/.circleci/config.yml b/.circleci/config.yml index 7de018f8ba..eb801f834d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,7 +46,7 @@ commands: jobs: check-style: docker: - - image: cimg/rust:1.53 + - image: cimg/rust:1.54.0 resource_class: xlarge steps: - checkout @@ -61,7 +61,7 @@ jobs: clippy: docker: - - image: cimg/rust:1.54 + - image: cimg/rust:1.54.0 resource_class: xlarge steps: - checkout @@ -76,7 +76,7 @@ jobs: # code-cov: # docker: - # - image: cimg/rust:1.53.0 + # - image: cimg/rust:1.54.0 # resource_class: xlarge # environment: # RUSTC_BOOTSTRAP: 1 @@ -118,7 +118,7 @@ jobs: leo-executable: docker: - - image: cimg/rust:1.54 + - image: cimg/rust:1.54.0 resource_class: xlarge steps: - checkout @@ -136,7 +136,7 @@ jobs: leo-new: docker: - - image: cimg/rust:1.54 + - image: cimg/rust:1.54.0 resource_class: xlarge steps: - attach_workspace: @@ -149,7 +149,7 @@ jobs: leo-init: docker: - - image: cimg/rust:1.54 + - image: cimg/rust:1.54.0 resource_class: xlarge steps: - attach_workspace: @@ -162,7 +162,7 @@ jobs: leo-clean: docker: - - image: cimg/rust:1.54 + - image: cimg/rust:1.54.0 resource_class: xlarge steps: - attach_workspace: @@ -175,7 +175,7 @@ jobs: leo-setup: docker: - - image: cimg/rust:1.54 + - image: cimg/rust:1.54.0 resource_class: xlarge steps: - attach_workspace: @@ -188,7 +188,7 @@ jobs: leo-add-remove: docker: - - image: cimg/rust:1.54 + - image: cimg/rust:1.54.0 resource_class: xlarge steps: - attach_workspace: @@ -201,7 +201,7 @@ jobs: leo-check-constraints: docker: - - image: cimg/rust:1.54 + - image: cimg/rust:1.54.0 resource_class: xlarge steps: - attach_workspace: @@ -214,7 +214,7 @@ jobs: leo-login-logout: docker: - - image: cimg/rust:1.54 + - image: cimg/rust:1.54.0 resource_class: xlarge steps: - attach_workspace: @@ -227,7 +227,7 @@ jobs: leo-clone: docker: - - image: cimg/rust:1.54 + - image: cimg/rust:1.54.0 resource_class: xlarge steps: - attach_workspace: @@ -240,7 +240,7 @@ jobs: leo-publish: docker: - - image: cimg/rust:1.54 + - image: cimg/rust:1.54.0 resource_class: xlarge steps: - attach_workspace: diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..2168b7bfd2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +# Force certain files to be LF +*.leo text eol=lf +*.out text eol=lf +*.rs text eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d4d6a4bd8f..47226188b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,14 +93,11 @@ jobs: run: | sccache --start-server - - name: Install cargo-all-features - run: | - cargo install cargo-all-features - - name: Test - run: | - cd package - cargo test-all-features + uses: actions-rs/cargo@v1 + with: + command: test + args: --all --features ci_skip - name: Print sccache stats run: sccache --show-stats @@ -160,17 +157,11 @@ jobs: run: | sccache --start-server - - name: Install cargo-all-features - run: | - SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path) \ - MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version) \ - cargo install cargo-all-features - - name: Test run: | SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path) \ MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version) \ - cd package && cargo test-all-features + cargo test --all --features ci_skip - name: Print sccache stats run: sccache --show-stats @@ -178,6 +169,74 @@ jobs: - name: Stop sccache server run: sccache --stop-server || true + test-docs: + name: Test Docs + runs-on: ubuntu-latest + env: + RUSTC_WRAPPER: sccache + SCCACHE_CACHE_SIZE: 2G + SCCACHE_DIR: /home/runner/.cache/sccache + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: master + + - name: Install sccache + env: + LINK: https://github.com/mozilla/sccache/releases/download + SCCACHE_VERSION: v0.2.15 + run: | + SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl + mkdir -p $HOME/.local/bin + curl -L "$LINK/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz + mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache + chmod +x $HOME/.local/bin/sccache + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Cache cargo registry + uses: actions/cache@v2 + continue-on-error: false + with: + path: | + ~/.cargo/registry + ~/.cargo/git + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Install Rust Stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Save sccache + uses: actions/cache@v2 + continue-on-error: false + with: + path: /home/runner/.cache/sccache + key: ubuntu-sccache-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ubuntu-sccache- + + - name: Start sccache server + run: sccache --start-server + + - name: Build Cargo Docs + env: + RUSTDOCFLAGS: "--enable-index-page -Zunstable-options" + RUSTC_BOOTSTRAP: "1" + run: | + cargo doc --no-deps --document-private-items --workspace + rm -rf ./tests + + - name: Print sccache stats + run: sccache --show-stats + + - name: Stop sccache server + run: sccache --stop-server || true + codecov: name: Code Coverage runs-on: ubuntu-latest diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..7fa86e8025 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,69 @@ +name: Master Crates Docs +on: + push: + branches: + - master + +jobs: + build-crates-docs: + name: Build Crates Docs + runs-on: ubuntu-latest + env: + RUSTC_WRAPPER: sccache + SCCACHE_CACHE_SIZE: 2G + SCCACHE_DIR: /home/runner/.cache/sccache + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: master + + - name: Install sccache + env: + LINK: https://github.com/mozilla/sccache/releases/download + SCCACHE_VERSION: v0.2.15 + run: | + SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl + mkdir -p $HOME/.local/bin + curl -L "$LINK/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz + mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache + chmod +x $HOME/.local/bin/sccache + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Install Rust Stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Save sccache + uses: actions/cache@v2 + continue-on-error: false + with: + path: /home/runner/.cache/sccache + key: ubuntu-sccache-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ubuntu-sccache- + + - name: Start sccache server + run: sccache --start-server + + - name: Build Cargo Docs + env: + RUSTDOCFLAGS: "--enable-index-page -Zunstable-options" + RUSTC_BOOTSTRAP: "1" + run: | + cargo doc --no-deps --document-private-items --workspace + rm -rf ./tests + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./target/doc/ + + - name: Print sccache stats + run: sccache --show-stats + + - name: Stop sccache server + run: sccache --stop-server || true \ No newline at end of file diff --git a/.gitignore b/.gitignore index cabf0b1b00..d01b74f25d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,9 @@ **/.crates2.json **/bin/ +# sccache from pipeline +sccache*/ + # Emacs gitignore files *~ \#*\# diff --git a/.rusty-hook.toml b/.rusty-hook.toml index bcdbfd8fa4..82a9ed5d69 100644 --- a/.rusty-hook.toml +++ b/.rusty-hook.toml @@ -1,5 +1,5 @@ [hooks] -pre-commit = "cargo clippy && cargo +nightly fmt --all -- --check" +pre-commit = "cargo clippy && cargo fmt --all -- --check" [logging] verbose = true diff --git a/Cargo.lock b/Cargo.lock index bc2e671e06..8d50c4974b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,9 +23,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd" dependencies = [ "gimli", ] @@ -76,9 +76,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.42" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595d3cfa7a60d4555cb5067b99f07142a08ea778de5cf993f7b75c7d8fabc486" +checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf" [[package]] name = "arrayvec" @@ -119,9 +119,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" +checksum = "e7a905d892734eea339e896738c14b9afce22b5318f64b951e70bf3844419b01" dependencies = [ "addr2line", "cc", @@ -340,6 +340,17 @@ dependencies = [ "vec_map", ] +[[package]] +name = "color-backtrace" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd6c04463c99389fff045d2b90ce84f5131332712c7ffbede020f5e9ad1ed685" +dependencies = [ + "atty", + "backtrace", + "termcolor", +] + [[package]] name = "colored" version = "2.0.0" @@ -640,6 +651,16 @@ dependencies = [ "indexmap", ] +[[package]] +name = "eyre" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "221239d1d5ea86bf5d6f91c9d6bc3646ffe471b08ff9b0f91c44f115ac969d2b" +dependencies = [ + "indenter", + "once_cell", +] + [[package]] name = "failure" version = "0.1.8" @@ -900,9 +921,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" [[package]] name = "h2" @@ -1044,6 +1065,12 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + [[package]] name = "indexmap" version = "1.7.0" @@ -1172,12 +1199,12 @@ dependencies = [ "criterion", "indexmap", "leo-ast", + "leo-errors", "leo-parser", "num-bigint", "serde", "serde_json", "tendril", - "thiserror", "typed-arena", ] @@ -1186,21 +1213,21 @@ name = "leo-asg-passes" version = "1.5.3" dependencies = [ "leo-asg", + "leo-errors", ] [[package]] name = "leo-ast" version = "1.5.3" dependencies = [ - "anyhow", "criterion", "indexmap", + "leo-errors", "leo-input", "pest", "serde", "serde_json", "tendril", - "thiserror", ] [[package]] @@ -1213,6 +1240,7 @@ dependencies = [ "leo-asg", "leo-asg-passes", "leo-ast", + "leo-errors", "leo-imports", "leo-input", "leo-package", @@ -1237,10 +1265,25 @@ dependencies = [ "snarkvm-utilities", "tempfile", "tendril", - "thiserror", "tracing", ] +[[package]] +name = "leo-errors" +version = "1.5.3" +dependencies = [ + "backtrace", + "color-backtrace", + "colored", + "derivative", + "eyre", + "leo-input", + "pest", + "serde", + "tendril", + "thiserror", +] + [[package]] name = "leo-imports" version = "1.5.3" @@ -1248,8 +1291,8 @@ dependencies = [ "indexmap", "leo-asg", "leo-ast", + "leo-errors", "leo-parser", - "thiserror", "tracing", ] @@ -1270,9 +1313,9 @@ name = "leo-lang" version = "1.5.3" dependencies = [ "ansi_term 0.12.1", - "anyhow", "assert_cmd", "clap", + "color-backtrace", "colored", "console", "dirs", @@ -1280,6 +1323,7 @@ dependencies = [ "lazy_static", "leo-ast", "leo-compiler", + "leo-errors", "leo-imports", "leo-input", "leo-package", @@ -1301,7 +1345,6 @@ dependencies = [ "snarkvm-utilities", "structopt", "test_dir", - "thiserror", "toml", "tracing", "tracing-subscriber", @@ -1317,8 +1360,8 @@ name = "leo-package" version = "1.5.3" dependencies = [ "lazy_static", + "leo-errors", "serde", - "thiserror", "toml", "tracing", "walkdir", @@ -1333,12 +1376,12 @@ dependencies = [ "indexmap", "lazy_static", "leo-ast", + "leo-errors", "leo-test-framework", "serde", "serde_json", "serde_yaml", "tendril", - "thiserror", "tracing", ] @@ -1348,6 +1391,7 @@ version = "1.5.3" dependencies = [ "indexmap", "leo-ast", + "leo-errors", "leo-input", "rand 0.8.4", "rand_core 0.6.3", @@ -1356,14 +1400,15 @@ dependencies = [ "snarkvm-curves", "snarkvm-dpc", "snarkvm-utilities", - "thiserror", ] [[package]] name = "leo-synthesizer" version = "1.5.3" dependencies = [ + "eyre", "hex", + "leo-errors", "num-bigint", "serde", "serde_json", @@ -1695,9 +1740,9 @@ checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a" [[package]] name = "object" -version = "0.25.3" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" +checksum = "c55827317fb4c08822499848a14237d2874d6f139828893017237e7ab93eb386" dependencies = [ "memchr", ] @@ -2367,9 +2412,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.17" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15654ed4ab61726bf918a39cb8d98a2e2995b002387807fa6ba58fdf7f59bb23" +checksum = "039ba818c784248423789eec090aab9fb566c7b94d6ebbfa1814a9fd52c8afb2" dependencies = [ "dtoa", "linked-hash-map", @@ -2434,9 +2479,9 @@ checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] name = "snarkvm-algorithms" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40caa98abd0a874a003d844d6a73562020fb5fa976daa14055f030d9803430b7" +checksum = "3534da2cfa71894e4d28c5dcaf9f9c5c94315904c4ace6c86419a8f2ff8b1641" dependencies = [ "anyhow", "bitvec", @@ -2462,9 +2507,9 @@ dependencies = [ [[package]] name = "snarkvm-curves" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "010ae5c95693279db519e4a8525a8a3145edc8e36198efdfaf250622f4540cc1" +checksum = "83b4de7cd1533c67dd386058b631d7e5ea8b2063ebca212159b13fc1a94ff4a7" dependencies = [ "derivative", "rand 0.8.4", @@ -2478,9 +2523,9 @@ dependencies = [ [[package]] name = "snarkvm-derives" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e963ae4209f0166a619ab9266ce71c6f9228861ec55615a1b6154d673ffc158" +checksum = "3e854888634305d8c5c79fe59adaae593971a8b29d3148834f698141b16c2c7b" dependencies = [ "proc-macro-crate", "proc-macro-error", @@ -2491,9 +2536,9 @@ dependencies = [ [[package]] name = "snarkvm-dpc" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1588a3d2f38307bd64838cf1761d8cef485461e5224831c9b9df11a1fa9864e7" +checksum = "c922bb690fbe9c5919f67f2d887452376339a36bf5ffb50dc6b00d58a5650284" dependencies = [ "anyhow", "base58", @@ -2523,9 +2568,9 @@ dependencies = [ [[package]] name = "snarkvm-fields" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "761cb4c19d6685ac9d1d3a6eb1619600334bcf80dc6ac742cc38f4fe349ba871" +checksum = "bca141a8eae489ea39600b04f0a642059ce076bd3a7d21704b38b90fc87c37f0" dependencies = [ "anyhow", "bincode", @@ -2539,9 +2584,9 @@ dependencies = [ [[package]] name = "snarkvm-gadgets" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3b0cd11387a572f9a1c318c1d446dd46e0522c9be7681b8d6af6882d20880fd" +checksum = "3138cfcaaa27e53cabc7a4fc596b3b0abb47c3cb46fee496e3ac7ce2cd07df9d" dependencies = [ "derivative", "digest 0.9.0", @@ -2559,9 +2604,9 @@ dependencies = [ [[package]] name = "snarkvm-marlin" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206d633d6299dfb4f52640a3188567462dbf1f207de70cbb829707c07858c7e6" +checksum = "12e6987cde7b734415afc7afe58a038d224393842ad5dfaba728a601c5c5473d" dependencies = [ "blake2", "derivative", @@ -2583,9 +2628,9 @@ dependencies = [ [[package]] name = "snarkvm-parameters" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f5c4d4233a623c46c483296aa24bf4d95a5f3344c669ce4f2956467fe6ea904" +checksum = "506cbbbfe27acb4d4e8dd15e49b430dbfb920fd680cfe1c69ab87542083d0422" dependencies = [ "curl", "hex", @@ -2596,9 +2641,9 @@ dependencies = [ [[package]] name = "snarkvm-polycommit" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b5ca8d560cb6f49d9de9b4a955778cc14563b0a381c56db48ea6171788f30d4" +checksum = "c23a7fa2aab25aa6fc3b7fb27b3d639936725a5c29b29936d1530b64bd011e67" dependencies = [ "derivative", "digest 0.9.0", @@ -2615,15 +2660,15 @@ dependencies = [ [[package]] name = "snarkvm-profiler" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29cb28d79c59db77774484dbc0f4e876dc8604085d8d7f43eee1b813ec0614b4" +checksum = "f7d80cc343b9e19e0f38582fa7e17e6263c4c7449122cf9a606279567ff33d71" [[package]] name = "snarkvm-r1cs" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12e3b7acea34af74dbe5dea056714a9f3c9b1029a9ac888595c96a6e3c676e6" +checksum = "537f2123c7da8a9d3482523156318479790c41e390d33f6936b89a3ed9eee0a8" dependencies = [ "cfg-if 1.0.0", "fxhash", @@ -2636,9 +2681,9 @@ dependencies = [ [[package]] name = "snarkvm-utilities" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0842ff685e625cb7a2f9ddc7ca1b1560d2a3e3a7220099781a28ea54564133b" +checksum = "a6d1565a7c2a320b711308188adf84980013872e579ae2e6abffe8796eb8e6fe" dependencies = [ "anyhow", "bincode", @@ -2765,6 +2810,15 @@ dependencies = [ "utf-8", ] +[[package]] +name = "termcolor" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +dependencies = [ + "winapi-util", +] + [[package]] name = "terminal_size" version = "0.1.17" diff --git a/Cargo.toml b/Cargo.toml index b87e85071a..fb3a68e932 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,6 +30,7 @@ members = [ "asg-passes", "ast", "compiler", + "errors", "grammar", "imports", "input", @@ -49,6 +50,10 @@ version = "1.5.3" path = "./compiler" version = "1.5.3" +[dependencies.leo-errors] +path = "./errors" +version = "1.5.3" + [dependencies.leo-imports] path = "./imports" version = "1.5.3" @@ -77,7 +82,7 @@ version = "1.5.3" version = "0.7.6" [dependencies.snarkvm-curves] -version = "0.7.8" +version = "0.7.9" default-features = false [dependencies.snarkvm-gadgets] @@ -91,15 +96,15 @@ default-features = false [dependencies.snarkvm-utilities] version = "0.7.6" -[dependencies.anyhow] -version = "1.0" - [dependencies.structopt] version = "0.3" [dependencies.clap] version = "2.33.3" +[dependencies] +color-backtrace = "0.5.1" + [dependencies.colored] version = "2.0" @@ -139,9 +144,6 @@ features = [ "derive" ] [dependencies.serde_json] version = "1.0" -[dependencies.thiserror] -version = "1.0" - [dependencies.toml] version = "0.5" diff --git a/asg-passes/Cargo.toml b/asg-passes/Cargo.toml index 6b5ca6d4f6..6fafc821ed 100644 --- a/asg-passes/Cargo.toml +++ b/asg-passes/Cargo.toml @@ -23,3 +23,7 @@ path = "src/lib.rs" [dependencies.leo-asg] path = "../asg" version = "1.5.3" + +[dependencies.leo-errors] +path = "../errors" +version = "1.5.3" diff --git a/asg-passes/README.md b/asg-passes/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/asg-passes/src/constant_folding/mod.rs b/asg-passes/src/constant_folding/mod.rs index e18853336a..90d90c014c 100644 --- a/asg-passes/src/constant_folding/mod.rs +++ b/asg-passes/src/constant_folding/mod.rs @@ -17,6 +17,7 @@ use std::cell::Cell; use leo_asg::*; +use leo_errors::LeoError; pub struct ConstantFolding<'a, 'b> { program: &'b Program<'a>, @@ -45,7 +46,7 @@ impl<'a, 'b> StatementVisitor<'a> for ConstantFolding<'a, 'b> {} impl<'a, 'b> ProgramVisitor<'a> for ConstantFolding<'a, 'b> {} impl<'a, 'b> AsgPass<'a> for ConstantFolding<'a, 'b> { - fn do_pass(asg: Program<'a>) -> Result, FormattedError> { + fn do_pass(asg: Program<'a>) -> Result, LeoError> { let pass = ConstantFolding { program: &asg }; let mut director = VisitorDirector::new(pass); director.visit_program(&asg).ok(); diff --git a/asg-passes/src/dead_code_elimination/mod.rs b/asg-passes/src/dead_code_elimination/mod.rs index 7482fcc972..1d11629f3a 100644 --- a/asg-passes/src/dead_code_elimination/mod.rs +++ b/asg-passes/src/dead_code_elimination/mod.rs @@ -17,6 +17,7 @@ use std::cell::Cell; use leo_asg::*; +use leo_errors::LeoError; pub struct DeadCodeElimination {} @@ -65,7 +66,7 @@ impl<'a> ReconstructingReducerStatement<'a> for DeadCodeElimination { } impl<'a> AsgPass<'a> for DeadCodeElimination { - fn do_pass(asg: Program<'a>) -> Result, FormattedError> { + fn do_pass(asg: Program<'a>) -> Result, LeoError> { let pass = DeadCodeElimination {}; let mut director = ReconstructingDirector::new(asg.context, pass); Ok(director.reduce_program(asg)) diff --git a/asg-passes/src/lib.rs b/asg-passes/src/lib.rs index 39bd6e309f..1904bf782d 100644 --- a/asg-passes/src/lib.rs +++ b/asg-passes/src/lib.rs @@ -14,6 +14,8 @@ // 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")] + pub mod constant_folding; pub use constant_folding::*; diff --git a/asg/Cargo.toml b/asg/Cargo.toml index f41ef3b108..37a691a34e 100644 --- a/asg/Cargo.toml +++ b/asg/Cargo.toml @@ -26,13 +26,14 @@ version = "1.0" [dependencies.indexmap] version = "1.7" -[dependencies.thiserror] -version = "1.0" - [dependencies.leo-ast] version = "1.5.3" path = "../ast" +[dependencies.leo-errors] +path = "../errors" +version = "1.5.3" + [dependencies.leo-parser] version = "1.5.3" path = "../parser" diff --git a/asg/src/checks/return_path.rs b/asg/src/checks/return_path.rs index 31e24e2e52..3761c2e928 100644 --- a/asg/src/checks/return_path.rs +++ b/asg/src/checks/return_path.rs @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{ - statement::*, BoolAnd, Expression, Monoid, MonoidalReducerExpression, MonoidalReducerStatement, Node, Span, -}; +use crate::{statement::*, BoolAnd, Expression, Monoid, MonoidalReducerExpression, MonoidalReducerStatement, Node}; + +use leo_errors::Span; pub struct ReturnPathReducer { pub errors: Vec<(Span, String)>, diff --git a/asg/src/const_value.rs b/asg/src/const_value.rs index cfe091f749..5ed2f9b40d 100644 --- a/asg/src/const_value.rs +++ b/asg/src/const_value.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, Circuit, Identifier, IntegerType, Span, Type}; +use crate::{Circuit, Identifier, IntegerType, Type}; +use leo_errors::{AsgError, Result, Span}; use indexmap::IndexMap; use num_bigint::BigInt; @@ -313,18 +314,18 @@ impl ConstInt { Type::Integer(self.get_int_type()) } - pub fn parse(int_type: &IntegerType, value: &str, span: &Span) -> Result { + pub fn parse(int_type: &IntegerType, value: &str, span: &Span) -> Result { Ok(match int_type { - IntegerType::I8 => ConstInt::I8(value.parse().map_err(|_| AsgConvertError::invalid_int(value, span))?), - IntegerType::I16 => ConstInt::I16(value.parse().map_err(|_| AsgConvertError::invalid_int(value, span))?), - IntegerType::I32 => ConstInt::I32(value.parse().map_err(|_| AsgConvertError::invalid_int(value, span))?), - IntegerType::I64 => ConstInt::I64(value.parse().map_err(|_| AsgConvertError::invalid_int(value, span))?), - IntegerType::I128 => ConstInt::I128(value.parse().map_err(|_| AsgConvertError::invalid_int(value, span))?), - IntegerType::U8 => ConstInt::U8(value.parse().map_err(|_| AsgConvertError::invalid_int(value, span))?), - IntegerType::U16 => ConstInt::U16(value.parse().map_err(|_| AsgConvertError::invalid_int(value, span))?), - IntegerType::U32 => ConstInt::U32(value.parse().map_err(|_| AsgConvertError::invalid_int(value, span))?), - IntegerType::U64 => ConstInt::U64(value.parse().map_err(|_| AsgConvertError::invalid_int(value, span))?), - IntegerType::U128 => ConstInt::U128(value.parse().map_err(|_| AsgConvertError::invalid_int(value, span))?), + IntegerType::I8 => ConstInt::I8(value.parse().map_err(|_| AsgError::invalid_int(value, span))?), + IntegerType::I16 => ConstInt::I16(value.parse().map_err(|_| AsgError::invalid_int(value, span))?), + IntegerType::I32 => ConstInt::I32(value.parse().map_err(|_| AsgError::invalid_int(value, span))?), + IntegerType::I64 => ConstInt::I64(value.parse().map_err(|_| AsgError::invalid_int(value, span))?), + IntegerType::I128 => ConstInt::I128(value.parse().map_err(|_| AsgError::invalid_int(value, span))?), + IntegerType::U8 => ConstInt::U8(value.parse().map_err(|_| AsgError::invalid_int(value, span))?), + IntegerType::U16 => ConstInt::U16(value.parse().map_err(|_| AsgError::invalid_int(value, span))?), + IntegerType::U32 => ConstInt::U32(value.parse().map_err(|_| AsgError::invalid_int(value, span))?), + IntegerType::U64 => ConstInt::U64(value.parse().map_err(|_| AsgError::invalid_int(value, span))?), + IntegerType::U128 => ConstInt::U128(value.parse().map_err(|_| AsgError::invalid_int(value, span))?), }) } } diff --git a/asg/src/error/mod.rs b/asg/src/error/mod.rs deleted file mode 100644 index fd045ff26d..0000000000 --- a/asg/src/error/mod.rs +++ /dev/null @@ -1,329 +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 . - -//! Errors encountered when attempting to convert to an asg from an ast. - -use crate::Span; -use leo_ast::{AstError, FormattedError, LeoError}; -use leo_parser::SyntaxError; - -#[derive(Debug, Error)] -pub enum AsgConvertError { - #[error("{}", _0)] - Error(#[from] FormattedError), - - #[error("{}", _0)] - ImportError(FormattedError), - - #[error("{}", _0)] - AstError(#[from] AstError), - - #[error("{}", _0)] - InternalError(String), - - #[error("{}", _0)] - SyntaxError(#[from] SyntaxError), -} - -impl LeoError for AsgConvertError {} - -impl AsgConvertError { - fn new_from_span(message: String, span: &Span) -> Self { - AsgConvertError::Error(FormattedError::new_from_span(message, span)) - } - - pub fn unresolved_circuit(name: &str, span: &Span) -> Self { - Self::new_from_span(format!("failed to resolve circuit: '{}'", name), span) - } - - pub fn unresolved_import(name: &str, span: &Span) -> Self { - Self::new_from_span(format!("failed to resolve import: '{}'", name), span) - } - - pub fn unresolved_circuit_member(circuit_name: &str, name: &str, span: &Span) -> Self { - Self::new_from_span( - format!( - "illegal reference to non-existant member '{}' of circuit '{}'", - name, circuit_name - ), - span, - ) - } - - pub fn missing_circuit_member(circuit_name: &str, name: &str, span: &Span) -> Self { - Self::new_from_span( - format!( - "missing circuit member '{}' for initialization of circuit '{}'", - name, circuit_name - ), - span, - ) - } - - pub fn overridden_circuit_member(circuit_name: &str, name: &str, span: &Span) -> Self { - Self::new_from_span( - format!( - "cannot declare circuit member '{}' more than once for initialization of circuit '{}'", - name, circuit_name - ), - span, - ) - } - - pub fn redefined_circuit_member(circuit_name: &str, name: &str, span: &Span) -> Self { - Self::new_from_span( - format!( - "cannot declare circuit member '{}' multiple times in circuit '{}'", - name, circuit_name - ), - span, - ) - } - - pub fn extra_circuit_member(circuit_name: &str, name: &str, span: &Span) -> Self { - Self::new_from_span( - format!( - "extra circuit member '{}' for initialization of circuit '{}' is not allowed", - name, circuit_name - ), - span, - ) - } - - pub fn illegal_function_assign(name: &str, span: &Span) -> Self { - Self::new_from_span(format!("attempt to assign to function '{}'", name), span) - } - - pub fn circuit_variable_call(circuit_name: &str, name: &str, span: &Span) -> Self { - Self::new_from_span( - format!("cannot call variable member '{}' of circuit '{}'", name, circuit_name), - span, - ) - } - - pub fn circuit_static_call_invalid(circuit_name: &str, name: &str, span: &Span) -> Self { - Self::new_from_span( - format!( - "cannot call static function '{}' of circuit '{}' from target", - name, circuit_name - ), - span, - ) - } - - pub fn circuit_member_mut_call_invalid(circuit_name: &str, name: &str, span: &Span) -> Self { - Self::new_from_span( - format!( - "cannot call mutable member function '{}' of circuit '{}' from immutable context", - name, circuit_name - ), - span, - ) - } - - pub fn circuit_member_call_invalid(circuit_name: &str, name: &str, span: &Span) -> Self { - Self::new_from_span( - format!( - "cannot call member function '{}' of circuit '{}' from static context", - name, circuit_name - ), - span, - ) - } - - pub fn circuit_function_ref(circuit_name: &str, name: &str, span: &Span) -> Self { - Self::new_from_span( - format!( - "cannot reference function member '{}' of circuit '{}' as value", - name, circuit_name - ), - span, - ) - } - - pub fn index_into_non_array(name: &str, span: &Span) -> Self { - Self::new_from_span(format!("failed to index into non-array '{}'", name), span) - } - - pub fn invalid_assign_index(name: &str, num: &str, span: &Span) -> Self { - Self::new_from_span( - format!("failed to index array with invalid integer '{}'[{}]", name, num), - span, - ) - } - - pub fn invalid_backwards_assignment(name: &str, left: usize, right: usize, span: &Span) -> Self { - Self::new_from_span( - format!( - "failed to index array range for assignment with left > right '{}'[{}..{}]", - name, left, right - ), - span, - ) - } - - pub fn invalid_const_assign(name: &str, span: &Span) -> Self { - Self::new_from_span( - format!( - "failed to create const variable(s) '{}' with non constant values.", - name - ), - span, - ) - } - - pub fn duplicate_function_definition(name: &str, span: &Span) -> Self { - Self::new_from_span( - format!("a function named \"{}\" already exists in this scope", name), - span, - ) - } - - pub fn duplicate_variable_definition(name: &str, span: &Span) -> Self { - Self::new_from_span( - format!("a variable named \"{}\" already exists in this scope", name), - span, - ) - } - - pub fn index_into_non_tuple(name: &str, span: &Span) -> Self { - Self::new_from_span(format!("failed to index into non-tuple '{}'", name), span) - } - - pub fn tuple_index_out_of_bounds(index: usize, span: &Span) -> Self { - Self::new_from_span(format!("tuple index out of bounds: '{}'", index), span) - } - - pub fn array_index_out_of_bounds(index: usize, span: &Span) -> Self { - Self::new_from_span(format!("array index out of bounds: '{}'", index), span) - } - - pub fn ternary_different_types(left: &str, right: &str, span: &Span) -> Self { - let message = format!("ternary sides had different types: left {}, right {}", left, right); - - Self::new_from_span(message, span) - } - - pub fn unknown_array_size(span: &Span) -> Self { - Self::new_from_span("array size cannot be inferred, add explicit types".to_string(), span) - } - - pub fn unexpected_call_argument_count(expected: usize, got: usize, span: &Span) -> Self { - Self::new_from_span( - format!("function call expected {} arguments, got {}", expected, got), - span, - ) - } - - pub fn unresolved_function(name: &str, span: &Span) -> Self { - Self::new_from_span(format!("failed to resolve function: '{}'", name), span) - } - - pub fn unresolved_type(name: &str, span: &Span) -> Self { - Self::new_from_span( - format!("failed to resolve type for variable definition '{}'", name), - span, - ) - } - - pub fn unexpected_type(expected: &str, received: Option<&str>, span: &Span) -> Self { - Self::new_from_span( - format!( - "unexpected type, expected: '{}', received: '{}'", - expected, - received.unwrap_or("unknown") - ), - span, - ) - } - - pub fn unexpected_nonconst(span: &Span) -> Self { - Self::new_from_span("expected const, found non-const value".to_string(), span) - } - - pub fn unresolved_reference(name: &str, span: &Span) -> Self { - Self::new_from_span(format!("failed to resolve variable reference '{}'", name), span) - } - - pub fn invalid_boolean(value: &str, span: &Span) -> Self { - Self::new_from_span(format!("failed to parse boolean value '{}'", value), span) - } - - pub fn invalid_char(value: &str, span: &Span) -> Self { - Self::new_from_span(format!("failed to parse char value '{}'", value), span) - } - - pub fn invalid_int(value: &str, span: &Span) -> Self { - Self::new_from_span(format!("failed to parse int value '{}'", value), span) - } - - pub fn unsigned_negation(span: &Span) -> Self { - Self::new_from_span("cannot negate unsigned integer".to_string(), span) - } - - pub fn immutable_assignment(name: &str, span: &Span) -> Self { - Self::new_from_span(format!("illegal assignment to immutable variable '{}'", name), span) - } - - pub fn function_missing_return(name: &str, span: &Span) -> Self { - Self::new_from_span(format!("function '{}' missing return for all paths", name), span) - } - - pub fn function_return_validation(name: &str, description: &str, span: &Span) -> Self { - Self::new_from_span( - format!("function '{}' failed to validate return path: '{}'", name, description), - span, - ) - } - - pub fn input_ref_needs_type(category: &str, name: &str, span: &Span) -> Self { - Self::new_from_span( - format!("could not infer type for input in '{}': '{}'", category, name), - span, - ) - } - - pub fn invalid_self_in_global(span: &Span) -> Self { - Self::new_from_span( - "cannot have `mut self` or `self` arguments in global functions".to_string(), - span, - ) - } - - pub fn call_test_function(span: &Span) -> Self { - Self::new_from_span("cannot call test function".to_string(), span) - } - - pub fn circuit_test_function(span: &Span) -> Self { - Self::new_from_span("cannot have test function as member of circuit".to_string(), span) - } - - pub fn parse_index_error() -> Self { - AsgConvertError::InternalError("failed to parse index".to_string()) - } - - pub fn parse_dimension_error() -> Self { - AsgConvertError::InternalError("failed to parse dimension".to_string()) - } - - pub fn reference_self_outside_circuit() -> Self { - AsgConvertError::InternalError("referenced self outside of circuit function".to_string()) - } - - pub fn illegal_ast_structure(details: &str) -> Self { - AsgConvertError::InternalError(format!("illegal ast structure: {}", details)) - } -} diff --git a/asg/src/expression/array_access.rs b/asg/src/expression/array_access.rs index 2bbcf4f871..5987a48fd9 100644 --- a/asg/src/expression/array_access.rs +++ b/asg/src/expression/array_access.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type}; +use crate::{ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Type}; use leo_ast::IntegerType; +use leo_errors::{AsgError, Result, Span}; use std::cell::Cell; @@ -83,7 +84,7 @@ impl<'a> FromAst<'a, leo_ast::ArrayAccessExpression> for ArrayAccessExpression<' scope: &'a Scope<'a>, value: &leo_ast::ArrayAccessExpression, expected_type: Option>, - ) -> Result, AsgConvertError> { + ) -> Result> { let array = <&Expression<'a>>::from_ast( scope, &*value.array, @@ -92,11 +93,12 @@ impl<'a> FromAst<'a, leo_ast::ArrayAccessExpression> for ArrayAccessExpression<' let array_len = match array.get_type() { Some(Type::Array(_, len)) => len, type_ => { - return Err(AsgConvertError::unexpected_type( + return Err(AsgError::unexpected_type( "array", - type_.map(|x| x.to_string()).as_deref(), + type_.map(|x| x.to_string()).unwrap_or_else(|| "unknown".to_string()), &value.span, - )); + ) + .into()); } }; @@ -112,10 +114,9 @@ impl<'a> FromAst<'a, leo_ast::ArrayAccessExpression> for ArrayAccessExpression<' .flatten() { if index >= array_len { - return Err(AsgConvertError::array_index_out_of_bounds( - index, - &array.span().cloned().unwrap_or_default(), - )); + return Err( + AsgError::array_index_out_of_bounds(index, &array.span().cloned().unwrap_or_default()).into(), + ); } } diff --git a/asg/src/expression/array_init.rs b/asg/src/expression/array_init.rs index df2c2afe07..23ea049271 100644 --- a/asg/src/expression/array_init.rs +++ b/asg/src/expression/array_init.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type}; +use crate::{ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Type}; +use leo_errors::{AsgError, Result, Span}; use std::cell::Cell; @@ -68,16 +69,12 @@ impl<'a> FromAst<'a, leo_ast::ArrayInitExpression> for ArrayInitExpression<'a> { scope: &'a Scope<'a>, value: &leo_ast::ArrayInitExpression, expected_type: Option>, - ) -> Result, AsgConvertError> { + ) -> Result> { let (mut expected_item, expected_len) = match expected_type { Some(PartialType::Array(item, dims)) => (item.map(|x| *x), dims), None => (None, None), Some(type_) => { - return Err(AsgConvertError::unexpected_type( - &type_.to_string(), - Some("array"), - &value.span, - )); + return Err(AsgError::unexpected_type(type_, "array", &value.span).into()); } }; let dimensions = value @@ -85,20 +82,23 @@ impl<'a> FromAst<'a, leo_ast::ArrayInitExpression> for ArrayInitExpression<'a> { .0 .iter() .map(|x| { - x.value + Ok(x.value .parse::() - .map_err(|_| AsgConvertError::parse_dimension_error()) + .map_err(|_| AsgError::parse_dimension_error(&value.span))?) }) - .collect::, AsgConvertError>>()?; + .collect::>>()?; - let len = *dimensions.get(0).ok_or_else(AsgConvertError::parse_dimension_error)?; + let len = *dimensions + .get(0) + .ok_or_else(|| AsgError::parse_dimension_error(&value.span))?; if let Some(expected_len) = expected_len { if expected_len != len { - return Err(AsgConvertError::unexpected_type( - &*format!("array of length {}", expected_len), - Some(&*format!("array of length {}", len)), + return Err(AsgError::unexpected_type( + format!("array of length {}", expected_len), + format!("array of length {}", len), &value.span, - )); + ) + .into()); } } @@ -107,11 +107,12 @@ impl<'a> FromAst<'a, leo_ast::ArrayInitExpression> for ArrayInitExpression<'a> { Some(PartialType::Array(item, len)) => { if let Some(len) = len { if len != dimension { - return Err(AsgConvertError::unexpected_type( - &*format!("array of length {}", dimension), - Some(&*format!("array of length {}", len)), + return Err(AsgError::unexpected_type( + format!("array of length {}", dimension), + format!("array of length {}", len), &value.span, - )); + ) + .into()); } } @@ -119,11 +120,7 @@ impl<'a> FromAst<'a, leo_ast::ArrayInitExpression> for ArrayInitExpression<'a> { } None => None, Some(type_) => { - return Err(AsgConvertError::unexpected_type( - "array", - Some(&type_.to_string()), - &value.span, - )); + return Err(AsgError::unexpected_type("array", type_, &value.span).into()); } } } diff --git a/asg/src/expression/array_inline.rs b/asg/src/expression/array_inline.rs index 6d53e0798f..56bd7d8987 100644 --- a/asg/src/expression/array_inline.rs +++ b/asg/src/expression/array_inline.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type}; +use crate::{ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Type}; use leo_ast::SpreadOrExpression; +use leo_errors::{AsgError, Result, Span}; use std::cell::Cell; @@ -103,16 +104,12 @@ impl<'a> FromAst<'a, leo_ast::ArrayInlineExpression> for ArrayInlineExpression<' scope: &'a Scope<'a>, value: &leo_ast::ArrayInlineExpression, expected_type: Option>, - ) -> Result, AsgConvertError> { + ) -> Result> { let (mut expected_item, expected_len) = match expected_type { Some(PartialType::Array(item, dims)) => (item.map(|x| *x), dims), None => (None, None), Some(type_) => { - return Err(AsgConvertError::unexpected_type( - &type_.to_string(), - Some("array"), - &value.span, - )); + return Err(AsgError::unexpected_type(type_, "array", &value.span).into()); } }; @@ -169,29 +166,31 @@ impl<'a> FromAst<'a, leo_ast::ArrayInlineExpression> for ArrayInlineExpression<' len += spread_len; } type_ => { - return Err(AsgConvertError::unexpected_type( + return Err(AsgError::unexpected_type( expected_item .as_ref() .map(|x| x.to_string()) .as_deref() .unwrap_or("unknown"), - type_.map(|x| x.to_string()).as_deref(), + type_.map(|x| x.to_string()).unwrap_or_else(|| "unknown".to_string()), &value.span, - )); + ) + .into()); } } Ok((Cell::new(expr), true)) } }) - .collect::, AsgConvertError>>()?, + .collect::>>()?, }; if let Some(expected_len) = expected_len { if len != expected_len { - return Err(AsgConvertError::unexpected_type( - &*format!("array of length {}", expected_len), - Some(&*format!("array of length {}", len)), + return Err(AsgError::unexpected_type( + format!("array of length {}", expected_len), + format!("array of length {}", len), &value.span, - )); + ) + .into()); } } Ok(output) diff --git a/asg/src/expression/array_range_access.rs b/asg/src/expression/array_range_access.rs index c0810a2586..0d32f3933f 100644 --- a/asg/src/expression/array_range_access.rs +++ b/asg/src/expression/array_range_access.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type}; +use crate::{ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Type}; use leo_ast::IntegerType; +use leo_errors::{AsgError, Result, Span}; use std::cell::Cell; @@ -102,16 +103,12 @@ impl<'a> FromAst<'a, leo_ast::ArrayRangeAccessExpression> for ArrayRangeAccessEx scope: &'a Scope<'a>, value: &leo_ast::ArrayRangeAccessExpression, expected_type: Option>, - ) -> Result, AsgConvertError> { + ) -> Result> { let (expected_array, expected_len) = match expected_type.clone() { Some(PartialType::Array(element, len)) => (Some(PartialType::Array(element, None)), len), None => (None, None), Some(x) => { - return Err(AsgConvertError::unexpected_type( - &x.to_string(), - Some("array"), - &value.span, - )); + return Err(AsgError::unexpected_type(x, "array", &value.span).into()); } }; let array = <&Expression<'a>>::from_ast(scope, &*value.array, expected_array)?; @@ -119,11 +116,12 @@ impl<'a> FromAst<'a, leo_ast::ArrayRangeAccessExpression> for ArrayRangeAccessEx let (parent_element, parent_size) = match array_type { Some(Type::Array(inner, size)) => (inner, size), type_ => { - return Err(AsgConvertError::unexpected_type( + return Err(AsgError::unexpected_type( "array", - type_.map(|x| x.to_string()).as_deref(), + type_.map(|x| x.to_string()).unwrap_or_else(|| "unknown".to_string()), &value.span, - )); + ) + .into()); } }; @@ -157,7 +155,7 @@ impl<'a> FromAst<'a, leo_ast::ArrayRangeAccessExpression> for ArrayRangeAccessEx } else { value.span.clone() }; - return Err(AsgConvertError::array_index_out_of_bounds(inner_value, &error_span)); + return Err(AsgError::array_index_out_of_bounds(inner_value, &error_span).into()); } else if let Some(left) = const_left { if left > inner_value { let error_span = if let Some(right) = right { @@ -165,7 +163,7 @@ impl<'a> FromAst<'a, leo_ast::ArrayRangeAccessExpression> for ArrayRangeAccessEx } else { value.span.clone() }; - return Err(AsgConvertError::array_index_out_of_bounds(inner_value, &error_span)); + return Err(AsgError::array_index_out_of_bounds(inner_value, &error_span).into()); } } } @@ -185,11 +183,9 @@ impl<'a> FromAst<'a, leo_ast::ArrayRangeAccessExpression> for ArrayRangeAccessEx if let Some(length) = length { if length != expected_len { let concrete_type = Type::Array(parent_element, length); - return Err(AsgConvertError::unexpected_type( - &expected_type.as_ref().unwrap().to_string(), - Some(&concrete_type.to_string()), - &value.span, - )); + return Err( + AsgError::unexpected_type(expected_type.as_ref().unwrap(), concrete_type, &value.span).into(), + ); } } if let Some(left_value) = const_left { @@ -199,13 +195,13 @@ impl<'a> FromAst<'a, leo_ast::ArrayRangeAccessExpression> for ArrayRangeAccessEx } else { value.span.clone() }; - return Err(AsgConvertError::array_index_out_of_bounds(left_value, &error_span)); + return Err(AsgError::array_index_out_of_bounds(left_value, &error_span).into()); } } length = Some(expected_len); } if length.is_none() { - return Err(AsgConvertError::unknown_array_size(&value.span)); + return Err(AsgError::unknown_array_size(&value.span).into()); } Ok(ArrayRangeAccessExpression { diff --git a/asg/src/expression/binary.rs b/asg/src/expression/binary.rs index 9322b1d587..3029e2b98c 100644 --- a/asg/src/expression/binary.rs +++ b/asg/src/expression/binary.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type}; +use crate::{ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Type}; pub use leo_ast::{BinaryOperation, BinaryOperationClass}; +use leo_errors::{AsgError, Result, Span}; use std::cell::Cell; @@ -116,17 +117,13 @@ impl<'a> FromAst<'a, leo_ast::BinaryExpression> for BinaryExpression<'a> { scope: &'a Scope<'a>, value: &leo_ast::BinaryExpression, expected_type: Option>, - ) -> Result, AsgConvertError> { + ) -> Result> { let class = value.op.class(); let expected_type = match class { BinaryOperationClass::Boolean => match expected_type { Some(PartialType::Type(Type::Boolean)) | None => None, Some(x) => { - return Err(AsgConvertError::unexpected_type( - &x.to_string(), - Some(&*Type::Boolean.to_string()), - &value.span, - )); + return Err(AsgError::unexpected_type(x, Type::Boolean, &value.span).into()); } }, BinaryOperationClass::Numeric => match expected_type { @@ -134,11 +131,7 @@ impl<'a> FromAst<'a, leo_ast::BinaryExpression> for BinaryExpression<'a> { Some(x @ PartialType::Type(Type::Field)) => Some(x), Some(x @ PartialType::Type(Type::Group)) => Some(x), Some(x) => { - return Err(AsgConvertError::unexpected_type( - &x.to_string(), - Some("integer, field, or group"), - &value.span, - )); + return Err(AsgError::unexpected_type(x, "integer, field, or group", &value.span).into()); } None => None, }, @@ -187,33 +180,26 @@ impl<'a> FromAst<'a, leo_ast::BinaryExpression> for BinaryExpression<'a> { } Some(Type::Field) if value.op == BinaryOperation::Mul || value.op == BinaryOperation::Div => (), type_ => { - return Err(AsgConvertError::unexpected_type( + return Err(AsgError::unexpected_type( "integer", - type_.map(|x| x.to_string()).as_deref(), + type_.map(|x| x.to_string()).unwrap_or_else(|| "unknown".to_string()), &value.span, - )); + ) + .into()); } }, BinaryOperationClass::Boolean => match &value.op { BinaryOperation::And | BinaryOperation::Or => match left_type { Some(Type::Boolean) | None => (), Some(x) => { - return Err(AsgConvertError::unexpected_type( - &x.to_string(), - Some(&*Type::Boolean.to_string()), - &value.span, - )); + return Err(AsgError::unexpected_type(x, Type::Boolean, &value.span).into()); } }, BinaryOperation::Eq | BinaryOperation::Ne => (), // all types allowed _ => match left_type { Some(Type::Integer(_)) | None => (), Some(x) => { - return Err(AsgConvertError::unexpected_type( - &x.to_string(), - Some("integer"), - &value.span, - )); + return Err(AsgError::unexpected_type(x, "integer", &value.span).into()); } }, }, @@ -224,19 +210,11 @@ impl<'a> FromAst<'a, leo_ast::BinaryExpression> for BinaryExpression<'a> { match (left_type, right_type) { (Some(left_type), Some(right_type)) => { if !left_type.is_assignable_from(&right_type) { - return Err(AsgConvertError::unexpected_type( - &left_type.to_string(), - Some(&*right_type.to_string()), - &value.span, - )); + return Err(AsgError::unexpected_type(left_type, right_type, &value.span).into()); } } (None, None) => { - return Err(AsgConvertError::unexpected_type( - "any type", - Some("unknown type"), - &value.span, - )); + return Err(AsgError::unexpected_type("any type", "unknown type", &value.span).into()); } (_, _) => (), } diff --git a/asg/src/expression/call.rs b/asg/src/expression/call.rs index 41b7cb0660..1673096204 100644 --- a/asg/src/expression/call.rs +++ b/asg/src/expression/call.rs @@ -15,10 +15,11 @@ // along with the Leo library. If not, see . use crate::{ - AsgConvertError, CircuitMember, ConstValue, Expression, ExpressionNode, FromAst, Function, FunctionQualifier, Node, - PartialType, Scope, Span, Type, + CircuitMember, ConstValue, Expression, ExpressionNode, FromAst, Function, FunctionQualifier, Node, PartialType, + Scope, Type, }; pub use leo_ast::{BinaryOperation, Node as AstNode}; +use leo_errors::{AsgError, Result, Span}; use std::cell::Cell; @@ -78,13 +79,13 @@ impl<'a> FromAst<'a, leo_ast::CallExpression> for CallExpression<'a> { scope: &'a Scope<'a>, value: &leo_ast::CallExpression, expected_type: Option>, - ) -> Result, AsgConvertError> { + ) -> Result> { let (target, function) = match &*value.function { leo_ast::Expression::Identifier(name) => ( None, scope .resolve_function(&name.name) - .ok_or_else(|| AsgConvertError::unresolved_function(&name.name, &name.span))?, + .ok_or_else(|| AsgError::unresolved_function(&name.name, &name.span))?, ), leo_ast::Expression::CircuitMemberAccess(leo_ast::CircuitMemberAccessExpression { circuit: ast_circuit, @@ -95,37 +96,32 @@ impl<'a> FromAst<'a, leo_ast::CallExpression> for CallExpression<'a> { let circuit = match target.get_type() { Some(Type::Circuit(circuit)) => circuit, type_ => { - return Err(AsgConvertError::unexpected_type( + return Err(AsgError::unexpected_type( "circuit", - type_.map(|x| x.to_string()).as_deref(), + type_.map(|x| x.to_string()).unwrap_or_else(|| "unknown".to_string()), span, - )); + ) + .into()); } }; let circuit_name = circuit.name.borrow().name.clone(); let member = circuit.members.borrow(); let member = member .get(name.name.as_ref()) - .ok_or_else(|| AsgConvertError::unresolved_circuit_member(&circuit_name, &name.name, span))?; + .ok_or_else(|| AsgError::unresolved_circuit_member(&circuit_name, &name.name, span))?; match member { CircuitMember::Function(body) => { if body.qualifier == FunctionQualifier::Static { - return Err(AsgConvertError::circuit_static_call_invalid( - &circuit_name, - &name.name, - span, - )); + return Err(AsgError::circuit_static_call_invalid(&circuit_name, &name.name, span).into()); } else if body.qualifier == FunctionQualifier::MutSelfRef && !target.is_mut_ref() { - return Err(AsgConvertError::circuit_member_mut_call_invalid( - &circuit_name, - &name.name, - span, - )); + return Err( + AsgError::circuit_member_mut_call_invalid(circuit_name, &name.name, span).into(), + ); } (Some(target), *body) } CircuitMember::Variable(_) => { - return Err(AsgConvertError::circuit_variable_call(&circuit_name, &name.name, span)); + return Err(AsgError::circuit_variable_call(circuit_name, &name.name, span).into()); } } } @@ -137,54 +133,49 @@ impl<'a> FromAst<'a, leo_ast::CallExpression> for CallExpression<'a> { let circuit = if let leo_ast::Expression::Identifier(circuit_name) = &**ast_circuit { scope .resolve_circuit(&circuit_name.name) - .ok_or_else(|| AsgConvertError::unresolved_circuit(&circuit_name.name, &circuit_name.span))? + .ok_or_else(|| AsgError::unresolved_circuit(&circuit_name.name, &circuit_name.span))? } else { - return Err(AsgConvertError::unexpected_type("circuit", None, span)); + return Err(AsgError::unexpected_type("circuit", "unknown", span).into()); }; let circuit_name = circuit.name.borrow().name.clone(); let member = circuit.members.borrow(); let member = member .get(name.name.as_ref()) - .ok_or_else(|| AsgConvertError::unresolved_circuit_member(&circuit_name, &name.name, span))?; + .ok_or_else(|| AsgError::unresolved_circuit_member(&circuit_name, &name.name, span))?; match member { CircuitMember::Function(body) => { if body.qualifier != FunctionQualifier::Static { - return Err(AsgConvertError::circuit_member_call_invalid( - &circuit_name, - &name.name, - span, - )); + return Err(AsgError::circuit_member_call_invalid(circuit_name, &name.name, span).into()); } (None, *body) } CircuitMember::Variable(_) => { - return Err(AsgConvertError::circuit_variable_call(&circuit_name, &name.name, span)); + return Err(AsgError::circuit_variable_call(circuit_name, &name.name, span).into()); } } } _ => { - return Err(AsgConvertError::illegal_ast_structure( + return Err(AsgError::illegal_ast_structure( "non Identifier/CircuitMemberAccess/CircuitStaticFunctionAccess as call target", - )); + &value.span, + ) + .into()); } }; if let Some(expected) = expected_type { let output: Type = function.output.clone(); if !expected.matches(&output) { - return Err(AsgConvertError::unexpected_type( - &expected.to_string(), - Some(&*output.to_string()), - &value.span, - )); + return Err(AsgError::unexpected_type(expected, output, &value.span).into()); } } if value.arguments.len() != function.arguments.len() { - return Err(AsgConvertError::unexpected_call_argument_count( + return Err(AsgError::unexpected_call_argument_count( function.arguments.len(), value.arguments.len(), &value.span, - )); + ) + .into()); } let arguments = value @@ -195,14 +186,14 @@ impl<'a> FromAst<'a, leo_ast::CallExpression> for CallExpression<'a> { let argument = argument.get().borrow(); let converted = <&Expression<'a>>::from_ast(scope, expr, Some(argument.type_.clone().partial()))?; if argument.const_ && !converted.is_consty() { - return Err(AsgConvertError::unexpected_nonconst(expr.span())); + return Err(AsgError::unexpected_nonconst(expr.span()).into()); } Ok(Cell::new(converted)) }) - .collect::, AsgConvertError>>()?; + .collect::>>()?; if function.is_test() { - return Err(AsgConvertError::call_test_function(&value.span)); + return Err(AsgError::call_test_function(&value.span).into()); } Ok(CallExpression { parent: Cell::new(None), diff --git a/asg/src/expression/cast.rs b/asg/src/expression/cast.rs index e7060492d4..3f2765ba5a 100644 --- a/asg/src/expression/cast.rs +++ b/asg/src/expression/cast.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type}; +use crate::{ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Type}; pub use leo_ast::UnaryOperation; +use leo_errors::{AsgError, Result, Span}; use std::cell::Cell; @@ -75,15 +76,11 @@ impl<'a> FromAst<'a, leo_ast::CastExpression> for CastExpression<'a> { scope: &'a Scope<'a>, value: &leo_ast::CastExpression, expected_type: Option>, - ) -> Result, AsgConvertError> { - let target_type = scope.resolve_ast_type(&value.target_type)?; + ) -> Result> { + let target_type = scope.resolve_ast_type(&value.target_type, &value.span)?; if let Some(expected_type) = &expected_type { if !expected_type.matches(&target_type) { - return Err(AsgConvertError::unexpected_type( - &expected_type.to_string(), - Some(&target_type.to_string()), - &value.span, - )); + return Err(AsgError::unexpected_type(expected_type, target_type, &value.span).into()); } } diff --git a/asg/src/expression/circuit_access.rs b/asg/src/expression/circuit_access.rs index e945c8f902..5152f2b9c5 100644 --- a/asg/src/expression/circuit_access.rs +++ b/asg/src/expression/circuit_access.rs @@ -15,10 +15,10 @@ // along with the Leo library. If not, see . use crate::{ - AsgConvertError, Circuit, CircuitMember, ConstValue, Expression, ExpressionNode, FromAst, Identifier, Node, - PartialType, Scope, Span, Type, + Circuit, CircuitMember, ConstValue, Expression, ExpressionNode, FromAst, Identifier, Node, PartialType, Scope, Type, }; +use leo_errors::{AsgError, Result, Span}; use std::cell::Cell; #[derive(Clone)] @@ -92,16 +92,17 @@ impl<'a> FromAst<'a, leo_ast::CircuitMemberAccessExpression> for CircuitAccessEx scope: &'a Scope<'a>, value: &leo_ast::CircuitMemberAccessExpression, expected_type: Option>, - ) -> Result, AsgConvertError> { + ) -> Result> { let target = <&'a Expression<'a>>::from_ast(scope, &*value.circuit, None)?; let circuit = match target.get_type() { Some(Type::Circuit(circuit)) => circuit, x => { - return Err(AsgConvertError::unexpected_type( + return Err(AsgError::unexpected_type( "circuit", - x.map(|x| x.to_string()).as_deref(), + x.map(|x| x.to_string()).unwrap_or_else(|| "unknown".to_string()), &value.span, - )); + ) + .into()); } }; @@ -112,11 +113,7 @@ impl<'a> FromAst<'a, leo_ast::CircuitMemberAccessExpression> for CircuitAccessEx if let CircuitMember::Variable(type_) = &member { let type_: Type = type_.clone(); if !expected_type.matches(&type_) { - return Err(AsgConvertError::unexpected_type( - &expected_type.to_string(), - Some(&type_.to_string()), - &value.span, - )); + return Err(AsgError::unexpected_type(expected_type, type_, &value.span).into()); } } // used by call expression } @@ -136,18 +133,17 @@ impl<'a> FromAst<'a, leo_ast::CircuitMemberAccessExpression> for CircuitAccessEx CircuitMember::Variable(expected_type.clone()), ); } else { - return Err(AsgConvertError::input_ref_needs_type( - &circuit.name.borrow().name, - &value.name.name, - &value.span, - )); + return Err( + AsgError::input_ref_needs_type(&circuit.name.borrow().name, &value.name.name, &value.span).into(), + ); } } else { - return Err(AsgConvertError::unresolved_circuit_member( + return Err(AsgError::unresolved_circuit_member( &circuit.name.borrow().name, &value.name.name, &value.span, - )); + ) + .into()); } Ok(CircuitAccessExpression { @@ -165,36 +161,29 @@ impl<'a> FromAst<'a, leo_ast::CircuitStaticFunctionAccessExpression> for Circuit scope: &Scope<'a>, value: &leo_ast::CircuitStaticFunctionAccessExpression, expected_type: Option, - ) -> Result, AsgConvertError> { + ) -> Result> { let circuit = match &*value.circuit { leo_ast::Expression::Identifier(name) => scope .resolve_circuit(&name.name) - .ok_or_else(|| AsgConvertError::unresolved_circuit(&name.name, &name.span))?, + .ok_or_else(|| AsgError::unresolved_circuit(&name.name, &name.span))?, _ => { - return Err(AsgConvertError::unexpected_type( - "circuit", - Some("unknown"), - &value.span, - )); + return Err(AsgError::unexpected_type("circuit", "unknown", &value.span).into()); } }; if let Some(expected_type) = expected_type { - return Err(AsgConvertError::unexpected_type( - &expected_type.to_string(), - Some("none"), - &value.span, - )); + return Err(AsgError::unexpected_type(expected_type, "none", &value.span).into()); } if let Some(CircuitMember::Function(_)) = circuit.members.borrow().get(value.name.name.as_ref()) { // okay } else { - return Err(AsgConvertError::unresolved_circuit_member( + return Err(AsgError::unresolved_circuit_member( &circuit.name.borrow().name, &value.name.name, &value.span, - )); + ) + .into()); } Ok(CircuitAccessExpression { diff --git a/asg/src/expression/circuit_init.rs b/asg/src/expression/circuit_init.rs index 4da91ea8b6..0223047839 100644 --- a/asg/src/expression/circuit_init.rs +++ b/asg/src/expression/circuit_init.rs @@ -15,10 +15,11 @@ // along with the Leo library. If not, see . use crate::{ - AsgConvertError, Circuit, CircuitMember, ConstValue, Expression, ExpressionNode, FromAst, Identifier, Node, - PartialType, Scope, Span, Type, + Circuit, CircuitMember, ConstValue, Expression, ExpressionNode, FromAst, Identifier, Node, PartialType, Scope, Type, }; +use leo_errors::{AsgError, Result, Span}; + use indexmap::{IndexMap, IndexSet}; use std::cell::Cell; @@ -82,19 +83,15 @@ impl<'a> FromAst<'a, leo_ast::CircuitInitExpression> for CircuitInitExpression<' scope: &'a Scope<'a>, value: &leo_ast::CircuitInitExpression, expected_type: Option>, - ) -> Result, AsgConvertError> { + ) -> Result> { let circuit = scope .resolve_circuit(&value.name.name) - .ok_or_else(|| AsgConvertError::unresolved_circuit(&value.name.name, &value.name.span))?; + .ok_or_else(|| AsgError::unresolved_circuit(&value.name.name, &value.name.span))?; match expected_type { Some(PartialType::Type(Type::Circuit(expected_circuit))) if expected_circuit == circuit => (), None => (), Some(x) => { - return Err(AsgConvertError::unexpected_type( - &x.to_string(), - Some(&circuit.name.borrow().name), - &value.span, - )); + return Err(AsgError::unexpected_type(x, circuit.name.borrow().name.to_string(), &value.span).into()); } } let members: IndexMap<&str, (&Identifier, Option<&leo_ast::Expression>)> = value @@ -110,11 +107,9 @@ impl<'a> FromAst<'a, leo_ast::CircuitInitExpression> for CircuitInitExpression<' let circuit_members = circuit.members.borrow(); for (name, member) in circuit_members.iter() { if defined_variables.contains(name) { - return Err(AsgConvertError::overridden_circuit_member( - &circuit.name.borrow().name, - name, - &value.span, - )); + return Err( + AsgError::overridden_circuit_member(&circuit.name.borrow().name, name, &value.span).into(), + ); } defined_variables.insert(name.clone()); let type_: Type = if let CircuitMember::Variable(type_) = &member { @@ -134,21 +129,17 @@ impl<'a> FromAst<'a, leo_ast::CircuitInitExpression> for CircuitInitExpression<' }; values.push(((*identifier).clone(), Cell::new(received))); } else { - return Err(AsgConvertError::missing_circuit_member( - &circuit.name.borrow().name, - name, - &value.span, - )); + return Err( + AsgError::missing_circuit_member(&circuit.name.borrow().name, name, &value.span).into(), + ); } } for (name, (identifier, _expression)) in members.iter() { if circuit_members.get(*name).is_none() { - return Err(AsgConvertError::extra_circuit_member( - &circuit.name.borrow().name, - *name, - &identifier.span, - )); + return Err( + AsgError::extra_circuit_member(&circuit.name.borrow().name, name, &identifier.span).into(), + ); } } } diff --git a/asg/src/expression/constant.rs b/asg/src/expression/constant.rs index 212df302c1..acdef6c076 100644 --- a/asg/src/expression/constant.rs +++ b/asg/src/expression/constant.rs @@ -15,10 +15,11 @@ // along with the Leo library. If not, see . use crate::{ - AsgConvertError, CharValue, ConstInt, ConstValue, Expression, ExpressionNode, FromAst, GroupValue, Node, - PartialType, Scope, Span, Type, + CharValue, ConstInt, ConstValue, Expression, ExpressionNode, FromAst, GroupValue, Node, PartialType, Scope, Type, }; +use leo_errors::{AsgError, Result, Span}; + use std::cell::Cell; #[derive(Clone)] @@ -67,18 +68,14 @@ impl<'a> FromAst<'a, leo_ast::ValueExpression> for Constant<'a> { _scope: &'a Scope<'a>, value: &leo_ast::ValueExpression, expected_type: Option>, - ) -> Result, AsgConvertError> { + ) -> Result> { use leo_ast::ValueExpression::*; Ok(match value { Address(value, span) => { match expected_type.map(PartialType::full).flatten() { Some(Type::Address) | None => (), Some(x) => { - return Err(AsgConvertError::unexpected_type( - &x.to_string(), - Some(&*Type::Address.to_string()), - span, - )); + return Err(AsgError::unexpected_type(x, Type::Address, span).into()); } } Constant { @@ -91,11 +88,7 @@ impl<'a> FromAst<'a, leo_ast::ValueExpression> for Constant<'a> { match expected_type.map(PartialType::full).flatten() { Some(Type::Boolean) | None => (), Some(x) => { - return Err(AsgConvertError::unexpected_type( - &x.to_string(), - Some(&*Type::Boolean.to_string()), - span, - )); + return Err(AsgError::unexpected_type(x, Type::Boolean, span).into()); } } Constant { @@ -104,7 +97,7 @@ impl<'a> FromAst<'a, leo_ast::ValueExpression> for Constant<'a> { value: ConstValue::Boolean( value .parse::() - .map_err(|_| AsgConvertError::invalid_boolean(value, span))?, + .map_err(|_| AsgError::invalid_boolean(value, span))?, ), } } @@ -112,11 +105,7 @@ impl<'a> FromAst<'a, leo_ast::ValueExpression> for Constant<'a> { match expected_type.map(PartialType::full).flatten() { Some(Type::Char) | None => (), Some(x) => { - return Err(AsgConvertError::unexpected_type( - &x.to_string(), - Some(&*Type::Char.to_string()), - value.span(), - )); + return Err(AsgError::unexpected_type(x, Type::Char, value.span()).into()); } } @@ -130,28 +119,20 @@ impl<'a> FromAst<'a, leo_ast::ValueExpression> for Constant<'a> { match expected_type.map(PartialType::full).flatten() { Some(Type::Field) | None => (), Some(x) => { - return Err(AsgConvertError::unexpected_type( - &x.to_string(), - Some(&*Type::Field.to_string()), - span, - )); + return Err(AsgError::unexpected_type(x, Type::Field, span).into()); } } Constant { parent: Cell::new(None), span: Some(span.clone()), - value: ConstValue::Field(value.parse().map_err(|_| AsgConvertError::invalid_int(value, span))?), + value: ConstValue::Field(value.parse().map_err(|_| AsgError::invalid_int(value, span))?), } } Group(value) => { match expected_type.map(PartialType::full).flatten() { Some(Type::Group) | None => (), Some(x) => { - return Err(AsgConvertError::unexpected_type( - &x.to_string(), - Some(&*Type::Group.to_string()), - value.span(), - )); + return Err(AsgError::unexpected_type(x, Type::Group, value.span()).into()); } } Constant { @@ -166,7 +147,7 @@ impl<'a> FromAst<'a, leo_ast::ValueExpression> for Constant<'a> { } } Implicit(value, span) => match expected_type { - None => return Err(AsgConvertError::unresolved_type("unknown", span)), + None => return Err(AsgError::unresolved_type("unknown", span).into()), Some(PartialType::Integer(Some(sub_type), _)) | Some(PartialType::Integer(None, Some(sub_type))) => { Constant { parent: Cell::new(None), @@ -177,7 +158,7 @@ impl<'a> FromAst<'a, leo_ast::ValueExpression> for Constant<'a> { Some(PartialType::Type(Type::Field)) => Constant { parent: Cell::new(None), span: Some(span.clone()), - value: ConstValue::Field(value.parse().map_err(|_| AsgConvertError::invalid_int(value, span))?), + value: ConstValue::Field(value.parse().map_err(|_| AsgError::invalid_int(value, span))?), }, Some(PartialType::Type(Type::Group)) => Constant { parent: Cell::new(None), @@ -189,7 +170,9 @@ impl<'a> FromAst<'a, leo_ast::ValueExpression> for Constant<'a> { span: Some(span.clone()), value: ConstValue::Address(value.clone()), }, - Some(x) => return Err(AsgConvertError::unexpected_type(&x.to_string(), Some("unknown"), span)), + Some(x) => { + return Err(AsgError::unexpected_type(x, "unknown", span).into()); + } }, Integer(int_type, value, span) => { match expected_type { @@ -197,11 +180,7 @@ impl<'a> FromAst<'a, leo_ast::ValueExpression> for Constant<'a> { Some(PartialType::Integer(None, Some(_))) => (), None => (), Some(x) => { - return Err(AsgConvertError::unexpected_type( - &x.to_string(), - Some(&*int_type.to_string()), - span, - )); + return Err(AsgError::unexpected_type(x, int_type, span).into()); } } Constant { diff --git a/asg/src/expression/mod.rs b/asg/src/expression/mod.rs index 60c9d3f47c..f72d3c8b43 100644 --- a/asg/src/expression/mod.rs +++ b/asg/src/expression/mod.rs @@ -65,7 +65,8 @@ pub use variable_ref::*; mod cast; pub use cast::*; -use crate::{AsgConvertError, ConstValue, FromAst, Node, PartialType, Scope, Span, Type}; +use crate::{ConstValue, FromAst, Node, PartialType, Scope, Type}; +use leo_errors::{Result, Span}; #[derive(Clone)] pub enum Expression<'a> { @@ -284,7 +285,7 @@ impl<'a> FromAst<'a, leo_ast::Expression> for &'a Expression<'a> { scope: &'a Scope<'a>, value: &leo_ast::Expression, expected_type: Option>, - ) -> Result { + ) -> Result { use leo_ast::Expression::*; let expression = match value { Identifier(identifier) => Self::from_ast(scope, identifier, expected_type)?, diff --git a/asg/src/expression/ternary.rs b/asg/src/expression/ternary.rs index ee071f05e8..8f286d4559 100644 --- a/asg/src/expression/ternary.rs +++ b/asg/src/expression/ternary.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type}; +use crate::{ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Type}; +use leo_errors::{AsgError, Result, Span}; use std::cell::Cell; @@ -78,7 +79,7 @@ impl<'a> FromAst<'a, leo_ast::TernaryExpression> for TernaryExpression<'a> { scope: &'a Scope<'a>, value: &leo_ast::TernaryExpression, expected_type: Option>, - ) -> Result, AsgConvertError> { + ) -> Result> { let if_true = Cell::new(<&Expression<'a>>::from_ast( scope, &*value.if_true, @@ -90,11 +91,7 @@ impl<'a> FromAst<'a, leo_ast::TernaryExpression> for TernaryExpression<'a> { let right = if_false.get().get_type().unwrap().into(); if left != right { - return Err(AsgConvertError::ternary_different_types( - &left.to_string(), - &right.to_string(), - &value.span, - )); + return Err(AsgError::ternary_different_types(left, right, &value.span).into()); } Ok(TernaryExpression { diff --git a/asg/src/expression/tuple_access.rs b/asg/src/expression/tuple_access.rs index fc21c08def..327ed51548 100644 --- a/asg/src/expression/tuple_access.rs +++ b/asg/src/expression/tuple_access.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type}; +use crate::{ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Type}; +use leo_errors::{AsgError, Result, Span}; use std::cell::Cell; @@ -74,12 +75,12 @@ impl<'a> FromAst<'a, leo_ast::TupleAccessExpression> for TupleAccessExpression<' scope: &'a Scope<'a>, value: &leo_ast::TupleAccessExpression, expected_type: Option>, - ) -> Result, AsgConvertError> { + ) -> Result> { let index = value .index .value .parse::() - .map_err(|_| AsgConvertError::parse_index_error())?; + .map_err(|_| AsgError::parse_index_error(&value.span))?; let mut expected_tuple = vec![None; index + 1]; expected_tuple[index] = expected_type; @@ -88,11 +89,14 @@ impl<'a> FromAst<'a, leo_ast::TupleAccessExpression> for TupleAccessExpression<' let tuple_type = tuple.get_type(); if let Some(Type::Tuple(_items)) = tuple_type { } else { - return Err(AsgConvertError::unexpected_type( + return Err(AsgError::unexpected_type( "a tuple", - tuple_type.map(|x| x.to_string()).as_deref(), + tuple_type + .map(|x| x.to_string()) + .unwrap_or_else(|| "unknown".to_string()), &value.span, - )); + ) + .into()); } Ok(TupleAccessExpression { diff --git a/asg/src/expression/tuple_init.rs b/asg/src/expression/tuple_init.rs index 90397989de..317020f80a 100644 --- a/asg/src/expression/tuple_init.rs +++ b/asg/src/expression/tuple_init.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type}; +use crate::{ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Type}; +use leo_errors::{AsgError, Result, Span}; use std::cell::Cell; @@ -80,16 +81,17 @@ impl<'a> FromAst<'a, leo_ast::TupleInitExpression> for TupleInitExpression<'a> { scope: &'a Scope<'a>, value: &leo_ast::TupleInitExpression, expected_type: Option>, - ) -> Result, AsgConvertError> { + ) -> Result> { let tuple_types = match expected_type { Some(PartialType::Tuple(sub_types)) => Some(sub_types), None => None, x => { - return Err(AsgConvertError::unexpected_type( + return Err(AsgError::unexpected_type( "tuple", - x.map(|x| x.to_string()).as_deref(), + x.map(|x| x.to_string()).unwrap_or_else(|| "unknown".to_string()), &value.span, - )); + ) + .into()); } }; @@ -97,11 +99,12 @@ impl<'a> FromAst<'a, leo_ast::TupleInitExpression> for TupleInitExpression<'a> { // Expected type can be equal or less than actual size of a tuple. // Size of expected tuple can be based on accessed index. if tuple_types.len() > value.elements.len() { - return Err(AsgConvertError::unexpected_type( - &*format!("tuple of length {}", tuple_types.len()), - Some(&*format!("tuple of length {}", value.elements.len())), + return Err(AsgError::unexpected_type( + format!("tuple of length {}", tuple_types.len()), + format!("tuple of length {}", value.elements.len()), &value.span, - )); + ) + .into()); } } @@ -117,7 +120,7 @@ impl<'a> FromAst<'a, leo_ast::TupleInitExpression> for TupleInitExpression<'a> { ) .map(Cell::new) }) - .collect::, AsgConvertError>>()?; + .collect::>>()?; Ok(TupleInitExpression { parent: Cell::new(None), diff --git a/asg/src/expression/unary.rs b/asg/src/expression/unary.rs index 4ccc7662a6..a9da91eec6 100644 --- a/asg/src/expression/unary.rs +++ b/asg/src/expression/unary.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Span, Type}; +use crate::{ConstValue, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, Type}; pub use leo_ast::UnaryOperation; +use leo_errors::{AsgError, Result, Span}; use std::cell::Cell; @@ -89,16 +90,12 @@ impl<'a> FromAst<'a, leo_ast::UnaryExpression> for UnaryExpression<'a> { scope: &'a Scope<'a>, value: &leo_ast::UnaryExpression, expected_type: Option>, - ) -> Result, AsgConvertError> { + ) -> Result> { let expected_type = match value.op { UnaryOperation::Not => match expected_type.map(|x| x.full()).flatten() { Some(Type::Boolean) | None => Some(Type::Boolean), Some(type_) => { - return Err(AsgConvertError::unexpected_type( - &type_.to_string(), - Some(&*Type::Boolean.to_string()), - &value.span, - )); + return Err(AsgError::unexpected_type(type_, Type::Boolean, &value.span).into()); } }, UnaryOperation::Negate => match expected_type.map(|x| x.full()).flatten() { @@ -107,22 +104,14 @@ impl<'a> FromAst<'a, leo_ast::UnaryExpression> for UnaryExpression<'a> { Some(Type::Field) => Some(Type::Field), None => None, Some(type_) => { - return Err(AsgConvertError::unexpected_type( - &type_.to_string(), - Some("integer, group, field"), - &value.span, - )); + return Err(AsgError::unexpected_type(type_, "integer, group, field", &value.span).into()); } }, UnaryOperation::BitNot => match expected_type.map(|x| x.full()).flatten() { Some(type_ @ Type::Integer(_)) => Some(type_), None => None, Some(type_) => { - return Err(AsgConvertError::unexpected_type( - &type_.to_string(), - Some("integer"), - &value.span, - )); + return Err(AsgError::unexpected_type(type_, "integer", &value.span).into()); } }, }; @@ -137,7 +126,7 @@ impl<'a> FromAst<'a, leo_ast::UnaryExpression> for UnaryExpression<'a> { }) .unwrap_or(false); if is_expr_unsigned { - return Err(AsgConvertError::unsigned_negation(&value.span)); + return Err(AsgError::unsigned_negation(&value.span).into()); } } Ok(UnaryExpression { diff --git a/asg/src/expression/variable_ref.rs b/asg/src/expression/variable_ref.rs index ba8b59221b..f16598ac44 100644 --- a/asg/src/expression/variable_ref.rs +++ b/asg/src/expression/variable_ref.rs @@ -15,10 +15,12 @@ // along with the Leo library. If not, see . use crate::{ - AsgConvertError, ConstValue, Constant, DefinitionStatement, Expression, ExpressionNode, FromAst, Node, PartialType, - Scope, Span, Statement, Type, Variable, + ConstValue, Constant, DefinitionStatement, Expression, ExpressionNode, FromAst, Node, PartialType, Scope, + Statement, Type, Variable, }; +use leo_errors::{AsgError, Result, Span}; + use std::cell::Cell; #[derive(Clone)] @@ -123,14 +125,12 @@ impl<'a> FromAst<'a, leo_ast::Identifier> for &'a Expression<'a> { scope: &'a Scope<'a>, value: &leo_ast::Identifier, expected_type: Option>, - ) -> Result<&'a Expression<'a>, AsgConvertError> { + ) -> Result<&'a Expression<'a>> { let variable = if value.name.as_ref() == "input" { if let Some(input) = scope.resolve_input() { input.container } else { - return Err(AsgConvertError::InternalError( - "attempted to reference input when none is in scope".to_string(), - )); + return Err(AsgError::illegal_input_variable_reference(&value.span).into()); } } else { match scope.resolve_variable(&value.name) { @@ -143,7 +143,7 @@ impl<'a> FromAst<'a, leo_ast::Identifier> for &'a Expression<'a> { value: ConstValue::Address(value.name.clone()), }))); } - return Err(AsgConvertError::unresolved_reference(&value.name, &value.span)); + return Err(AsgError::unresolved_reference(&value.name, &value.span).into()); } } }; @@ -158,13 +158,9 @@ impl<'a> FromAst<'a, leo_ast::Identifier> for &'a Expression<'a> { if let Some(expected_type) = expected_type { let type_ = expression .get_type() - .ok_or_else(|| AsgConvertError::unresolved_reference(&value.name, &value.span))?; + .ok_or_else(|| AsgError::unresolved_reference(&value.name, &value.span))?; if !expected_type.matches(&type_) { - return Err(AsgConvertError::unexpected_type( - &expected_type.to_string(), - Some(&*type_.to_string()), - &value.span, - )); + return Err(AsgError::unexpected_type(expected_type, type_, &value.span).into()); } } diff --git a/asg/src/import.rs b/asg/src/import.rs index 4dc3c5ae43..3e95ce1e22 100644 --- a/asg/src/import.rs +++ b/asg/src/import.rs @@ -18,7 +18,8 @@ use std::marker::PhantomData; -use crate::{AsgContext, AsgConvertError, Program, Span}; +use crate::{AsgContext, Program}; +use leo_errors::{Result, Span}; use indexmap::IndexMap; @@ -28,7 +29,7 @@ pub trait ImportResolver<'a> { context: AsgContext<'a>, package_segments: &[&str], span: &Span, - ) -> Result>, AsgConvertError>; + ) -> Result>>; } pub struct NullImportResolver; @@ -39,7 +40,7 @@ impl<'a> ImportResolver<'a> for NullImportResolver { _context: AsgContext<'a>, _package_segments: &[&str], _span: &Span, - ) -> Result>, AsgConvertError> { + ) -> Result>> { Ok(None) } } @@ -64,7 +65,7 @@ impl<'a, 'b, T: ImportResolver<'b>> ImportResolver<'b> for CoreImportResolver<'a context: AsgContext<'b>, package_segments: &[&str], span: &Span, - ) -> Result>, AsgConvertError> { + ) -> Result>> { if !package_segments.is_empty() && package_segments.get(0).unwrap() == &"core" { Ok(crate::resolve_core_module(context, &*package_segments[1..].join("."))?) } else { @@ -83,7 +84,7 @@ impl<'a> ImportResolver<'a> for MockedImportResolver<'a> { _context: AsgContext<'a>, package_segments: &[&str], _span: &Span, - ) -> Result>, AsgConvertError> { + ) -> Result>> { Ok(self.packages.get(&package_segments.join(".")).cloned()) } } diff --git a/asg/src/input.rs b/asg/src/input.rs index b22ee2f8b9..625500ed0f 100644 --- a/asg/src/input.rs +++ b/asg/src/input.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . use crate::{Circuit, CircuitMember, Identifier, Scope, Type, Variable}; +use leo_errors::Span; use indexmap::IndexMap; use std::cell::RefCell; @@ -44,7 +45,7 @@ impl<'a> Input<'a> { members: RefCell::new(IndexMap::new()), core_mapping: RefCell::new(None), scope, - span: Default::default(), + span: Some(Span::default()), }) } @@ -73,7 +74,7 @@ impl<'a> Input<'a> { members: RefCell::new(container_members), core_mapping: RefCell::new(None), scope: input_scope, - span: Default::default(), + span: Some(Span::default()), }); Input { diff --git a/asg/src/lib.rs b/asg/src/lib.rs index 0c74b6f3cd..ecb5702ab6 100644 --- a/asg/src/lib.rs +++ b/asg/src/lib.rs @@ -24,9 +24,7 @@ #![allow(clippy::from_over_into)] #![allow(clippy::result_unit_err)] - -#[macro_use] -extern crate thiserror; +#![doc = include_str!("../README.md")] pub mod checks; pub use checks::*; @@ -34,9 +32,6 @@ pub use checks::*; pub mod const_value; pub use const_value::*; -pub mod error; -pub use error::*; - pub mod expression; pub use expression::*; @@ -77,7 +72,8 @@ pub use pass::*; pub mod context; pub use context::*; -pub use leo_ast::{Ast, Identifier, Span}; +pub use leo_ast::{Ast, Identifier}; +use leo_errors::Result; /// The abstract semantic graph (ASG) for a Leo program. /// @@ -97,7 +93,7 @@ impl<'a> Asg<'a> { context: AsgContext<'a>, ast: Y, resolver: &mut T, - ) -> Result { + ) -> Result { Ok(Self { context, asg: Program::new(context, ast.as_ref(), resolver)?, @@ -130,7 +126,7 @@ pub fn load_asg<'a, T: ImportResolver<'a>>( context: AsgContext<'a>, content: &str, resolver: &mut T, -) -> Result, AsgConvertError> { +) -> Result> { // Parses the Leo file and constructs a grammar ast. let ast = leo_parser::parse_ast("input.leo", content)?; diff --git a/asg/src/node.rs b/asg/src/node.rs index b7e5a2c3e5..27d9998c03 100644 --- a/asg/src/node.rs +++ b/asg/src/node.rs @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{ - AsgContextInner, AsgConvertError, Circuit, Expression, Function, PartialType, Scope, Span, Statement, Variable, -}; +use crate::{AsgContextInner, Circuit, Expression, Function, PartialType, Scope, Statement, Variable}; + +use leo_errors::{Result, Span}; /// A node in the abstract semantic graph. pub trait Node { @@ -26,11 +26,7 @@ pub trait Node { pub(super) trait FromAst<'a, T: leo_ast::Node + 'static>: Sized { // expected_type contract: if present, output expression must be of type expected_type. // type of an element may NEVER be None unless it is functionally a non-expression. (static call targets, function ref call targets are not expressions) - fn from_ast( - scope: &'a Scope<'a>, - value: &T, - expected_type: Option>, - ) -> Result; + fn from_ast(scope: &'a Scope<'a>, value: &T, expected_type: Option>) -> Result; } pub enum ArenaNode<'a> { diff --git a/asg/src/pass.rs b/asg/src/pass.rs index 69dd68b4e8..6828362e57 100644 --- a/asg/src/pass.rs +++ b/asg/src/pass.rs @@ -15,8 +15,8 @@ // along with the Leo library. If not, see . use crate::Program; -pub use leo_ast::FormattedError; +use leo_errors::Result; pub trait AsgPass<'a> { - fn do_pass(asg: Program<'a>) -> Result, FormattedError>; + fn do_pass(asg: Program<'a>) -> Result>; } diff --git a/asg/src/prelude.rs b/asg/src/prelude.rs index d4a2faffbc..42d17a955c 100644 --- a/asg/src/prelude.rs +++ b/asg/src/prelude.rs @@ -16,12 +16,13 @@ // TODO (protryon): We should merge this with core -use crate::{AsgContext, AsgConvertError, Program}; +use crate::{AsgContext, Program}; +use leo_errors::Result; // TODO (protryon): Make asg deep copy so we can cache resolved core modules // TODO (protryon): Figure out how to do headers without bogus returns -pub fn resolve_core_module<'a>(context: AsgContext<'a>, module: &str) -> Result>, AsgConvertError> { +pub fn resolve_core_module<'a>(context: AsgContext<'a>, module: &str) -> Result>> { match module { "unstable.blake2s" => { let asg = crate::load_asg( diff --git a/asg/src/program/circuit.rs b/asg/src/program/circuit.rs index 4ef8bb57ff..009ecb2161 100644 --- a/asg/src/program/circuit.rs +++ b/asg/src/program/circuit.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, Function, Identifier, Node, Scope, Span, Type}; +use crate::{Function, Identifier, Node, Scope, Type}; +use leo_errors::{AsgError, Result, Span}; use indexmap::IndexMap; use std::cell::RefCell; @@ -53,7 +54,7 @@ impl<'a> Node for Circuit<'a> { } impl<'a> Circuit<'a> { - pub(super) fn init(scope: &'a Scope<'a>, value: &leo_ast::Circuit) -> Result<&'a Circuit<'a>, AsgConvertError> { + pub(super) fn init(scope: &'a Scope<'a>, value: &leo_ast::Circuit) -> Result<&'a Circuit<'a>> { let new_scope = scope.make_subscope(); let circuit = scope.context.alloc_circuit(Circuit { @@ -64,21 +65,18 @@ impl<'a> Circuit<'a> { span: Some(value.circuit_name.span.clone()), scope: new_scope, }); - new_scope.circuit_self.replace(Some(circuit)); let mut members = circuit.members.borrow_mut(); for member in value.members.iter() { if let leo_ast::CircuitMember::CircuitVariable(name, type_) = member { if members.contains_key(name.name.as_ref()) { - return Err(AsgConvertError::redefined_circuit_member( - &value.circuit_name.name, - &name.name, - &name.span, - )); + return Err( + AsgError::redefined_circuit_member(&value.circuit_name.name, &name.name, &name.span).into(), + ); } members.insert( name.name.to_string(), - CircuitMember::Variable(new_scope.resolve_ast_type(type_)?), + CircuitMember::Variable(new_scope.resolve_ast_type(type_, &name.span)?), ); } } @@ -86,30 +84,27 @@ impl<'a> Circuit<'a> { Ok(circuit) } - pub(super) fn init_member( - scope: &'a Scope<'a>, - value: &leo_ast::Circuit, - ) -> Result<&'a Circuit<'a>, AsgConvertError> { + pub(super) fn init_member(scope: &'a Scope<'a>, value: &leo_ast::Circuit) -> Result<&'a Circuit<'a>> { let new_scope = scope.make_subscope(); let circuits = scope.circuits.borrow(); let circuit = circuits.get(value.circuit_name.name.as_ref()).unwrap(); - new_scope.circuit_self.replace(Some(circuit)); let mut members = circuit.members.borrow_mut(); for member in value.members.iter() { if let leo_ast::CircuitMember::CircuitFunction(function) = member { if members.contains_key(function.identifier.name.as_ref()) { - return Err(AsgConvertError::redefined_circuit_member( + return Err(AsgError::redefined_circuit_member( &value.circuit_name.name, &function.identifier.name, &function.identifier.span, - )); + ) + .into()); } let asg_function = Function::init(new_scope, function)?; asg_function.circuit.replace(Some(circuit)); if asg_function.is_test() { - return Err(AsgConvertError::circuit_test_function(&function.identifier.span)); + return Err(AsgError::circuit_test_function(&function.identifier.span).into()); } members.insert( function.identifier.name.to_string(), @@ -121,7 +116,7 @@ impl<'a> Circuit<'a> { Ok(circuit) } - pub(super) fn fill_from_ast(self: &'a Circuit<'a>, value: &leo_ast::Circuit) -> Result<(), AsgConvertError> { + pub(super) fn fill_from_ast(self: &'a Circuit<'a>, value: &leo_ast::Circuit) -> Result<()> { for member in value.members.iter() { match member { leo_ast::CircuitMember::CircuitVariable(..) => {} diff --git a/asg/src/program/function.rs b/asg/src/program/function.rs index 6d8f68e68b..f2a4cb105e 100644 --- a/asg/src/program/function.rs +++ b/asg/src/program/function.rs @@ -15,12 +15,12 @@ // along with the Leo library. If not, see . use crate::{ - AsgConvertError, BlockStatement, Circuit, FromAst, Identifier, MonoidalDirector, ReturnPathReducer, Scope, Span, - Statement, Type, Variable, + BlockStatement, Circuit, FromAst, Identifier, MonoidalDirector, ReturnPathReducer, Scope, Statement, Type, Variable, }; use indexmap::IndexMap; pub use leo_ast::Annotation; use leo_ast::FunctionInput; +use leo_errors::{AsgError, Result, Span}; use std::cell::{Cell, RefCell}; @@ -58,11 +58,11 @@ impl<'a> PartialEq for Function<'a> { impl<'a> Eq for Function<'a> {} impl<'a> Function<'a> { - pub(crate) fn init(scope: &'a Scope<'a>, value: &leo_ast::Function) -> Result<&'a Function<'a>, AsgConvertError> { + pub(crate) fn init(scope: &'a Scope<'a>, value: &leo_ast::Function) -> Result<&'a Function<'a>> { let output: Type<'a> = value .output .as_ref() - .map(|t| scope.resolve_ast_type(t)) + .map(|t| scope.resolve_ast_type(t, &value.span)) .transpose()? .unwrap_or_else(|| Type::Tuple(vec![])); let mut qualifier = FunctionQualifier::Static; @@ -81,31 +81,22 @@ impl<'a> Function<'a> { FunctionInput::MutSelfKeyword(_) => { qualifier = FunctionQualifier::MutSelfRef; } - FunctionInput::Variable(leo_ast::FunctionInputVariable { - type_, - identifier, - const_, - mutable, - .. - }) => { + FunctionInput::Variable(input_variable) => { let variable = scope.context.alloc_variable(RefCell::new(crate::InnerVariable { id: scope.context.get_id(), - name: identifier.clone(), - type_: scope.resolve_ast_type(type_)?, - mutable: *mutable, - const_: *const_, + name: input_variable.identifier.clone(), + type_: scope.resolve_ast_type(&input_variable.type_, &value.span)?, + mutable: input_variable.mutable, + const_: input_variable.const_, declaration: crate::VariableDeclaration::Parameter, references: vec![], assignments: vec![], })); - arguments.insert(identifier.name.to_string(), Cell::new(&*variable)); + arguments.insert(input_variable.identifier.name.to_string(), Cell::new(&*variable)); } } } } - if qualifier != FunctionQualifier::Static && scope.circuit_self.get().is_none() { - return Err(AsgConvertError::invalid_self_in_global(&value.span)); - } let function = scope.context.alloc_function(Function { id: scope.context.get_id(), name: RefCell::new(value.identifier.clone()), @@ -123,7 +114,7 @@ impl<'a> Function<'a> { Ok(function) } - pub(super) fn fill_from_ast(self: &'a Function<'a>, value: &leo_ast::Function) -> Result<(), AsgConvertError> { + pub(super) fn fill_from_ast(self: &'a Function<'a>, value: &leo_ast::Function) -> Result<()> { if self.qualifier != FunctionQualifier::Static { let circuit = self.circuit.get(); let self_variable = self.scope.context.alloc_variable(RefCell::new(crate::InnerVariable { @@ -148,19 +139,12 @@ impl<'a> Function<'a> { let main_block = BlockStatement::from_ast(self.scope, &value.block, None)?; let mut director = MonoidalDirector::new(ReturnPathReducer::new()); if !director.reduce_block(&main_block).0 && !self.output.is_unit() { - return Err(AsgConvertError::function_missing_return( - &self.name.borrow().name, - &value.span, - )); + return Err(AsgError::function_missing_return(&self.name.borrow().name, &value.span).into()); } #[allow(clippy::never_loop)] // TODO @Protryon: How should we return multiple errors? for (span, error) in director.reducer().errors { - return Err(AsgConvertError::function_return_validation( - &self.name.borrow().name, - &error, - &span, - )); + return Err(AsgError::function_return_validation(&self.name.borrow().name, error, &span).into()); } self.body diff --git a/asg/src/program/mod.rs b/asg/src/program/mod.rs index cc2ec02dcc..44b8cad74c 100644 --- a/asg/src/program/mod.rs +++ b/asg/src/program/mod.rs @@ -24,10 +24,9 @@ pub use circuit::*; mod function; pub use function::*; -use crate::{ - node::FromAst, ArenaNode, AsgContext, AsgConvertError, DefinitionStatement, ImportResolver, Input, Scope, Statement, -}; -use leo_ast::{Identifier, PackageAccess, PackageOrPackages, Span}; +use crate::{node::FromAst, ArenaNode, AsgContext, DefinitionStatement, ImportResolver, Input, Scope, Statement}; +use leo_ast::{Identifier, PackageAccess, PackageOrPackages}; +use leo_errors::{AsgError, Result, Span}; use indexmap::IndexMap; use std::cell::{Cell, RefCell}; @@ -138,7 +137,7 @@ impl<'a> Program<'a> { context: AsgContext<'a>, program: &leo_ast::Program, import_resolver: &mut T, - ) -> Result, AsgConvertError> { + ) -> Result> { // Recursively extract imported symbols. let mut imported_symbols: Vec<(Vec, ImportSymbol, Span)> = vec![]; for import in program.imports.iter() { @@ -164,7 +163,9 @@ impl<'a> Program<'a> { span, )? { Some(x) => x, - None => return Err(AsgConvertError::unresolved_import(&*pretty_package, &Span::default())), + None => { + return Err(AsgError::unresolved_import(pretty_package, &Span::default()).into()); + } }; resolved_packages.insert(package.clone(), resolved_package); @@ -195,10 +196,7 @@ impl<'a> Program<'a> { } else if let Some(global_const) = resolved_package.global_consts.get(&name) { imported_global_consts.insert(name.clone(), *global_const); } else { - return Err(AsgConvertError::unresolved_import( - &*format!("{}.{}", pretty_package, name), - &span, - )); + return Err(AsgError::unresolved_import(format!("{}.{}", pretty_package, name), &span).into()); } } ImportSymbol::Alias(name, alias) => { @@ -209,10 +207,7 @@ impl<'a> Program<'a> { } else if let Some(global_const) = resolved_package.global_consts.get(&name) { imported_global_consts.insert(alias.clone(), *global_const); } else { - return Err(AsgConvertError::unresolved_import( - &*format!("{}.{}", pretty_package, name), - &span, - )); + return Err(AsgError::unresolved_import(format!("{}.{}", pretty_package, name), &span).into()); } } } @@ -222,7 +217,6 @@ impl<'a> Program<'a> { context, id: context.get_id(), parent_scope: Cell::new(None), - circuit_self: Cell::new(None), variables: RefCell::new(IndexMap::new()), functions: RefCell::new(imported_functions), global_consts: RefCell::new(imported_global_consts), @@ -239,7 +233,6 @@ impl<'a> Program<'a> { input: Cell::new(Some(Input::new(import_scope))), // we use import_scope to avoid recursive scope ref here id: context.get_id(), parent_scope: Cell::new(Some(import_scope)), - circuit_self: Cell::new(None), variables: RefCell::new(IndexMap::new()), functions: RefCell::new(IndexMap::new()), global_consts: RefCell::new(IndexMap::new()), @@ -303,7 +296,7 @@ impl<'a> Program<'a> { let name = name.name.to_string(); if functions.contains_key(&name) { - return Err(AsgConvertError::duplicate_function_definition(&name, &function.span)); + return Err(AsgError::duplicate_function_definition(name, &function.span).into()); } functions.insert(name, asg_function); diff --git a/asg/src/scope.rs b/asg/src/scope.rs index 0582aa13c0..fb34bb35fe 100644 --- a/asg/src/scope.rs +++ b/asg/src/scope.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgContext, AsgConvertError, Circuit, DefinitionStatement, Function, Input, Type, Variable}; +use crate::{AsgContext, Circuit, DefinitionStatement, Function, Input, Type, Variable}; +use leo_errors::{AsgError, Result, Span}; use indexmap::IndexMap; use std::cell::{Cell, RefCell}; @@ -33,9 +34,6 @@ pub struct Scope<'a> { /// The function definition that this scope occurs in. pub function: Cell>>, - /// The circuit definition that this scope occurs in. - pub circuit_self: Cell>>, - /// Maps variable name => variable. pub variables: RefCell>>, @@ -127,8 +125,6 @@ impl<'a> Scope<'a> { pub fn resolve_circuit(&self, name: &str) -> Option<&'a Circuit<'a>> { if let Some(resolved) = self.circuits.borrow().get(name) { Some(*resolved) - } else if name == "Self" && self.circuit_self.get().is_some() { - self.circuit_self.get() } else if let Some(resolved) = self.parent_scope.get() { resolved.resolve_circuit(name) } else { @@ -136,22 +132,6 @@ impl<'a> Scope<'a> { } } - /// - /// Returns a reference to the current circuit. - /// - /// If the current scope did not have a circuit self present, then the parent scope is checked. - /// If there is no parent scope, then `None` is returned. - /// - pub fn resolve_circuit_self(&self) -> Option<&'a Circuit<'a>> { - if let Some(resolved) = self.circuit_self.get() { - Some(resolved) - } else if let Some(resolved) = self.parent_scope.get() { - resolved.resolve_circuit_self() - } else { - None - } - } - /// /// Returns a new scope given a parent scope. /// @@ -160,7 +140,6 @@ impl<'a> Scope<'a> { context: self.context, id: self.context.get_id(), parent_scope: Cell::new(Some(self)), - circuit_self: Cell::new(None), variables: RefCell::new(IndexMap::new()), functions: RefCell::new(IndexMap::new()), circuits: RefCell::new(IndexMap::new()), @@ -173,7 +152,7 @@ impl<'a> Scope<'a> { /// /// Returns the type returned by the current scope. /// - pub fn resolve_ast_type(&self, type_: &leo_ast::Type) -> Result, AsgConvertError> { + pub fn resolve_ast_type(&self, type_: &leo_ast::Type, span: &Span) -> Result> { use leo_ast::Type::*; Ok(match type_ { Address => Type::Address, @@ -183,12 +162,12 @@ impl<'a> Scope<'a> { Group => Type::Group, IntegerType(int_type) => Type::Integer(int_type.clone()), Array(sub_type, dimensions) => { - let mut item = Box::new(self.resolve_ast_type(&*sub_type)?); + let mut item = Box::new(self.resolve_ast_type(&*sub_type, span)?); for dimension in dimensions.0.iter().rev() { let dimension = dimension .value .parse::() - .map_err(|_| AsgConvertError::parse_index_error())?; + .map_err(|_| AsgError::parse_index_error(span))?; item = Box::new(Type::Array(item, dimension)); } *item @@ -196,20 +175,13 @@ impl<'a> Scope<'a> { Tuple(sub_types) => Type::Tuple( sub_types .iter() - .map(|x| self.resolve_ast_type(x)) - .collect::, AsgConvertError>>()?, - ), - Circuit(name) if name.name.as_ref() == "Self" => Type::Circuit( - self.resolve_circuit_self() - .ok_or_else(|| AsgConvertError::unresolved_circuit(&name.name, &name.span))?, - ), - SelfType => Type::Circuit( - self.resolve_circuit_self() - .ok_or_else(AsgConvertError::reference_self_outside_circuit)?, + .map(|x| self.resolve_ast_type(x, span)) + .collect::>>()?, ), + SelfType => return Err(AsgError::unexpected_big_self(span).into()), Circuit(name) => Type::Circuit( self.resolve_circuit(&name.name) - .ok_or_else(|| AsgConvertError::unresolved_circuit(&name.name, &name.span))?, + .ok_or_else(|| AsgError::unresolved_circuit(&name.name, &name.span))?, ), }) } diff --git a/asg/src/statement/assign.rs b/asg/src/statement/assign.rs index 3fe02a1928..59c7b3a528 100644 --- a/asg/src/statement/assign.rs +++ b/asg/src/statement/assign.rs @@ -15,11 +15,12 @@ // along with the Leo library. If not, see . use crate::{ - AsgConvertError, CircuitMember, ConstInt, ConstValue, Expression, ExpressionNode, FromAst, Identifier, IntegerType, - Node, PartialType, Scope, Span, Statement, Type, Variable, + CircuitMember, ConstInt, ConstValue, Expression, ExpressionNode, FromAst, Identifier, IntegerType, Node, + PartialType, Scope, Statement, Type, Variable, }; pub use leo_ast::AssignOperation; use leo_ast::AssigneeAccess as AstAssigneeAccess; +use leo_errors::{AsgError, Result, Span}; use std::cell::Cell; @@ -52,25 +53,26 @@ impl<'a> FromAst<'a, leo_ast::AssignStatement> for &'a Statement<'a> { scope: &'a Scope<'a>, statement: &leo_ast::AssignStatement, _expected_type: Option>, - ) -> Result { - let (name, span) = (&statement.assignee.identifier.name, &statement.assignee.identifier.span); + ) -> Result { + let (name, span) = ( + &statement.assignee.identifier.name.clone(), + &statement.assignee.identifier.span, + ); let variable = if name.as_ref() == "input" { if let Some(input) = scope.resolve_input() { input.container } else { - return Err(AsgConvertError::InternalError( - "attempted to reference input when none is in scope".to_string(), - )); + return Err(AsgError::illegal_input_variable_reference(&statement.span).into()); } } else { scope .resolve_variable(name) - .ok_or_else(|| AsgConvertError::unresolved_reference(name, span))? + .ok_or_else(|| AsgError::unresolved_reference(name, span))? }; if !variable.borrow().mutable { - return Err(AsgConvertError::immutable_assignment(name, &statement.span)); + return Err(AsgError::immutable_assignment(name, &statement.span).into()); } let mut target_type: Option = Some(variable.borrow().type_.clone().into()); @@ -81,19 +83,15 @@ impl<'a> FromAst<'a, leo_ast::AssignStatement> for &'a Statement<'a> { let index_type = Some(PartialType::Integer(None, Some(IntegerType::U32))); let left = left .as_ref() - .map( - |left: &leo_ast::Expression| -> Result<&'a Expression<'a>, AsgConvertError> { - <&Expression<'a>>::from_ast(scope, left, index_type.clone()) - }, - ) + .map(|left: &leo_ast::Expression| -> Result<&'a Expression<'a>> { + <&Expression<'a>>::from_ast(scope, left, index_type.clone()) + }) .transpose()?; let right = right .as_ref() - .map( - |right: &leo_ast::Expression| -> Result<&'a Expression<'a>, AsgConvertError> { - <&Expression<'a>>::from_ast(scope, right, index_type) - }, - ) + .map(|right: &leo_ast::Expression| -> Result<&'a Expression<'a>> { + <&Expression<'a>>::from_ast(scope, right, index_type) + }) .transpose()?; match &target_type { @@ -109,29 +107,30 @@ impl<'a> FromAst<'a, leo_ast::AssignStatement> for &'a Statement<'a> { ) { let left = match left { ConstValue::Int(x) => x.to_usize().ok_or_else(|| { - AsgConvertError::invalid_assign_index(name, &x.to_string(), &statement.span) + AsgError::invalid_assign_index(name, x.to_string(), &statement.span) })?, _ => unimplemented!(), }; let right = match right { ConstValue::Int(x) => x.to_usize().ok_or_else(|| { - AsgConvertError::invalid_assign_index(name, &x.to_string(), &statement.span) + AsgError::invalid_assign_index(name, x.to_string(), &statement.span) })?, _ => unimplemented!(), }; if right >= left { target_type = Some(PartialType::Array(item.clone(), Some((right - left) as usize))) } else { - return Err(AsgConvertError::invalid_backwards_assignment( + return Err(AsgError::invalid_backwards_assignment( name, left, right, &statement.span, - )); + ) + .into()); } } } - _ => return Err(AsgConvertError::index_into_non_array(name, &statement.span)), + _ => return Err(AsgError::index_into_non_array(name, &statement.span).into()), } AssignAccess::ArrayRange(Cell::new(left), Cell::new(right)) @@ -139,7 +138,7 @@ impl<'a> FromAst<'a, leo_ast::AssignStatement> for &'a Statement<'a> { AstAssigneeAccess::ArrayIndex(index) => { target_type = match target_type.clone() { Some(PartialType::Array(item, _)) => item.map(|x| *x), - _ => return Err(AsgConvertError::index_into_non_array(name, &statement.span)), + _ => return Err(AsgError::index_into_non_array(name, &statement.span).into()), }; AssignAccess::ArrayIndex(Cell::new(<&Expression<'a>>::from_ast( scope, @@ -147,17 +146,17 @@ impl<'a> FromAst<'a, leo_ast::AssignStatement> for &'a Statement<'a> { Some(PartialType::Integer(None, Some(IntegerType::U32))), )?)) } - AstAssigneeAccess::Tuple(index, _) => { + AstAssigneeAccess::Tuple(index, span) => { let index = index .value .parse::() - .map_err(|_| AsgConvertError::parse_index_error())?; + .map_err(|_| AsgError::parse_index_error(span))?; target_type = match target_type { Some(PartialType::Tuple(types)) => types .get(index) .cloned() - .ok_or_else(|| AsgConvertError::tuple_index_out_of_bounds(index, &statement.span))?, - _ => return Err(AsgConvertError::index_into_non_tuple(name, &statement.span)), + .ok_or_else(|| AsgError::tuple_index_out_of_bounds(index, &statement.span))?, + _ => return Err(AsgError::index_into_non_tuple(name, &statement.span).into()), }; AssignAccess::Tuple(index) } @@ -168,7 +167,7 @@ impl<'a> FromAst<'a, leo_ast::AssignStatement> for &'a Statement<'a> { let members = circuit.members.borrow(); let member = members.get(name.name.as_ref()).ok_or_else(|| { - AsgConvertError::unresolved_circuit_member( + AsgError::unresolved_circuit_member( &circuit.name.borrow().name, &name.name, &statement.span, @@ -178,16 +177,17 @@ impl<'a> FromAst<'a, leo_ast::AssignStatement> for &'a Statement<'a> { let x = match &member { CircuitMember::Variable(type_) => type_.clone(), CircuitMember::Function(_) => { - return Err(AsgConvertError::illegal_function_assign(&name.name, &statement.span)); + return Err(AsgError::illegal_function_assign(&name.name, &statement.span).into()); } }; Some(x.partial()) } _ => { - return Err(AsgConvertError::index_into_non_tuple( + return Err(AsgError::index_into_non_tuple( &statement.assignee.identifier.name, &statement.span, - )); + ) + .into()); } }; AssignAccess::Member(name.clone()) diff --git a/asg/src/statement/block.rs b/asg/src/statement/block.rs index 2b50d0c3df..f93faa0ad8 100644 --- a/asg/src/statement/block.rs +++ b/asg/src/statement/block.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, FromAst, Node, PartialType, Scope, Span, Statement}; +use crate::{FromAst, Node, PartialType, Scope, Statement}; +use leo_errors::{Result, Span}; use std::cell::Cell; @@ -37,7 +38,7 @@ impl<'a> FromAst<'a, leo_ast::Block> for BlockStatement<'a> { scope: &'a Scope<'a>, statement: &leo_ast::Block, _expected_type: Option>, - ) -> Result { + ) -> Result { let new_scope = scope.make_subscope(); let mut output = vec![]; diff --git a/asg/src/statement/conditional.rs b/asg/src/statement/conditional.rs index b468ce9d3c..fb14b9c6eb 100644 --- a/asg/src/statement/conditional.rs +++ b/asg/src/statement/conditional.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, BlockStatement, Expression, FromAst, Node, PartialType, Scope, Span, Statement, Type}; +use crate::{BlockStatement, Expression, FromAst, Node, PartialType, Scope, Statement, Type}; +use leo_errors::{Result, Span}; use std::cell::Cell; @@ -38,7 +39,7 @@ impl<'a> FromAst<'a, leo_ast::ConditionalStatement> for ConditionalStatement<'a> scope: &'a Scope<'a>, statement: &leo_ast::ConditionalStatement, _expected_type: Option>, - ) -> Result { + ) -> Result { let condition = <&Expression<'a>>::from_ast(scope, &statement.condition, Some(Type::Boolean.into()))?; let result = scope.context.alloc_statement(Statement::Block(BlockStatement::from_ast( scope, @@ -48,9 +49,7 @@ impl<'a> FromAst<'a, leo_ast::ConditionalStatement> for ConditionalStatement<'a> let next = statement .next .as_deref() - .map(|next| -> Result<&'a Statement<'a>, AsgConvertError> { - <&'a Statement<'a>>::from_ast(scope, next, None) - }) + .map(|next| -> Result<&'a Statement<'a>> { <&'a Statement<'a>>::from_ast(scope, next, None) }) .transpose()?; Ok(ConditionalStatement { diff --git a/asg/src/statement/console.rs b/asg/src/statement/console.rs index 5708576425..3d34b1296e 100644 --- a/asg/src/statement/console.rs +++ b/asg/src/statement/console.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, CharValue, Expression, FromAst, Node, PartialType, Scope, Span, Statement, Type}; +use crate::{CharValue, Expression, FromAst, Node, PartialType, Scope, Statement, Type}; use leo_ast::ConsoleFunction as AstConsoleFunction; +use leo_errors::{Result, Span}; use std::cell::Cell; @@ -52,7 +53,7 @@ impl<'a> FromAst<'a, leo_ast::ConsoleArgs> for ConsoleArgs<'a> { scope: &'a Scope<'a>, value: &leo_ast::ConsoleArgs, _expected_type: Option>, - ) -> Result { + ) -> Result { let mut parameters = vec![]; for parameter in value.parameters.iter() { parameters.push(Cell::new(<&Expression<'a>>::from_ast(scope, parameter, None)?)); @@ -80,7 +81,7 @@ impl<'a> FromAst<'a, leo_ast::ConsoleStatement> for ConsoleStatement<'a> { scope: &'a Scope<'a>, statement: &leo_ast::ConsoleStatement, _expected_type: Option>, - ) -> Result { + ) -> Result { Ok(ConsoleStatement { parent: Cell::new(None), span: Some(statement.span.clone()), diff --git a/asg/src/statement/definition.rs b/asg/src/statement/definition.rs index 481af198a5..fcf1a98c5c 100644 --- a/asg/src/statement/definition.rs +++ b/asg/src/statement/definition.rs @@ -14,10 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{ - AsgConvertError, Expression, ExpressionNode, FromAst, InnerVariable, Node, PartialType, Scope, Span, Statement, - Type, Variable, -}; +use crate::{Expression, ExpressionNode, FromAst, InnerVariable, Node, PartialType, Scope, Statement, Type, Variable}; +use leo_errors::{AsgError, Result, Span}; use std::cell::{Cell, RefCell}; @@ -59,11 +57,11 @@ impl<'a> FromAst<'a, leo_ast::DefinitionStatement> for &'a Statement<'a> { scope: &'a Scope<'a>, statement: &leo_ast::DefinitionStatement, _expected_type: Option>, - ) -> Result { + ) -> Result { let type_ = statement .type_ .as_ref() - .map(|x| scope.resolve_ast_type(x)) + .map(|x| scope.resolve_ast_type(x, &statement.span)) .transpose()?; let value = <&Expression<'a>>::from_ast(scope, &statement.value, type_.clone().map(Into::into))?; @@ -76,7 +74,7 @@ impl<'a> FromAst<'a, leo_ast::DefinitionStatement> for &'a Statement<'a> { .collect::>() .join(" ,"); - return Err(AsgConvertError::invalid_const_assign(&var_names, &statement.span)); + return Err(AsgError::invalid_const_assign(var_names, &statement.span).into()); } let type_ = type_.or_else(|| value.get_type()); @@ -85,9 +83,11 @@ impl<'a> FromAst<'a, leo_ast::DefinitionStatement> for &'a Statement<'a> { let mut variables = vec![]; if statement.variable_names.is_empty() { - return Err(AsgConvertError::illegal_ast_structure( + return Err(AsgError::illegal_ast_structure( "cannot have 0 variable names in destructuring tuple", - )); + &statement.span, + ) + .into()); } if statement.variable_names.len() == 1 { // any return type is fine @@ -99,11 +99,12 @@ impl<'a> FromAst<'a, leo_ast::DefinitionStatement> for &'a Statement<'a> { output_types.extend(sub_types.clone().into_iter().map(Some).collect::>()); } type_ => { - return Err(AsgConvertError::unexpected_type( - &*format!("{}-ary tuple", statement.variable_names.len()), - type_.map(|x| x.to_string()).as_deref(), + return Err(AsgError::unexpected_type( + format!("{}-ary tuple", statement.variable_names.len()), + type_.map(|x| x.to_string()).unwrap_or_else(|| "unknown".to_string()), &statement.span, - )); + ) + .into()); } } } @@ -112,8 +113,7 @@ impl<'a> FromAst<'a, leo_ast::DefinitionStatement> for &'a Statement<'a> { variables.push(&*scope.context.alloc_variable(RefCell::new(InnerVariable { id: scope.context.get_id(), name: variable.identifier.clone(), - type_: - type_.ok_or_else(|| AsgConvertError::unresolved_type(&variable.identifier.name, &statement.span))?, + type_: type_.ok_or_else(|| AsgError::unresolved_type(&variable.identifier.name, &statement.span))?, mutable: variable.mutable, const_: false, declaration: crate::VariableDeclaration::Definition, @@ -126,10 +126,7 @@ impl<'a> FromAst<'a, leo_ast::DefinitionStatement> for &'a Statement<'a> { let mut variables = scope.variables.borrow_mut(); let var_name = variable.borrow().name.name.to_string(); if variables.contains_key(&var_name) { - return Err(AsgConvertError::duplicate_variable_definition( - &var_name, - &statement.span, - )); + return Err(AsgError::duplicate_variable_definition(var_name, &statement.span).into()); } variables.insert(var_name, *variable); diff --git a/asg/src/statement/expression.rs b/asg/src/statement/expression.rs index f00c55c488..02dbb0628a 100644 --- a/asg/src/statement/expression.rs +++ b/asg/src/statement/expression.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, Expression, FromAst, Node, PartialType, Scope, Span, Statement}; +use crate::{Expression, FromAst, Node, PartialType, Scope, Statement}; +use leo_errors::{Result, Span}; use std::cell::Cell; @@ -36,7 +37,7 @@ impl<'a> FromAst<'a, leo_ast::ExpressionStatement> for ExpressionStatement<'a> { scope: &'a Scope<'a>, statement: &leo_ast::ExpressionStatement, _expected_type: Option>, - ) -> Result { + ) -> Result { let expression = <&Expression<'a>>::from_ast(scope, &statement.expression, None)?; Ok(ExpressionStatement { diff --git a/asg/src/statement/iteration.rs b/asg/src/statement/iteration.rs index bc38076659..27de5b4deb 100644 --- a/asg/src/statement/iteration.rs +++ b/asg/src/statement/iteration.rs @@ -16,10 +16,8 @@ use leo_ast::IntegerType; -use crate::{ - AsgConvertError, Expression, ExpressionNode, FromAst, InnerVariable, Node, PartialType, Scope, Span, Statement, - Variable, -}; +use crate::{Expression, ExpressionNode, FromAst, InnerVariable, Node, PartialType, Scope, Statement, Variable}; +use leo_errors::{AsgError, Result, Span}; use std::cell::{Cell, RefCell}; @@ -45,21 +43,17 @@ impl<'a> FromAst<'a, leo_ast::IterationStatement> for &'a Statement<'a> { scope: &'a Scope<'a>, statement: &leo_ast::IterationStatement, _expected_type: Option>, - ) -> Result { + ) -> Result { let expected_index_type = Some(PartialType::Integer(Some(IntegerType::U32), None)); let start = <&Expression<'a>>::from_ast(scope, &statement.start, expected_index_type.clone())?; let stop = <&Expression<'a>>::from_ast(scope, &statement.stop, expected_index_type)?; // Return an error if start or stop is not constant. if !start.is_consty() { - return Err(AsgConvertError::unexpected_nonconst( - &start.span().cloned().unwrap_or_default(), - )); + return Err(AsgError::unexpected_nonconst(&start.span().cloned().unwrap_or_default()).into()); } if !stop.is_consty() { - return Err(AsgConvertError::unexpected_nonconst( - &stop.span().cloned().unwrap_or_default(), - )); + return Err(AsgError::unexpected_nonconst(&stop.span().cloned().unwrap_or_default()).into()); } let variable = scope.context.alloc_variable(RefCell::new(InnerVariable { @@ -67,7 +61,7 @@ impl<'a> FromAst<'a, leo_ast::IterationStatement> for &'a Statement<'a> { name: statement.variable.clone(), type_: start .get_type() - .ok_or_else(|| AsgConvertError::unresolved_type(&statement.variable.name, &statement.span))?, + .ok_or_else(|| AsgError::unresolved_type(&statement.variable.name, &statement.span))?, mutable: false, const_: true, declaration: crate::VariableDeclaration::IterationDefinition, diff --git a/asg/src/statement/mod.rs b/asg/src/statement/mod.rs index c564eac4b8..e9da0f591b 100644 --- a/asg/src/statement/mod.rs +++ b/asg/src/statement/mod.rs @@ -42,7 +42,8 @@ pub use iteration::*; mod return_; pub use return_::*; -use crate::{AsgConvertError, FromAst, Node, PartialType, Scope, Span}; +use crate::{FromAst, Node, PartialType, Scope}; +use leo_errors::{Result, Span}; #[derive(Clone)] pub enum Statement<'a> { @@ -79,14 +80,14 @@ impl<'a> FromAst<'a, leo_ast::Statement> for &'a Statement<'a> { scope: &'a Scope<'a>, value: &leo_ast::Statement, _expected_type: Option>, - ) -> Result<&'a Statement<'a>, AsgConvertError> { + ) -> Result<&'a Statement<'a>> { use leo_ast::Statement::*; Ok(match value { Return(statement) => scope .context .alloc_statement(Statement::Return(ReturnStatement::from_ast(scope, statement, None)?)), Definition(statement) => Self::from_ast(scope, statement, None)?, - Assign(statement) => Self::from_ast(scope, statement, None)?, + Assign(statement) => Self::from_ast(scope, &**statement, None)?, Conditional(statement) => { scope .context @@ -94,7 +95,7 @@ impl<'a> FromAst<'a, leo_ast::Statement> for &'a Statement<'a> { scope, statement, None, )?)) } - Iteration(statement) => Self::from_ast(scope, statement, None)?, + Iteration(statement) => Self::from_ast(scope, &**statement, None)?, Console(statement) => scope .context .alloc_statement(Statement::Console(ConsoleStatement::from_ast(scope, statement, None)?)), @@ -118,9 +119,9 @@ impl<'a> Into for &Statement<'a> { match self { Return(statement) => leo_ast::Statement::Return(statement.into()), Definition(statement) => leo_ast::Statement::Definition(statement.into()), - Assign(statement) => leo_ast::Statement::Assign(statement.into()), + Assign(statement) => leo_ast::Statement::Assign(Box::new(statement.into())), Conditional(statement) => leo_ast::Statement::Conditional(statement.into()), - Iteration(statement) => leo_ast::Statement::Iteration(statement.into()), + Iteration(statement) => leo_ast::Statement::Iteration(Box::new(statement.into())), Console(statement) => leo_ast::Statement::Console(statement.into()), Expression(statement) => leo_ast::Statement::Expression(statement.into()), Block(statement) => leo_ast::Statement::Block(statement.into()), diff --git a/asg/src/statement/return_.rs b/asg/src/statement/return_.rs index fb6b640390..e4ed97db01 100644 --- a/asg/src/statement/return_.rs +++ b/asg/src/statement/return_.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{AsgConvertError, Expression, FromAst, Node, PartialType, Scope, Span, Statement, Type}; +use crate::{Expression, FromAst, Node, PartialType, Scope, Statement, Type}; +use leo_errors::{Result, Span}; use std::cell::Cell; #[derive(Clone)] @@ -35,7 +36,7 @@ impl<'a> FromAst<'a, leo_ast::ReturnStatement> for ReturnStatement<'a> { scope: &'a Scope<'a>, statement: &leo_ast::ReturnStatement, _expected_type: Option>, - ) -> Result { + ) -> Result { let return_type: Option = scope .resolve_current_function() .map(|x| x.output.clone()) diff --git a/asg/tests/mod.rs b/asg/tests/mod.rs index 5545253624..018b68b19d 100644 --- a/asg/tests/mod.rs +++ b/asg/tests/mod.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . use leo_asg::*; +use leo_errors::LeoError; use leo_parser::parse_ast; mod fail; @@ -22,7 +23,7 @@ mod pass; const TESTING_FILEPATH: &str = "input.leo"; -fn load_asg(program_string: &str) -> Result, AsgConvertError> { +fn load_asg(program_string: &str) -> Result, LeoError> { load_asg_imports(make_test_context(), program_string, &mut NullImportResolver) } @@ -30,8 +31,9 @@ fn load_asg_imports<'a, T: ImportResolver<'a>>( context: AsgContext<'a>, program_string: &str, imports: &mut T, -) -> Result, AsgConvertError> { - let ast = parse_ast(&TESTING_FILEPATH, program_string)?; +) -> Result, LeoError> { + let mut ast = parse_ast(&TESTING_FILEPATH, program_string)?; + ast.canonicalize()?; Program::new(context, &ast.as_repr(), imports) } diff --git a/ast/Cargo.toml b/ast/Cargo.toml index c33cd7f912..845221644a 100644 --- a/ast/Cargo.toml +++ b/ast/Cargo.toml @@ -21,6 +21,10 @@ edition = "2018" path = "../input" version = "1.5.3" +[dependencies.leo-errors] +path = "../errors" +version = "1.5.3" + [dependencies.indexmap] version = "1.7.0" features = [ "serde-1" ] @@ -35,12 +39,6 @@ features = [ "derive", "rc" ] [dependencies.serde_json] version = "1.0" -[dependencies.anyhow] -version = "1.0" - -[dependencies.thiserror] -version = "1.0" - [dependencies.tendril] version = "0.4" diff --git a/ast/README.md b/ast/README.md index 1ec612648f..99d41e65c6 100644 --- a/ast/README.md +++ b/ast/README.md @@ -1,4 +1,5 @@ # leo-ast + [![Crates.io](https://img.shields.io/crates/v/leo-ast.svg?color=neon)](https://crates.io/crates/leo-ast) [![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/ast/src/annotation.rs b/ast/src/annotation.rs index f58ff5ed7c..a9591c0cac 100644 --- a/ast/src/annotation.rs +++ b/ast/src/annotation.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Identifier, Span}; +use crate::Identifier; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use tendril::StrTendril; diff --git a/ast/src/chars/char_value.rs b/ast/src/chars/char_value.rs index 96d0f8f8c7..52be1583a2 100644 --- a/ast/src/chars/char_value.rs +++ b/ast/src/chars/char_value.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::common::span::Span; +use leo_errors::Span; use serde::{Deserialize, Serialize}; // use serde::de::{Deserialize as SerDeserialize, Deserializer}; diff --git a/ast/src/common/const_self_keyword.rs b/ast/src/common/const_self_keyword.rs index 52d361ae16..1836a9c6e5 100644 --- a/ast/src/common/const_self_keyword.rs +++ b/ast/src/common/const_self_keyword.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Identifier, Node, Span}; +use crate::{Identifier, Node}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/common/identifier.rs b/ast/src/common/identifier.rs index 6728212c77..971f473563 100644 --- a/ast/src/common/identifier.rs +++ b/ast/src/common/identifier.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::Span; +use leo_errors::Span; use leo_input::common::Identifier as InputIdentifier; use tendril::StrTendril; diff --git a/ast/src/common/mod.rs b/ast/src/common/mod.rs index a1255ed0a0..22df56b6e8 100644 --- a/ast/src/common/mod.rs +++ b/ast/src/common/mod.rs @@ -32,12 +32,7 @@ pub use positive_number::*; pub mod self_keyword; pub use self_keyword::*; -pub mod span; -pub use span::*; - pub mod spread_or_expression; pub use spread_or_expression::*; -pub mod tendril_json; - pub mod vec_tendril_json; diff --git a/ast/src/common/mut_self_keyword.rs b/ast/src/common/mut_self_keyword.rs index d28c501be8..a314176720 100644 --- a/ast/src/common/mut_self_keyword.rs +++ b/ast/src/common/mut_self_keyword.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Identifier, Node, Span}; +use crate::{Identifier, Node}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/common/positive_number.rs b/ast/src/common/positive_number.rs index f674463607..c78dea6bca 100644 --- a/ast/src/common/positive_number.rs +++ b/ast/src/common/positive_number.rs @@ -23,7 +23,7 @@ use tendril::StrTendril; /// A number string guaranteed to be positive by the pest grammar. #[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Eq, Hash)] pub struct PositiveNumber { - #[serde(with = "crate::common::tendril_json")] + #[serde(with = "leo_errors::common::tendril_json")] pub value: StrTendril, } diff --git a/ast/src/common/self_keyword.rs b/ast/src/common/self_keyword.rs index 06b6bb12a8..6aec795684 100644 --- a/ast/src/common/self_keyword.rs +++ b/ast/src/common/self_keyword.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Identifier, Node, Span}; +use crate::{Identifier, Node}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/common/spread_or_expression.rs b/ast/src/common/spread_or_expression.rs index b758d0b0ea..d060b60edd 100644 --- a/ast/src/common/spread_or_expression.rs +++ b/ast/src/common/spread_or_expression.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Expression, Node, Span}; +use crate::{Expression, Node}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/errors/ast.rs b/ast/src/errors/ast.rs deleted file mode 100644 index 4e8b7db187..0000000000 --- a/ast/src/errors/ast.rs +++ /dev/null @@ -1,40 +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::{FormattedError, LeoError, ReducerError, Span}; - -#[derive(Debug, Error)] -pub enum AstError { - #[error("{}", _0)] - Error(#[from] FormattedError), - - #[error("{}", _0)] - IOError(#[from] std::io::Error), - - #[error("{}", _0)] - ReducerError(#[from] ReducerError), - - #[error("{}", _0)] - SerdeJsonError(#[from] ::serde_json::Error), -} - -impl LeoError for AstError {} - -impl AstError { - fn _new_from_span(message: String, span: &Span) -> Self { - AstError::Error(FormattedError::new_from_span(message, span)) - } -} diff --git a/ast/src/errors/canonicalization.rs b/ast/src/errors/canonicalization.rs deleted file mode 100644 index b3f7cb6622..0000000000 --- a/ast/src/errors/canonicalization.rs +++ /dev/null @@ -1,43 +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::{FormattedError, LeoError, Span}; - -#[derive(Debug, Error)] -pub enum CanonicalizeError { - #[error("{}", _0)] - Error(#[from] FormattedError), -} - -impl LeoError for CanonicalizeError {} - -impl CanonicalizeError { - fn new_from_span(message: String, span: &Span) -> Self { - CanonicalizeError::Error(FormattedError::new_from_span(message, span)) - } - - pub fn big_self_outside_of_circuit(span: &Span) -> Self { - let message = "cannot call keyword `Self` outside of a circuit function".to_string(); - - Self::new_from_span(message, span) - } - - pub fn invalid_array_dimension_size(span: &Span) -> Self { - let message = "received dimension size of 0, expected it to be 1 or larger.".to_string(); - - Self::new_from_span(message, span) - } -} diff --git a/ast/src/errors/error.rs b/ast/src/errors/error.rs deleted file mode 100644 index b2c1ebff5a..0000000000 --- a/ast/src/errors/error.rs +++ /dev/null @@ -1,142 +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::{LeoError, Span}; -use std::{fmt, sync::Arc}; - -pub const INDENT: &str = " "; - -/// Formatted compiler error type -/// --> file.leo: 2:8 -/// | -/// 2 | let a = x; -/// | ^ -/// | -/// = undefined value `x` -#[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct FormattedError { - pub line_start: usize, - pub line_stop: usize, - pub col_start: usize, - pub col_stop: usize, - pub path: Arc, - pub content: String, - pub message: String, -} - -impl FormattedError { - pub fn new_from_span(message: String, span: &Span) -> Self { - Self { - line_start: span.line_start, - line_stop: span.line_stop, - col_start: span.col_start, - col_stop: span.col_stop, - path: span.path.clone(), - content: span.content.to_string(), - message, - } - } -} - -impl LeoError for FormattedError {} - -fn underline(mut start: usize, mut end: usize) -> String { - if start > end { - std::mem::swap(&mut start, &mut end) - } - - let mut underline = String::new(); - - for _ in 0..start { - underline.push(' '); - end -= 1; - } - - for _ in 0..end { - underline.push('^'); - } - - underline -} - -impl fmt::Display for FormattedError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let underline = underline(self.col_start, self.col_stop); - - let error_message = format!( - "{indent }--> {path}:{line_start}:{start}\n\ - {indent } ", - indent = INDENT, - path = &*self.path, - line_start = self.line_start, - start = self.col_start, - ); - - write!(f, "{}", error_message)?; - - for (line_no, line) in self.content.lines().enumerate() { - writeln!( - f, - "|\n{line_no:width$} | {text}", - width = INDENT.len(), - line_no = self.line_start + line_no, - text = line, - )?; - } - - write!( - f, - "{indent } |{underline}\n\ - {indent } |\n\ - {indent } = {message}", - indent = INDENT, - underline = underline, - message = self.message, - ) - } -} - -impl std::error::Error for FormattedError { - fn description(&self) -> &str { - &self.message - } -} - -#[test] -fn test_error() { - let err = FormattedError { - path: std::sync::Arc::new("file.leo".to_string()), - line_start: 2, - line_stop: 2, - col_start: 9, - col_stop: 10, - content: "let a = x;".into(), - message: "undefined value `x`".to_string(), - }; - - assert_eq!( - err.to_string(), - vec![ - " --> file.leo:2:9", - " |", - " 2 | let a = x;", - " | ^", - " |", - " = undefined value `x`", - ] - .join("\n") - ); -} diff --git a/ast/src/errors/mod.rs b/ast/src/errors/mod.rs deleted file mode 100644 index 776172bc11..0000000000 --- a/ast/src/errors/mod.rs +++ /dev/null @@ -1,32 +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 ast; -pub use ast::*; - -pub mod canonicalization; -pub use canonicalization::*; - -pub mod combiner; -pub use combiner::*; - -pub mod error; -pub use error::*; - -pub mod reducer; -pub use reducer::*; - -pub trait LeoError {} diff --git a/ast/src/errors/reducer.rs b/ast/src/errors/reducer.rs deleted file mode 100644 index 9655c47bde..0000000000 --- a/ast/src/errors/reducer.rs +++ /dev/null @@ -1,50 +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::{CanonicalizeError, CombinerError, FormattedError, LeoError, Span}; - -#[derive(Debug, Error)] -pub enum ReducerError { - #[error("{}", _0)] - Error(#[from] FormattedError), - - #[error("{}", _0)] - CanonicalizeError(#[from] CanonicalizeError), - - #[error("{}", _0)] - CombinerError(#[from] CombinerError), -} - -impl LeoError for ReducerError {} - -impl ReducerError { - fn new_from_span(message: String, span: &Span) -> Self { - ReducerError::Error(FormattedError::new_from_span(message, span)) - } - - pub fn empty_string(span: &Span) -> Self { - let message = - "Cannot constrcut an empty string: it has the type of [char; 0] which is not possible.".to_string(); - - Self::new_from_span(message, span) - } - - pub fn impossible_console_assert_call(span: &Span) -> Self { - let message = "Console::Assert cannot be matched here, its handled in another case.".to_string(); - - Self::new_from_span(message, span) - } -} diff --git a/ast/src/expression/mod.rs b/ast/src/expression/mod.rs index 2d2389d0ac..f79926d0f5 100644 --- a/ast/src/expression/mod.rs +++ b/ast/src/expression/mod.rs @@ -15,15 +15,15 @@ // along with the Leo library. If not, see . use crate::{ - ArrayDimensions, CircuitImpliedVariableDefinition, GroupValue, Identifier, IntegerType, PositiveNumber, Span, + ArrayDimensions, CircuitImpliedVariableDefinition, GroupValue, Identifier, IntegerType, Node, PositiveNumber, SpreadOrExpression, }; +use leo_errors::Span; + use serde::{Deserialize, Serialize}; use std::fmt; -use crate::Node; - mod binary; pub use binary::*; mod unary; diff --git a/ast/src/expression/value.rs b/ast/src/expression/value.rs index 2d7231e904..0b6722ddb6 100644 --- a/ast/src/expression/value.rs +++ b/ast/src/expression/value.rs @@ -17,20 +17,20 @@ use tendril::StrTendril; use super::*; -use crate::{Char, CharValue, GroupTuple}; +use crate::{Char, CharValue}; #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub enum ValueExpression { // todo: deserialize values here - Address(#[serde(with = "crate::common::tendril_json")] StrTendril, Span), - Boolean(#[serde(with = "crate::common::tendril_json")] StrTendril, Span), + Address(#[serde(with = "leo_errors::common::tendril_json")] StrTendril, Span), + Boolean(#[serde(with = "leo_errors::common::tendril_json")] StrTendril, Span), Char(CharValue), - Field(#[serde(with = "crate::common::tendril_json")] StrTendril, Span), + Field(#[serde(with = "leo_errors::common::tendril_json")] StrTendril, Span), Group(Box), - Implicit(#[serde(with = "crate::common::tendril_json")] StrTendril, Span), + Implicit(#[serde(with = "leo_errors::common::tendril_json")] StrTendril, Span), Integer( IntegerType, - #[serde(with = "crate::common::tendril_json")] StrTendril, + #[serde(with = "leo_errors::common::tendril_json")] StrTendril, Span, ), String(Vec, Span), @@ -69,7 +69,8 @@ impl Node for ValueExpression { | String(_, span) => span, Char(character) => &character.span, Group(group) => match &**group { - GroupValue::Single(_, span) | GroupValue::Tuple(GroupTuple { span, .. }) => span, + GroupValue::Single(_, span) => span, + GroupValue::Tuple(tuple) => &tuple.span, }, } } @@ -85,7 +86,8 @@ impl Node for ValueExpression { | String(_, span) => *span = new_span, Char(character) => character.span = new_span, Group(group) => match &mut **group { - GroupValue::Single(_, span) | GroupValue::Tuple(GroupTuple { span, .. }) => *span = new_span, + GroupValue::Single(_, span) => *span = new_span, + GroupValue::Tuple(tuple) => tuple.span = new_span, }, } } diff --git a/ast/src/functions/function.rs b/ast/src/functions/function.rs index d00c39a084..beb3a9322e 100644 --- a/ast/src/functions/function.rs +++ b/ast/src/functions/function.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Annotation, Block, FunctionInput, Identifier, Node, Span, Type}; +use crate::{Annotation, Block, FunctionInput, Identifier, Node, Type}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/functions/input/function_input.rs b/ast/src/functions/input/function_input.rs index 90f45f3d24..c89168d2fd 100644 --- a/ast/src/functions/input/function_input.rs +++ b/ast/src/functions/input/function_input.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Identifier, Node, Span, Type}; +use crate::{Identifier, Node, Type}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/functions/input/input_variable.rs b/ast/src/functions/input/input_variable.rs index 9f5d0575af..73e98a8389 100644 --- a/ast/src/functions/input/input_variable.rs +++ b/ast/src/functions/input/input_variable.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{ConstSelfKeyword, FunctionInputVariable, MutSelfKeyword, Node, SelfKeyword, Span}; +use crate::{ConstSelfKeyword, FunctionInputVariable, MutSelfKeyword, Node, SelfKeyword}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/groups/group_coordinate.rs b/ast/src/groups/group_coordinate.rs index b8d05ee786..d13c7b9d19 100644 --- a/ast/src/groups/group_coordinate.rs +++ b/ast/src/groups/group_coordinate.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::common::span::Span; +use leo_errors::Span; use leo_input::values::{ GroupCoordinate as InputGroupCoordinate, Inferred as InputInferred, NumberValue as InputNumberValue, SignHigh as InputSignHigh, SignLow as InputSignLow, @@ -26,7 +26,7 @@ use tendril::StrTendril; #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub enum GroupCoordinate { - Number(#[serde(with = "crate::common::tendril_json")] StrTendril, Span), + Number(#[serde(with = "leo_errors::common::tendril_json")] StrTendril, Span), SignHigh, SignLow, Inferred, diff --git a/ast/src/groups/group_value.rs b/ast/src/groups/group_value.rs index e3bff066dc..489422774e 100644 --- a/ast/src/groups/group_value.rs +++ b/ast/src/groups/group_value.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{common::span::Span, groups::GroupCoordinate}; +use crate::groups::GroupCoordinate; +use leo_errors::Span; use leo_input::values::{ GroupRepresentation as InputGroupRepresentation, GroupTuple as InputGroupTuple, GroupValue as InputGroupValue, }; @@ -25,7 +26,7 @@ use tendril::StrTendril; #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub enum GroupValue { - Single(#[serde(with = "crate::common::tendril_json")] StrTendril, Span), + Single(#[serde(with = "leo_errors::common::tendril_json")] StrTendril, Span), Tuple(GroupTuple), } diff --git a/ast/src/imports/import.rs b/ast/src/imports/import.rs index 93c4ad6f6d..d7d74fe861 100644 --- a/ast/src/imports/import.rs +++ b/ast/src/imports/import.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{PackageOrPackages, Span}; +use crate::PackageOrPackages; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/imports/import_symbol.rs b/ast/src/imports/import_symbol.rs index 4d82b898d9..c00c406699 100644 --- a/ast/src/imports/import_symbol.rs +++ b/ast/src/imports/import_symbol.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Identifier, Span}; +use crate::Identifier; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/imports/package.rs b/ast/src/imports/package.rs index 1ccd3007b1..b6878cbd32 100644 --- a/ast/src/imports/package.rs +++ b/ast/src/imports/package.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{common::Identifier, PackageAccess, Span}; +use crate::{common::Identifier, PackageAccess}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/imports/package_access.rs b/ast/src/imports/package_access.rs index 3935d71598..3029f20732 100644 --- a/ast/src/imports/package_access.rs +++ b/ast/src/imports/package_access.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{ImportSymbol, Node, Package, Packages, Span}; +use crate::{ImportSymbol, Node, Package, Packages}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/imports/package_or_packages.rs b/ast/src/imports/package_or_packages.rs index 7f42d57fd7..c4766a7681 100644 --- a/ast/src/imports/package_or_packages.rs +++ b/ast/src/imports/package_or_packages.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Node, Package, Packages, Span}; +use crate::{Node, Package, Packages}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/imports/packages.rs b/ast/src/imports/packages.rs index e561080807..2b2aab8300 100644 --- a/ast/src/imports/packages.rs +++ b/ast/src/imports/packages.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{common::Identifier, PackageAccess, Span}; +use crate::{common::Identifier, PackageAccess}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/input/input_value.rs b/ast/src/input/input_value.rs index 735bba7222..76363e2f72 100644 --- a/ast/src/input/input_value.rs +++ b/ast/src/input/input_value.rs @@ -14,7 +14,8 @@ // 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, Span as AstSpan}; +use crate::{ArrayDimensions, Char, CharValue, GroupValue}; +use leo_errors::Span as AstSpan; use leo_input::{ errors::InputParserError, expressions::{ArrayInitializerExpression, ArrayInlineExpression, Expression, StringExpression, TupleExpression}, diff --git a/ast/src/input/parameters/parameter.rs b/ast/src/input/parameters/parameter.rs index 7f275f2fea..634324828b 100644 --- a/ast/src/input/parameters/parameter.rs +++ b/ast/src/input/parameters/parameter.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Identifier, Span, Type}; +use crate::{Identifier, Type}; +use leo_errors::Span; use leo_input::parameters::Parameter as GrammarParameter; #[derive(Clone, PartialEq, Eq, Hash)] diff --git a/ast/src/lib.rs b/ast/src/lib.rs index 0db6ff375c..58a45a6677 100644 --- a/ast/src/lib.rs +++ b/ast/src/lib.rs @@ -20,8 +20,7 @@ //! The [`Ast`] type is intended to be parsed and modified by different passes //! of the Leo compiler. The Leo compiler can generate a set of R1CS constraints from any [`Ast`]. -#[macro_use] -extern crate thiserror; +#![doc = include_str!("../README.md")] pub mod annotation; pub use self::annotation::*; @@ -35,9 +34,6 @@ pub use self::chars::*; pub mod common; pub use self::common::*; -pub mod errors; -pub use self::errors::*; - pub mod expression; pub use self::expression::*; @@ -68,6 +64,8 @@ pub use self::types::*; mod node; pub use node::*; +use leo_errors::{AstError, Result}; + /// The abstract syntax tree (AST) for a Leo program. /// /// The [`Ast`] type represents a Leo program as a series of recursive data types. @@ -86,7 +84,7 @@ impl Ast { } /// Mutates the program ast by preforming canonicalization on it. - pub fn canonicalize(&mut self) -> Result<(), AstError> { + pub fn canonicalize(&mut self) -> Result<()> { self.ast = ReconstructingDirector::new(Canonicalizer::default()).reduce_program(self.as_repr())?; Ok(()) } @@ -101,26 +99,28 @@ impl Ast { } /// Serializes the ast into a JSON string. - pub fn to_json_string(&self) -> Result { - Ok(serde_json::to_string_pretty(&self.ast)?) + pub fn to_json_string(&self) -> Result { + Ok(serde_json::to_string_pretty(&self.ast).map_err(|e| AstError::failed_to_convert_ast_to_json_string(&e))?) } - pub fn to_json_file(&self, mut path: std::path::PathBuf, file_name: &str) -> Result<(), AstError> { + /// Serializes the ast into a JSON file. + pub fn to_json_file(&self, mut path: std::path::PathBuf, file_name: &str) -> Result<()> { path.push(file_name); - let file = std::fs::File::create(path)?; + let file = std::fs::File::create(&path).map_err(|e| AstError::failed_to_create_ast_json_file(&path, &e))?; let writer = std::io::BufWriter::new(file); - serde_json::to_writer_pretty(writer, &self.ast)?; - Ok(()) + Ok(serde_json::to_writer_pretty(writer, &self.ast) + .map_err(|e| AstError::failed_to_write_ast_to_json_file(&path, &e))?) } /// Deserializes the JSON string into a ast. - pub fn from_json_string(json: &str) -> Result { - let ast: Program = serde_json::from_str(json)?; + pub fn from_json_string(json: &str) -> Result { + let ast: Program = serde_json::from_str(json).map_err(|e| AstError::failed_to_read_json_string_to_ast(&e))?; Ok(Self { ast }) } - pub fn from_json_file(path: std::path::PathBuf) -> Result { - let data = std::fs::read_to_string(path)?; + /// Deserializes the JSON string into a ast from a file. + pub fn from_json_file(path: std::path::PathBuf) -> Result { + let data = std::fs::read_to_string(&path).map_err(|e| AstError::failed_to_read_json_file(&path, &e))?; Self::from_json_string(&data) } } diff --git a/ast/src/node.rs b/ast/src/node.rs index f486503b50..e2ec6cc653 100644 --- a/ast/src/node.rs +++ b/ast/src/node.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::Span; +use leo_errors::Span; pub trait Node: std::fmt::Debug + std::fmt::Display + Clone + PartialEq + Eq + serde::Serialize + serde::de::DeserializeOwned diff --git a/ast/src/reducer/canonicalization.rs b/ast/src/reducer/canonicalization.rs index 019ffe66f4..1f2ec23b74 100644 --- a/ast/src/reducer/canonicalization.rs +++ b/ast/src/reducer/canonicalization.rs @@ -15,11 +15,12 @@ // along with the Leo library. If not, see . use crate::*; +use leo_errors::{AstError, Result, Span}; /// Replace Self when it is in a enclosing circuit type. /// Error when Self is outside an enclosing circuit type. /// Tuple array types and expressions expand to nested arrays. -/// Tuple array types and expressions error if a size of 0 is given.anyhow +/// Tuple array types and expressions error if a size of 0 is given. /// Compound operators become simple assignments. /// Functions missing output type return a empty tuple. pub struct Canonicalizer { @@ -43,7 +44,7 @@ impl Canonicalizer { start: Expression, accesses: &[AssigneeAccess], span: &Span, - ) -> Result, ReducerError> { + ) -> Result> { let mut left = Box::new(start); for access in accesses.iter() { @@ -83,10 +84,7 @@ impl Canonicalizer { Ok(left) } - pub fn compound_operation_converstion( - &mut self, - operation: &AssignOperation, - ) -> Result { + pub fn compound_operation_converstion(&mut self, operation: &AssignOperation) -> Result { match operation { AssignOperation::Assign => unreachable!(), AssignOperation::Add => Ok(BinaryOperation::Add), @@ -106,8 +104,24 @@ impl Canonicalizer { } } - fn is_self_type(&mut self, type_option: Option<&Type>) -> bool { - matches!(type_option, Some(Type::SelfType)) + fn canonicalize_self_type(&self, type_option: Option<&Type>) -> Option { + match type_option { + Some(type_) => match type_ { + Type::SelfType => Some(Type::Circuit(self.circuit_name.as_ref().unwrap().clone())), + Type::Array(type_, dimensions) => Some(Type::Array( + Box::new(self.canonicalize_self_type(Some(type_)).unwrap()), + dimensions.clone(), + )), + Type::Tuple(types) => Some(Type::Tuple( + types + .iter() + .map(|type_| self.canonicalize_self_type(Some(type_)).unwrap()) + .collect(), + )), + _ => Some(type_.clone()), + }, + None => None, + } } fn canonicalize_expression(&mut self, expression: &Expression) -> Expression { @@ -147,11 +161,7 @@ impl Canonicalizer { Expression::Cast(cast) => { let inner = Box::new(self.canonicalize_expression(&cast.inner)); - let mut target_type = cast.target_type.clone(); - - if matches!(target_type, Type::SelfType) { - target_type = Type::Circuit(self.circuit_name.as_ref().unwrap().clone()); - } + let target_type = self.canonicalize_self_type(Some(&cast.target_type)).unwrap(); return Expression::Cast(CastExpression { inner, @@ -338,11 +348,7 @@ impl Canonicalizer { } Statement::Definition(definition) => { let value = self.canonicalize_expression(&definition.value); - let mut type_ = definition.type_.clone(); - - if self.is_self_type(type_.as_ref()) { - type_ = Some(Type::Circuit(self.circuit_name.as_ref().unwrap().clone())); - } + let type_ = self.canonicalize_self_type(definition.type_.as_ref()); Statement::Definition(DefinitionStatement { declaration_type: definition.declaration_type.clone(), @@ -356,12 +362,12 @@ impl Canonicalizer { let assignee = self.canonicalize_assignee(&assign.assignee); let value = self.canonicalize_expression(&assign.value); - Statement::Assign(AssignStatement { + Statement::Assign(Box::new(AssignStatement { assignee, value, operation: assign.operation, span: assign.span.clone(), - }) + })) } Statement::Conditional(conditional) => { let condition = self.canonicalize_expression(&conditional.condition); @@ -383,14 +389,14 @@ impl Canonicalizer { let stop = self.canonicalize_expression(&iteration.stop); let block = self.canonicalize_block(&iteration.block); - Statement::Iteration(IterationStatement { + Statement::Iteration(Box::new(IterationStatement { variable: iteration.variable.clone(), start, stop, inclusive: iteration.inclusive, block, span: iteration.span.clone(), - }) + })) } Statement::Console(console_function_call) => { let function = match &console_function_call.function { @@ -436,13 +442,9 @@ impl Canonicalizer { CircuitMember::CircuitVariable(_, _) => {} CircuitMember::CircuitFunction(function) => { let input = function.input.clone(); - let mut output = function.output.clone(); + let output = self.canonicalize_self_type(function.output.as_ref()); let block = self.canonicalize_block(&function.block); - if self.is_self_type(output.as_ref()) { - output = Some(Type::Circuit(self.circuit_name.as_ref().unwrap().clone())); - } - return CircuitMember::CircuitFunction(Function { annotations: function.annotations.clone(), identifier: function.identifier.clone(), @@ -467,13 +469,11 @@ impl ReconstructingReducer for Canonicalizer { self.in_circuit = !self.in_circuit; } - fn reduce_type(&mut self, _type_: &Type, new: Type, span: &Span) -> Result { + fn reduce_type(&mut self, _type_: &Type, new: Type, span: &Span) -> Result { match new { Type::Array(type_, mut dimensions) => { if dimensions.is_zero() { - return Err(ReducerError::from(CanonicalizeError::invalid_array_dimension_size( - span, - ))); + return Err(AstError::invalid_array_dimension_size(span).into()); } let mut next = Type::Array(type_, ArrayDimensions(vec![dimensions.remove_last().unwrap()])); @@ -490,16 +490,14 @@ impl ReconstructingReducer for Canonicalizer { Ok(array) } - Type::SelfType if !self.in_circuit => { - Err(ReducerError::from(CanonicalizeError::big_self_outside_of_circuit(span))) - } + Type::SelfType if !self.in_circuit => Err(AstError::big_self_outside_of_circuit(span).into()), _ => Ok(new.clone()), } } - fn reduce_string(&mut self, string: &[Char], span: &Span) -> Result { + fn reduce_string(&mut self, string: &[Char], span: &Span) -> Result { if string.is_empty() { - return Err(ReducerError::empty_string(span)); + return Err(AstError::empty_string(span).into()); } let mut elements = Vec::new(); @@ -534,14 +532,14 @@ impl ReconstructingReducer for Canonicalizer { elements.push(SpreadOrExpression::Expression(Expression::Value( ValueExpression::Char(CharValue { character: character.clone(), - span: Span { - line_start: span.line_start, - line_stop: span.line_stop, + span: Span::new( + span.line_start, + span.line_stop, col_start, col_stop, - path: span.path.clone(), - content: span.content.clone(), - }, + span.path.clone(), + span.content.clone(), + ), }), ))); } @@ -556,11 +554,9 @@ impl ReconstructingReducer for Canonicalizer { &mut self, array_init: &ArrayInitExpression, element: Expression, - ) -> Result { + ) -> Result { if array_init.dimensions.is_zero() { - return Err(ReducerError::from(CanonicalizeError::invalid_array_dimension_size( - &array_init.span, - ))); + return Err(AstError::invalid_array_dimension_size(&array_init.span).into()); } let element = Box::new(element); @@ -607,7 +603,7 @@ impl ReconstructingReducer for Canonicalizer { assign: &AssignStatement, assignee: Assignee, value: Expression, - ) -> Result { + ) -> Result { match value { value if assign.operation != AssignOperation::Assign => { let left = self.canonicalize_accesses( @@ -649,7 +645,7 @@ impl ReconstructingReducer for Canonicalizer { input: Vec, output: Option, block: Block, - ) -> Result { + ) -> Result { let new_output = match output { None => Some(Type::Tuple(vec![])), _ => output, @@ -670,7 +666,7 @@ impl ReconstructingReducer for Canonicalizer { _circuit: &Circuit, circuit_name: Identifier, members: Vec, - ) -> Result { + ) -> Result { self.circuit_name = Some(circuit_name.clone()); let circ = Circuit { circuit_name, diff --git a/ast/src/reducer/reconstructing_director.rs b/ast/src/reducer/reconstructing_director.rs index d7710df122..85e28c98f7 100644 --- a/ast/src/reducer/reconstructing_director.rs +++ b/ast/src/reducer/reconstructing_director.rs @@ -19,6 +19,7 @@ use crate::*; use indexmap::IndexMap; +use leo_errors::{AstError, Result, Span}; pub struct ReconstructingDirector { reducer: R, @@ -29,7 +30,7 @@ impl ReconstructingDirector { Self { reducer } } - pub fn reduce_type(&mut self, type_: &Type, span: &Span) -> Result { + pub fn reduce_type(&mut self, type_: &Type, span: &Span) -> Result { let new = match type_ { Type::Array(type_, dimensions) => Type::Array(Box::new(self.reduce_type(type_, span)?), dimensions.clone()), Type::Tuple(types) => { @@ -48,7 +49,7 @@ impl ReconstructingDirector { } // Expressions - pub fn reduce_expression(&mut self, expression: &Expression) -> Result { + pub fn reduce_expression(&mut self, expression: &Expression) -> Result { let new = match expression { Expression::Identifier(identifier) => Expression::Identifier(self.reduce_identifier(identifier)?), Expression::Value(value) => self.reduce_value(value)?, @@ -81,15 +82,15 @@ impl ReconstructingDirector { self.reducer.reduce_expression(expression, new) } - pub fn reduce_identifier(&mut self, identifier: &Identifier) -> Result { + pub fn reduce_identifier(&mut self, identifier: &Identifier) -> Result { self.reducer.reduce_identifier(identifier) } - pub fn reduce_group_tuple(&mut self, group_tuple: &GroupTuple) -> Result { + pub fn reduce_group_tuple(&mut self, group_tuple: &GroupTuple) -> Result { self.reducer.reduce_group_tuple(group_tuple) } - pub fn reduce_group_value(&mut self, group_value: &GroupValue) -> Result { + pub fn reduce_group_value(&mut self, group_value: &GroupValue) -> Result { let new = match group_value { GroupValue::Tuple(group_tuple) => GroupValue::Tuple(self.reduce_group_tuple(group_tuple)?), _ => group_value.clone(), @@ -98,11 +99,11 @@ impl ReconstructingDirector { self.reducer.reduce_group_value(group_value, new) } - pub fn reduce_string(&mut self, string: &[Char], span: &Span) -> Result { + pub fn reduce_string(&mut self, string: &[Char], span: &Span) -> Result { self.reducer.reduce_string(string, span) } - pub fn reduce_value(&mut self, value: &ValueExpression) -> Result { + pub fn reduce_value(&mut self, value: &ValueExpression) -> Result { let new = match value { ValueExpression::Group(group_value) => { Expression::Value(ValueExpression::Group(Box::new(self.reduce_group_value(group_value)?))) @@ -114,20 +115,20 @@ impl ReconstructingDirector { self.reducer.reduce_value(value, new) } - pub fn reduce_binary(&mut self, binary: &BinaryExpression) -> Result { + pub fn reduce_binary(&mut self, binary: &BinaryExpression) -> Result { let left = self.reduce_expression(&binary.left)?; let right = self.reduce_expression(&binary.right)?; self.reducer.reduce_binary(binary, left, right, binary.op.clone()) } - pub fn reduce_unary(&mut self, unary: &UnaryExpression) -> Result { + pub fn reduce_unary(&mut self, unary: &UnaryExpression) -> Result { let inner = self.reduce_expression(&unary.inner)?; self.reducer.reduce_unary(unary, inner, unary.op.clone()) } - pub fn reduce_ternary(&mut self, ternary: &TernaryExpression) -> Result { + pub fn reduce_ternary(&mut self, ternary: &TernaryExpression) -> Result { let condition = self.reduce_expression(&ternary.condition)?; let if_true = self.reduce_expression(&ternary.if_true)?; let if_false = self.reduce_expression(&ternary.if_false)?; @@ -135,17 +136,14 @@ impl ReconstructingDirector { self.reducer.reduce_ternary(ternary, condition, if_true, if_false) } - pub fn reduce_cast(&mut self, cast: &CastExpression) -> Result { + pub fn reduce_cast(&mut self, cast: &CastExpression) -> Result { let inner = self.reduce_expression(&cast.inner)?; let target_type = self.reduce_type(&cast.target_type, &cast.span)?; self.reducer.reduce_cast(cast, inner, target_type) } - pub fn reduce_array_inline( - &mut self, - array_inline: &ArrayInlineExpression, - ) -> Result { + pub fn reduce_array_inline(&mut self, array_inline: &ArrayInlineExpression) -> Result { let mut elements = vec![]; for element in array_inline.elements.iter() { let reduced_element = match element { @@ -163,16 +161,13 @@ impl ReconstructingDirector { self.reducer.reduce_array_inline(array_inline, elements) } - pub fn reduce_array_init(&mut self, array_init: &ArrayInitExpression) -> Result { + pub fn reduce_array_init(&mut self, array_init: &ArrayInitExpression) -> Result { let element = self.reduce_expression(&array_init.element)?; self.reducer.reduce_array_init(array_init, element) } - pub fn reduce_array_access( - &mut self, - array_access: &ArrayAccessExpression, - ) -> Result { + pub fn reduce_array_access(&mut self, array_access: &ArrayAccessExpression) -> Result { let array = self.reduce_expression(&array_access.array)?; let index = self.reduce_expression(&array_access.index)?; @@ -182,7 +177,7 @@ impl ReconstructingDirector { pub fn reduce_array_range_access( &mut self, array_range_access: &ArrayRangeAccessExpression, - ) -> Result { + ) -> Result { let array = self.reduce_expression(&array_range_access.array)?; let left = array_range_access .left @@ -199,7 +194,7 @@ impl ReconstructingDirector { .reduce_array_range_access(array_range_access, array, left, right) } - pub fn reduce_tuple_init(&mut self, tuple_init: &TupleInitExpression) -> Result { + pub fn reduce_tuple_init(&mut self, tuple_init: &TupleInitExpression) -> Result { let mut elements = vec![]; for element in tuple_init.elements.iter() { elements.push(self.reduce_expression(element)?); @@ -208,10 +203,7 @@ impl ReconstructingDirector { self.reducer.reduce_tuple_init(tuple_init, elements) } - pub fn reduce_tuple_access( - &mut self, - tuple_access: &TupleAccessExpression, - ) -> Result { + pub fn reduce_tuple_access(&mut self, tuple_access: &TupleAccessExpression) -> Result { let tuple = self.reduce_expression(&tuple_access.tuple)?; self.reducer.reduce_tuple_access(tuple_access, tuple) @@ -220,7 +212,7 @@ impl ReconstructingDirector { pub fn reduce_circuit_implied_variable_definition( &mut self, variable: &CircuitImpliedVariableDefinition, - ) -> Result { + ) -> Result { let identifier = self.reduce_identifier(&variable.identifier)?; let expression = variable .expression @@ -232,10 +224,7 @@ impl ReconstructingDirector { .reduce_circuit_implied_variable_definition(variable, identifier, expression) } - pub fn reduce_circuit_init( - &mut self, - circuit_init: &CircuitInitExpression, - ) -> Result { + pub fn reduce_circuit_init(&mut self, circuit_init: &CircuitInitExpression) -> Result { let name = self.reduce_identifier(&circuit_init.name)?; let mut members = vec![]; @@ -249,7 +238,7 @@ impl ReconstructingDirector { pub fn reduce_circuit_member_access( &mut self, circuit_member_access: &CircuitMemberAccessExpression, - ) -> Result { + ) -> Result { let circuit = self.reduce_expression(&circuit_member_access.circuit)?; let name = self.reduce_identifier(&circuit_member_access.name)?; @@ -260,7 +249,7 @@ impl ReconstructingDirector { pub fn reduce_circuit_static_fn_access( &mut self, circuit_static_fn_access: &CircuitStaticFunctionAccessExpression, - ) -> Result { + ) -> Result { let circuit = self.reduce_expression(&circuit_static_fn_access.circuit)?; let name = self.reduce_identifier(&circuit_static_fn_access.name)?; @@ -268,7 +257,7 @@ impl ReconstructingDirector { .reduce_circuit_static_fn_access(circuit_static_fn_access, circuit, name) } - pub fn reduce_call(&mut self, call: &CallExpression) -> Result { + pub fn reduce_call(&mut self, call: &CallExpression) -> Result { let function = self.reduce_expression(&call.function)?; let mut arguments = vec![]; @@ -280,13 +269,13 @@ impl ReconstructingDirector { } // Statements - pub fn reduce_statement(&mut self, statement: &Statement) -> Result { + pub fn reduce_statement(&mut self, statement: &Statement) -> Result { let new = match statement { Statement::Return(return_statement) => Statement::Return(self.reduce_return(return_statement)?), Statement::Definition(definition) => Statement::Definition(self.reduce_definition(definition)?), - Statement::Assign(assign) => Statement::Assign(self.reduce_assign(assign)?), + Statement::Assign(assign) => Statement::Assign(Box::new(self.reduce_assign(assign)?)), Statement::Conditional(conditional) => Statement::Conditional(self.reduce_conditional(conditional)?), - Statement::Iteration(iteration) => Statement::Iteration(self.reduce_iteration(iteration)?), + Statement::Iteration(iteration) => Statement::Iteration(Box::new(self.reduce_iteration(iteration)?)), Statement::Console(console) => Statement::Console(self.reduce_console(console)?), Statement::Expression(expression) => Statement::Expression(self.reduce_expression_statement(expression)?), Statement::Block(block) => Statement::Block(self.reduce_block(block)?), @@ -295,19 +284,19 @@ impl ReconstructingDirector { self.reducer.reduce_statement(statement, new) } - pub fn reduce_return(&mut self, return_statement: &ReturnStatement) -> Result { + pub fn reduce_return(&mut self, return_statement: &ReturnStatement) -> Result { let expression = self.reduce_expression(&return_statement.expression)?; self.reducer.reduce_return(return_statement, expression) } - pub fn reduce_variable_name(&mut self, variable_name: &VariableName) -> Result { + pub fn reduce_variable_name(&mut self, variable_name: &VariableName) -> Result { let identifier = self.reduce_identifier(&variable_name.identifier)?; self.reducer.reduce_variable_name(variable_name, identifier) } - pub fn reduce_definition(&mut self, definition: &DefinitionStatement) -> Result { + pub fn reduce_definition(&mut self, definition: &DefinitionStatement) -> Result { let mut variable_names = vec![]; for variable_name in definition.variable_names.iter() { variable_names.push(self.reduce_variable_name(variable_name)?); @@ -324,7 +313,7 @@ impl ReconstructingDirector { self.reducer.reduce_definition(definition, variable_names, type_, value) } - pub fn reduce_assignee_access(&mut self, access: &AssigneeAccess) -> Result { + pub fn reduce_assignee_access(&mut self, access: &AssigneeAccess) -> Result { let new = match access { AssigneeAccess::ArrayRange(left, right) => { let left = left.as_ref().map(|left| self.reduce_expression(left)).transpose()?; @@ -340,7 +329,7 @@ impl ReconstructingDirector { self.reducer.reduce_assignee_access(access, new) } - pub fn reduce_assignee(&mut self, assignee: &Assignee) -> Result { + pub fn reduce_assignee(&mut self, assignee: &Assignee) -> Result { let identifier = self.reduce_identifier(&assignee.identifier)?; let mut accesses = vec![]; @@ -351,17 +340,14 @@ impl ReconstructingDirector { self.reducer.reduce_assignee(assignee, identifier, accesses) } - pub fn reduce_assign(&mut self, assign: &AssignStatement) -> Result { + pub fn reduce_assign(&mut self, assign: &AssignStatement) -> Result { let assignee = self.reduce_assignee(&assign.assignee)?; let value = self.reduce_expression(&assign.value)?; self.reducer.reduce_assign(assign, assignee, value) } - pub fn reduce_conditional( - &mut self, - conditional: &ConditionalStatement, - ) -> Result { + pub fn reduce_conditional(&mut self, conditional: &ConditionalStatement) -> Result { let condition = self.reduce_expression(&conditional.condition)?; let block = self.reduce_block(&conditional.block)?; let next = conditional @@ -373,7 +359,7 @@ impl ReconstructingDirector { self.reducer.reduce_conditional(conditional, condition, block, next) } - pub fn reduce_iteration(&mut self, iteration: &IterationStatement) -> Result { + pub fn reduce_iteration(&mut self, iteration: &IterationStatement) -> Result { let variable = self.reduce_identifier(&iteration.variable)?; let start = self.reduce_expression(&iteration.start)?; let stop = self.reduce_expression(&iteration.stop)?; @@ -382,10 +368,7 @@ impl ReconstructingDirector { self.reducer.reduce_iteration(iteration, variable, start, stop, block) } - pub fn reduce_console( - &mut self, - console_function_call: &ConsoleStatement, - ) -> Result { + pub fn reduce_console(&mut self, console_function_call: &ConsoleStatement) -> Result { let function = match &console_function_call.function { ConsoleFunction::Assert(expression) => ConsoleFunction::Assert(self.reduce_expression(expression)?), ConsoleFunction::Error(args) | ConsoleFunction::Log(args) => { @@ -403,7 +386,7 @@ impl ReconstructingDirector { match &console_function_call.function { ConsoleFunction::Error(_) => ConsoleFunction::Error(formatted), ConsoleFunction::Log(_) => ConsoleFunction::Log(formatted), - _ => return Err(ReducerError::impossible_console_assert_call(&args.span)), + _ => return Err(AstError::impossible_console_assert_call(&args.span).into()), } } }; @@ -411,15 +394,12 @@ impl ReconstructingDirector { self.reducer.reduce_console(console_function_call, function) } - pub fn reduce_expression_statement( - &mut self, - expression: &ExpressionStatement, - ) -> Result { + pub fn reduce_expression_statement(&mut self, expression: &ExpressionStatement) -> Result { let inner_expression = self.reduce_expression(&expression.expression)?; self.reducer.reduce_expression_statement(expression, inner_expression) } - pub fn reduce_block(&mut self, block: &Block) -> Result { + pub fn reduce_block(&mut self, block: &Block) -> Result { let mut statements = vec![]; for statement in block.statements.iter() { statements.push(self.reduce_statement(statement)?); @@ -429,7 +409,7 @@ impl ReconstructingDirector { } // Program - pub fn reduce_program(&mut self, program: &Program) -> Result { + pub fn reduce_program(&mut self, program: &Program) -> Result { let mut inputs = vec![]; for input in program.expected_input.iter() { inputs.push(self.reduce_function_input(input)?); @@ -464,14 +444,14 @@ impl ReconstructingDirector { pub fn reduce_function_input_variable( &mut self, variable: &FunctionInputVariable, - ) -> Result { + ) -> Result { let identifier = self.reduce_identifier(&variable.identifier)?; let type_ = self.reduce_type(&variable.type_, &variable.span)?; self.reducer.reduce_function_input_variable(variable, identifier, type_) } - pub fn reduce_function_input(&mut self, input: &FunctionInput) -> Result { + pub fn reduce_function_input(&mut self, input: &FunctionInput) -> Result { let new = match input { FunctionInput::Variable(function_input_variable) => { FunctionInput::Variable(self.reduce_function_input_variable(function_input_variable)?) @@ -482,10 +462,7 @@ impl ReconstructingDirector { self.reducer.reduce_function_input(input, new) } - pub fn reduce_package_or_packages( - &mut self, - package_or_packages: &PackageOrPackages, - ) -> Result { + pub fn reduce_package_or_packages(&mut self, package_or_packages: &PackageOrPackages) -> Result { let new = match package_or_packages { PackageOrPackages::Package(package) => PackageOrPackages::Package(Package { name: self.reduce_identifier(&package.name)?, @@ -502,13 +479,13 @@ impl ReconstructingDirector { self.reducer.reduce_package_or_packages(package_or_packages, new) } - pub fn reduce_import(&mut self, import: &ImportStatement) -> Result { + pub fn reduce_import(&mut self, import: &ImportStatement) -> Result { let package_or_packages = self.reduce_package_or_packages(&import.package_or_packages)?; self.reducer.reduce_import(import, package_or_packages) } - pub fn reduce_circuit_member(&mut self, circuit_member: &CircuitMember) -> Result { + pub fn reduce_circuit_member(&mut self, circuit_member: &CircuitMember) -> Result { let new = match circuit_member { CircuitMember::CircuitVariable(identifier, type_) => CircuitMember::CircuitVariable( self.reduce_identifier(identifier)?, @@ -520,7 +497,7 @@ impl ReconstructingDirector { self.reducer.reduce_circuit_member(circuit_member, new) } - pub fn reduce_circuit(&mut self, circuit: &Circuit) -> Result { + pub fn reduce_circuit(&mut self, circuit: &Circuit) -> Result { let circuit_name = self.reduce_identifier(&circuit.circuit_name)?; let mut members = vec![]; @@ -531,13 +508,13 @@ impl ReconstructingDirector { self.reducer.reduce_circuit(circuit, circuit_name, members) } - fn reduce_annotation(&mut self, annotation: &Annotation) -> Result { + fn reduce_annotation(&mut self, annotation: &Annotation) -> Result { let name = self.reduce_identifier(&annotation.name)?; self.reducer.reduce_annotation(annotation, name) } - pub fn reduce_function(&mut self, function: &Function) -> Result { + pub fn reduce_function(&mut self, function: &Function) -> Result { let identifier = self.reduce_identifier(&function.identifier)?; let mut annotations = vec![]; diff --git a/ast/src/reducer/reconstructing_reducer.rs b/ast/src/reducer/reconstructing_reducer.rs index 9bac0a88c7..36acacf7e3 100644 --- a/ast/src/reducer/reconstructing_reducer.rs +++ b/ast/src/reducer/reconstructing_reducer.rs @@ -16,6 +16,7 @@ use crate::*; use indexmap::IndexMap; +use leo_errors::{Result, Span}; // Needed to fix clippy bug. #[allow(clippy::redundant_closure)] @@ -23,23 +24,23 @@ pub trait ReconstructingReducer { fn in_circuit(&self) -> bool; fn swap_in_circuit(&mut self); - fn reduce_type(&mut self, _type_: &Type, new: Type, _span: &Span) -> Result { + fn reduce_type(&mut self, _type_: &Type, new: Type, _span: &Span) -> Result { Ok(new) } // Expressions - fn reduce_expression(&mut self, _expression: &Expression, new: Expression) -> Result { + fn reduce_expression(&mut self, _expression: &Expression, new: Expression) -> Result { Ok(new) } - fn reduce_identifier(&mut self, identifier: &Identifier) -> Result { + fn reduce_identifier(&mut self, identifier: &Identifier) -> Result { Ok(Identifier { name: identifier.name.clone(), span: identifier.span.clone(), }) } - fn reduce_group_tuple(&mut self, group_tuple: &GroupTuple) -> Result { + fn reduce_group_tuple(&mut self, group_tuple: &GroupTuple) -> Result { Ok(GroupTuple { x: group_tuple.x.clone(), y: group_tuple.y.clone(), @@ -47,18 +48,18 @@ pub trait ReconstructingReducer { }) } - fn reduce_group_value(&mut self, _group_value: &GroupValue, new: GroupValue) -> Result { + fn reduce_group_value(&mut self, _group_value: &GroupValue, new: GroupValue) -> Result { Ok(new) } - fn reduce_string(&mut self, string: &[Char], span: &Span) -> Result { + fn reduce_string(&mut self, string: &[Char], span: &Span) -> Result { Ok(Expression::Value(ValueExpression::String( string.to_vec(), span.clone(), ))) } - fn reduce_value(&mut self, _value: &ValueExpression, new: Expression) -> Result { + fn reduce_value(&mut self, _value: &ValueExpression, new: Expression) -> Result { Ok(new) } @@ -68,7 +69,7 @@ pub trait ReconstructingReducer { left: Expression, right: Expression, op: BinaryOperation, - ) -> Result { + ) -> Result { Ok(BinaryExpression { left: Box::new(left), right: Box::new(right), @@ -82,7 +83,7 @@ pub trait ReconstructingReducer { unary: &UnaryExpression, inner: Expression, op: UnaryOperation, - ) -> Result { + ) -> Result { Ok(UnaryExpression { inner: Box::new(inner), op, @@ -96,7 +97,7 @@ pub trait ReconstructingReducer { condition: Expression, if_true: Expression, if_false: Expression, - ) -> Result { + ) -> Result { Ok(TernaryExpression { condition: Box::new(condition), if_true: Box::new(if_true), @@ -105,12 +106,7 @@ pub trait ReconstructingReducer { }) } - fn reduce_cast( - &mut self, - cast: &CastExpression, - inner: Expression, - target_type: Type, - ) -> Result { + fn reduce_cast(&mut self, cast: &CastExpression, inner: Expression, target_type: Type) -> Result { Ok(CastExpression { inner: Box::new(inner), target_type, @@ -122,7 +118,7 @@ pub trait ReconstructingReducer { &mut self, array_inline: &ArrayInlineExpression, elements: Vec, - ) -> Result { + ) -> Result { Ok(ArrayInlineExpression { elements, span: array_inline.span.clone(), @@ -133,7 +129,7 @@ pub trait ReconstructingReducer { &mut self, array_init: &ArrayInitExpression, element: Expression, - ) -> Result { + ) -> Result { Ok(ArrayInitExpression { element: Box::new(element), dimensions: array_init.dimensions.clone(), @@ -146,7 +142,7 @@ pub trait ReconstructingReducer { array_access: &ArrayAccessExpression, array: Expression, index: Expression, - ) -> Result { + ) -> Result { Ok(ArrayAccessExpression { array: Box::new(array), index: Box::new(index), @@ -160,7 +156,7 @@ pub trait ReconstructingReducer { array: Expression, left: Option, right: Option, - ) -> Result { + ) -> Result { Ok(ArrayRangeAccessExpression { array: Box::new(array), left: left.map(|expr| Box::new(expr)), @@ -173,7 +169,7 @@ pub trait ReconstructingReducer { &mut self, tuple_init: &TupleInitExpression, elements: Vec, - ) -> Result { + ) -> Result { Ok(TupleInitExpression { elements, span: tuple_init.span.clone(), @@ -184,7 +180,7 @@ pub trait ReconstructingReducer { &mut self, tuple_access: &TupleAccessExpression, tuple: Expression, - ) -> Result { + ) -> Result { Ok(TupleAccessExpression { tuple: Box::new(tuple), index: tuple_access.index.clone(), @@ -197,7 +193,7 @@ pub trait ReconstructingReducer { _variable: &CircuitImpliedVariableDefinition, identifier: Identifier, expression: Option, - ) -> Result { + ) -> Result { Ok(CircuitImpliedVariableDefinition { identifier, expression }) } @@ -206,7 +202,7 @@ pub trait ReconstructingReducer { circuit_init: &CircuitInitExpression, name: Identifier, members: Vec, - ) -> Result { + ) -> Result { Ok(CircuitInitExpression { name, members, @@ -219,7 +215,7 @@ pub trait ReconstructingReducer { circuit_member_access: &CircuitMemberAccessExpression, circuit: Expression, name: Identifier, - ) -> Result { + ) -> Result { Ok(CircuitMemberAccessExpression { circuit: Box::new(circuit), name, @@ -232,7 +228,7 @@ pub trait ReconstructingReducer { circuit_static_fn_access: &CircuitStaticFunctionAccessExpression, circuit: Expression, name: Identifier, - ) -> Result { + ) -> Result { Ok(CircuitStaticFunctionAccessExpression { circuit: Box::new(circuit), name, @@ -245,7 +241,7 @@ pub trait ReconstructingReducer { call: &CallExpression, function: Expression, arguments: Vec, - ) -> Result { + ) -> Result { Ok(CallExpression { function: Box::new(function), arguments, @@ -254,26 +250,18 @@ pub trait ReconstructingReducer { } // Statements - fn reduce_statement(&mut self, _statement: &Statement, new: Statement) -> Result { + fn reduce_statement(&mut self, _statement: &Statement, new: Statement) -> Result { Ok(new) } - fn reduce_return( - &mut self, - return_statement: &ReturnStatement, - expression: Expression, - ) -> Result { + fn reduce_return(&mut self, return_statement: &ReturnStatement, expression: Expression) -> Result { Ok(ReturnStatement { expression, span: return_statement.span.clone(), }) } - fn reduce_variable_name( - &mut self, - variable_name: &VariableName, - identifier: Identifier, - ) -> Result { + fn reduce_variable_name(&mut self, variable_name: &VariableName, identifier: Identifier) -> Result { Ok(VariableName { mutable: variable_name.mutable, identifier, @@ -287,7 +275,7 @@ pub trait ReconstructingReducer { variable_names: Vec, type_: Option, value: Expression, - ) -> Result { + ) -> Result { Ok(DefinitionStatement { declaration_type: definition.declaration_type.clone(), variable_names, @@ -297,11 +285,7 @@ pub trait ReconstructingReducer { }) } - fn reduce_assignee_access( - &mut self, - _access: &AssigneeAccess, - new: AssigneeAccess, - ) -> Result { + fn reduce_assignee_access(&mut self, _access: &AssigneeAccess, new: AssigneeAccess) -> Result { Ok(new) } @@ -310,7 +294,7 @@ pub trait ReconstructingReducer { assignee: &Assignee, identifier: Identifier, accesses: Vec, - ) -> Result { + ) -> Result { Ok(Assignee { identifier, accesses, @@ -323,7 +307,7 @@ pub trait ReconstructingReducer { assign: &AssignStatement, assignee: Assignee, value: Expression, - ) -> Result { + ) -> Result { Ok(AssignStatement { operation: assign.operation, assignee, @@ -338,7 +322,7 @@ pub trait ReconstructingReducer { condition: Expression, block: Block, statement: Option, - ) -> Result { + ) -> Result { Ok(ConditionalStatement { condition, block, @@ -354,7 +338,7 @@ pub trait ReconstructingReducer { start: Expression, stop: Expression, block: Block, - ) -> Result { + ) -> Result { Ok(IterationStatement { variable, start, @@ -365,11 +349,7 @@ pub trait ReconstructingReducer { }) } - fn reduce_console( - &mut self, - console: &ConsoleStatement, - function: ConsoleFunction, - ) -> Result { + fn reduce_console(&mut self, console: &ConsoleStatement, function: ConsoleFunction) -> Result { Ok(ConsoleStatement { function, span: console.span.clone(), @@ -380,14 +360,14 @@ pub trait ReconstructingReducer { &mut self, expression_statement: &ExpressionStatement, expression: Expression, - ) -> Result { + ) -> Result { Ok(ExpressionStatement { expression, span: expression_statement.span.clone(), }) } - fn reduce_block(&mut self, block: &Block, statements: Vec) -> Result { + fn reduce_block(&mut self, block: &Block, statements: Vec) -> Result { Ok(Block { statements, span: block.span.clone(), @@ -403,7 +383,7 @@ pub trait ReconstructingReducer { circuits: IndexMap, functions: IndexMap, global_consts: IndexMap, - ) -> Result { + ) -> Result { Ok(Program { name: program.name.clone(), expected_input, @@ -419,7 +399,7 @@ pub trait ReconstructingReducer { variable: &FunctionInputVariable, identifier: Identifier, type_: Type, - ) -> Result { + ) -> Result { Ok(FunctionInputVariable { identifier, const_: variable.const_, @@ -429,11 +409,7 @@ pub trait ReconstructingReducer { }) } - fn reduce_function_input( - &mut self, - _input: &FunctionInput, - new: FunctionInput, - ) -> Result { + fn reduce_function_input(&mut self, _input: &FunctionInput, new: FunctionInput) -> Result { Ok(new) } @@ -441,7 +417,7 @@ pub trait ReconstructingReducer { &mut self, _package_or_packages: &PackageOrPackages, new: PackageOrPackages, - ) -> Result { + ) -> Result { Ok(new) } @@ -449,18 +425,14 @@ pub trait ReconstructingReducer { &mut self, import: &ImportStatement, package_or_packages: PackageOrPackages, - ) -> Result { + ) -> Result { Ok(ImportStatement { package_or_packages, span: import.span.clone(), }) } - fn reduce_circuit_member( - &mut self, - _circuit_member: &CircuitMember, - new: CircuitMember, - ) -> Result { + fn reduce_circuit_member(&mut self, _circuit_member: &CircuitMember, new: CircuitMember) -> Result { Ok(new) } @@ -469,11 +441,11 @@ pub trait ReconstructingReducer { _circuit: &Circuit, circuit_name: Identifier, members: Vec, - ) -> Result { + ) -> Result { Ok(Circuit { circuit_name, members }) } - fn reduce_annotation(&mut self, annotation: &Annotation, name: Identifier) -> Result { + fn reduce_annotation(&mut self, annotation: &Annotation, name: Identifier) -> Result { Ok(Annotation { span: annotation.span.clone(), name, @@ -490,7 +462,7 @@ pub trait ReconstructingReducer { input: Vec, output: Option, block: Block, - ) -> Result { + ) -> Result { Ok(Function { identifier, annotations, diff --git a/ast/src/statements/assign/assignee.rs b/ast/src/statements/assign/assignee.rs index da73eb9d38..4816cb20b4 100644 --- a/ast/src/statements/assign/assignee.rs +++ b/ast/src/statements/assign/assignee.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Expression, Identifier, PositiveNumber, Span}; +use crate::{Expression, Identifier, PositiveNumber}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/statements/assign/mod.rs b/ast/src/statements/assign/mod.rs index 29da40821b..4deb42334c 100644 --- a/ast/src/statements/assign/mod.rs +++ b/ast/src/statements/assign/mod.rs @@ -14,7 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Expression, Node, Span}; +use crate::{Expression, Node}; + +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/statements/block.rs b/ast/src/statements/block.rs index 71270e0d19..d69a074b69 100644 --- a/ast/src/statements/block.rs +++ b/ast/src/statements/block.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Node, Span, Statement}; +use crate::{Node, Statement}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/statements/conditional.rs b/ast/src/statements/conditional.rs index bb78e83fff..fe9516f450 100644 --- a/ast/src/statements/conditional.rs +++ b/ast/src/statements/conditional.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Block, Expression, Node, Span, Statement}; +use crate::{Block, Expression, Node, Statement}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/statements/console/console_args.rs b/ast/src/statements/console/console_args.rs index ebe6e12725..6adcb23493 100644 --- a/ast/src/statements/console/console_args.rs +++ b/ast/src/statements/console/console_args.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Char, Expression, Node, Span}; +use crate::{Char, Expression, Node}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/statements/console/console_function.rs b/ast/src/statements/console/console_function.rs index 8c782a1e88..9462061d72 100644 --- a/ast/src/statements/console/console_function.rs +++ b/ast/src/statements/console/console_function.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{ConsoleArgs, Expression, Node, Span}; +use crate::{ConsoleArgs, Expression, Node}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/statements/console/console_statement.rs b/ast/src/statements/console/console_statement.rs index de916205fa..2bb14e12e4 100644 --- a/ast/src/statements/console/console_statement.rs +++ b/ast/src/statements/console/console_statement.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{ConsoleFunction, Node, Span}; +use crate::{ConsoleFunction, Node}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/statements/definition/mod.rs b/ast/src/statements/definition/mod.rs index 15d2893b2d..190756fbc5 100644 --- a/ast/src/statements/definition/mod.rs +++ b/ast/src/statements/definition/mod.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Expression, Node, Span, Type}; +use crate::{Expression, Node, Type}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/statements/definition/variable_name.rs b/ast/src/statements/definition/variable_name.rs index c0fc5b09d6..546d79ecc0 100644 --- a/ast/src/statements/definition/variable_name.rs +++ b/ast/src/statements/definition/variable_name.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Identifier, Node, Span}; +use crate::{Identifier, Node}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/statements/expression.rs b/ast/src/statements/expression.rs index 9b86ea41a2..d9dd172bb2 100644 --- a/ast/src/statements/expression.rs +++ b/ast/src/statements/expression.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Expression, Node, Span}; +use crate::{Expression, Node}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/statements/iteration.rs b/ast/src/statements/iteration.rs index a97941ac55..6a35099ad1 100644 --- a/ast/src/statements/iteration.rs +++ b/ast/src/statements/iteration.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Block, Expression, Identifier, Node, Span}; +use crate::{Block, Expression, Identifier, Node}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/statements/return_statement.rs b/ast/src/statements/return_statement.rs index 4e2f813466..60c4c1a5c5 100644 --- a/ast/src/statements/return_statement.rs +++ b/ast/src/statements/return_statement.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Expression, Node, Span}; +use crate::{Expression, Node}; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/ast/src/statements/statement.rs b/ast/src/statements/statement.rs index f60c019edb..bbcf488373 100644 --- a/ast/src/statements/statement.rs +++ b/ast/src/statements/statement.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{ConditionalStatement, Node, Span}; +use crate::{ConditionalStatement, Node}; +use leo_errors::Span; use super::*; use serde::{Deserialize, Serialize}; @@ -25,9 +26,9 @@ use std::fmt; pub enum Statement { Return(ReturnStatement), Definition(DefinitionStatement), - Assign(AssignStatement), + Assign(Box), Conditional(ConditionalStatement), - Iteration(IterationStatement), + Iteration(Box), Console(ConsoleStatement), Expression(ExpressionStatement), Block(Block), diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index 013630af82..a2f90bc3b6 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -21,6 +21,10 @@ edition = "2018" path = "../ast" version = "1.5.3" +[dependencies.leo-errors] +path = "../errors" +version = "1.5.3" + [dependencies.leo-imports] path = "../imports" version = "1.5.3" @@ -57,7 +61,7 @@ version = "1.5.3" version = "0.4" [dependencies.snarkvm-curves] -version = "0.7.8" +version = "0.7.9" default-features = false [dependencies.snarkvm-fields] @@ -65,7 +69,7 @@ version = "0.7.7" default-features = false [dependencies.snarkvm-dpc] -version = "0.7.8" +version = "0.7.9" default-features = false [dependencies.snarkvm-gadgets] @@ -102,9 +106,6 @@ version = "1.0" [dependencies.sha2] version = "0.9" -[dependencies.thiserror] -version = "1.0" - [dependencies.tracing] version = "0.1" diff --git a/compiler/src/compiler.rs b/compiler/src/compiler.rs index dd922524f5..7e8c825fb4 100644 --- a/compiler/src/compiler.rs +++ b/compiler/src/compiler.rs @@ -17,12 +17,12 @@ //! Compiles a Leo program from a file path. use crate::{ constraints::{generate_constraints, generate_test_constraints}, - errors::CompilerError, AstSnapshotOptions, CompilerOptions, GroupType, Output, OutputFile, TypeInferencePhase, }; pub use leo_asg::{new_context, AsgContext as Context, AsgContext}; -use leo_asg::{Asg, AsgPass, FormattedError, Program as AsgProgram}; +use leo_asg::{Asg, AsgPass, Program as AsgProgram}; use leo_ast::{Input, MainInput, Program as AstProgram}; +use leo_errors::{CompilerError, Result}; use leo_input::LeoInputParser; use leo_package::inputs::InputPairs; use leo_parser::parse_ast; @@ -108,7 +108,7 @@ impl<'a, F: PrimeField, G: GroupType> Compiler<'a, F, G> { context: AsgContext<'a>, options: Option, ast_snapshot_options: Option, - ) -> Result { + ) -> Result { let mut compiler = Self::new( package_name, main_file_path, @@ -147,7 +147,7 @@ impl<'a, F: PrimeField, G: GroupType> Compiler<'a, F, G> { context: AsgContext<'a>, options: Option, ast_snapshot_options: Option, - ) -> Result { + ) -> Result { let mut compiler = Self::new( package_name, main_file_path, @@ -175,7 +175,7 @@ impl<'a, F: PrimeField, G: GroupType> Compiler<'a, F, G> { input_path: &Path, state_string: &str, state_path: &Path, - ) -> Result<(), CompilerError> { + ) -> Result<()> { let input_syntax_tree = LeoInputParser::parse_file(input_string).map_err(|mut e| { e.set_path( input_path.to_str().unwrap_or_default(), @@ -218,10 +218,10 @@ impl<'a, F: PrimeField, G: GroupType> Compiler<'a, F, G> { /// /// Parses and stores all programs imported by the main program file. /// - pub fn parse_program(&mut self) -> Result<(), CompilerError> { + pub fn parse_program(&mut self) -> Result<()> { // Load the program file. let content = fs::read_to_string(&self.main_file_path) - .map_err(|e| CompilerError::FileReadError(self.main_file_path.clone(), e))?; + .map_err(|e| CompilerError::file_read_error(self.main_file_path.clone(), e))?; self.parse_program_from_string(&content) } @@ -230,7 +230,7 @@ impl<'a, F: PrimeField, G: GroupType> Compiler<'a, F, G> { /// Equivalent to parse_and_check_program but uses the given program_string instead of a main /// file path. /// - pub fn parse_program_from_string(&mut self, program_string: &str) -> Result<(), CompilerError> { + pub fn parse_program_from_string(&mut self, program_string: &str) -> Result<()> { // Use the parser to construct the abstract syntax tree (ast). let mut ast: leo_ast::Ast = parse_ast(self.main_file_path.to_str().unwrap_or_default(), program_string)?; @@ -239,13 +239,11 @@ impl<'a, F: PrimeField, G: GroupType> Compiler<'a, F, G> { ast.to_json_file(self.output_directory.clone(), "initial_ast.json")?; } - // Preform compiler optimization via canonicalizing AST if its enabled. - if self.options.canonicalization_enabled { - ast.canonicalize()?; + // Preform canonicalization of AST always. + ast.canonicalize()?; - if self.ast_snapshot_options.canonicalized { - ast.to_json_file(self.output_directory.clone(), "canonicalization_ast.json")?; - } + if self.ast_snapshot_options.canonicalized { + ast.to_json_file(self.output_directory.clone(), "canonicalization_ast.json")?; } // Store the main program file. @@ -273,7 +271,7 @@ impl<'a, F: PrimeField, G: GroupType> Compiler<'a, F, G> { // Store the ASG. self.asg = Some(asg.into_repr()); - self.do_asg_passes().map_err(CompilerError::AsgPassError)?; + self.do_asg_passes()?; Ok(()) } @@ -281,7 +279,7 @@ impl<'a, F: PrimeField, G: GroupType> Compiler<'a, F, G> { /// /// Run compiler optimization passes on the program in asg format. /// - fn do_asg_passes(&mut self) -> Result<(), FormattedError> { + fn do_asg_passes(&mut self) -> Result<()> { assert!(self.asg.is_some()); // Do constant folding. @@ -302,24 +300,24 @@ impl<'a, F: PrimeField, G: GroupType> Compiler<'a, F, G> { /// /// Synthesizes the circuit with program input to verify correctness. /// - pub fn compile_constraints>(&self, cs: &mut CS) -> Result { + pub fn compile_constraints>(&self, cs: &mut CS) -> Result { generate_constraints::(cs, self.asg.as_ref().unwrap(), &self.program_input) } /// /// Synthesizes the circuit for test functions with program input. /// - pub fn compile_test_constraints(self, input_pairs: InputPairs) -> Result<(u32, u32), CompilerError> { + pub fn compile_test_constraints(self, input_pairs: InputPairs) -> Result<(u32, u32)> { generate_test_constraints::(self.asg.as_ref().unwrap(), input_pairs, &self.output_directory) } /// /// Returns a SHA256 checksum of the program file. /// - pub fn checksum(&self) -> Result { + pub fn checksum(&self) -> Result { // Read in the main file as string let unparsed_file = fs::read_to_string(&self.main_file_path) - .map_err(|e| CompilerError::FileReadError(self.main_file_path.clone(), e))?; + .map_err(|e| CompilerError::file_read_error(self.main_file_path.clone(), e))?; // Hash the file contents let mut hasher = Sha256::new(); @@ -334,10 +332,7 @@ impl<'a, F: PrimeField, G: GroupType> Compiler<'a, F, G> { /// /// Verifies the input to the program. /// - pub fn verify_local_data_commitment( - &self, - system_parameters: &SystemParameters, - ) -> Result { + pub fn verify_local_data_commitment(&self, system_parameters: &SystemParameters) -> Result { let result = verify_local_data_commitment(system_parameters, &self.program_input)?; Ok(result) @@ -360,10 +355,14 @@ impl<'a, F: PrimeField, G: GroupType> ConstraintSynthesizer for Compiler<' fn generate_constraints>(&self, cs: &mut CS) -> Result<(), SynthesisError> { let output_directory = self.output_directory.clone(); let package_name = self.program_name.clone(); - let result = self.compile_constraints(cs).map_err(|e| { - tracing::error!("{}", e); - SynthesisError::Unsatisfiable - })?; + + let result = match self.compile_constraints(cs) { + Err(err) => { + eprintln!("{}", err); + std::process::exit(err.exit_code()) + } + Ok(result) => result, + }; // Write results to file let output_file = OutputFile::new(&package_name); diff --git a/compiler/src/console/assert.rs b/compiler/src/console/assert.rs index ef9ef8cebc..5ec8b5d001 100644 --- a/compiler/src/console/assert.rs +++ b/compiler/src/console/assert.rs @@ -16,10 +16,9 @@ //! Enforces an assert equals statement in a compiled Leo program. -use crate::{ - errors::ConsoleError, get_indicator_value, program::ConstrainedProgram, value::ConstrainedValue, GroupType, -}; -use leo_asg::{Expression, Span}; +use crate::{get_indicator_value, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use leo_asg::Expression; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::boolean::Boolean; @@ -32,7 +31,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { indicator: &Boolean, expression: &'a Expression<'a>, span: &Span, - ) -> Result<(), ConsoleError> { + ) -> Result<()> { // Evaluate assert expression let assert_expression = self.enforce_expression(cs, expression)?; @@ -46,13 +45,13 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { let result_option = match assert_expression { ConstrainedValue::Boolean(boolean) => boolean.get_value(), _ => { - return Err(ConsoleError::assertion_must_be_boolean(span)); + return Err(CompilerError::console_assertion_must_be_boolean(span).into()); } }; - let result_bool = result_option.ok_or_else(|| ConsoleError::assertion_depends_on_input(span))?; + let result_bool = result_option.ok_or_else(|| CompilerError::console_assertion_depends_on_input(span))?; if !result_bool { - return Err(ConsoleError::assertion_failed(span)); + return Err(CompilerError::console_assertion_failed(span).into()); } Ok(()) diff --git a/compiler/src/console/console.rs b/compiler/src/console/console.rs index 46f3dee52a..89184f91af 100644 --- a/compiler/src/console/console.rs +++ b/compiler/src/console/console.rs @@ -16,8 +16,9 @@ //! Evaluates a macro in a compiled Leo program. -use crate::{errors::ConsoleError, program::ConstrainedProgram, statement::get_indicator_value, GroupType}; +use crate::{program::ConstrainedProgram, statement::get_indicator_value, GroupType}; use leo_asg::{ConsoleFunction, ConsoleStatement}; +use leo_errors::Result; use snarkvm_fields::PrimeField; use snarkvm_gadgets::boolean::Boolean; @@ -29,7 +30,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { cs: &mut CS, indicator: &Boolean, console: &ConsoleStatement<'a>, - ) -> Result<(), ConsoleError> { + ) -> Result<()> { match &console.function { ConsoleFunction::Assert(expression) => { self.evaluate_console_assert( diff --git a/compiler/src/console/format.rs b/compiler/src/console/format.rs index dd936223fc..560bb4444f 100644 --- a/compiler/src/console/format.rs +++ b/compiler/src/console/format.rs @@ -16,17 +16,15 @@ //! Evaluates a formatted string in a compiled Leo program. -use crate::{errors::ConsoleError, program::ConstrainedProgram, GroupType}; +use crate::{program::ConstrainedProgram, GroupType}; use leo_asg::{CharValue, ConsoleArgs}; +use leo_errors::{CompilerError, Result}; + use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { - pub fn format>( - &mut self, - cs: &mut CS, - args: &ConsoleArgs<'a>, - ) -> Result { + pub fn format>(&mut self, cs: &mut CS, args: &ConsoleArgs<'a>) -> Result { let mut out = Vec::new(); let mut in_container = false; let mut substring = String::new(); @@ -52,7 +50,14 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { in_container = false; let parameter = match args.parameters.get(arg_index) { Some(index) => index, - None => return Err(ConsoleError::length(arg_index + 1, args.parameters.len(), &args.span)), + None => { + return Err(CompilerError::console_container_parameter_length_mismatch( + arg_index + 1, + args.parameters.len(), + &args.span, + ) + .into()); + } }; out.push(self.enforce_expression(cs, parameter.get())?.to_string()); arg_index += 1; @@ -63,12 +68,12 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { substring.push('}'); escape_right_bracket = true; } else { - return Err(ConsoleError::expected_escaped_right_brace(&args.span)); + return Err(CompilerError::console_fmt_expected_escaped_right_brace(&args.span).into()); } } } _ if in_container => { - return Err(ConsoleError::expected_left_or_right_brace(&args.span)); + return Err(CompilerError::console_fmt_expected_left_or_right_brace(&args.span).into()); } _ => substring.push(*scalar), }, @@ -82,7 +87,12 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { // Check that containers and parameters match if arg_index != args.parameters.len() { - return Err(ConsoleError::length(arg_index, args.parameters.len(), &args.span)); + return Err(CompilerError::console_container_parameter_length_mismatch( + arg_index, + args.parameters.len(), + &args.span, + ) + .into()); } Ok(out.join("")) diff --git a/compiler/src/constraints/constraints.rs b/compiler/src/constraints/constraints.rs index 4e34b4c096..8f740ae175 100644 --- a/compiler/src/constraints/constraints.rs +++ b/compiler/src/constraints/constraints.rs @@ -16,9 +16,10 @@ //! Generates R1CS constraints for a compiled Leo program. -use crate::{errors::CompilerError, ConstrainedProgram, GroupType, Output, OutputFile}; +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; @@ -30,7 +31,7 @@ pub fn generate_constraints<'a, F: PrimeField, G: GroupType, CS: ConstraintSy cs: &mut CS, program: &Program<'a>, input: &Input, -) -> Result { +) -> Result { let mut resolved_program = ConstrainedProgram::::new(program.clone()); for (_, global_const) in program.global_consts.iter() { @@ -47,7 +48,7 @@ pub fn generate_constraints<'a, F: PrimeField, G: GroupType, CS: ConstraintSy let result = resolved_program.enforce_main_function(cs, function, input)?; Ok(result) } - _ => Err(CompilerError::NoMainFunction), + _ => Err(CompilerError::no_main_function().into()), } } @@ -55,7 +56,7 @@ pub fn generate_test_constraints<'a, F: PrimeField, G: GroupType>( program: &Program<'a>, input: InputPairs, output_directory: &Path, -) -> Result<(u32, u32), CompilerError> { +) -> Result<(u32, u32)> { let mut resolved_program = ConstrainedProgram::::new(program.clone()); let program_name = program.name.clone(); @@ -101,10 +102,12 @@ pub fn generate_test_constraints<'a, F: PrimeField, G: GroupType>( .or_else(|| input.pairs.get(&file_name_kebab)) { Some(pair) => pair.to_owned(), - None => return Err(CompilerError::InvalidTestContext(file_name.to_string())), + None => { + return Err(CompilerError::invalid_test_context(file_name).into()); + } } } - None => default.ok_or(CompilerError::NoTestInput)?, + None => default.ok_or_else(CompilerError::no_test_input)?, }; // parse input files to abstract syntax trees diff --git a/compiler/src/errors/compiler.rs b/compiler/src/errors/compiler.rs deleted file mode 100644 index d1c98b5b8b..0000000000 --- a/compiler/src/errors/compiler.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::errors::{ExpressionError, FunctionError, ImportError, StatementError}; -use leo_asg::{AsgConvertError, FormattedError}; -use leo_ast::{AstError, LeoError}; -use leo_input::InputParserError; -use leo_parser::SyntaxError; -use leo_state::LocalDataVerificationError; - -use std::path::PathBuf; - -#[derive(Debug, Error)] -pub enum CompilerError { - #[error("{}", _0)] - SyntaxError(#[from] SyntaxError), - - #[error("{}", _0)] - AsgPassError(FormattedError), - - #[error("{}", _0)] - ExpressionError(#[from] ExpressionError), - - #[error("{}", _0)] - ImportError(#[from] ImportError), - - #[error("{}", _0)] - InputParserError(#[from] InputParserError), - - #[error("Cannot find input files with context name `{}`", _0)] - InvalidTestContext(String), - - #[error("{}", _0)] - FunctionError(#[from] FunctionError), - - #[error("Cannot read from the provided file path '{:?}': {}", _0, _1)] - FileReadError(PathBuf, std::io::Error), - - #[error("{}", _0)] - LocalDataVerificationError(#[from] LocalDataVerificationError), - - #[error("`main` must be a function")] - NoMainFunction, - - #[error("Failed to find input files for the current test")] - NoTestInput, - - #[error("{}", _0)] - AsgConvertError(#[from] AsgConvertError), - - #[error("{}", _0)] - AstError(#[from] AstError), - - #[error("{}", _0)] - StatementError(#[from] StatementError), -} - -impl LeoError for CompilerError {} diff --git a/compiler/src/errors/console.rs b/compiler/src/errors/console.rs deleted file mode 100644 index 76d4538f1c..0000000000 --- a/compiler/src/errors/console.rs +++ /dev/null @@ -1,76 +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::errors::ExpressionError; -use leo_ast::{FormattedError, LeoError, Span}; - -#[derive(Debug, Error)] -pub enum ConsoleError { - #[error("{}", _0)] - Error(#[from] FormattedError), - - #[error("{}", _0)] - Expression(#[from] ExpressionError), -} - -impl LeoError for ConsoleError {} - -impl ConsoleError { - fn new_from_span(message: String, span: &Span) -> Self { - ConsoleError::Error(FormattedError::new_from_span(message, span)) - } - - pub fn expected_left_or_right_brace(span: &Span) -> Self { - let message = "Formatter given a {. Expected a { or } after".to_string(); - - Self::new_from_span(message, span) - } - - pub fn expected_escaped_right_brace(span: &Span) -> Self { - let message = "Formatter given a }. Expected a container {} or }}".to_string(); - - Self::new_from_span(message, span) - } - - pub fn length(containers: usize, parameters: usize, span: &Span) -> Self { - let message = format!( - "Formatter given {} containers and found {} parameters", - containers, parameters - ); - - Self::new_from_span(message, span) - } - - pub fn assertion_depends_on_input(span: &Span) -> Self { - let message = "console.assert() does not produce constraints and cannot use inputs. \ - Assertions should only be used in @test functions" - .to_string(); - - Self::new_from_span(message, span) - } - - pub fn assertion_failed(span: &Span) -> Self { - let message = "Assertion failed".to_string(); - - Self::new_from_span(message, span) - } - - pub fn assertion_must_be_boolean(span: &Span) -> Self { - let message = "Assertion expression must evaluate to a boolean value".to_string(); - - Self::new_from_span(message, span) - } -} diff --git a/compiler/src/errors/import.rs b/compiler/src/errors/import.rs deleted file mode 100644 index 022ec5d1b9..0000000000 --- a/compiler/src/errors/import.rs +++ /dev/null @@ -1,25 +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 leo_ast::{FormattedError, LeoError}; - -#[derive(Debug, Error)] -pub enum ImportError { - #[error("{}", _0)] - Error(#[from] FormattedError), -} - -impl LeoError for ImportError {} diff --git a/compiler/src/errors/mod.rs b/compiler/src/errors/mod.rs deleted file mode 100644 index daf4325aa2..0000000000 --- a/compiler/src/errors/mod.rs +++ /dev/null @@ -1,42 +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 compiler; -pub use self::compiler::*; - -pub mod expression; -pub use self::expression::*; - -pub mod function; -pub use self::function::*; - -pub mod import; -pub use self::import::*; - -pub mod console; -pub use self::console::*; - -pub mod output_file; -pub use self::output_file::*; - -pub mod output_bytes; -pub use self::output_bytes::*; - -pub mod statement; -pub use self::statement::*; - -pub mod value; -pub use self::value::*; diff --git a/compiler/src/errors/output_bytes.rs b/compiler/src/errors/output_bytes.rs deleted file mode 100644 index 460d21f876..0000000000 --- a/compiler/src/errors/output_bytes.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 . - -use crate::errors::ValueError; -use leo_asg::{AsgConvertError, Type}; -use leo_ast::{FormattedError, LeoError, Span}; - -#[derive(Debug, Error)] -pub enum OutputBytesError { - #[error("{}", _0)] - Error(#[from] FormattedError), - - #[error("{}", _0)] - ValueError(#[from] ValueError), - - #[error("{}", _0)] - AsgConvertError(#[from] AsgConvertError), -} - -impl LeoError for OutputBytesError {} - -impl OutputBytesError { - fn new_from_span(message: String, span: &Span) -> Self { - OutputBytesError::Error(FormattedError::new_from_span(message, span)) - } - - pub fn not_enough_registers(span: &Span) -> Self { - let message = "number of input registers must be greater than or equal to output registers".to_string(); - - Self::new_from_span(message, span) - } - - pub fn mismatched_output_types(left: &Type, right: &Type, span: &Span) -> Self { - let message = format!( - "Mismatched types. Expected register output type `{}`, found type `{}`.", - left, right - ); - - Self::new_from_span(message, span) - } -} diff --git a/compiler/src/errors/statement.rs b/compiler/src/errors/statement.rs deleted file mode 100644 index fd42cbd5d8..0000000000 --- a/compiler/src/errors/statement.rs +++ /dev/null @@ -1,193 +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::errors::{AddressError, BooleanError, ConsoleError, ExpressionError, IntegerError, ValueError}; -use leo_asg::Type; -use leo_ast::{FormattedError, LeoError, Span}; - -#[derive(Debug, Error)] -pub enum StatementError { - #[error("{}", _0)] - AddressError(#[from] AddressError), - - #[error("{}", _0)] - BooleanError(#[from] BooleanError), - - #[error("{}", _0)] - Error(#[from] FormattedError), - - #[error("{}", _0)] - ExpressionError(#[from] ExpressionError), - - #[error("{}", _0)] - IntegerError(#[from] IntegerError), - - #[error("{}", _0)] - MacroError(#[from] ConsoleError), - - #[error("{}", _0)] - ValueError(#[from] ValueError), -} - -impl LeoError for StatementError {} - -impl StatementError { - fn new_from_span(message: String, span: &Span) -> Self { - StatementError::Error(FormattedError::new_from_span(message, span)) - } - - pub fn array_assign_index(span: &Span) -> Self { - let message = "Cannot assign single index to array of values".to_string(); - - Self::new_from_span(message, span) - } - - pub fn array_assign_index_const(span: &Span) -> Self { - let message = "Cannot assign to non-const array index".to_string(); - - Self::new_from_span(message, span) - } - - pub fn array_assign_interior_index(span: &Span) -> Self { - let message = "Cannot assign single index to interior of array of values".to_string(); - - Self::new_from_span(message, span) - } - - pub fn array_assign_range(span: &Span) -> Self { - let message = "Cannot assign range of array values to single value".to_string(); - - Self::new_from_span(message, span) - } - - pub fn array_assign_index_bounds(index: usize, length: usize, span: &Span) -> Self { - let message = format!( - "Array assign index `{}` out of range for array of length `{}`", - index, length - ); - - Self::new_from_span(message, span) - } - - pub fn array_assign_range_order(start: usize, stop: usize, length: usize, span: &Span) -> Self { - let message = format!( - "Array assign range `{}`..`{}` out of range for array of length `{}`", - start, stop, length - ); - - Self::new_from_span(message, span) - } - - pub fn conditional_boolean(actual: String, span: &Span) -> Self { - let message = format!("If, else conditional must resolve to a boolean, found `{}`", actual); - - Self::new_from_span(message, span) - } - - pub fn indicator_calculation(name: String, span: &Span) -> Self { - let message = format!( - "Constraint system failed to evaluate branch selection indicator `{}`", - name - ); - - Self::new_from_span(message, span) - } - - pub fn invalid_number_of_definitions(expected: usize, actual: usize, span: &Span) -> Self { - let message = format!( - "Multiple definition statement expected {} return values, found {} values", - expected, actual - ); - - Self::new_from_span(message, span) - } - - pub fn multiple_definition(value: String, span: &Span) -> Self { - let message = format!("cannot assign multiple variables to a single value: {}", value,); - - Self::new_from_span(message, span) - } - - pub fn multiple_returns(span: &Span) -> Self { - let message = "This function returns multiple times and produces unreachable circuits with undefined behavior." - .to_string(); - - Self::new_from_span(message, span) - } - - pub fn no_returns(expected: &Type, span: &Span) -> Self { - let message = format!( - "function expected `{}` return type but no valid branches returned a result", - expected - ); - - Self::new_from_span(message, span) - } - - pub fn select_fail(first: String, second: String, span: &Span) -> Self { - let message = format!( - "Conditional select gadget failed to select between `{}` or `{}`", - first, second - ); - - Self::new_from_span(message, span) - } - - pub fn tuple_assign_index(span: &Span) -> Self { - let message = "Cannot assign single index to tuple of values".to_string(); - - Self::new_from_span(message, span) - } - - pub fn tuple_assign_index_bounds(index: usize, length: usize, span: &Span) -> Self { - let message = format!( - "Tuple assign index `{}` out of range for tuple of length `{}`", - index, length - ); - - Self::new_from_span(message, span) - } - - pub fn unassigned(span: &Span) -> Self { - let message = "Expected assignment of return values for expression".to_string(); - - Self::new_from_span(message, span) - } - - pub fn undefined_variable(name: String, span: &Span) -> Self { - let message = format!("Attempted to assign to unknown variable `{}`", name); - - Self::new_from_span(message, span) - } - - pub fn undefined_circuit(name: String, span: &Span) -> Self { - let message = format!("Attempted to assign to unknown circuit `{}`", name); - - Self::new_from_span(message, span) - } - - pub fn undefined_circuit_variable(name: String, span: &Span) -> Self { - let message = format!("Attempted to assign to unknown circuit member variable `{}`", name); - - Self::new_from_span(message, span) - } - - pub fn loop_index_const(span: &Span) -> Self { - let message = "iteration range must be const".to_string(); - - Self::new_from_span(message, span) - } -} diff --git a/compiler/src/errors/value/address.rs b/compiler/src/errors/value/address.rs deleted file mode 100644 index 2b8d4d8022..0000000000 --- a/compiler/src/errors/value/address.rs +++ /dev/null @@ -1,50 +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 leo_ast::{FormattedError, LeoError, Span}; -use snarkvm_dpc::AccountError; - -#[derive(Debug, Error)] -pub enum AddressError { - #[error("{}", _0)] - Error(#[from] FormattedError), -} - -impl LeoError for AddressError {} - -impl AddressError { - fn new_from_span(message: String, span: &Span) -> Self { - AddressError::Error(FormattedError::new_from_span(message, span)) - } - - pub fn account_error(error: AccountError, span: &Span) -> Self { - let message = format!("account creation failed due to `{}`", error); - - Self::new_from_span(message, span) - } - - pub fn invalid_address(actual: String, span: &Span) -> Self { - let message = format!("expected address input type, found `{}`", actual); - - Self::new_from_span(message, span) - } - - pub fn missing_address(span: &Span) -> Self { - let message = "expected address input not found".to_string(); - - Self::new_from_span(message, span) - } -} diff --git a/compiler/src/errors/value/boolean.rs b/compiler/src/errors/value/boolean.rs deleted file mode 100644 index 71b740dff6..0000000000 --- a/compiler/src/errors/value/boolean.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 . - -use leo_ast::{FormattedError, LeoError, Span}; -use snarkvm_r1cs::SynthesisError; - -#[derive(Debug, Error)] -pub enum BooleanError { - #[error("{}", _0)] - Error(#[from] FormattedError), -} - -impl LeoError for BooleanError {} - -impl BooleanError { - fn new_from_span(message: String, span: &Span) -> Self { - BooleanError::Error(FormattedError::new_from_span(message, span)) - } - - pub fn cannot_enforce(operation: String, error: SynthesisError, span: &Span) -> Self { - let message = format!( - "the boolean operation `{}` failed due to the synthesis error `{:?}`", - operation, error, - ); - - Self::new_from_span(message, span) - } - - pub fn cannot_evaluate(operation: String, span: &Span) -> Self { - let message = format!("no implementation found for `{}`", operation); - - Self::new_from_span(message, span) - } - - pub fn invalid_boolean(actual: String, span: &Span) -> Self { - let message = format!("expected boolean input type, found `{}`", actual); - - Self::new_from_span(message, span) - } - - pub fn missing_boolean(expected: String, span: &Span) -> Self { - let message = format!("expected boolean input `{}` not found", expected); - - Self::new_from_span(message, span) - } -} diff --git a/compiler/src/errors/value/char.rs b/compiler/src/errors/value/char.rs deleted file mode 100644 index 9220609b35..0000000000 --- a/compiler/src/errors/value/char.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::errors::FieldError; -use leo_ast::{FormattedError, LeoError, Span}; - -#[derive(Debug, Error)] -pub enum CharError { - #[error("{}", _0)] - Error(#[from] FormattedError), - - #[error("{}", _0)] - FieldError(#[from] FieldError), -} - -impl LeoError for CharError {} - -impl CharError { - fn new_from_span(message: String, span: &Span) -> Self { - CharError::Error(FormattedError::new_from_span(message, span)) - } - - pub fn invalid_char(actual: String, span: &Span) -> Self { - let message = format!("expected char element input type, found `{}`", actual); - - Self::new_from_span(message, span) - } -} diff --git a/compiler/src/errors/value/field.rs b/compiler/src/errors/value/field.rs deleted file mode 100644 index 9ec8a5f152..0000000000 --- a/compiler/src/errors/value/field.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 leo_ast::{FormattedError, LeoError, Span}; -use snarkvm_r1cs::SynthesisError; - -#[derive(Debug, Error)] -pub enum FieldError { - #[error("{}", _0)] - Error(#[from] FormattedError), -} - -impl LeoError for FieldError {} - -impl FieldError { - fn new_from_span(message: String, span: &Span) -> Self { - FieldError::Error(FormattedError::new_from_span(message, span)) - } - - pub fn negate_operation(error: SynthesisError, span: &Span) -> Self { - let message = format!("field negation failed due to synthesis error `{:?}`", error,); - - Self::new_from_span(message, span) - } - - pub fn binary_operation(operation: String, error: SynthesisError, span: &Span) -> Self { - let message = format!( - "the field binary operation `{}` failed due to synthesis error `{:?}`", - operation, error, - ); - - Self::new_from_span(message, span) - } - - pub fn invalid_field(actual: String, span: &Span) -> Self { - let message = format!("expected field element input type, found `{}`", actual); - - Self::new_from_span(message, span) - } - - pub fn missing_field(expected: String, span: &Span) -> Self { - let message = format!("expected field input `{}` not found", expected); - - Self::new_from_span(message, span) - } - - pub fn no_inverse(field: String, span: &Span) -> Self { - let message = format!("no multiplicative inverse found for field `{}`", field); - - Self::new_from_span(message, span) - } -} diff --git a/compiler/src/errors/value/group.rs b/compiler/src/errors/value/group.rs deleted file mode 100644 index ae3bd107d0..0000000000 --- a/compiler/src/errors/value/group.rs +++ /dev/null @@ -1,101 +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 leo_ast::{FormattedError, LeoError, Span}; -use snarkvm_r1cs::SynthesisError; - -#[derive(Debug, Error)] -pub enum GroupError { - #[error("{}", _0)] - Error(#[from] FormattedError), -} - -impl LeoError for GroupError {} - -impl GroupError { - fn new_from_span(message: String, span: &Span) -> Self { - GroupError::Error(FormattedError::new_from_span(message, span)) - } - - pub fn negate_operation(error: SynthesisError, span: &Span) -> Self { - let message = format!("group negation failed due to the synthesis error `{:?}`", error,); - - Self::new_from_span(message, span) - } - - pub fn binary_operation(operation: String, error: SynthesisError, span: &Span) -> Self { - let message = format!( - "the group binary operation `{}` failed due to the synthesis error `{:?}`", - operation, error, - ); - - Self::new_from_span(message, span) - } - - pub fn invalid_group(actual: String, span: &Span) -> Self { - let message = format!("expected group affine point input type, found `{}`", actual); - - Self::new_from_span(message, span) - } - - pub fn missing_group(expected: String, span: &Span) -> Self { - let message = format!("expected group input `{}` not found", expected); - - Self::new_from_span(message, span) - } - - pub fn synthesis_error(error: SynthesisError, span: &Span) -> Self { - let message = format!("compilation failed due to group synthesis error `{:?}`", error); - - Self::new_from_span(message, span) - } - - pub fn x_invalid(x: String, span: &Span) -> Self { - let message = format!("invalid x coordinate `{}`", x); - - Self::new_from_span(message, span) - } - - pub fn y_invalid(y: String, span: &Span) -> Self { - let message = format!("invalid y coordinate `{}`", y); - - Self::new_from_span(message, span) - } - - pub fn not_on_curve(element: String, span: &Span) -> Self { - let message = format!("group element `{}` is not on the supported curve", element); - - Self::new_from_span(message, span) - } - - pub fn x_recover(span: &Span) -> Self { - let message = "could not recover group element from x coordinate".to_string(); - - Self::new_from_span(message, span) - } - - pub fn y_recover(span: &Span) -> Self { - let message = "could not recover group element from y coordinate".to_string(); - - Self::new_from_span(message, span) - } - - pub fn n_group(number: String, span: &Span) -> Self { - let message = format!("cannot multiply group generator by \"{}\"", number); - - Self::new_from_span(message, span) - } -} diff --git a/compiler/src/errors/value/integer.rs b/compiler/src/errors/value/integer.rs deleted file mode 100644 index f27ce2f071..0000000000 --- a/compiler/src/errors/value/integer.rs +++ /dev/null @@ -1,94 +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 leo_ast::{FormattedError, LeoError, Span}; - -use snarkvm_gadgets::errors::{SignedIntegerError, UnsignedIntegerError}; -use snarkvm_r1cs::SynthesisError; - -#[derive(Debug, Error)] -pub enum IntegerError { - #[error("{}", _0)] - Error(#[from] FormattedError), -} - -impl LeoError for IntegerError {} - -impl IntegerError { - fn new_from_span(message: String, span: &Span) -> Self { - IntegerError::Error(FormattedError::new_from_span(message, span)) - } - - pub fn signed(error: SignedIntegerError, span: &Span) -> Self { - let message = format!("integer operation failed due to the signed integer error `{:?}`", error); - - Self::new_from_span(message, span) - } - - pub fn unsigned(error: UnsignedIntegerError, span: &Span) -> Self { - let message = format!( - "integer operation failed due to the unsigned integer error `{:?}`", - error - ); - - Self::new_from_span(message, span) - } - - pub fn synthesis(error: SynthesisError, span: &Span) -> Self { - let message = format!("integer operation failed due to the synthesis error `{}`", error); - - Self::new_from_span(message, span) - } - - pub fn negate_operation(span: &Span) -> Self { - let message = "integer negation can only be enforced on signed integers".to_string(); - - Self::new_from_span(message, span) - } - - pub fn binary_operation(operation: String, span: &Span) -> Self { - let message = format!( - "the integer binary operation `{}` can only be enforced on integers of the same type", - operation - ); - - Self::new_from_span(message, span) - } - - pub fn integer_type_mismatch(expected: String, received: String, span: &Span) -> Self { - let message = format!("expected data type `{}`, found `{}`", expected, received); - - Self::new_from_span(message, span) - } - - pub fn invalid_integer(actual: String, span: &Span) -> Self { - let message = format!("failed to parse `{}` as expected integer type", actual); - - Self::new_from_span(message, span) - } - - pub fn missing_integer(expected: String, span: &Span) -> Self { - let message = format!("expected integer input `{}` not found", expected); - - Self::new_from_span(message, span) - } - - pub fn cannot_evaluate(operation: String, span: &Span) -> Self { - let message = format!("no implementation found for `{}`", operation); - - Self::new_from_span(message, span) - } -} diff --git a/compiler/src/errors/value/mod.rs b/compiler/src/errors/value/mod.rs deleted file mode 100644 index 74a2fa1c84..0000000000 --- a/compiler/src/errors/value/mod.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 . - -pub mod address; -pub use self::address::*; - -pub mod boolean; -pub use self::boolean::*; - -pub mod char; -pub use self::char::*; - -pub mod field; -pub use self::field::*; - -pub mod group; -pub use self::group::*; - -pub mod integer; -pub use self::integer::*; - -pub mod value; -pub use self::value::*; diff --git a/compiler/src/errors/value/value.rs b/compiler/src/errors/value/value.rs deleted file mode 100644 index bd34b788c8..0000000000 --- a/compiler/src/errors/value/value.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::errors::{AddressError, BooleanError, FieldError, GroupError, IntegerError}; -use leo_ast::{FormattedError, LeoError}; - -#[derive(Debug, Error)] -pub enum ValueError { - #[error("{}", _0)] - AddressError(#[from] AddressError), - - #[error("{}", _0)] - BooleanError(#[from] BooleanError), - - #[error("{}", _0)] - Error(#[from] FormattedError), - - #[error("{}", _0)] - FieldError(#[from] FieldError), - - #[error("{}", _0)] - GroupError(#[from] GroupError), - - #[error("{}", _0)] - IntegerError(#[from] IntegerError), -} - -impl LeoError for ValueError {} diff --git a/compiler/src/expression/arithmetic/add.rs b/compiler/src/expression/arithmetic/add.rs index a5c787f948..187a6377f8 100644 --- a/compiler/src/expression/arithmetic/add.rs +++ b/compiler/src/expression/arithmetic/add.rs @@ -16,8 +16,8 @@ //! Enforces an arithmetic `+` operator in a resolved Leo program. -use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_ast::Span; +use crate::{value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -27,7 +27,7 @@ pub fn enforce_add<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( left: ConstrainedValue<'a, F, G>, right: ConstrainedValue<'a, F, G>, span: &Span, -) -> Result, ExpressionError> { +) -> Result> { match (left, right) { (ConstrainedValue::Integer(num_1), ConstrainedValue::Integer(num_2)) => { Ok(ConstrainedValue::Integer(num_1.add(cs, num_2, span)?)) @@ -38,9 +38,8 @@ pub fn enforce_add<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( (ConstrainedValue::Group(point_1), ConstrainedValue::Group(point_2)) => { Ok(ConstrainedValue::Group(point_1.add(cs, &point_2, span)?)) } - (val_1, val_2) => Err(ExpressionError::incompatible_types( - format!("{} + {}", val_1, val_2), - span, - )), + (val_1, val_2) => { + return Err(CompilerError::incompatible_types(format!("{} + {}", val_1, val_2), span).into()); + } } } diff --git a/compiler/src/expression/arithmetic/bit_not.rs b/compiler/src/expression/arithmetic/bit_not.rs index 3f6f973839..639fb5aac1 100644 --- a/compiler/src/expression/arithmetic/bit_not.rs +++ b/compiler/src/expression/arithmetic/bit_not.rs @@ -16,14 +16,14 @@ //! Enforces a logical `!` operator in a resolved Leo program. -use crate::{errors::IntegerError, value::ConstrainedValue, GroupType}; -use leo_asg::Span; +use crate::{value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; pub fn evaluate_bit_not<'a, F: PrimeField, G: GroupType>( value: ConstrainedValue<'a, F, G>, span: &Span, -) -> Result, IntegerError> { - Err(IntegerError::cannot_evaluate(format!("!{}", value), span)) +) -> Result> { + return Err(CompilerError::cannot_evaluate_expression(format!("!{}", value), span).into()); } diff --git a/compiler/src/expression/arithmetic/div.rs b/compiler/src/expression/arithmetic/div.rs index dee8aeac58..b7020fa73a 100644 --- a/compiler/src/expression/arithmetic/div.rs +++ b/compiler/src/expression/arithmetic/div.rs @@ -16,8 +16,8 @@ //! Enforces an arithmetic `/` operator in a resolved Leo program. -use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_ast::Span; +use crate::{value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -27,7 +27,7 @@ pub fn enforce_div<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( left: ConstrainedValue<'a, F, G>, right: ConstrainedValue<'a, F, G>, span: &Span, -) -> Result, ExpressionError> { +) -> Result> { match (left, right) { (ConstrainedValue::Integer(num_1), ConstrainedValue::Integer(num_2)) => { Ok(ConstrainedValue::Integer(num_1.div(cs, num_2, span)?)) @@ -35,9 +35,8 @@ pub fn enforce_div<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( (ConstrainedValue::Field(field_1), ConstrainedValue::Field(field_2)) => { Ok(ConstrainedValue::Field(field_1.div(cs, &field_2, span)?)) } - (val_1, val_2) => Err(ExpressionError::incompatible_types( - format!("{} / {}", val_1, val_2,), - span, - )), + (val_1, val_2) => { + return Err(CompilerError::incompatible_types(format!("{} / {}", val_1, val_2,), span).into()); + } } } diff --git a/compiler/src/expression/arithmetic/mul.rs b/compiler/src/expression/arithmetic/mul.rs index 92468eb7a4..3ccb38dda6 100644 --- a/compiler/src/expression/arithmetic/mul.rs +++ b/compiler/src/expression/arithmetic/mul.rs @@ -16,8 +16,8 @@ //! Enforces an arithmetic `*` operator in a resolved Leo program. -use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_ast::Span; +use crate::{value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -27,7 +27,7 @@ pub fn enforce_mul<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( left: ConstrainedValue<'a, F, G>, right: ConstrainedValue<'a, F, G>, span: &Span, -) -> Result, ExpressionError> { +) -> Result> { match (left, right) { (ConstrainedValue::Integer(num_1), ConstrainedValue::Integer(num_2)) => { Ok(ConstrainedValue::Integer(num_1.mul(cs, num_2, span)?)) @@ -35,9 +35,8 @@ pub fn enforce_mul<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( (ConstrainedValue::Field(field_1), ConstrainedValue::Field(field_2)) => { Ok(ConstrainedValue::Field(field_1.mul(cs, &field_2, span)?)) } - (val_1, val_2) => Err(ExpressionError::incompatible_types( - format!("{} * {}", val_1, val_2), - span, - )), + (val_1, val_2) => { + return Err(CompilerError::incompatible_types(format!("{} * {}", val_1, val_2), span).into()); + } } } diff --git a/compiler/src/expression/arithmetic/negate.rs b/compiler/src/expression/arithmetic/negate.rs index 2781f66148..165f99ec73 100644 --- a/compiler/src/expression/arithmetic/negate.rs +++ b/compiler/src/expression/arithmetic/negate.rs @@ -16,8 +16,8 @@ //! Enforces a unary negate `-` operator in a resolved Leo program. -use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_ast::Span; +use crate::{value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -26,11 +26,11 @@ pub fn enforce_negate<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem, span: &Span, -) -> Result, ExpressionError> { +) -> Result> { match value { ConstrainedValue::Integer(integer) => Ok(ConstrainedValue::Integer(integer.negate(cs, span)?)), ConstrainedValue::Field(field) => Ok(ConstrainedValue::Field(field.negate(cs, span)?)), ConstrainedValue::Group(group) => Ok(ConstrainedValue::Group(group.negate(cs, span)?)), - value => Err(ExpressionError::incompatible_types(format!("-{}", value), span)), + value => return Err(CompilerError::incompatible_types(format!("-{}", value), span).into()), } } diff --git a/compiler/src/expression/arithmetic/pow.rs b/compiler/src/expression/arithmetic/pow.rs index 001d9be286..6202b98277 100644 --- a/compiler/src/expression/arithmetic/pow.rs +++ b/compiler/src/expression/arithmetic/pow.rs @@ -16,8 +16,8 @@ //! Enforces an arithmetic `**` operator in a resolved Leo program. -use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_ast::Span; +use crate::{value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -27,14 +27,13 @@ pub fn enforce_pow<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( left: ConstrainedValue<'a, F, G>, right: ConstrainedValue<'a, F, G>, span: &Span, -) -> Result, ExpressionError> { +) -> Result> { match (left, right) { (ConstrainedValue::Integer(num_1), ConstrainedValue::Integer(num_2)) => { Ok(ConstrainedValue::Integer(num_1.pow(cs, num_2, span)?)) } - (val_1, val_2) => Err(ExpressionError::incompatible_types( - format!("{} ** {}", val_1, val_2,), - span, - )), + (val_1, val_2) => { + return Err(CompilerError::incompatible_types(format!("{} ** {}", val_1, val_2,), span).into()); + } } } diff --git a/compiler/src/expression/arithmetic/sub.rs b/compiler/src/expression/arithmetic/sub.rs index cf12de9c53..5c2a4b3b8a 100644 --- a/compiler/src/expression/arithmetic/sub.rs +++ b/compiler/src/expression/arithmetic/sub.rs @@ -16,8 +16,8 @@ //! Enforces an arithmetic `-` operator in a resolved Leo program. -use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_ast::Span; +use crate::{value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -27,7 +27,7 @@ pub fn enforce_sub<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( left: ConstrainedValue<'a, F, G>, right: ConstrainedValue<'a, F, G>, span: &Span, -) -> Result, ExpressionError> { +) -> Result> { match (left, right) { (ConstrainedValue::Integer(num_1), ConstrainedValue::Integer(num_2)) => { Ok(ConstrainedValue::Integer(num_1.sub(cs, num_2, span)?)) @@ -38,9 +38,8 @@ pub fn enforce_sub<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( (ConstrainedValue::Group(point_1), ConstrainedValue::Group(point_2)) => { Ok(ConstrainedValue::Group(point_1.sub(cs, &point_2, span)?)) } - (val_1, val_2) => Err(ExpressionError::incompatible_types( - format!("{} - {}", val_1, val_2), - span, - )), + (val_1, val_2) => { + return Err(CompilerError::incompatible_types(format!("{} - {}", val_1, val_2), span).into()); + } } } diff --git a/compiler/src/expression/array/access.rs b/compiler/src/expression/array/access.rs index 0fd6e7f5fb..340d412561 100644 --- a/compiler/src/expression/array/access.rs +++ b/compiler/src/expression/array/access.rs @@ -20,13 +20,13 @@ use std::convert::TryInto; use crate::{ arithmetic::*, - errors::ExpressionError, program::ConstrainedProgram, relational::*, value::{ConstrainedValue, Integer}, GroupType, }; -use leo_asg::{ConstInt, Expression, Span}; +use leo_asg::{ConstInt, Expression}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::{ @@ -45,7 +45,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { index_resolved: &Integer, array_len: u32, span: &Span, - ) -> Result<(), ExpressionError> { + ) -> Result<()> { let bounds_check = evaluate_lt::( cs, ConstrainedValue::Integer(index_resolved.clone()), @@ -62,7 +62,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { let mut unique_namespace = cs.ns(|| namespace_string); bounds_check .enforce_equal(&mut unique_namespace, &Boolean::Constant(true)) - .map_err(|e| ExpressionError::cannot_enforce("array bounds check".to_string(), e, span))?; + .map_err(|e| CompilerError::cannot_enforce_expression("array bounds check", e, span))?; Ok(()) } @@ -73,27 +73,28 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { array: &'a Expression<'a>, index: &'a Expression<'a>, span: &Span, - ) -> Result, ExpressionError> { + ) -> Result> { let mut array = match self.enforce_expression(cs, array)? { ConstrainedValue::Array(array) => array, - value => return Err(ExpressionError::undefined_array(value.to_string(), span)), + value => return Err(CompilerError::undefined_array(value.to_string(), span).into()), }; let index_resolved = self.enforce_index(cs, index, span)?; if let Some(resolved) = index_resolved.to_usize() { if resolved >= array.len() { - return Err(ExpressionError::array_index_out_of_bounds(resolved, span)); + return Err(CompilerError::array_index_out_of_bounds(resolved, span).into()); } Ok(array[resolved].to_owned()) } else { if array.is_empty() { - return Err(ExpressionError::array_index_out_of_bounds(0, span)); + return Err(CompilerError::array_index_out_of_bounds(0, span).into()); } + { let array_len: u32 = array .len() .try_into() - .map_err(|_| ExpressionError::array_length_out_of_bounds(span))?; + .map_err(|_| CompilerError::array_length_out_of_bounds(span))?; self.array_bounds_check(cs, &index_resolved, array_len, span)?; } @@ -104,17 +105,17 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { let index_bounded = i .try_into() - .map_err(|_| ExpressionError::array_index_out_of_legal_bounds(span))?; + .map_err(|_| CompilerError::array_index_out_of_legal_bounds(span))?; let const_index = ConstInt::U32(index_bounded).cast_to(&index_resolved.get_type()); let index_comparison = index_resolved .evaluate_equal(eq_namespace, &Integer::new(&const_index)) - .map_err(|_| ExpressionError::cannot_evaluate("==".to_string(), span))?; + .map_err(|_| CompilerError::cannot_evaluate_expression("==", span))?; let unique_namespace = cs.ns(|| format!("select array access {} {}:{}", i, span.line_start, span.col_start)); let value = ConstrainedValue::conditionally_select(unique_namespace, &index_comparison, &item, ¤t_value) - .map_err(|e| ExpressionError::cannot_enforce("conditional select".to_string(), e, span))?; + .map_err(|e| CompilerError::cannot_enforce_expression("conditional select", e, span))?; current_value = value; } Ok(current_value) @@ -130,10 +131,10 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { right: Option<&'a Expression<'a>>, length: usize, span: &Span, - ) -> Result, ExpressionError> { + ) -> Result> { let array = match self.enforce_expression(cs, array)? { ConstrainedValue::Array(array) => array, - value => return Err(ExpressionError::undefined_array(value.to_string(), span)), + value => return Err(CompilerError::undefined_array(value, span).into()), }; let from_resolved = match left { @@ -146,7 +147,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { let index_bounded: u32 = array .len() .try_into() - .map_err(|_| ExpressionError::array_length_out_of_bounds(span))?; + .map_err(|_| CompilerError::array_length_out_of_bounds(span))?; Integer::new(&ConstInt::U32(index_bounded)) } // Array slice ends at array length }; @@ -158,10 +159,10 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { }; Ok(if let Some((left, right)) = const_dimensions { if right - left != length { - return Err(ExpressionError::array_invalid_slice_length(span)); + return Err(CompilerError::array_invalid_slice_length(span).into()); } if right > array.len() { - return Err(ExpressionError::array_index_out_of_bounds(right, span)); + return Err(CompilerError::array_index_out_of_bounds(right, span).into()); } ConstrainedValue::Array(array[left..right].to_owned()) } else { @@ -183,7 +184,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { let mut unique_namespace = cs.ns(|| namespace_string); calc_len .enforce_equal(&mut unique_namespace, &Integer::new(&ConstInt::U32(length as u32))) - .map_err(|e| ExpressionError::cannot_enforce("array length check".to_string(), e, span))?; + .map_err(|e| CompilerError::cannot_enforce_expression("array length check", e, span))?; } { let bounds_check = evaluate_le::( @@ -203,7 +204,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { let mut unique_namespace = cs.ns(|| namespace_string); bounds_check .enforce_equal(&mut unique_namespace, &Boolean::Constant(true)) - .map_err(|e| ExpressionError::cannot_enforce("array bounds check".to_string(), e, span))?; + .map_err(|e| CompilerError::cannot_enforce_expression("array bounds check", e, span))?; } let mut windows = array.windows(length); let mut result = ConstrainedValue::Array(vec![]); @@ -232,7 +233,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { let unique_namespace = unique_namespace.ns(|| format!("array index {} {}:{}", i, span.line_start, span.col_start)); result = ConstrainedValue::conditionally_select(unique_namespace, &equality, &array_value, &result) - .map_err(|e| ExpressionError::cannot_enforce("conditional select".to_string(), e, span))?; + .map_err(|e| CompilerError::cannot_enforce_expression("conditional select", e, span))?; } result }) diff --git a/compiler/src/expression/array/array.rs b/compiler/src/expression/array/array.rs index f643850bc0..e8c3979c39 100644 --- a/compiler/src/expression/array/array.rs +++ b/compiler/src/expression/array/array.rs @@ -18,8 +18,9 @@ use std::cell::Cell; -use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_asg::{Expression, Span}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use leo_asg::Expression; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -31,8 +32,8 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { cs: &mut CS, array: &[(Cell<&'a Expression<'a>>, bool)], span: &Span, - ) -> Result, ExpressionError> { - let expected_dimension = None; + ) -> Result> { + let expected_dimension: Option = None; let mut result = vec![]; for (element, is_spread) in array.iter() { @@ -51,7 +52,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { if let Some(dimension) = expected_dimension { // Return an error if the expected dimension != the actual dimension. if dimension != result.len() { - return Err(ExpressionError::invalid_length(dimension, result.len(), span)); + return Err(CompilerError::unexpected_array_length(dimension, result.len(), span).into()); } } @@ -67,7 +68,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { cs: &mut CS, element_expression: &'a Expression<'a>, actual_size: usize, - ) -> Result, ExpressionError> { + ) -> Result> { let mut value = self.enforce_expression(cs, element_expression)?; // Allocate the array. diff --git a/compiler/src/expression/array/index.rs b/compiler/src/expression/array/index.rs index 7254090320..8873325eb8 100644 --- a/compiler/src/expression/array/index.rs +++ b/compiler/src/expression/array/index.rs @@ -16,8 +16,9 @@ //! Enforces an array index expression in a compiled Leo program. -use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType, Integer}; -use leo_asg::{Expression, Span}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType, Integer}; +use leo_asg::Expression; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -28,10 +29,10 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { cs: &mut CS, index: &'a Expression<'a>, span: &Span, - ) -> Result { + ) -> Result { match self.enforce_expression(cs, index)? { ConstrainedValue::Integer(number) => Ok(number), - value => Err(ExpressionError::invalid_index(value.to_string(), span)), + value => Err(CompilerError::invalid_index_expression(value, span).into()), } } } diff --git a/compiler/src/expression/binary/binary.rs b/compiler/src/expression/binary/binary.rs index 943bbacb64..be91649e3f 100644 --- a/compiler/src/expression/binary/binary.rs +++ b/compiler/src/expression/binary/binary.rs @@ -16,8 +16,9 @@ //! Enforces a binary expression in a compiled Leo program. -use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; use leo_asg::Expression; +use leo_errors::Result; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -31,7 +32,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { cs: &mut CS, left: &'a Expression<'a>, right: &'a Expression<'a>, - ) -> Result, ExpressionError> { + ) -> Result> { let resolved_left = { let mut left_namespace = cs.ns(|| "left".to_string()); self.enforce_expression(&mut left_namespace, left)? diff --git a/compiler/src/expression/circuit/access.rs b/compiler/src/expression/circuit/access.rs index 671e6543cc..58c0aa9a08 100644 --- a/compiler/src/expression/circuit/access.rs +++ b/compiler/src/expression/circuit/access.rs @@ -16,8 +16,9 @@ //! Enforces a circuit access expression in a compiled Leo program. -use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; use leo_asg::{CircuitAccessExpression, Node}; +use leo_errors::{CompilerError, Result}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -28,7 +29,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { &mut self, cs: &mut CS, expr: &CircuitAccessExpression<'a>, - ) -> Result, ExpressionError> { + ) -> Result> { if let Some(target) = expr.target.get() { //todo: we can prob pass values by ref here to avoid copying the entire circuit on access let target_value = self.enforce_expression(cs, target)?; @@ -38,23 +39,22 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { if let Some(member) = members.into_iter().find(|x| x.0.name == expr.member.name) { Ok(member.1) } else { - Err(ExpressionError::undefined_member_access( - expr.circuit.get().name.borrow().to_string(), - expr.member.to_string(), + return Err(CompilerError::undefined_circuit_member_access( + expr.circuit.get().name.borrow(), + &expr.member.name, &expr.member.span, - )) + ) + .into()); } } - value => Err(ExpressionError::undefined_circuit( - value.to_string(), - &target.span().cloned().unwrap_or_default(), - )), + value => { + return Err( + CompilerError::undefined_circuit(value, &target.span().cloned().unwrap_or_default()).into(), + ); + } } } else { - Err(ExpressionError::invalid_static_access( - expr.member.to_string(), - &expr.member.span, - )) + Err(CompilerError::invalid_circuit_static_member_access(&expr.member.name, &expr.member.span).into()) } } } diff --git a/compiler/src/expression/circuit/circuit.rs b/compiler/src/expression/circuit/circuit.rs index d5630a741f..7732d9b938 100644 --- a/compiler/src/expression/circuit/circuit.rs +++ b/compiler/src/expression/circuit/circuit.rs @@ -17,12 +17,12 @@ //! Enforces a circuit expression in a compiled Leo program. use crate::{ - errors::ExpressionError, program::ConstrainedProgram, value::{ConstrainedCircuitMember, ConstrainedValue}, GroupType, }; -use leo_asg::{CircuitInitExpression, CircuitMember, Span}; +use leo_asg::{CircuitInitExpression, CircuitMember}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -33,7 +33,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { cs: &mut CS, expr: &CircuitInitExpression<'a>, span: &Span, - ) -> Result, ExpressionError> { + ) -> Result> { let circuit = expr.circuit.get(); let members = circuit.members.borrow(); @@ -49,7 +49,9 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { let variable_value = self.enforce_expression(cs, inner.get())?; resolved_members.push(ConstrainedCircuitMember(name.clone(), variable_value)); } - _ => return Err(ExpressionError::expected_circuit_member(name.to_string(), span)), + _ => { + return Err(CompilerError::expected_circuit_member(name, span).into()); + } } } diff --git a/compiler/src/expression/conditional/conditional.rs b/compiler/src/expression/conditional/conditional.rs index 5502b76523..661aef7335 100644 --- a/compiler/src/expression/conditional/conditional.rs +++ b/compiler/src/expression/conditional/conditional.rs @@ -16,8 +16,9 @@ //! Enforces a conditional expression in a compiled Leo program. -use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_asg::{Expression, Span}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use leo_asg::Expression; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::traits::select::CondSelectGadget; @@ -33,10 +34,12 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { first: &'a Expression<'a>, second: &'a Expression<'a>, span: &Span, - ) -> Result, ExpressionError> { + ) -> Result> { let conditional_value = match self.enforce_expression(cs, conditional)? { ConstrainedValue::Boolean(resolved) => resolved, - value => return Err(ExpressionError::conditional_boolean(value.to_string(), span)), + value => { + return Err(CompilerError::conditional_boolean_expression_fails_to_resolve_to_bool(value, span).into()); + } }; let first_value = self.enforce_expression(cs, first)?; @@ -50,7 +53,9 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { ) }); - ConstrainedValue::conditionally_select(unique_namespace, &conditional_value, &first_value, &second_value) - .map_err(|e| ExpressionError::cannot_enforce("conditional select".to_string(), e, span)) + Ok( + ConstrainedValue::conditionally_select(unique_namespace, &conditional_value, &first_value, &second_value) + .map_err(|e| CompilerError::cannot_enforce_expression("conditional select", e, span))?, + ) } } diff --git a/compiler/src/expression/expression.rs b/compiler/src/expression/expression.rs index da22053fd1..4191a95a2c 100644 --- a/compiler/src/expression/expression.rs +++ b/compiler/src/expression/expression.rs @@ -18,7 +18,6 @@ use crate::{ arithmetic::*, - errors::ExpressionError, logical::*, program::ConstrainedProgram, relational::*, @@ -26,7 +25,8 @@ use crate::{ value::{Address, Char, CharType, ConstrainedCircuitMember, ConstrainedValue, Integer}, FieldType, GroupType, }; -use leo_asg::{expression::*, ConstValue, Expression, Node, Span}; +use leo_asg::{expression::*, ConstValue, Expression, Node}; +use leo_errors::{Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::boolean::Boolean; @@ -38,7 +38,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { cs: &mut CS, value: &'a ConstValue<'a>, span: &Span, - ) -> Result, ExpressionError> { + ) -> Result> { Ok(match value { ConstValue::Address(value) => ConstrainedValue::Address(Address::constant(value.to_string(), span)?), ConstValue::Boolean(value) => ConstrainedValue::Boolean(Boolean::Constant(*value)), @@ -92,7 +92,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { &mut self, cs: &mut CS, expression: &'a Expression<'a>, - ) -> Result, ExpressionError> { + ) -> Result> { let span = &expression.span().cloned().unwrap_or_default(); match expression { // Cast @@ -116,15 +116,10 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { BinaryOperation::Mul => enforce_mul(cs, resolved_left, resolved_right, span), BinaryOperation::Div => enforce_div(cs, resolved_left, resolved_right, span), BinaryOperation::Pow => enforce_pow(cs, resolved_left, resolved_right, span), - BinaryOperation::Or => { - enforce_or(cs, resolved_left, resolved_right, span).map_err(ExpressionError::BooleanError) - } - BinaryOperation::And => { - enforce_and(cs, resolved_left, resolved_right, span).map_err(ExpressionError::BooleanError) - } + BinaryOperation::Or => enforce_or(cs, resolved_left, resolved_right, span), + BinaryOperation::And => enforce_and(cs, resolved_left, resolved_right, span), BinaryOperation::Eq => evaluate_eq(cs, resolved_left, resolved_right, span), - BinaryOperation::Ne => evaluate_not(evaluate_eq(cs, resolved_left, resolved_right, span)?, span) - .map_err(ExpressionError::BooleanError), + BinaryOperation::Ne => evaluate_not(evaluate_eq(cs, resolved_left, resolved_right, span)?, span), BinaryOperation::Ge => evaluate_ge(cs, resolved_left, resolved_right, span), BinaryOperation::Gt => evaluate_gt(cs, resolved_left, resolved_right, span), BinaryOperation::Le => evaluate_le(cs, resolved_left, resolved_right, span), diff --git a/compiler/src/expression/function/core_circuit.rs b/compiler/src/expression/function/core_circuit.rs index c1a467724d..3a596b132c 100644 --- a/compiler/src/expression/function/core_circuit.rs +++ b/compiler/src/expression/function/core_circuit.rs @@ -18,8 +18,9 @@ use std::cell::Cell; use crate::{program::ConstrainedProgram, value::ConstrainedValue, CoreCircuit, GroupType}; -use crate::errors::ExpressionError; -use leo_asg::{Expression, Function, Span}; +use leo_asg::{Expression, Function}; +use leo_errors::{Result, Span}; + use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -34,7 +35,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { target: Option<&'a Expression<'a>>, arguments: &[Cell<&'a Expression<'a>>], span: &Span, - ) -> Result, ExpressionError> { + ) -> Result> { let target_value = target.map(|target| self.enforce_expression(cs, target)).transpose()?; // Get the value of each core function argument diff --git a/compiler/src/expression/function/function.rs b/compiler/src/expression/function/function.rs index 58f2f0b3d4..538945ef81 100644 --- a/compiler/src/expression/function/function.rs +++ b/compiler/src/expression/function/function.rs @@ -18,8 +18,9 @@ use std::cell::Cell; -use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_asg::{Expression, Function, Span}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use leo_asg::{Expression, Function}; +use leo_errors::{Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -33,7 +34,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { target: Option<&'a Expression<'a>>, arguments: &[Cell<&'a Expression<'a>>], span: &Span, - ) -> Result, ExpressionError> { + ) -> Result> { let name_unique = || { format!( "function call {} {}:{}", @@ -43,9 +44,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { ) }; - let return_value = self - .enforce_function(&mut cs.ns(name_unique), function, target, arguments) - .map_err(|error| ExpressionError::from(Box::new(error)))?; + let return_value = self.enforce_function(&mut cs.ns(name_unique), function, target, arguments)?; Ok(return_value) } diff --git a/compiler/src/expression/logical/and.rs b/compiler/src/expression/logical/and.rs index 51dd5996b8..50c1526eff 100644 --- a/compiler/src/expression/logical/and.rs +++ b/compiler/src/expression/logical/and.rs @@ -16,8 +16,8 @@ //! Enforces a logical `&&` operator in a resolved Leo program. -use crate::{errors::BooleanError, value::ConstrainedValue, GroupType}; -use leo_asg::Span; +use crate::{value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::boolean::Boolean; @@ -28,7 +28,7 @@ pub fn enforce_and<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( left: ConstrainedValue<'a, F, G>, right: ConstrainedValue<'a, F, G>, span: &Span, -) -> Result, BooleanError> { +) -> Result> { let name = format!("{} && {}", left, right); if let (ConstrainedValue::Boolean(left_bool), ConstrainedValue::Boolean(right_bool)) = (left, right) { @@ -37,10 +37,10 @@ pub fn enforce_and<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( &left_bool, &right_bool, ) - .map_err(|e| BooleanError::cannot_enforce("&&".to_string(), e, span))?; + .map_err(|e| CompilerError::cannot_enforce_expression("&&", e, span))?; return Ok(ConstrainedValue::Boolean(result)); } - Err(BooleanError::cannot_evaluate(name, span)) + Err(CompilerError::cannot_evaluate_expression(name, span).into()) } diff --git a/compiler/src/expression/logical/not.rs b/compiler/src/expression/logical/not.rs index 98fc04317f..8ebc132037 100644 --- a/compiler/src/expression/logical/not.rs +++ b/compiler/src/expression/logical/not.rs @@ -16,17 +16,19 @@ //! Enforces a logical `!` operator in a resolved Leo program. -use crate::{errors::BooleanError, value::ConstrainedValue, GroupType}; -use leo_asg::Span; +use crate::{value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; pub fn evaluate_not<'a, F: PrimeField, G: GroupType>( value: ConstrainedValue<'a, F, G>, span: &Span, -) -> Result, BooleanError> { +) -> Result> { match value { ConstrainedValue::Boolean(boolean) => Ok(ConstrainedValue::Boolean(boolean.not())), - value => Err(BooleanError::cannot_evaluate(format!("!{}", value), span)), + value => { + return Err(CompilerError::cannot_evaluate_expression(format!("!{}", value), span).into()); + } } } diff --git a/compiler/src/expression/logical/or.rs b/compiler/src/expression/logical/or.rs index e7b0e2c5ae..f8ab3a9f84 100644 --- a/compiler/src/expression/logical/or.rs +++ b/compiler/src/expression/logical/or.rs @@ -16,8 +16,8 @@ //! Enforces a logical `||` operator in a resolved Leo program. -use crate::{errors::BooleanError, value::ConstrainedValue, GroupType}; -use leo_asg::Span; +use crate::{value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::boolean::Boolean; @@ -28,7 +28,7 @@ pub fn enforce_or<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( left: ConstrainedValue<'a, F, G>, right: ConstrainedValue<'a, F, G>, span: &Span, -) -> Result, BooleanError> { +) -> Result> { let name = format!("{} || {}", left, right); if let (ConstrainedValue::Boolean(left_bool), ConstrainedValue::Boolean(right_bool)) = (left, right) { @@ -37,10 +37,10 @@ pub fn enforce_or<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( &left_bool, &right_bool, ) - .map_err(|e| BooleanError::cannot_enforce("||".to_string(), e, span))?; + .map_err(|e| CompilerError::cannot_enforce_expression("||", e, span))?; return Ok(ConstrainedValue::Boolean(result)); } - Err(BooleanError::cannot_evaluate(name, span)) + Err(CompilerError::cannot_evaluate_expression(name, span).into()) } diff --git a/compiler/src/expression/relational/eq.rs b/compiler/src/expression/relational/eq.rs index 6e5fa0f874..3fea711e53 100644 --- a/compiler/src/expression/relational/eq.rs +++ b/compiler/src/expression/relational/eq.rs @@ -16,8 +16,8 @@ //! Enforces a relational `==` operator in a resolved Leo program. -use crate::{enforce_and, errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_asg::Span; +use crate::{enforce_and, value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::{boolean::Boolean, traits::eq::EvaluateEqGadget}; @@ -28,7 +28,7 @@ pub fn evaluate_eq<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( left: ConstrainedValue<'a, F, G>, right: ConstrainedValue<'a, F, G>, span: &Span, -) -> Result, ExpressionError> { +) -> Result> { let namespace_string = format!("evaluate {} == {} {}:{}", left, right, span.line_start, span.col_start); let constraint_result = match (left, right) { (ConstrainedValue::Address(address_1), ConstrainedValue::Address(address_2)) => { @@ -75,14 +75,11 @@ pub fn evaluate_eq<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( return Ok(current); } (val_1, val_2) => { - return Err(ExpressionError::incompatible_types( - format!("{} == {}", val_1, val_2,), - span, - )); + return Err(CompilerError::incompatible_types(format!("{} == {}", val_1, val_2,), span).into()); } }; - let boolean = constraint_result.map_err(|_| ExpressionError::cannot_evaluate("==".to_string(), span))?; + let boolean = constraint_result.map_err(|_| CompilerError::cannot_evaluate_expression("==", span))?; Ok(ConstrainedValue::Boolean(boolean)) } diff --git a/compiler/src/expression/relational/ge.rs b/compiler/src/expression/relational/ge.rs index 4c0eaae137..958588dce9 100644 --- a/compiler/src/expression/relational/ge.rs +++ b/compiler/src/expression/relational/ge.rs @@ -16,8 +16,8 @@ //! Enforces a relational `>=` operator in a resolved Leo program. -use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_asg::Span; +use crate::{value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::traits::bits::ComparatorGadget; @@ -28,21 +28,18 @@ pub fn evaluate_ge<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( left: ConstrainedValue<'a, F, G>, right: ConstrainedValue<'a, F, G>, span: &Span, -) -> Result, ExpressionError> { +) -> Result> { let unique_namespace = cs.ns(|| format!("evaluate {} >= {} {}:{}", left, right, span.line_start, span.col_start)); let constraint_result = match (left, right) { (ConstrainedValue::Integer(num_1), ConstrainedValue::Integer(num_2)) => { num_1.greater_than_or_equal(unique_namespace, &num_2) } (val_1, val_2) => { - return Err(ExpressionError::incompatible_types( - format!("{} >= {}", val_1, val_2), - span, - )); + return Err(CompilerError::incompatible_types(format!("{} >= {}", val_1, val_2), span).into()); } }; - let boolean = constraint_result.map_err(|_| ExpressionError::cannot_evaluate(">=".to_string(), span))?; + let boolean = constraint_result.map_err(|_| CompilerError::cannot_evaluate_expression(">=", span))?; Ok(ConstrainedValue::Boolean(boolean)) } diff --git a/compiler/src/expression/relational/gt.rs b/compiler/src/expression/relational/gt.rs index ff90419a45..ab3f06868c 100644 --- a/compiler/src/expression/relational/gt.rs +++ b/compiler/src/expression/relational/gt.rs @@ -16,8 +16,8 @@ //! Enforces a relational `>` operator in a resolved Leo program. -use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_asg::Span; +use crate::{value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::traits::bits::ComparatorGadget; @@ -28,21 +28,18 @@ pub fn evaluate_gt<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( left: ConstrainedValue<'a, F, G>, right: ConstrainedValue<'a, F, G>, span: &Span, -) -> Result, ExpressionError> { +) -> Result> { let unique_namespace = cs.ns(|| format!("evaluate {} > {} {}:{}", left, right, span.line_start, span.col_start)); let constraint_result = match (left, right) { (ConstrainedValue::Integer(num_1), ConstrainedValue::Integer(num_2)) => { num_1.greater_than(unique_namespace, &num_2) } (val_1, val_2) => { - return Err(ExpressionError::incompatible_types( - format!("{} > {}", val_1, val_2), - span, - )); + return Err(CompilerError::incompatible_types(format!("{} > {}", val_1, val_2), span).into()); } }; - let boolean = constraint_result.map_err(|_| ExpressionError::cannot_evaluate(">".to_string(), span))?; + let boolean = constraint_result.map_err(|_| CompilerError::cannot_evaluate_expression(">", span))?; Ok(ConstrainedValue::Boolean(boolean)) } diff --git a/compiler/src/expression/relational/le.rs b/compiler/src/expression/relational/le.rs index 9bce73f1be..e1f1e57131 100644 --- a/compiler/src/expression/relational/le.rs +++ b/compiler/src/expression/relational/le.rs @@ -16,8 +16,8 @@ //! Enforces a relational `<=` operator in a resolved Leo program. -use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_asg::Span; +use crate::{value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::traits::bits::ComparatorGadget; @@ -28,21 +28,18 @@ pub fn evaluate_le<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( left: ConstrainedValue<'a, F, G>, right: ConstrainedValue<'a, F, G>, span: &Span, -) -> Result, ExpressionError> { +) -> Result> { let unique_namespace = cs.ns(|| format!("evaluate {} <= {} {}:{}", left, right, span.line_start, span.col_start)); let constraint_result = match (left, right) { (ConstrainedValue::Integer(num_1), ConstrainedValue::Integer(num_2)) => { num_1.less_than_or_equal(unique_namespace, &num_2) } (val_1, val_2) => { - return Err(ExpressionError::incompatible_types( - format!("{} <= {}", val_1, val_2), - span, - )); + return Err(CompilerError::incompatible_types(format!("{} <= {}", val_1, val_2), span).into()); } }; - let boolean = constraint_result.map_err(|_| ExpressionError::cannot_evaluate("<=".to_string(), span))?; + let boolean = constraint_result.map_err(|_| CompilerError::cannot_evaluate_expression("<=", span))?; Ok(ConstrainedValue::Boolean(boolean)) } diff --git a/compiler/src/expression/relational/lt.rs b/compiler/src/expression/relational/lt.rs index 4beb907241..839ea7fb7a 100644 --- a/compiler/src/expression/relational/lt.rs +++ b/compiler/src/expression/relational/lt.rs @@ -16,8 +16,8 @@ //! Enforces a relational `<` operator in a resolved Leo program. -use crate::{errors::ExpressionError, value::ConstrainedValue, GroupType}; -use leo_asg::Span; +use crate::{value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::traits::bits::EvaluateLtGadget; @@ -28,21 +28,18 @@ pub fn evaluate_lt<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( left: ConstrainedValue<'a, F, G>, right: ConstrainedValue<'a, F, G>, span: &Span, -) -> Result, ExpressionError> { +) -> Result> { let unique_namespace = cs.ns(|| format!("evaluate {} < {} {}:{}", left, right, span.line_start, span.col_start)); let constraint_result = match (left, right) { (ConstrainedValue::Integer(num_1), ConstrainedValue::Integer(num_2)) => { num_1.less_than(unique_namespace, &num_2) } (val_1, val_2) => { - return Err(ExpressionError::incompatible_types( - format!("{} < {}", val_1, val_2), - span, - )); + return Err(CompilerError::incompatible_types(format!("{} < {}", val_1, val_2), span).into()); } }; - let boolean = constraint_result.map_err(|_| ExpressionError::cannot_evaluate("<".to_string(), span))?; + let boolean = constraint_result.map_err(|_| CompilerError::cannot_evaluate_expression("<", span))?; Ok(ConstrainedValue::Boolean(boolean)) } diff --git a/compiler/src/expression/tuple/access.rs b/compiler/src/expression/tuple/access.rs index 842c714ab2..59a823ae3b 100644 --- a/compiler/src/expression/tuple/access.rs +++ b/compiler/src/expression/tuple/access.rs @@ -16,8 +16,9 @@ //! Enforces array access in a compiled Leo program. -use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_asg::{Expression, Span}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use leo_asg::Expression; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -30,17 +31,17 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { tuple: &'a Expression<'a>, index: usize, span: &Span, - ) -> Result, ExpressionError> { + ) -> Result> { // Get the tuple values. let tuple = match self.enforce_expression(cs, tuple)? { ConstrainedValue::Tuple(tuple) => tuple, - value => return Err(ExpressionError::undefined_array(value.to_string(), span)), + value => return Err(CompilerError::undefined_array(value, span).into()), }; // Check for out of bounds access. if index > tuple.len() - 1 { // probably safe to be a panic here - return Err(ExpressionError::tuple_index_out_of_bounds(index, span)); + return Err(CompilerError::tuple_index_out_of_bounds(index, span).into()); } Ok(tuple[index].to_owned()) diff --git a/compiler/src/expression/tuple/tuple.rs b/compiler/src/expression/tuple/tuple.rs index 45ce92d86d..95dc276d79 100644 --- a/compiler/src/expression/tuple/tuple.rs +++ b/compiler/src/expression/tuple/tuple.rs @@ -18,8 +18,9 @@ use std::cell::Cell; -use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; use leo_asg::Expression; +use leo_errors::Result; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -30,7 +31,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { &mut self, cs: &mut CS, tuple: &[Cell<&'a Expression<'a>>], - ) -> Result, ExpressionError> { + ) -> Result> { let mut result = Vec::with_capacity(tuple.len()); for expression in tuple.iter() { result.push(self.enforce_expression(cs, expression.get())?); diff --git a/compiler/src/expression/variable_ref/variable_ref.rs b/compiler/src/expression/variable_ref/variable_ref.rs index abc07ddf82..a27f3d13e6 100644 --- a/compiler/src/expression/variable_ref/variable_ref.rs +++ b/compiler/src/expression/variable_ref/variable_ref.rs @@ -16,21 +16,25 @@ //! Enforces an identifier expression in a compiled Leo program. -use crate::{errors::ExpressionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; use leo_asg::VariableRef; +use leo_errors::{CompilerError, Result}; use snarkvm_fields::PrimeField; impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { /// Enforce a variable expression by getting the resolved value - pub fn evaluate_ref(&mut self, variable_ref: &VariableRef) -> Result, ExpressionError> { + pub fn evaluate_ref(&mut self, variable_ref: &VariableRef) -> Result> { // Evaluate the identifier name in the current function scope + let span = variable_ref.span.clone(); let variable = variable_ref.variable.borrow(); let result_value = if let Some(value) = self.get(variable.id) { value.clone() } else { - return Err(ExpressionError::undefined_identifier(variable.name.clone())); + return Err( + CompilerError::undefined_identifier(&variable.name.clone().name, &span.unwrap_or_default()).into(), + ); // todo: probably can be a panic here instead }; diff --git a/compiler/src/function/function.rs b/compiler/src/function/function.rs index 2ecc340d17..4bbf4fa87f 100644 --- a/compiler/src/function/function.rs +++ b/compiler/src/function/function.rs @@ -16,9 +16,10 @@ //! Enforces constraints on a function in a compiled Leo program. -use crate::{errors::FunctionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; use leo_asg::{Expression, Function, FunctionQualifier}; +use leo_errors::{CompilerError, Result}; use std::cell::Cell; use snarkvm_fields::PrimeField; @@ -32,7 +33,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { function: &'a Function<'a>, target: Option<&'a Expression<'a>>, arguments: &[Cell<&'a Expression<'a>>], - ) -> Result, FunctionError> { + ) -> Result> { let target_value = target.map(|target| self.enforce_expression(cs, target)).transpose()?; let self_var = if let Some(target) = &target_value { @@ -47,10 +48,12 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { }; if function.arguments.len() != arguments.len() { - return Err(FunctionError::input_not_found( - "arguments length invalid".to_string(), + return Err(CompilerError::function_input_not_found( + &function.name.borrow().name.to_string(), + "arguments length invalid", &function.span.clone().unwrap_or_default(), - )); + ) + .into()); } // Store input values as new variables in resolved program @@ -90,6 +93,5 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { // Conditionally select a result based on returned indicators Self::conditionally_select_result(cs, &output, results, &function.span.clone().unwrap_or_default()) - .map_err(FunctionError::StatementError) } } diff --git a/compiler/src/function/input/array.rs b/compiler/src/function/input/array.rs index 5ac984e118..47da5b93f8 100644 --- a/compiler/src/function/input/array.rs +++ b/compiler/src/function/input/array.rs @@ -16,10 +16,11 @@ //! Allocates an array as a main function input parameter in a compiled Leo program. -use crate::{errors::FunctionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; use leo_asg::Type; -use leo_ast::{InputValue, Span}; +use leo_ast::InputValue; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -33,18 +34,14 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { array_len: usize, input_value: Option, span: &Span, - ) -> Result, FunctionError> { + ) -> Result> { // Build the array value using the expected types. let mut array_value = vec![]; match input_value { Some(InputValue::Array(arr)) => { if array_len != arr.len() { - return Err(FunctionError::invalid_input_array_dimensions( - arr.len(), - array_len, - span, - )); + return Err(CompilerError::invalid_input_array_dimensions(arr.len(), array_len, span).into()); } // Allocate each value in the current row @@ -69,7 +66,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { } } _ => { - return Err(FunctionError::invalid_array(input_value.unwrap().to_string(), span)); + return Err(CompilerError::invalid_function_input_array(input_value.unwrap(), span).into()); } } diff --git a/compiler/src/function/input/input_keyword.rs b/compiler/src/function/input/input_keyword.rs index 9db9e13b1e..17c218d564 100644 --- a/compiler/src/function/input/input_keyword.rs +++ b/compiler/src/function/input/input_keyword.rs @@ -14,9 +14,10 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{errors::FunctionError, ConstrainedCircuitMember, ConstrainedProgram, ConstrainedValue, GroupType}; +use crate::{ConstrainedCircuitMember, ConstrainedProgram, ConstrainedValue, GroupType}; use leo_asg::{Circuit, CircuitMember, Type}; -use leo_ast::{Identifier, Input, Span}; +use leo_ast::{Identifier, Input}; +use leo_errors::{Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -34,7 +35,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { span: &Span, expected_type: &'a Circuit<'a>, input: &Input, - ) -> Result, FunctionError> { + ) -> Result> { // Create an identifier for each input variable let registers_name = Identifier { diff --git a/compiler/src/function/input/input_section.rs b/compiler/src/function/input/input_section.rs index 1fc8b1f988..72b1d7856a 100644 --- a/compiler/src/function/input/input_section.rs +++ b/compiler/src/function/input/input_section.rs @@ -14,9 +14,10 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{errors::FunctionError, ConstrainedCircuitMember, ConstrainedProgram, ConstrainedValue, GroupType}; -use leo_asg::{AsgConvertError, Circuit, CircuitMember}; +use crate::{ConstrainedCircuitMember, ConstrainedProgram, ConstrainedValue, GroupType}; +use leo_asg::{Circuit, CircuitMember}; use leo_ast::{Identifier, InputValue, Parameter}; +use leo_errors::{AsgError, Result}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -30,7 +31,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { identifier: Identifier, expected_type: &'a Circuit<'a>, section: IndexMap>, - ) -> Result, FunctionError> { + ) -> Result> { let mut members = Vec::with_capacity(section.len()); // Allocate each section definition as a circuit member value @@ -40,14 +41,9 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { Some(CircuitMember::Variable(inner)) => inner, _ => continue, // present, but unused }; - let declared_type = self.asg.scope.resolve_ast_type(¶meter.type_)?; + let declared_type = self.asg.scope.resolve_ast_type(¶meter.type_, ¶meter.span)?; if !expected_type.is_assignable_from(&declared_type) { - return Err(AsgConvertError::unexpected_type( - &expected_type.to_string(), - Some(&declared_type.to_string()), - &identifier.span, - ) - .into()); + return Err(AsgError::unexpected_type(expected_type, declared_type, &identifier.span).into()); } let member_name = parameter.variable.clone(); let member_value = self.allocate_main_function_input( diff --git a/compiler/src/function/input/main_function_input.rs b/compiler/src/function/input/main_function_input.rs index 3f54f73200..bfa2765182 100644 --- a/compiler/src/function/input/main_function_input.rs +++ b/compiler/src/function/input/main_function_input.rs @@ -18,7 +18,6 @@ use crate::{ address::Address, - errors::{FunctionError, IntegerError}, program::ConstrainedProgram, value::{ boolean::input::bool_from_input, char::char_from_input, field::input::field_from_input, @@ -27,7 +26,8 @@ use crate::{ CharType, FieldType, GroupType, Integer, }; use leo_asg::{ConstInt, Type}; -use leo_ast::{Char, InputValue, Span}; +use leo_ast::{Char, InputValue}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::boolean::Boolean; @@ -41,7 +41,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { name: &str, input_option: Option, span: &Span, - ) -> Result, FunctionError> { + ) -> Result> { match type_ { Type::Address => Ok(Address::from_input(cs, name, input_option, span)?), Type::Boolean => Ok(bool_from_input(cs, name, input_option, span)?), @@ -71,8 +71,8 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { name: &str, input_option: Option, span: &Span, - ) -> Result, FunctionError> { - let input = input_option.ok_or_else(|| FunctionError::input_not_found(name.to_string(), span))?; + ) -> Result> { + let input = input_option.ok_or_else(|| CompilerError::function_input_not_found("main", name, span))?; match (type_, input) { (Type::Address, InputValue::Address(addr)) => Ok(ConstrainedValue::Address(Address::constant(addr, span)?)), @@ -100,21 +100,15 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { let parsed_type = parsed.get_int_type(); let input_type = input_type.into(); if std::mem::discriminant(&parsed_type) != std::mem::discriminant(&input_type) { - return Err(FunctionError::from(IntegerError::integer_type_mismatch( - input_type.to_string(), - parsed_type.to_string(), - span, - ))); + return Err( + CompilerError::integer_value_integer_type_mismatch(input_type, parsed_type, span).into(), + ); } Ok(ConstrainedValue::Integer(Integer::new(&parsed))) } (Type::Array(type_, arr_len), InputValue::Array(values)) => { if *arr_len != values.len() { - return Err(FunctionError::invalid_input_array_dimensions( - *arr_len, - values.len(), - span, - )); + return Err(CompilerError::invalid_input_array_dimensions(*arr_len, values.len(), span).into()); } Ok(ConstrainedValue::Array( @@ -126,7 +120,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { } (Type::Tuple(types), InputValue::Tuple(values)) => { if values.len() != types.len() { - return Err(FunctionError::tuple_size_mismatch(types.len(), values.len(), span)); + return Err(CompilerError::input_tuple_size_mismatch(types.len(), values.len(), span).into()); } Ok(ConstrainedValue::Tuple( @@ -142,12 +136,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { (Type::Circuit(_), _) => unimplemented!("main function input not implemented for type {}", type_), // Should not happen. // Return an error if the input type and input value do not match. - (_, input) => Err(FunctionError::input_type_mismatch( - type_.to_string(), - input.to_string(), - name.to_string(), - span, - )), + (_, input) => Err(CompilerError::input_variable_type_mismatch(type_, input, name, span).into()), } } } diff --git a/compiler/src/function/input/tuple.rs b/compiler/src/function/input/tuple.rs index f35922718b..8bd4b8e220 100644 --- a/compiler/src/function/input/tuple.rs +++ b/compiler/src/function/input/tuple.rs @@ -16,10 +16,11 @@ //! Allocates an array as a main function input parameter in a compiled Leo program. -use crate::{errors::FunctionError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; use leo_asg::Type; -use leo_ast::{InputValue, Span}; +use leo_ast::InputValue; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -32,13 +33,13 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { types: &[Type], input_value: Option, span: &Span, - ) -> Result, FunctionError> { + ) -> Result> { let mut tuple_values = vec![]; match input_value { Some(InputValue::Tuple(values)) => { if values.len() != types.len() { - return Err(FunctionError::tuple_size_mismatch(types.len(), values.len(), span)); + return Err(CompilerError::input_tuple_size_mismatch(types.len(), values.len(), span).into()); } // Allocate each value in the tuple. @@ -57,7 +58,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { } } _ => { - return Err(FunctionError::invalid_tuple(input_value.unwrap().to_string(), span)); + return Err(CompilerError::invalid_function_input_tuple(input_value.unwrap(), span).into()); } } diff --git a/compiler/src/function/main_function.rs b/compiler/src/function/main_function.rs index 2e615924dc..7aefd335ff 100644 --- a/compiler/src/function/main_function.rs +++ b/compiler/src/function/main_function.rs @@ -16,10 +16,11 @@ //! Enforces constraints on the main function of a compiled Leo program. -use crate::{errors::FunctionError, program::ConstrainedProgram, GroupType, Output}; +use crate::{program::ConstrainedProgram, GroupType, Output}; use leo_asg::{Expression, Function, FunctionQualifier}; use leo_ast::Input; +use leo_errors::{CompilerError, Result}; use std::cell::Cell; use snarkvm_fields::PrimeField; @@ -31,7 +32,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { cs: &mut CS, function: &'a Function<'a>, input: &Input, - ) -> Result { + ) -> Result { let registers = input.get_registers(); // Iterate over main function input variables and allocate new values @@ -65,10 +66,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { ) { // If variable is in both [main] and [constants] sections - error. (_, Some(_), Some(_)) => { - return Err(FunctionError::double_input_declaration( - name.to_string(), - &input_variable.name.span, - )); + return Err(CompilerError::double_input_declaration(name, &input_variable.name.span).into()); } // If input option is found in [main] section and input is not const. (false, Some(input_option), _) => self.allocate_main_function_input( @@ -88,24 +86,24 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { )?, // Function argument is const, input is not. (true, Some(_), None) => { - return Err(FunctionError::expected_const_input( - name.to_string(), - &input_variable.name.span, - )); + return Err( + CompilerError::expected_const_input_variable(name, &input_variable.name.span).into(), + ); } // Input is const, function argument is not. (false, None, Some(_)) => { - return Err(FunctionError::expected_non_const_input( - name.to_string(), - &input_variable.name.span, - )); + return Err( + CompilerError::expected_non_const_input_variable(name, &input_variable.name.span).into(), + ); } // When not found - Error out. (_, _, _) => { - return Err(FunctionError::input_not_found( - name.to_string(), + return Err(CompilerError::function_input_not_found( + function.name.borrow().name.to_string(), + name, &input_variable.name.span, - )); + ) + .into()); } }; diff --git a/compiler/src/function/mut_target.rs b/compiler/src/function/mut_target.rs index 5ab48dade7..8d6a080889 100644 --- a/compiler/src/function/mut_target.rs +++ b/compiler/src/function/mut_target.rs @@ -18,11 +18,12 @@ use std::cell::Cell; -use crate::{errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; use leo_asg::{ ArrayAccessExpression, ArrayRangeAccessExpression, AssignAccess, AssignOperation, AssignStatement, CircuitAccessExpression, Expression, Node, TupleAccessExpression, Variable, }; +use leo_errors::Result; use snarkvm_fields::PrimeField; use snarkvm_gadgets::boolean::Boolean; @@ -32,7 +33,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { fn prepare_mut_access( out: &mut Vec>, expr: &'a Expression<'a>, - ) -> Result>, StatementError> { + ) -> Result>> { match expr { Expression::ArrayRangeAccess(ArrayRangeAccessExpression { array, left, right, .. }) => { let inner = Self::prepare_mut_access(out, array.get())?; @@ -76,7 +77,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { assignee: &'a Expression<'a>, target_value: ConstrainedValue<'a, F, G>, indicator: &Boolean, - ) -> Result { + ) -> Result { let mut accesses = vec![]; let target = Self::prepare_mut_access(&mut accesses, assignee)?; if target.is_none() { diff --git a/compiler/src/function/result/result.rs b/compiler/src/function/result/result.rs index 9e7885e86e..6bd779fa95 100644 --- a/compiler/src/function/result/result.rs +++ b/compiler/src/function/result/result.rs @@ -16,11 +16,10 @@ //! Enforces that one return value is produced in a compiled Leo program. -use crate::{ - errors::StatementError, get_indicator_value, program::ConstrainedProgram, value::ConstrainedValue, GroupType, -}; +use crate::{get_indicator_value, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_asg::{Span, Type}; +use leo_asg::Type; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::{boolean::Boolean, traits::select::CondSelectGadget}; @@ -36,7 +35,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { expected_return: &Type<'a>, results: Vec<(Boolean, ConstrainedValue<'a, F, G>)>, span: &Span, - ) -> Result, StatementError> { + ) -> Result> { // Initialize empty return value. let mut return_value = None; @@ -56,7 +55,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { if get_indicator_value(&indicator) { // Error if we already have a return value. if return_value.is_some() { - return Err(StatementError::multiple_returns(span)); + return Err(CompilerError::statement_multiple_returns(span).into()); } else { // Set the function return value. return_value = Some(result); @@ -80,7 +79,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { &result, value, ) - .map_err(|_| StatementError::select_fail(result.to_string(), value.to_string(), span))?, + .map_err(|_| CompilerError::statement_select_fail(result, value, span))?, ); } else { return_value = Some(result); // we ignore indicator for default -- questionable @@ -90,7 +89,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { if expected_return.is_unit() { Ok(ConstrainedValue::Tuple(vec![])) } else { - return_value.ok_or_else(|| StatementError::no_returns(expected_return, span)) + Ok(return_value.ok_or_else(|| CompilerError::statement_no_returns(expected_return.to_string(), span))?) } } } diff --git a/compiler/src/lib.rs b/compiler/src/lib.rs index 631e923f38..d020bfb780 100644 --- a/compiler/src/lib.rs +++ b/compiler/src/lib.rs @@ -20,9 +20,7 @@ #![allow(clippy::module_inception)] #![allow(clippy::upper_case_acronyms)] - -#[macro_use] -extern crate thiserror; +#![doc = include_str!("../README.md")] pub mod compiler; @@ -34,8 +32,6 @@ pub use constraints::*; pub mod definition; -pub mod errors; - pub mod expression; pub use expression::*; diff --git a/compiler/src/option.rs b/compiler/src/option.rs index 36617d3a30..0dc5ccca51 100644 --- a/compiler/src/option.rs +++ b/compiler/src/option.rs @@ -19,7 +19,6 @@ /// #[derive(Clone)] pub struct CompilerOptions { - pub canonicalization_enabled: bool, pub constant_folding_enabled: bool, pub dead_code_elimination_enabled: bool, } @@ -30,7 +29,6 @@ impl Default for CompilerOptions { /// fn default() -> Self { CompilerOptions { - canonicalization_enabled: true, constant_folding_enabled: true, dead_code_elimination_enabled: true, } diff --git a/compiler/src/output/mod.rs b/compiler/src/output/mod.rs index 2030b12764..0e3c322d65 100644 --- a/compiler/src/output/mod.rs +++ b/compiler/src/output/mod.rs @@ -22,9 +22,10 @@ pub use self::output_file::*; pub mod output_bytes; pub use self::output_bytes::*; -use crate::{errors::OutputBytesError, Char, CharType, ConstrainedValue, GroupType, REGISTERS_VARIABLE_NAME}; +use crate::{Char, CharType, ConstrainedValue, GroupType, REGISTERS_VARIABLE_NAME}; use leo_asg::Program; -use leo_ast::{Parameter, Registers, Span}; +use leo_ast::{Parameter, Registers}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; @@ -88,7 +89,7 @@ impl Output { registers: &Registers, value: ConstrainedValue<'a, F, G>, span: &Span, - ) -> Result { + ) -> Result { let return_values = match value { ConstrainedValue::Tuple(tuple) => tuple, value => vec![value], @@ -105,7 +106,7 @@ impl Output { // Return an error if we do not have enough return registers if register_values.len() < return_values.len() { - return Err(OutputBytesError::not_enough_registers(span)); + return Err(CompilerError::output_not_enough_registers(span).into()); } let mut registers = BTreeMap::new(); @@ -114,15 +115,11 @@ impl Output { let name = parameter.variable.name; // Check register type == return value type. - let register_type = program.scope.resolve_ast_type(¶meter.type_)?; + let register_type = program.scope.resolve_ast_type(¶meter.type_, ¶meter.span)?; let return_value_type = value.to_type(span)?; if !register_type.is_assignable_from(&return_value_type) { - return Err(OutputBytesError::mismatched_output_types( - ®ister_type, - &return_value_type, - span, - )); + return Err(CompilerError::output_mismatched_types(register_type, return_value_type, span).into()); } let value = match value { diff --git a/compiler/src/output/output_bytes.rs b/compiler/src/output/output_bytes.rs index 9060f2e40c..7ca118a3f3 100644 --- a/compiler/src/output/output_bytes.rs +++ b/compiler/src/output/output_bytes.rs @@ -14,9 +14,10 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{errors::OutputBytesError, ConstrainedValue, GroupType, REGISTERS_VARIABLE_NAME}; +use crate::{ConstrainedValue, GroupType, REGISTERS_VARIABLE_NAME}; use leo_asg::Program; -use leo_ast::{Parameter, Registers, Span}; +use leo_ast::{Parameter, Registers}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; @@ -37,7 +38,7 @@ impl OutputBytes { value: ConstrainedValue<'a, F, G>, span: &Span, - ) -> Result { + ) -> Result { let return_values = match value { ConstrainedValue::Tuple(values) => values, value => vec![value], @@ -54,7 +55,7 @@ impl OutputBytes { // Return an error if we do not have enough return registers if register_values.len() < return_values.len() { - return Err(OutputBytesError::not_enough_registers(span)); + return Err(CompilerError::output_not_enough_registers(span).into()); } // Manually construct result string @@ -68,15 +69,11 @@ impl OutputBytes { let name = parameter.variable.name; // Check register type == return value type. - let register_type = program.scope.resolve_ast_type(¶meter.type_)?; + let register_type = program.scope.resolve_ast_type(¶meter.type_, ¶meter.span)?; let return_value_type = value.to_type(span)?; if !register_type.is_assignable_from(&return_value_type) { - return Err(OutputBytesError::mismatched_output_types( - ®ister_type, - &return_value_type, - span, - )); + return Err(CompilerError::output_mismatched_types(register_type, return_value_type, span).into()); } let value = value.to_string(); diff --git a/compiler/src/output/output_file.rs b/compiler/src/output/output_file.rs index 4731c290f3..62250bc1f1 100644 --- a/compiler/src/output/output_file.rs +++ b/compiler/src/output/output_file.rs @@ -16,7 +16,7 @@ //! The `program.out` file. -use crate::errors::OutputFileError; +use leo_errors::{CompilerError, Result}; use std::{ borrow::Cow, @@ -42,23 +42,23 @@ impl OutputFile { } /// Writes output to a file. - pub fn write(&self, path: &Path, bytes: &[u8]) -> Result<(), OutputFileError> { + pub fn write(&self, path: &Path, bytes: &[u8]) -> Result<()> { // create output file let path = self.setup_file_path(path); - let mut file = File::create(&path)?; + let mut file = File::create(&path).map_err(CompilerError::output_file_io_error)?; - Ok(file.write_all(bytes)?) + Ok(file.write_all(bytes).map_err(CompilerError::output_file_io_error)?) } /// Removes the output file at the given path if it exists. Returns `true` on success, /// `false` if the file doesn't exist, and `Error` if the file system fails during operation. - pub fn remove(&self, path: &Path) -> Result { + pub fn remove(&self, path: &Path) -> Result { let path = self.setup_file_path(path); if !path.exists() { return Ok(false); } - fs::remove_file(&path).map_err(|_| OutputFileError::FileRemovalError(path.into_owned()))?; + fs::remove_file(&path).map_err(|_| CompilerError::output_file_cannot_remove(path))?; Ok(true) } diff --git a/compiler/src/phases/phase.rs b/compiler/src/phases/phase.rs index 1423fa47fa..c5d7d1424c 100644 --- a/compiler/src/phases/phase.rs +++ b/compiler/src/phases/phase.rs @@ -18,7 +18,8 @@ use crate::{CombineAstAsgDirector, CombinerOptions}; use leo_asg::Program as AsgProgram; -use leo_ast::{Ast, Program as AstProgram, ReconstructingReducer, ReducerError}; +use leo_ast::{Ast, Program as AstProgram, ReconstructingReducer}; +use leo_errors::Result; macro_rules! phase { ($phase_name:ident, $function:item) => { @@ -49,7 +50,7 @@ macro_rules! phase { } impl $phase_name { - pub fn phase_ast(&self, ast: &AstProgram, asg: &AsgProgram) -> Result { + pub fn phase_ast(&self, ast: &AstProgram, asg: &AsgProgram) -> Result { Ok(Ast::new(CombineAstAsgDirector::new(Self::default(), Options{}) .reduce_program(ast, asg)?)) } diff --git a/compiler/src/phases/reducing_director.rs b/compiler/src/phases/reducing_director.rs index 49480254e0..380f6e577c 100644 --- a/compiler/src/phases/reducing_director.rs +++ b/compiler/src/phases/reducing_director.rs @@ -41,16 +41,17 @@ use leo_ast::{ CastExpression as AstCastExpression, Char, CharValue as AstCharValue, Circuit as AstCircuit, CircuitImpliedVariableDefinition, CircuitInitExpression as AstCircuitInitExpression, CircuitMember as AstCircuitMember, CircuitMemberAccessExpression, CircuitStaticFunctionAccessExpression, - CombinerError, ConditionalStatement as AstConditionalStatement, ConsoleArgs as AstConsoleArgs, + ConditionalStatement as AstConditionalStatement, ConsoleArgs as AstConsoleArgs, ConsoleFunction as AstConsoleFunction, ConsoleStatement as AstConsoleStatement, DefinitionStatement as AstDefinitionStatement, Expression as AstExpression, ExpressionStatement as AstExpressionStatement, Function as AstFunction, GroupTuple, GroupValue as AstGroupValue, - IterationStatement as AstIterationStatement, PositiveNumber, ReconstructingReducer, ReducerError, - ReturnStatement as AstReturnStatement, Span, SpreadOrExpression, Statement as AstStatement, + IterationStatement as AstIterationStatement, PositiveNumber, ReconstructingReducer, + ReturnStatement as AstReturnStatement, SpreadOrExpression, Statement as AstStatement, TernaryExpression as AstTernaryExpression, TupleAccessExpression as AstTupleAccessExpression, TupleInitExpression as AstTupleInitExpression, Type as AstType, UnaryExpression as AstUnaryExpression, ValueExpression, }; +use leo_errors::{AstError, Result, Span}; use tendril::StrTendril; pub trait CombinerOptions { @@ -69,7 +70,7 @@ impl CombineAstAsgDirector { Self { ast_reducer, options } } - pub fn reduce_type(&mut self, ast: &AstType, asg: &AsgType, span: &Span) -> Result { + pub fn reduce_type(&mut self, ast: &AstType, asg: &AsgType, span: &Span) -> Result { let new = match (ast, asg) { (AstType::Array(ast_type, ast_dimensions), AsgType::Array(asg_type, asg_dimensions)) => { if self.options.type_inference_enabled() { @@ -100,11 +101,7 @@ impl CombineAstAsgDirector { self.ast_reducer.reduce_type(ast, new, span) } - pub fn reduce_expression( - &mut self, - ast: &AstExpression, - asg: &AsgExpression, - ) -> Result { + pub fn reduce_expression(&mut self, ast: &AstExpression, asg: &AsgExpression) -> Result { let new = match (ast, asg) { (AstExpression::Value(value), AsgExpression::Constant(const_)) => self.reduce_value(value, const_)?, (AstExpression::Binary(ast), AsgExpression::Binary(asg)) => { @@ -159,7 +156,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstArrayAccessExpression, asg: &AsgArrayAccessExpression, - ) -> Result { + ) -> Result { let array = self.reduce_expression(&ast.array, asg.array.get())?; let index = self.reduce_expression(&ast.index, asg.index.get())?; @@ -170,7 +167,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstArrayInitExpression, asg: &AsgArrayInitExpression, - ) -> Result { + ) -> Result { let element = self.reduce_expression(&ast.element, asg.element.get())?; self.ast_reducer.reduce_array_init(ast, element) @@ -180,7 +177,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstArrayInlineExpression, asg: &AsgArrayInlineExpression, - ) -> Result { + ) -> Result { let mut elements = vec![]; for (ast_element, asg_element) in ast.elements.iter().zip(asg.elements.iter()) { let reduced_element = match ast_element { @@ -202,7 +199,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstArrayRangeAccessExpression, asg: &AsgArrayRangeAccessExpression, - ) -> Result { + ) -> Result { let array = self.reduce_expression(&ast.array, asg.array.get())?; let left = match (ast.left.as_ref(), asg.left.get()) { (Some(ast_left), Some(asg_left)) => Some(self.reduce_expression(ast_left, asg_left)?), @@ -220,18 +217,14 @@ impl CombineAstAsgDirector { &mut self, ast: &AstBinaryExpression, asg: &AsgBinaryExpression, - ) -> Result { + ) -> Result { let left = self.reduce_expression(&ast.left, asg.left.get())?; let right = self.reduce_expression(&ast.right, asg.right.get())?; self.ast_reducer.reduce_binary(ast, left, right, ast.op.clone()) } - pub fn reduce_call( - &mut self, - ast: &AstCallExpression, - asg: &AsgCallExpression, - ) -> Result { + pub fn reduce_call(&mut self, ast: &AstCallExpression, asg: &AsgCallExpression) -> Result { // TODO FIGURE IT OUT // let function = self.reduce_expression(&ast.function, asg.function.get())?; // let target = asg.target.get().map(|exp| self.reduce_expression()) @@ -245,11 +238,7 @@ impl CombineAstAsgDirector { self.ast_reducer.reduce_call(ast, *ast.function.clone(), arguments) } - pub fn reduce_cast( - &mut self, - ast: &AstCastExpression, - asg: &AsgCastExpression, - ) -> Result { + pub fn reduce_cast(&mut self, ast: &AstCastExpression, asg: &AsgCastExpression) -> Result { let inner = self.reduce_expression(&ast.inner, asg.inner.get())?; let target_type = self.reduce_type(&ast.target_type, &asg.target_type, &ast.span)?; @@ -260,7 +249,7 @@ impl CombineAstAsgDirector { &mut self, ast: &CircuitMemberAccessExpression, _asg: &AsgCircuitAccessExpression, - ) -> Result { + ) -> Result { // let circuit = self.reduce_expression(&circuit_member_access.circuit)?; // let name = self.reduce_identifier(&circuit_member_access.name)?; // let target = input.target.get().map(|e| self.reduce_expression(e)); @@ -273,7 +262,7 @@ impl CombineAstAsgDirector { &mut self, ast: &CircuitStaticFunctionAccessExpression, _asg: &AsgCircuitAccessExpression, - ) -> Result { + ) -> Result { // let circuit = self.reduce_expression(&circuit_member_access.circuit)?; // let name = self.reduce_identifier(&circuit_member_access.name)?; // let target = input.target.get().map(|e| self.reduce_expression(e)); @@ -286,7 +275,7 @@ impl CombineAstAsgDirector { &mut self, ast: &CircuitImpliedVariableDefinition, asg: &AsgExpression, - ) -> Result { + ) -> Result { let expression = ast .expression .as_ref() @@ -301,7 +290,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstCircuitInitExpression, asg: &AsgCircuitInitExpression, - ) -> Result { + ) -> Result { let mut members = vec![]; for (ast_member, asg_member) in ast.members.iter().zip(asg.values.iter()) { members.push(self.reduce_circuit_implied_variable_definition(ast_member, asg_member.1.get())?); @@ -314,7 +303,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstTernaryExpression, asg: &AsgTernaryExpression, - ) -> Result { + ) -> Result { let condition = self.reduce_expression(&ast.condition, asg.condition.get())?; let if_true = self.reduce_expression(&ast.if_true, asg.if_true.get())?; let if_false = self.reduce_expression(&ast.if_false, asg.if_false.get())?; @@ -326,7 +315,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstTupleAccessExpression, asg: &AsgTupleAccessExpression, - ) -> Result { + ) -> Result { let tuple = self.reduce_expression(&ast.tuple, asg.tuple_ref.get())?; self.ast_reducer.reduce_tuple_access(ast, tuple) @@ -336,7 +325,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstTupleInitExpression, asg: &AsgTupleInitExpression, - ) -> Result { + ) -> Result { let mut elements = vec![]; for (ast_element, asg_element) in ast.elements.iter().zip(asg.elements.iter()) { let element = self.reduce_expression(ast_element, asg_element.get())?; @@ -346,17 +335,13 @@ impl CombineAstAsgDirector { self.ast_reducer.reduce_tuple_init(ast, elements) } - pub fn reduce_unary( - &mut self, - ast: &AstUnaryExpression, - asg: &AsgUnaryExpression, - ) -> Result { + pub fn reduce_unary(&mut self, ast: &AstUnaryExpression, asg: &AsgUnaryExpression) -> Result { let inner = self.reduce_expression(&ast.inner, asg.inner.get())?; self.ast_reducer.reduce_unary(ast, inner, ast.op.clone()) } - pub fn reduce_value(&mut self, ast: &ValueExpression, asg: &AsgConstant) -> Result { + pub fn reduce_value(&mut self, ast: &ValueExpression, asg: &AsgConstant) -> Result { let mut new = ast.clone(); if self.options.type_inference_enabled() { @@ -405,11 +390,7 @@ impl CombineAstAsgDirector { self.ast_reducer.reduce_value(ast, AstExpression::Value(new)) } - pub fn reduce_variable_ref( - &mut self, - ast: &ValueExpression, - _asg: &AsgVariableRef, - ) -> Result { + pub fn reduce_variable_ref(&mut self, ast: &ValueExpression, _asg: &AsgVariableRef) -> Result { // TODO FIGURE IT OUT let new = match ast { // ValueExpression::Group(group_value) => { @@ -426,10 +407,10 @@ impl CombineAstAsgDirector { &mut self, ast_statement: &AstStatement, asg_statement: &AsgStatement, - ) -> Result { + ) -> Result { let new = match (ast_statement, asg_statement) { (AstStatement::Assign(ast), AsgStatement::Assign(asg)) => { - AstStatement::Assign(self.reduce_assign(ast, asg)?) + AstStatement::Assign(Box::new(self.reduce_assign(ast, asg)?)) } (AstStatement::Block(ast), AsgStatement::Block(asg)) => AstStatement::Block(self.reduce_block(ast, asg)?), (AstStatement::Conditional(ast), AsgStatement::Conditional(asg)) => { @@ -445,7 +426,7 @@ impl CombineAstAsgDirector { AstStatement::Expression(self.reduce_expression_statement(ast, asg)?) } (AstStatement::Iteration(ast), AsgStatement::Iteration(asg)) => { - AstStatement::Iteration(self.reduce_iteration(ast, asg)?) + AstStatement::Iteration(Box::new(self.reduce_iteration(ast, asg)?)) } (AstStatement::Return(ast), AsgStatement::Return(asg)) => { AstStatement::Return(self.reduce_return(ast, asg)?) @@ -456,11 +437,7 @@ impl CombineAstAsgDirector { self.ast_reducer.reduce_statement(ast_statement, new) } - pub fn reduce_assign_access( - &mut self, - ast: &AstAssignAccess, - asg: &AsgAssignAccess, - ) -> Result { + pub fn reduce_assign_access(&mut self, ast: &AstAssignAccess, asg: &AsgAssignAccess) -> Result { let new = match (ast, asg) { (AstAssignAccess::ArrayRange(ast_left, ast_right), AsgAssignAccess::ArrayRange(asg_left, asg_right)) => { let left = match (ast_left.as_ref(), asg_left.get()) { @@ -484,7 +461,7 @@ impl CombineAstAsgDirector { self.ast_reducer.reduce_assignee_access(ast, new) } - pub fn reduce_assignee(&mut self, ast: &Assignee, asg: &[AsgAssignAccess]) -> Result { + pub fn reduce_assignee(&mut self, ast: &Assignee, asg: &[AsgAssignAccess]) -> Result { let mut accesses = vec![]; for (ast_access, asg_access) in ast.accesses.iter().zip(asg) { accesses.push(self.reduce_assign_access(ast_access, asg_access)?); @@ -493,22 +470,14 @@ impl CombineAstAsgDirector { self.ast_reducer.reduce_assignee(ast, ast.identifier.clone(), accesses) } - pub fn reduce_assign( - &mut self, - ast: &AstAssignStatement, - asg: &AsgAssignStatement, - ) -> Result { + pub fn reduce_assign(&mut self, ast: &AstAssignStatement, asg: &AsgAssignStatement) -> Result { let assignee = self.reduce_assignee(&ast.assignee, &asg.target_accesses)?; let value = self.reduce_expression(&ast.value, asg.value.get())?; self.ast_reducer.reduce_assign(ast, assignee, value) } - pub fn reduce_block( - &mut self, - ast: &AstBlockStatement, - asg: &AsgBlockStatement, - ) -> Result { + pub fn reduce_block(&mut self, ast: &AstBlockStatement, asg: &AsgBlockStatement) -> Result { let mut statements = vec![]; for (ast_statement, asg_statement) in ast.statements.iter().zip(asg.statements.iter()) { statements.push(self.reduce_statement(ast_statement, asg_statement.get())?); @@ -521,15 +490,13 @@ impl CombineAstAsgDirector { &mut self, ast: &AstConditionalStatement, asg: &AsgConditionalStatement, - ) -> Result { + ) -> Result { let condition = self.reduce_expression(&ast.condition, asg.condition.get())?; let block; if let AsgStatement::Block(asg_block) = asg.result.get() { block = self.reduce_block(&ast.block, asg_block)?; } else { - return Err(ReducerError::from(CombinerError::asg_statement_not_block( - asg.span.as_ref().unwrap(), - ))); + return Err(AstError::ast_statement_not_block(asg.span.as_ref().unwrap()).into()); } let next = match (ast.next.as_ref(), asg.next.get()) { (Some(ast_next), Some(asg_next)) => Some(self.reduce_statement(ast_next, asg_next)?), @@ -543,7 +510,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstConsoleStatement, asg: &AsgConsoleStatement, - ) -> Result { + ) -> Result { let function = match (&ast.function, &asg.function) { (AstConsoleFunction::Assert(ast_expression), AsgConsoleFunction::Assert(asg_expression)) => { AstConsoleFunction::Assert(self.reduce_expression(ast_expression, asg_expression.get())?) @@ -566,7 +533,9 @@ impl CombineAstAsgDirector { match &ast.function { AstConsoleFunction::Error(_) => AstConsoleFunction::Error(args), AstConsoleFunction::Log(_) => AstConsoleFunction::Log(args), - _ => return Err(ReducerError::impossible_console_assert_call(&ast_console_args.span)), + _ => { + return Err(AstError::impossible_console_assert_call(&ast_console_args.span).into()); + } } } _ => ast.function.clone(), @@ -579,7 +548,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstDefinitionStatement, asg: &AsgDefinitionStatement, - ) -> Result { + ) -> Result { let type_; if asg.variables.len() > 1 { @@ -617,7 +586,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstExpressionStatement, asg: &AsgExpressionStatement, - ) -> Result { + ) -> Result { let inner_expression = self.reduce_expression(&ast.expression, asg.expression.get())?; self.ast_reducer.reduce_expression_statement(ast, inner_expression) } @@ -626,37 +595,27 @@ impl CombineAstAsgDirector { &mut self, ast: &AstIterationStatement, asg: &AsgIterationStatement, - ) -> Result { + ) -> Result { let start = self.reduce_expression(&ast.start, asg.start.get())?; let stop = self.reduce_expression(&ast.stop, asg.stop.get())?; let block; if let AsgStatement::Block(asg_block) = asg.body.get() { block = self.reduce_block(&ast.block, asg_block)?; } else { - return Err(ReducerError::from(CombinerError::asg_statement_not_block( - asg.span.as_ref().unwrap(), - ))); + return Err(AstError::ast_statement_not_block(asg.span.as_ref().unwrap()).into()); } self.ast_reducer .reduce_iteration(ast, ast.variable.clone(), start, stop, block) } - pub fn reduce_return( - &mut self, - ast: &AstReturnStatement, - asg: &AsgReturnStatement, - ) -> Result { + pub fn reduce_return(&mut self, ast: &AstReturnStatement, asg: &AsgReturnStatement) -> Result { let expression = self.reduce_expression(&ast.expression, asg.expression.get())?; self.ast_reducer.reduce_return(ast, expression) } - pub fn reduce_program( - &mut self, - ast: &leo_ast::Program, - asg: &leo_asg::Program, - ) -> Result { + pub fn reduce_program(&mut self, ast: &leo_ast::Program, asg: &leo_asg::Program) -> Result { self.ast_reducer.swap_in_circuit(); let mut circuits = IndexMap::new(); for ((ast_ident, ast_circuit), (_asg_ident, asg_circuit)) in ast.circuits.iter().zip(&asg.circuits) { @@ -685,7 +644,7 @@ impl CombineAstAsgDirector { ) } - pub fn reduce_function(&mut self, ast: &AstFunction, asg: &AsgFunction) -> Result { + pub fn reduce_function(&mut self, ast: &AstFunction, asg: &AsgFunction) -> Result { let output = ast .output .as_ref() @@ -718,7 +677,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstCircuitMember, asg: &AsgCircuitMember, - ) -> Result { + ) -> Result { let new = match (ast, asg) { (AstCircuitMember::CircuitVariable(identifier, ast_type), AsgCircuitMember::Variable(asg_type)) => { AstCircuitMember::CircuitVariable( @@ -735,7 +694,7 @@ impl CombineAstAsgDirector { self.ast_reducer.reduce_circuit_member(ast, new) } - pub fn reduce_circuit(&mut self, ast: &AstCircuit, asg: &AsgCircuit) -> Result { + pub fn reduce_circuit(&mut self, ast: &AstCircuit, asg: &AsgCircuit) -> Result { let mut members = vec![]; for (ast_member, asg_member) in ast.members.iter().zip(asg.members.borrow().iter()) { members.push(self.reduce_circuit_member(ast_member, asg_member.1)?); diff --git a/compiler/src/prelude/blake2s.rs b/compiler/src/prelude/blake2s.rs index 1b27e9267e..d8d2502194 100644 --- a/compiler/src/prelude/blake2s.rs +++ b/compiler/src/prelude/blake2s.rs @@ -15,8 +15,9 @@ // along with the Leo library. If not, see . use super::CoreCircuit; -use crate::{errors::ExpressionError, ConstrainedValue, GroupType, Integer}; -use leo_asg::{Function, Span}; +use crate::{ConstrainedValue, GroupType, Integer}; +use leo_asg::Function; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::{ @@ -51,7 +52,7 @@ impl<'a, F: PrimeField, G: GroupType> CoreCircuit<'a, F, G> for Blake2s { span: &Span, target: Option>, mut arguments: Vec>, - ) -> Result, ExpressionError> { + ) -> Result> { assert_eq!(arguments.len(), 2); // asg enforced assert!(function.name.borrow().name.as_ref() == "hash"); // asg enforced assert!(target.is_none()); // asg enforced @@ -59,12 +60,12 @@ impl<'a, F: PrimeField, G: GroupType> CoreCircuit<'a, F, G> for Blake2s { let seed = unwrap_argument(arguments.remove(0)); let digest = Blake2sGadget::check_evaluation_gadget(cs.ns(|| "blake2s hash"), &seed[..], &input[..]) - .map_err(|e| ExpressionError::cannot_enforce("Blake2s check evaluation gadget".to_owned(), e, span))?; + .map_err(|e| CompilerError::cannot_enforce_expression("Blake2s check evaluation gadget", e, span))?; Ok(ConstrainedValue::Array( digest .to_bytes(cs) - .map_err(|e| ExpressionError::cannot_enforce("Vec ToBytes".to_owned(), e, span))? + .map_err(|e| CompilerError::cannot_enforce_expression("Vec ToBytes", e, span))? .into_iter() .map(Integer::U8) .map(ConstrainedValue::Integer) diff --git a/compiler/src/prelude/mod.rs b/compiler/src/prelude/mod.rs index 736308274b..4189c374c9 100644 --- a/compiler/src/prelude/mod.rs +++ b/compiler/src/prelude/mod.rs @@ -17,8 +17,10 @@ pub mod blake2s; pub use blake2s::*; -use crate::{errors::ExpressionError, ConstrainedValue, GroupType}; -use leo_asg::{Function, Span}; +use crate::{ConstrainedValue, GroupType}; +use leo_asg::Function; +use leo_errors::{Result, Span}; + use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -30,7 +32,7 @@ pub trait CoreCircuit<'a, F: PrimeField, G: GroupType>: Send + Sync { span: &Span, target: Option>, arguments: Vec>, - ) -> Result, ExpressionError>; + ) -> Result>; } pub fn resolve_core_circuit<'a, F: PrimeField, G: GroupType>(name: &str) -> impl CoreCircuit<'a, F, G> { diff --git a/compiler/src/statement/assign/assign.rs b/compiler/src/statement/assign/assign.rs index a535d8214e..8fbf0af1e8 100644 --- a/compiler/src/statement/assign/assign.rs +++ b/compiler/src/statement/assign/assign.rs @@ -16,8 +16,9 @@ //! Enforces an assign statement in a compiled Leo program. -use crate::{arithmetic::*, errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_asg::{AssignOperation, AssignStatement, Span}; +use crate::{arithmetic::*, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use leo_asg::{AssignOperation, AssignStatement}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::{boolean::Boolean, traits::select::CondSelectGadget}; @@ -30,7 +31,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { cs: &mut CS, indicator: &Boolean, statement: &AssignStatement<'a>, - ) -> Result<(), StatementError> { + ) -> Result<()> { // Get the name of the variable we are assigning to let new_value = self.enforce_expression(cs, statement.value.get())?; @@ -47,7 +48,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { target: &mut ConstrainedValue<'a, F, G>, new_value: ConstrainedValue<'a, F, G>, span: &Span, - ) -> Result<(), StatementError> { + ) -> Result<()> { let new_value = match operation { AssignOperation::Assign => new_value, AssignOperation::Add => enforce_add(cs, target.clone(), new_value, span)?, @@ -58,7 +59,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { _ => unimplemented!("unimplemented assign operator"), }; let selected_value = ConstrainedValue::conditionally_select(cs.ns(|| scope), condition, &new_value, target) - .map_err(|_| StatementError::select_fail(new_value.to_string(), target.to_string(), span))?; + .map_err(|_| CompilerError::statement_select_fail(new_value, target.clone(), span))?; *target = selected_value; Ok(()) diff --git a/compiler/src/statement/assign/assignee/array_index.rs b/compiler/src/statement/assign/assignee/array_index.rs index 62d817b870..a08064e7d3 100644 --- a/compiler/src/statement/assign/assignee/array_index.rs +++ b/compiler/src/statement/assign/assignee/array_index.rs @@ -18,13 +18,9 @@ use std::convert::TryInto; -use crate::{ - errors::{ExpressionError, StatementError}, - program::ConstrainedProgram, - value::ConstrainedValue, - GroupType, Integer, -}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType, Integer}; use leo_asg::{ConstInt, Expression, Node}; +use leo_errors::{CompilerError, Result}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::traits::{eq::EvaluateEqGadget, select::CondSelectGadget}; @@ -38,7 +34,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { cs: &mut CS, mut context: ResolverContext<'a, 'b, F, G>, index: &'a Expression<'a>, - ) -> Result<(), StatementError> { + ) -> Result<()> { let input_len = context.input.len(); let index_resolved = self.enforce_index(cs, index, &context.span)?; @@ -47,11 +43,10 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { ConstrainedValue::Array(input) => { if let Some(index) = index_resolved.to_usize() { if index >= input.len() { - Err(StatementError::array_assign_index_bounds( - index, - input.len(), - &context.span, - )) + Err( + CompilerError::statement_array_assign_index_bounds(index, input.len(), &context.span) + .into(), + ) } else { let target = input.get_mut(index).unwrap(); if context.remaining_accesses.is_empty() { @@ -67,7 +62,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { let array_len: u32 = input .len() .try_into() - .map_err(|_| ExpressionError::array_length_out_of_bounds(&span))?; + .map_err(|_| CompilerError::array_length_out_of_bounds(&span))?; self.array_bounds_check(cs, &index_resolved, array_len, &span)?; } @@ -80,11 +75,11 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { let index_bounded = i .try_into() - .map_err(|_| ExpressionError::array_index_out_of_legal_bounds(&span))?; + .map_err(|_| CompilerError::array_index_out_of_legal_bounds(&span))?; let const_index = ConstInt::U32(index_bounded).cast_to(&index_resolved.get_type()); let index_comparison = index_resolved .evaluate_equal(eq_namespace, &Integer::new(&const_index)) - .map_err(|_| ExpressionError::cannot_evaluate("==".to_string(), &span))?; + .map_err(|_| CompilerError::cannot_evaluate_expression("==", &span))?; let mut unique_namespace = cs.ns(|| { format!( @@ -117,23 +112,21 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { &temp_item, item, ) - .map_err(|e| ExpressionError::cannot_enforce("conditional select".to_string(), e, &span))?; + .map_err(|e| CompilerError::cannot_enforce_expression("conditional select", e, &span))?; *item = value; } Ok(()) } } - _ => Err(StatementError::array_assign_interior_index(&context.span)), + _ => Err(CompilerError::statement_array_assign_interior_index(&context.span).into()), } } else if context.from_range && input_len != 0 { context.from_range = false; if let Some(index) = index_resolved.to_usize() { if index >= input_len { - return Err(StatementError::array_assign_index_bounds( - index, - input_len, - &context.span, - )); + return Err( + CompilerError::statement_array_assign_index_bounds(index, input_len, &context.span).into(), + ); } let target = context.input.remove(index); @@ -151,7 +144,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { .input .len() .try_into() - .map_err(|_| ExpressionError::array_length_out_of_bounds(&span))?; + .map_err(|_| CompilerError::array_length_out_of_bounds(&span))?; self.array_bounds_check(cs, &index_resolved, array_len, &span)?; } @@ -164,11 +157,11 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { let index_bounded = i .try_into() - .map_err(|_| ExpressionError::array_index_out_of_legal_bounds(&span))?; + .map_err(|_| CompilerError::array_index_out_of_legal_bounds(&span))?; let const_index = ConstInt::U32(index_bounded).cast_to(&index_resolved.get_type()); let index_comparison = index_resolved .evaluate_equal(eq_namespace, &Integer::new(&const_index)) - .map_err(|_| ExpressionError::cannot_evaluate("==".to_string(), &span))?; + .map_err(|_| CompilerError::cannot_evaluate_expression("==", &span))?; let mut unique_namespace = cs.ns(|| { format!( @@ -197,13 +190,13 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { }; let value = ConstrainedValue::conditionally_select(unique_namespace, &index_comparison, &temp_item, item) - .map_err(|e| ExpressionError::cannot_enforce("conditional select".to_string(), e, &span))?; + .map_err(|e| CompilerError::cannot_enforce_expression("conditional select", e, &span))?; **item = value; } Ok(()) } } else { - Err(StatementError::array_assign_interior_index(&context.span)) + Err(CompilerError::statement_array_assign_interior_index(&context.span).into()) } } } diff --git a/compiler/src/statement/assign/assignee/array_range_index.rs b/compiler/src/statement/assign/assignee/array_range_index.rs index 3712a06382..aa5234d707 100644 --- a/compiler/src/statement/assign/assignee/array_range_index.rs +++ b/compiler/src/statement/assign/assignee/array_range_index.rs @@ -16,8 +16,9 @@ //! Resolves assignees in a compiled Leo program. -use crate::{errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; use leo_asg::Expression; +use leo_errors::{CompilerError, Result}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -31,13 +32,13 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { mut context: ResolverContext<'a, 'b, F, G>, start: Option<&'a Expression<'a>>, stop: Option<&'a Expression<'a>>, - ) -> Result<(), StatementError> { + ) -> Result<()> { let start_index = start .map(|start| self.enforce_index(cs, start, &context.span)) .transpose()? .map(|x| { x.to_usize() - .ok_or_else(|| StatementError::array_assign_index_const(&context.span)) + .ok_or_else(|| CompilerError::statement_array_assign_index_const(&context.span)) }) .transpose()?; let stop_index = stop @@ -45,7 +46,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { .transpose()? .map(|x| { x.to_usize() - .ok_or_else(|| StatementError::array_assign_index_const(&context.span)) + .ok_or_else(|| CompilerError::statement_array_assign_index_const(&context.span)) }) .transpose()?; let start_index = start_index.unwrap_or(0); @@ -74,7 +75,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { } Ok(()) } - _ => Err(StatementError::array_assign_index(&context.span)), + _ => Err(CompilerError::statement_array_assign_index(&context.span).into()), } } else { // range of a range diff --git a/compiler/src/statement/assign/assignee/member.rs b/compiler/src/statement/assign/assignee/member.rs index c51c70514d..ac4fef1bcf 100644 --- a/compiler/src/statement/assign/assignee/member.rs +++ b/compiler/src/statement/assign/assignee/member.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; use leo_asg::Identifier; +use leo_errors::{CompilerError, Result}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -28,9 +29,9 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { cs: &mut CS, mut context: ResolverContext<'a, 'b, F, G>, name: &Identifier, - ) -> Result<(), StatementError> { + ) -> Result<()> { if context.input.len() != 1 { - return Err(StatementError::array_assign_interior_index(&context.span)); + return Err(CompilerError::statement_array_assign_interior_index(&context.span).into()); } match context.input.remove(0) { ConstrainedValue::CircuitExpression(_variable, members) => { @@ -44,15 +45,12 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { } None => { // Throw an error if the circuit variable does not exist in the circuit - Err(StatementError::undefined_circuit_variable( - name.to_string(), - &context.span, - )) + Err(CompilerError::statement_undefined_circuit_variable(name, &context.span).into()) } } } // Throw an error if the circuit definition does not exist in the file - x => Err(StatementError::undefined_circuit(x.to_string(), &context.span)), + x => Err(CompilerError::undefined_circuit(x, &context.span).into()), } } } diff --git a/compiler/src/statement/assign/assignee/mod.rs b/compiler/src/statement/assign/assignee/mod.rs index 1072c4039b..5c9cbd5927 100644 --- a/compiler/src/statement/assign/assignee/mod.rs +++ b/compiler/src/statement/assign/assignee/mod.rs @@ -16,8 +16,9 @@ //! Resolves assignees in a compiled Leo program. -use crate::{errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; -use leo_asg::{AssignAccess, AssignOperation, AssignStatement, Span}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use leo_asg::{AssignAccess, AssignOperation, AssignStatement}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::boolean::Boolean; @@ -44,7 +45,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { cs: &mut CS, context: &ResolverContext<'a, 'b, F, G>, target: &mut ConstrainedValue<'a, F, G>, - ) -> Result<(), StatementError> { + ) -> Result<()> { Self::enforce_assign_operation( cs, context.indicator, @@ -60,7 +61,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { &mut self, cs: &mut CS, mut context: ResolverContext<'a, 'b, F, G>, - ) -> Result<(), StatementError> { + ) -> Result<()> { if context.remaining_accesses.is_empty() { if context.input.len() != 1 { panic!("invalid non-array-context multi-value assignment"); @@ -89,7 +90,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { assignee: &AssignStatement<'a>, target_value: ConstrainedValue<'a, F, G>, indicator: &Boolean, - ) -> Result<(), StatementError> { + ) -> Result<()> { let span = assignee.span.clone().unwrap_or_default(); let variable = assignee.target_variable.get().borrow(); @@ -111,23 +112,13 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { Ok(()) } - pub(crate) fn check_range_index( - start_index: usize, - stop_index: usize, - len: usize, - span: &Span, - ) -> Result<(), StatementError> { + pub(crate) fn check_range_index(start_index: usize, stop_index: usize, len: usize, span: &Span) -> Result<()> { if stop_index < start_index { - Err(StatementError::array_assign_range_order( - start_index, - stop_index, - len, - span, - )) + Err(CompilerError::statement_array_assign_range_order(start_index, stop_index, len, span).into()) } else if start_index > len { - Err(StatementError::array_assign_index_bounds(start_index, len, span)) + Err(CompilerError::statement_array_assign_index_bounds(start_index, len, span).into()) } else if stop_index > len { - Err(StatementError::array_assign_index_bounds(stop_index, len, span)) + Err(CompilerError::statement_array_assign_index_bounds(stop_index, len, span).into()) } else { Ok(()) } diff --git a/compiler/src/statement/assign/assignee/tuple.rs b/compiler/src/statement/assign/assignee/tuple.rs index 34df5a3477..7cf32c1edd 100644 --- a/compiler/src/statement/assign/assignee/tuple.rs +++ b/compiler/src/statement/assign/assignee/tuple.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use leo_errors::{CompilerError, Result}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -27,24 +28,20 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { cs: &mut CS, mut context: ResolverContext<'a, 'b, F, G>, index: usize, - ) -> Result<(), StatementError> { + ) -> Result<()> { if context.input.len() != 1 { - return Err(StatementError::array_assign_interior_index(&context.span)); + return Err(CompilerError::statement_array_assign_interior_index(&context.span).into()); } match context.input.remove(0) { ConstrainedValue::Tuple(old) => { if index > old.len() { - Err(StatementError::tuple_assign_index_bounds( - index, - old.len(), - &context.span, - )) + Err(CompilerError::statement_tuple_assign_index_bounds(index, old.len(), &context.span).into()) } else { context.input = vec![&mut old[index]]; self.resolve_target_access(cs, context) } } - _ => Err(StatementError::tuple_assign_index(&context.span)), + _ => Err(CompilerError::statement_tuple_assign_index(&context.span).into()), } } } diff --git a/compiler/src/statement/conditional/conditional.rs b/compiler/src/statement/conditional/conditional.rs index 2a252edb1e..c8ba369309 100644 --- a/compiler/src/statement/conditional/conditional.rs +++ b/compiler/src/statement/conditional/conditional.rs @@ -17,10 +17,10 @@ //! Methods to enforce constraints on statements in a compiled Leo program. use crate::{ - errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType, - IndicatorAndConstrainedValue, StatementResult, + program::ConstrainedProgram, value::ConstrainedValue, GroupType, IndicatorAndConstrainedValue, StatementResult, }; use leo_asg::ConditionalStatement; +use leo_errors::CompilerError; use snarkvm_fields::PrimeField; use snarkvm_gadgets::boolean::Boolean; @@ -53,7 +53,11 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { let inner_indicator = match self.enforce_expression(cs, statement.condition.get())? { ConstrainedValue::Boolean(resolved) => resolved, value => { - return Err(StatementError::conditional_boolean(value.to_string(), &span)); + return Err(CompilerError::conditional_boolean_expression_fails_to_resolve_to_bool( + value.to_string(), + &span, + ) + .into()); } }; @@ -69,7 +73,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { outer_indicator, &inner_indicator, ) - .map_err(|_| StatementError::indicator_calculation(branch_1_name, &span))?; + .map_err(|_| CompilerError::statement_indicator_calculation(branch_1_name, &span))?; let mut results = vec![]; @@ -90,7 +94,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { outer_indicator, &inner_indicator, ) - .map_err(|_| StatementError::indicator_calculation(branch_2_name, &span))?; + .map_err(|_| CompilerError::statement_indicator_calculation(branch_2_name, &span))?; // Evaluate branch 2 let mut branch_2_result = match statement.next.get() { diff --git a/compiler/src/statement/definition/definition.rs b/compiler/src/statement/definition/definition.rs index e0b7eca6ea..586ff67e42 100644 --- a/compiler/src/statement/definition/definition.rs +++ b/compiler/src/statement/definition/definition.rs @@ -16,8 +16,9 @@ //! Enforces a definition statement in a compiled Leo program. -use crate::{errors::StatementError, program::ConstrainedProgram, ConstrainedValue, GroupType}; -use leo_asg::{DefinitionStatement, Span, Variable}; +use crate::{program::ConstrainedProgram, ConstrainedValue, GroupType}; +use leo_asg::{DefinitionStatement, Variable}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -28,13 +29,14 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { variable_names: &[&'a Variable<'a>], values: Vec>, span: &Span, - ) -> Result<(), StatementError> { + ) -> Result<()> { if values.len() != variable_names.len() { - return Err(StatementError::invalid_number_of_definitions( + return Err(CompilerError::statement_invalid_number_of_definitions( values.len(), variable_names.len(), span, - )); + ) + .into()); } for (variable, value) in variable_names.iter().zip(values.into_iter()) { @@ -49,7 +51,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { &mut self, cs: &mut CS, statement: &DefinitionStatement<'a>, - ) -> Result<(), StatementError> { + ) -> Result<()> { let num_variables = statement.variables.len(); let expression = self.enforce_expression(cs, statement.value.get())?; @@ -63,7 +65,9 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { let values = match expression { // ConstrainedValue::Return(values) => values, ConstrainedValue::Tuple(values) => values, - value => return Err(StatementError::multiple_definition(value.to_string(), &span)), + value => { + return Err(CompilerError::statement_multiple_definition(value, &span).into()); + } }; self.enforce_multiple_definition(&statement.variables[..], values, &span) diff --git a/compiler/src/statement/iteration/iteration.rs b/compiler/src/statement/iteration/iteration.rs index e4e885c502..1efd9e4319 100644 --- a/compiler/src/statement/iteration/iteration.rs +++ b/compiler/src/statement/iteration/iteration.rs @@ -17,10 +17,11 @@ //! Enforces an iteration statement in a compiled Leo program. use crate::{ - errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType, - IndicatorAndConstrainedValue, Integer, IntegerTrait, StatementResult, + program::ConstrainedProgram, value::ConstrainedValue, GroupType, IndicatorAndConstrainedValue, Integer, + IntegerTrait, StatementResult, }; use leo_asg::IterationStatement; +use leo_errors::CompilerError; use snarkvm_fields::PrimeField; use snarkvm_gadgets::{boolean::Boolean, integers::uint::UInt32}; @@ -41,11 +42,11 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { let from = self .enforce_index(cs, statement.start.get(), &span)? .to_usize() - .ok_or_else(|| StatementError::loop_index_const(&span))?; + .ok_or_else(|| CompilerError::statement_loop_index_const(&span))?; let to = self .enforce_index(cs, statement.stop.get(), &span)? .to_usize() - .ok_or_else(|| StatementError::loop_index_const(&span))?; + .ok_or_else(|| CompilerError::statement_loop_index_const(&span))?; let iter: Box> = match (from < to, statement.inclusive) { (true, true) => Box::new(from..=to), diff --git a/compiler/src/statement/return_/return_.rs b/compiler/src/statement/return_/return_.rs index 91e23c9e04..a539592b4e 100644 --- a/compiler/src/statement/return_/return_.rs +++ b/compiler/src/statement/return_/return_.rs @@ -16,8 +16,9 @@ //! Enforces a return statement in a compiled Leo program. -use crate::{errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; use leo_asg::ReturnStatement; +use leo_errors::Result; use snarkvm_fields::PrimeField; use snarkvm_r1cs::ConstraintSystem; @@ -27,7 +28,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { &mut self, cs: &mut CS, statement: &ReturnStatement<'a>, - ) -> Result, StatementError> { + ) -> Result> { let result = self.enforce_expression(cs, statement.expression.get())?; Ok(result) } diff --git a/compiler/src/statement/statement.rs b/compiler/src/statement/statement.rs index 4e349fcbc5..81bc267226 100644 --- a/compiler/src/statement/statement.rs +++ b/compiler/src/statement/statement.rs @@ -16,14 +16,15 @@ //! Enforces a statement in a compiled Leo program. -use crate::{errors::StatementError, program::ConstrainedProgram, value::ConstrainedValue, GroupType}; +use crate::{program::ConstrainedProgram, value::ConstrainedValue, GroupType}; use leo_asg::{Node, Statement}; +use leo_errors::{CompilerError, Result}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::boolean::Boolean; use snarkvm_r1cs::ConstraintSystem; -pub type StatementResult = Result; +pub type StatementResult = Result; pub type IndicatorAndConstrainedValue<'a, T, U> = (Boolean, ConstrainedValue<'a, T, U>); impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { @@ -81,7 +82,9 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { } } _ => { - return Err(StatementError::unassigned(&statement.span.clone().unwrap_or_default())); + return Err( + CompilerError::statement_unassigned(&statement.span.clone().unwrap_or_default()).into(), + ); } } } diff --git a/compiler/src/test.rs b/compiler/src/test.rs index d7ccbdedb5..244fa58961 100644 --- a/compiler/src/test.rs +++ b/compiler/src/test.rs @@ -18,6 +18,8 @@ use std::path::{Path, PathBuf}; use leo_asg::*; use leo_ast::{Ast, Program}; +use leo_errors::Result; + use leo_synthesizer::{CircuitSynthesizer, SerializedCircuit, SummarizedCircuit}; use leo_test_framework::{ runner::{Namespace, ParseType, Runner}, @@ -26,9 +28,7 @@ use leo_test_framework::{ use serde_yaml::Value; use snarkvm_curves::{bls12_377::Bls12_377, edwards_bls12::Fq}; -use crate::{ - compiler::Compiler, errors::CompilerError, targets::edwards_bls12::EdwardsGroupType, AstSnapshotOptions, Output, -}; +use crate::{compiler::Compiler, targets::edwards_bls12::EdwardsGroupType, AstSnapshotOptions, Output}; pub type EdwardsTestCompiler = Compiler<'static, Fq, EdwardsGroupType>; // pub type EdwardsConstrainedValue = ConstrainedValue<'static, Fq, EdwardsGroupType>; @@ -67,8 +67,8 @@ pub(crate) fn parse_program( program_string: &str, theorem_options: Option, cwd: Option, -) -> Result { - let mut compiler = new_compiler(cwd.unwrap_or("compiler-test".into()), theorem_options); +) -> Result { + let mut compiler = new_compiler(cwd.unwrap_or_else(|| "compiler-test".into()), theorem_options); compiler.parse_program_from_string(program_string)?; diff --git a/compiler/src/value/address/address.rs b/compiler/src/value/address/address.rs index 61c13ee83e..30e686ace1 100644 --- a/compiler/src/value/address/address.rs +++ b/compiler/src/value/address/address.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{errors::AddressError, ConstrainedValue, GroupType, IntegerTrait}; -use leo_ast::{InputValue, Span}; +use crate::{ConstrainedValue, GroupType, IntegerTrait}; +use leo_ast::InputValue; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_dpc::{account::Address as AleoAddress, testnet1::instantiated::Components}; use snarkvm_fields::PrimeField; @@ -40,8 +41,9 @@ pub struct Address { } impl Address { - pub(crate) fn constant(address: String, span: &Span) -> Result { - let address = AleoAddress::from_str(&address).map_err(|error| AddressError::account_error(error, span))?; + pub(crate) fn constant(address: String, span: &Span) -> Result { + let address = + AleoAddress::from_str(&address).map_err(|e| CompilerError::address_value_account_error(e, span))?; let mut address_bytes = vec![]; address.write_le(&mut address_bytes).unwrap(); @@ -63,14 +65,14 @@ impl Address { name: &str, input_value: Option, span: &Span, - ) -> Result, AddressError> { + ) -> Result> { // Check that the input value is the correct type let address_value = match input_value { Some(input) => { if let InputValue::Address(string) = input { Some(string) } else { - return Err(AddressError::invalid_address(name.to_owned(), span)); + return Err(CompilerError::address_value_invalid_address(name, span).into()); } } None => None, @@ -80,7 +82,7 @@ impl Address { cs.ns(|| format!("`{}: address` {}:{}", name, span.line_start, span.col_start)), || address_value.ok_or(SynthesisError::AssignmentMissing), ) - .map_err(|_| AddressError::missing_address(span))?; + .map_err(|_| CompilerError::address_value_missing_address(span))?; Ok(ConstrainedValue::Address(address)) } diff --git a/compiler/src/value/boolean/input.rs b/compiler/src/value/boolean/input.rs index 93e220b282..bcba6e7616 100644 --- a/compiler/src/value/boolean/input.rs +++ b/compiler/src/value/boolean/input.rs @@ -16,8 +16,9 @@ //! Methods to enforce constraints on input boolean values in a resolved Leo program. -use crate::{errors::BooleanError, value::ConstrainedValue, GroupType}; -use leo_ast::{InputValue, Span}; +use crate::{value::ConstrainedValue, GroupType}; +use leo_ast::InputValue; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::{boolean::Boolean, traits::alloc::AllocGadget}; @@ -28,12 +29,12 @@ pub(crate) fn allocate_bool>( name: &str, option: Option, span: &Span, -) -> Result { - Boolean::alloc( +) -> Result { + Ok(Boolean::alloc( cs.ns(|| format!("`{}: bool` {}:{}", name, span.line_start, span.col_start)), || option.ok_or(SynthesisError::AssignmentMissing), ) - .map_err(|_| BooleanError::missing_boolean(format!("{}: bool", name), span)) + .map_err(|_| CompilerError::boolean_value_missing_boolean(format!("{}: bool", name), span))?) } pub(crate) fn bool_from_input<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( @@ -41,14 +42,14 @@ pub(crate) fn bool_from_input<'a, F: PrimeField, G: GroupType, CS: Constraint name: &str, input_value: Option, span: &Span, -) -> Result, BooleanError> { +) -> Result> { // Check that the input value is the correct type let option = match input_value { Some(input) => { if let InputValue::Boolean(bool) = input { Some(bool) } else { - return Err(BooleanError::invalid_boolean(name.to_owned(), span)); + return Err(CompilerError::boolean_value_invalid_boolean(name, span).into()); } } None => None, diff --git a/compiler/src/value/char/char.rs b/compiler/src/value/char/char.rs index 400046ba76..ed3a268cb8 100644 --- a/compiler/src/value/char/char.rs +++ b/compiler/src/value/char/char.rs @@ -15,12 +15,13 @@ // along with the Leo library. If not, see . use crate::{ - errors::CharError, value::{field::input::allocate_field, ConstrainedValue}, FieldType, GroupType, }; -use leo_ast::{InputValue, Span}; +use leo_ast::InputValue; +use leo_errors::{CompilerError, Result, Span}; + use snarkvm_fields::PrimeField; use snarkvm_gadgets::{ boolean::Boolean, @@ -46,12 +47,7 @@ pub struct Char { } impl Char { - pub fn constant>( - cs: CS, - character: CharType, - field: String, - span: &Span, - ) -> Result { + pub fn constant>(cs: CS, character: CharType, field: String, span: &Span) -> Result { Ok(Self { character, field: FieldType::constant(cs, field, span)?, @@ -146,7 +142,7 @@ pub(crate) fn char_from_input<'a, F: PrimeField, G: GroupType, CS: Constraint name: &str, input_value: Option, span: &Span, -) -> Result, CharError> { +) -> Result> { // Check that the parameter value is the correct type let option = match input_value { Some(input) => { @@ -158,7 +154,7 @@ pub(crate) fn char_from_input<'a, F: PrimeField, G: GroupType, CS: Constraint } } } else { - return Err(CharError::invalid_char(input.to_string(), span)); + return Err(CompilerError::char_value_invalid_char(input, span).into()); } } None => (CharType::Scalar(0 as char), None), diff --git a/compiler/src/value/field/field_type.rs b/compiler/src/value/field/field_type.rs index b047545119..0dbef30991 100644 --- a/compiler/src/value/field/field_type.rs +++ b/compiler/src/value/field/field_type.rs @@ -16,8 +16,8 @@ //! A data type that represents a field value -use crate::{errors::FieldError, number_string_typing}; -use leo_ast::Span; +use crate::number_string_typing; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::{ @@ -46,70 +46,76 @@ impl FieldType { } /// Returns a new `FieldType` from the given `String` or returns a `FieldError`. - pub fn constant>(cs: CS, string: String, span: &Span) -> Result { + pub fn constant>(cs: CS, string: String, span: &Span) -> Result { let number_info = number_string_typing(&string); let value = match number_info { (number, neg) if neg => { - -F::from_str(&number).map_err(|_| FieldError::invalid_field(string.clone(), span))? + -F::from_str(&number).map_err(|_| CompilerError::field_value_invalid_field(string.clone(), span))? + } + (number, _) => { + F::from_str(&number).map_err(|_| CompilerError::field_value_invalid_field(string.clone(), span))? } - (number, _) => F::from_str(&number).map_err(|_| FieldError::invalid_field(string.clone(), span))?, }; - let value = FpGadget::alloc_constant(cs, || Ok(value)).map_err(|_| FieldError::invalid_field(string, span))?; + let value = FpGadget::alloc_constant(cs, || Ok(value)) + .map_err(|_| CompilerError::field_value_invalid_field(string, span))?; Ok(FieldType(value)) } /// Returns a new `FieldType` by calling the `FpGadget` `negate` function. - pub fn negate>(&self, cs: CS, span: &Span) -> Result { - let result = self.0.negate(cs).map_err(|e| FieldError::negate_operation(e, span))?; + pub fn negate>(&self, cs: CS, span: &Span) -> Result { + let result = self + .0 + .negate(cs) + .map_err(|e| CompilerError::field_value_negate_operation(e, span))?; Ok(FieldType(result)) } /// Returns a new `FieldType` by calling the `FpGadget` `add` function. - pub fn add>(&self, cs: CS, other: &Self, span: &Span) -> Result { + pub fn add>(&self, cs: CS, other: &Self, span: &Span) -> Result { let value = self .0 .add(cs, &other.0) - .map_err(|e| FieldError::binary_operation("+".to_string(), e, span))?; + .map_err(|e| CompilerError::field_value_binary_operation("+", e, span))?; Ok(FieldType(value)) } /// Returns a new `FieldType` by calling the `FpGadget` `sub` function. - pub fn sub>(&self, cs: CS, other: &Self, span: &Span) -> Result { + pub fn sub>(&self, cs: CS, other: &Self, span: &Span) -> Result { let value = self .0 .sub(cs, &other.0) - .map_err(|e| FieldError::binary_operation("-".to_string(), e, span))?; + .map_err(|e| CompilerError::field_value_binary_operation("-", e, span))?; Ok(FieldType(value)) } /// Returns a new `FieldType` by calling the `FpGadget` `mul` function. - pub fn mul>(&self, cs: CS, other: &Self, span: &Span) -> Result { + pub fn mul>(&self, cs: CS, other: &Self, span: &Span) -> Result { let value = self .0 .mul(cs, &other.0) - .map_err(|e| FieldError::binary_operation("*".to_string(), e, span))?; + .map_err(|e| CompilerError::field_value_binary_operation("*", e, span))?; Ok(FieldType(value)) } /// Returns a new `FieldType` by calling the `FpGadget` `inverse` function. - pub fn inverse>(&self, cs: CS, span: &Span) -> Result { + pub fn inverse>(&self, cs: CS, span: &Span) -> Result { let value = self .0 .inverse(cs) - .map_err(|e| FieldError::binary_operation("inv".to_string(), e, span))?; + .map_err(|e| CompilerError::field_value_binary_operation("inv", e, span))?; Ok(FieldType(value)) } /// Returns a new `FieldType` by calling the `FpGadget` `div` function. - pub fn div>(&self, mut cs: CS, other: &Self, span: &Span) -> Result { + pub fn div>(&self, mut cs: CS, other: &Self, span: &Span) -> Result { let inverse = other.inverse(cs.ns(|| "division inverse"), span)?; self.mul(cs, &inverse, span) diff --git a/compiler/src/value/field/input.rs b/compiler/src/value/field/input.rs index b1a1074788..350b659f71 100644 --- a/compiler/src/value/field/input.rs +++ b/compiler/src/value/field/input.rs @@ -16,8 +16,9 @@ //! Methods to enforce constraints on input field values in a compiled Leo program. -use crate::{errors::FieldError, number_string_typing, value::ConstrainedValue, FieldType, GroupType}; -use leo_ast::{InputValue, Span}; +use crate::{number_string_typing, value::ConstrainedValue, FieldType, GroupType}; +use leo_ast::InputValue; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::traits::alloc::AllocGadget; @@ -28,7 +29,7 @@ pub(crate) fn allocate_field>( name: &str, option: Option, span: &Span, -) -> Result, FieldError> { +) -> Result> { match option { Some(string) => { let number_info = number_string_typing(&string); @@ -39,15 +40,17 @@ pub(crate) fn allocate_field>( || Some(number).ok_or(SynthesisError::AssignmentMissing), ) .map(|value| value.negate(cs, span)) - .map_err(|_| FieldError::missing_field(format!("{}: field", name), span))?, - (number, _) => FieldType::alloc( + .map_err(|_| CompilerError::field_value_missing_field(format!("{}: field", name), span))?, + (number, _) => Ok(FieldType::alloc( cs.ns(|| format!("`{}: field` {}:{}", name, span.line_start, span.col_start)), || Some(number).ok_or(SynthesisError::AssignmentMissing), ) - .map_err(|_| FieldError::missing_field(format!("{}: field", name), span)), + .map_err(|_| CompilerError::field_value_missing_field(format!("{}: field", name), span))?), } } - None => Err(FieldError::missing_field(format!("{}: field", name), span)), + None => { + return Err(CompilerError::field_value_missing_field(format!("{}: field", name), span).into()); + } } } @@ -56,14 +59,14 @@ pub(crate) fn field_from_input<'a, F: PrimeField, G: GroupType, CS: Constrain name: &str, input_value: Option, span: &Span, -) -> Result, FieldError> { +) -> Result> { // Check that the parameter value is the correct type let option = match input_value { Some(input) => { if let InputValue::Field(string) = input { Some(string) } else { - return Err(FieldError::invalid_field(input.to_string(), span)); + return Err(CompilerError::field_value_invalid_field(input, span).into()); } } None => None, diff --git a/compiler/src/value/group/group_type.rs b/compiler/src/value/group/group_type.rs index 6a94d040ea..8ce9ffff7a 100644 --- a/compiler/src/value/group/group_type.rs +++ b/compiler/src/value/group/group_type.rs @@ -16,8 +16,8 @@ //! A data type that represents members in the group formed by the set of affine points on a curve. -use crate::errors::GroupError; -use leo_asg::{GroupValue, Span}; +use leo_asg::GroupValue; +use leo_errors::{Result, Span}; use snarkvm_fields::{Field, One}; use snarkvm_gadgets::{ @@ -45,13 +45,13 @@ pub trait GroupType: + ToBitsBEGadget + ToBytesGadget { - fn constant(value: &GroupValue, span: &Span) -> Result; + fn constant(value: &GroupValue, span: &Span) -> Result; - fn to_allocated>(&self, cs: CS, span: &Span) -> Result; + fn to_allocated>(&self, cs: CS, span: &Span) -> Result; - fn negate>(&self, cs: CS, span: &Span) -> Result; + fn negate>(&self, cs: CS, span: &Span) -> Result; - fn add>(&self, cs: CS, other: &Self, span: &Span) -> Result; + fn add>(&self, cs: CS, other: &Self, span: &Span) -> Result; - fn sub>(&self, cs: CS, other: &Self, span: &Span) -> Result; + fn sub>(&self, cs: CS, other: &Self, span: &Span) -> Result; } diff --git a/compiler/src/value/group/input.rs b/compiler/src/value/group/input.rs index e3d53ada8a..60d5eaa917 100644 --- a/compiler/src/value/group/input.rs +++ b/compiler/src/value/group/input.rs @@ -16,9 +16,10 @@ //! Methods to enforce constraints on input group values in a Leo program. -use crate::{errors::GroupError, ConstrainedValue, GroupType}; -use leo_asg::{GroupValue, Span}; +use crate::{ConstrainedValue, GroupType}; +use leo_asg::GroupValue; use leo_ast::InputValue; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_r1cs::{ConstraintSystem, SynthesisError}; @@ -28,12 +29,12 @@ pub(crate) fn allocate_group, CS: ConstraintSyste name: &str, option: Option, span: &Span, -) -> Result { - G::alloc( +) -> Result { + Ok(G::alloc( cs.ns(|| format!("`{}: group` {}:{}", name, span.line_start, span.col_start)), || option.ok_or(SynthesisError::AssignmentMissing), ) - .map_err(|_| GroupError::missing_group(format!("{}: group", name), span)) + .map_err(|_| CompilerError::group_value_missing_group(format!("{}: group", name), span))?) } pub(crate) fn group_from_input<'a, F: PrimeField, G: GroupType, CS: ConstraintSystem>( @@ -41,14 +42,14 @@ pub(crate) fn group_from_input<'a, F: PrimeField, G: GroupType, CS: Constrain name: &str, input_value: Option, span: &Span, -) -> Result, GroupError> { +) -> Result> { // Check that the parameter value is the correct type let option = match input_value { Some(input) => { if let InputValue::Group(string) = input { Some(string) } else { - return Err(GroupError::invalid_group(input.to_string(), span)); + return Err(CompilerError::group_value_missing_group(input, span).into()); } } None => None, diff --git a/compiler/src/value/group/targets/edwards_bls12.rs b/compiler/src/value/group/targets/edwards_bls12.rs index be98cecfab..43c84a7ed4 100644 --- a/compiler/src/value/group/targets/edwards_bls12.rs +++ b/compiler/src/value/group/targets/edwards_bls12.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{errors::GroupError, number_string_typing, GroupType}; -use leo_asg::{GroupCoordinate, GroupValue, Span}; +use crate::{number_string_typing, GroupType}; +use leo_asg::{GroupCoordinate, GroupValue}; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_curves::{ edwards_bls12::{EdwardsAffine, EdwardsParameters, Fq}, @@ -51,31 +52,32 @@ pub enum EdwardsGroupType { } impl GroupType for EdwardsGroupType { - fn constant(group: &GroupValue, span: &Span) -> Result { + fn constant(group: &GroupValue, span: &Span) -> Result { let value = Self::edwards_affine_from_value(group, span)?; Ok(EdwardsGroupType::Constant(value)) } - fn to_allocated>(&self, mut cs: CS, span: &Span) -> Result { - self.allocated(cs.ns(|| format!("allocate affine point {}:{}", span.line_start, span.col_start))) + fn to_allocated>(&self, mut cs: CS, span: &Span) -> Result { + Ok(self + .allocated(cs.ns(|| format!("allocate affine point {}:{}", span.line_start, span.col_start))) .map(|ebg| EdwardsGroupType::Allocated(Box::new(ebg))) - .map_err(|error| GroupError::synthesis_error(error, span)) + .map_err(|e| CompilerError::group_value_synthesis_error(e, span))?) } - fn negate>(&self, cs: CS, span: &Span) -> Result { + fn negate>(&self, cs: CS, span: &Span) -> Result { match self { EdwardsGroupType::Constant(group) => Ok(EdwardsGroupType::Constant(group.neg())), EdwardsGroupType::Allocated(group) => { let result = , Fq>>::negate(group, cs) - .map_err(|e| GroupError::negate_operation(e, span))?; + .map_err(|e| CompilerError::group_value_negate_operation(e, span))?; Ok(EdwardsGroupType::Allocated(Box::new(result))) } } } - fn add>(&self, cs: CS, other: &Self, span: &Span) -> Result { + fn add>(&self, cs: CS, other: &Self, span: &Span) -> Result { match (self, other) { (EdwardsGroupType::Constant(self_value), EdwardsGroupType::Constant(other_value)) => { Ok(EdwardsGroupType::Constant(self_value.add(other_value))) @@ -87,7 +89,7 @@ impl GroupType for EdwardsGroupType { cs, other_value, ) - .map_err(|e| GroupError::binary_operation("+".to_string(), e, span))?; + .map_err(|e| CompilerError::group_value_binary_operation("+", e, span))?; Ok(EdwardsGroupType::Allocated(Box::new(result))) } @@ -97,13 +99,13 @@ impl GroupType for EdwardsGroupType { Ok(EdwardsGroupType::Allocated(Box::new( allocated_value .add_constant(cs, constant_value) - .map_err(|e| GroupError::binary_operation("+".to_string(), e, span))?, + .map_err(|e| CompilerError::group_value_binary_operation("+", e, span))?, ))) } } } - fn sub>(&self, cs: CS, other: &Self, span: &Span) -> Result { + fn sub>(&self, cs: CS, other: &Self, span: &Span) -> Result { match (self, other) { (EdwardsGroupType::Constant(self_value), EdwardsGroupType::Constant(other_value)) => { Ok(EdwardsGroupType::Constant(self_value.sub(other_value))) @@ -115,7 +117,7 @@ impl GroupType for EdwardsGroupType { cs, other_value, ) - .map_err(|e| GroupError::binary_operation("-".to_string(), e, span))?; + .map_err(|e| CompilerError::group_value_binary_operation("-", e, span))?; Ok(EdwardsGroupType::Allocated(Box::new(result))) } @@ -125,7 +127,7 @@ impl GroupType for EdwardsGroupType { Ok(EdwardsGroupType::Allocated(Box::new( allocated_value .sub_constant(cs, constant_value) - .map_err(|e| GroupError::binary_operation("-".to_string(), e, span))?, + .map_err(|e| CompilerError::group_value_binary_operation("-", e, span))?, ))) } } @@ -133,14 +135,14 @@ impl GroupType for EdwardsGroupType { } impl EdwardsGroupType { - pub fn edwards_affine_from_value(value: &GroupValue, span: &Span) -> Result { + pub fn edwards_affine_from_value(value: &GroupValue, span: &Span) -> Result { match value { GroupValue::Single(number, ..) => Self::edwards_affine_from_single(number, span), GroupValue::Tuple(x, y) => Self::edwards_affine_from_tuple(x, y, span), } } - pub fn edwards_affine_from_single(number: &str, span: &Span) -> Result { + pub fn edwards_affine_from_single(number: &str, span: &Span) -> Result { let number_info = number_string_typing(number); if number_info.0.eq("0") { @@ -148,8 +150,12 @@ impl EdwardsGroupType { } else { let one = edwards_affine_one(); let number_value = match number_info { - (number, neg) if neg => -Fp256::from_str(&number).map_err(|_| GroupError::n_group(number, span))?, - (number, _) => Fp256::from_str(&number).map_err(|_| GroupError::n_group(number, span))?, + (number, neg) if neg => { + -Fp256::from_str(&number).map_err(|_| CompilerError::group_value_n_group(number, span))? + } + (number, _) => { + Fp256::from_str(&number).map_err(|_| CompilerError::group_value_n_group(number, span))? + } }; let result: EdwardsAffine = one.mul(number_value); @@ -158,11 +164,7 @@ impl EdwardsGroupType { } } - pub fn edwards_affine_from_tuple( - x: &GroupCoordinate, - y: &GroupCoordinate, - span: &Span, - ) -> Result { + pub fn edwards_affine_from_tuple(x: &GroupCoordinate, y: &GroupCoordinate, span: &Span) -> Result { let x = x.clone(); let y = y.clone(); @@ -200,7 +202,9 @@ impl EdwardsGroupType { Self::edwards_affine_from_y_str(number_string_typing(&y_string), span, None, span) } // Invalid - (x, y) => Err(GroupError::invalid_group(format!("({}, {})", x, y), span)), + (x, y) => { + return Err(CompilerError::group_value_invalid_group(format!("({}, {})", x, y), span).into()); + } } } @@ -209,17 +213,18 @@ impl EdwardsGroupType { x_span: &Span, greatest: Option, element_span: &Span, - ) -> Result { + ) -> Result { let x = match x_info { - (x_str, neg) if neg => -Fq::from_str(&x_str).map_err(|_| GroupError::x_invalid(x_str, x_span))?, - (x_str, _) => Fq::from_str(&x_str).map_err(|_| GroupError::x_invalid(x_str, x_span))?, + (x_str, neg) if neg => { + -Fq::from_str(&x_str).map_err(|_| CompilerError::group_value_x_invalid(x_str, x_span))? + } + (x_str, _) => Fq::from_str(&x_str).map_err(|_| CompilerError::group_value_x_invalid(x_str, x_span))?, }; match greatest { // Sign provided - Some(greatest) => { - EdwardsAffine::from_x_coordinate(x, greatest).ok_or_else(|| GroupError::x_recover(element_span)) - } + Some(greatest) => Ok(EdwardsAffine::from_x_coordinate(x, greatest) + .ok_or_else(|| CompilerError::group_value_x_recover(element_span))?), // Sign inferred None => { // Attempt to recover with a sign_low bit. @@ -233,7 +238,7 @@ impl EdwardsGroupType { } // Otherwise return error. - Err(GroupError::x_recover(element_span)) + Err(CompilerError::group_value_x_recover(element_span).into()) } } } @@ -243,17 +248,18 @@ impl EdwardsGroupType { y_span: &Span, greatest: Option, element_span: &Span, - ) -> Result { + ) -> Result { let y = match y_info { - (y_str, neg) if neg => -Fq::from_str(&y_str).map_err(|_| GroupError::y_invalid(y_str, y_span))?, - (y_str, _) => Fq::from_str(&y_str).map_err(|_| GroupError::y_invalid(y_str, y_span))?, + (y_str, neg) if neg => { + -Fq::from_str(&y_str).map_err(|_| CompilerError::group_value_y_invalid(y_str, y_span))? + } + (y_str, _) => Fq::from_str(&y_str).map_err(|_| CompilerError::group_value_y_invalid(y_str, y_span))?, }; match greatest { // Sign provided - Some(greatest) => { - EdwardsAffine::from_y_coordinate(y, greatest).ok_or_else(|| GroupError::y_recover(element_span)) - } + Some(greatest) => Ok(EdwardsAffine::from_y_coordinate(y, greatest) + .ok_or_else(|| CompilerError::group_value_y_recover(element_span))?), // Sign inferred None => { // Attempt to recover with a sign_low bit. @@ -267,7 +273,7 @@ impl EdwardsGroupType { } // Otherwise return error. - Err(GroupError::y_recover(element_span)) + Err(CompilerError::group_value_y_recover(element_span).into()) } } } @@ -278,19 +284,19 @@ impl EdwardsGroupType { x_span: &Span, y_span: &Span, element_span: &Span, - ) -> Result { + ) -> Result { let x = match x_info { (x_str, neg) if neg => { - -Fq::from_str(&x_str).map_err(|_| GroupError::x_invalid(x_str.to_string(), x_span))? + -Fq::from_str(&x_str).map_err(|_| CompilerError::group_value_x_invalid(x_str, x_span))? } - (x_str, _) => Fq::from_str(&x_str).map_err(|_| GroupError::x_invalid(x_str.to_string(), x_span))?, + (x_str, _) => Fq::from_str(&x_str).map_err(|_| CompilerError::group_value_x_invalid(x_str, x_span))?, }; let y = match y_info { (y_str, neg) if neg => { - -Fq::from_str(&y_str).map_err(|_| GroupError::y_invalid(y_str.to_string(), y_span))? + -Fq::from_str(&y_str).map_err(|_| CompilerError::group_value_y_invalid(y_str, y_span))? } - (y_str, _) => Fq::from_str(&y_str).map_err(|_| GroupError::y_invalid(y_str.to_string(), y_span))?, + (y_str, _) => Fq::from_str(&y_str).map_err(|_| CompilerError::group_value_y_invalid(y_str, y_span))?, }; let element = EdwardsAffine::new(x, y); @@ -298,7 +304,7 @@ impl EdwardsGroupType { if element.is_on_curve() { Ok(element) } else { - Err(GroupError::not_on_curve(element.to_string(), element_span)) + Err(CompilerError::group_value_not_on_curve(element, element_span).into()) } } diff --git a/compiler/src/value/integer/integer.rs b/compiler/src/value/integer/integer.rs index eacc71f064..e379213e21 100644 --- a/compiler/src/value/integer/integer.rs +++ b/compiler/src/value/integer/integer.rs @@ -15,9 +15,10 @@ // along with the Leo library. If not, see . //! Conversion of integer declarations to constraints in Leo. -use crate::{errors::IntegerError, IntegerTrait}; -use leo_asg::{ConstInt, IntegerType, Span}; +use crate::IntegerTrait; +use leo_asg::{ConstInt, IntegerType}; use leo_ast::InputValue; +use leo_errors::{CompilerError, Result, Span}; use snarkvm_fields::{Field, PrimeField}; use snarkvm_gadgets::{ @@ -131,7 +132,7 @@ impl Integer { name: &str, option: Option, span: &Span, - ) -> Result { + ) -> Result { Ok(match integer_type { IntegerType::U8 => allocate_type!(u8, UInt8, Integer::U8, cs, name, option, span), IntegerType::U16 => allocate_type!(u16, UInt16, Integer::U16, cs, name, option, span), @@ -153,22 +154,20 @@ impl Integer { name: &str, integer_value: Option, span: &Span, - ) -> Result { + ) -> Result { // Check that the input value is the correct type let option = match integer_value { Some(input) => { if let InputValue::Integer(type_, number) = input { let asg_type = IntegerType::from(type_); if std::mem::discriminant(&asg_type) != std::mem::discriminant(integer_type) { - return Err(IntegerError::integer_type_mismatch( - integer_type.to_string(), - asg_type.to_string(), - span, - )); + return Err( + CompilerError::integer_value_integer_type_mismatch(integer_type, asg_type, span).into(), + ); } Some(number) } else { - return Err(IntegerError::invalid_integer(input.to_string(), span)); + return Err(CompilerError::integer_value_invalid_integer(input, span).into()); } } None => None, @@ -177,26 +176,17 @@ impl Integer { Self::allocate_type(cs, integer_type, name, option, span) } - pub fn negate>( - self, - cs: &mut CS, - span: &Span, - ) -> Result { + pub fn negate>(self, cs: &mut CS, span: &Span) -> Result { let unique_namespace = format!("enforce -{} {}:{}", self, span.line_start, span.col_start); let a = self; let result = match_signed_integer!(a, span => a.neg(cs.ns(|| unique_namespace))); - result.ok_or_else(|| IntegerError::negate_operation(span)) + Ok(result.ok_or_else(|| CompilerError::integer_value_negate_operation(span))?) } - pub fn add>( - self, - cs: &mut CS, - other: Self, - span: &Span, - ) -> Result { + pub fn add>(self, cs: &mut CS, other: Self, span: &Span) -> Result { let unique_namespace = format!("enforce {} + {} {}:{}", self, other, span.line_start, span.col_start); let a = self; @@ -204,15 +194,10 @@ impl Integer { let result = match_integers_span!((a, b), span => a.add(cs.ns(|| unique_namespace), &b)); - result.ok_or_else(|| IntegerError::binary_operation("+".to_string(), span)) + Ok(result.ok_or_else(|| CompilerError::integer_value_binary_operation("+", span))?) } - pub fn sub>( - self, - cs: &mut CS, - other: Self, - span: &Span, - ) -> Result { + pub fn sub>(self, cs: &mut CS, other: Self, span: &Span) -> Result { let unique_namespace = format!("enforce {} - {} {}:{}", self, other, span.line_start, span.col_start); let a = self; @@ -220,15 +205,10 @@ impl Integer { let result = match_integers_span!((a, b), span => a.sub(cs.ns(|| unique_namespace), &b)); - result.ok_or_else(|| IntegerError::binary_operation("-".to_string(), span)) + Ok(result.ok_or_else(|| CompilerError::integer_value_binary_operation("-", span))?) } - pub fn mul>( - self, - cs: &mut CS, - other: Self, - span: &Span, - ) -> Result { + pub fn mul>(self, cs: &mut CS, other: Self, span: &Span) -> Result { let unique_namespace = format!("enforce {} * {} {}:{}", self, other, span.line_start, span.col_start); let a = self; @@ -236,15 +216,10 @@ impl Integer { let result = match_integers_span!((a, b), span => a.mul(cs.ns(|| unique_namespace), &b)); - result.ok_or_else(|| IntegerError::binary_operation("*".to_string(), span)) + Ok(result.ok_or_else(|| CompilerError::integer_value_binary_operation("*", span))?) } - pub fn div>( - self, - cs: &mut CS, - other: Self, - span: &Span, - ) -> Result { + pub fn div>(self, cs: &mut CS, other: Self, span: &Span) -> Result { let unique_namespace = format!("enforce {} ÷ {} {}:{}", self, other, span.line_start, span.col_start); let a = self; @@ -252,15 +227,10 @@ impl Integer { let result = match_integers_span!((a, b), span => a.div(cs.ns(|| unique_namespace), &b)); - result.ok_or_else(|| IntegerError::binary_operation("÷".to_string(), span)) + Ok(result.ok_or_else(|| CompilerError::integer_value_binary_operation("÷", span))?) } - pub fn pow>( - self, - cs: &mut CS, - other: Self, - span: &Span, - ) -> Result { + pub fn pow>(self, cs: &mut CS, other: Self, span: &Span) -> Result { let unique_namespace = format!("enforce {} ** {} {}:{}", self, other, span.line_start, span.col_start); let a = self; @@ -268,7 +238,7 @@ impl Integer { let result = match_integers_span!((a, b), span => a.pow(cs.ns(|| unique_namespace), &b)); - result.ok_or_else(|| IntegerError::binary_operation("**".to_string(), span)) + Ok(result.ok_or_else(|| CompilerError::integer_value_binary_operation("**", span))?) } } diff --git a/compiler/src/value/integer/macros.rs b/compiler/src/value/integer/macros.rs index ec1e064230..67ae416946 100644 --- a/compiler/src/value/integer/macros.rs +++ b/compiler/src/value/integer/macros.rs @@ -55,11 +55,21 @@ macro_rules! match_unsigned_integer { macro_rules! match_signed_integer { ($integer: ident, $span: ident => $expression: expr) => { match $integer { - Integer::I8($integer) => Some(Integer::I8($expression.map_err(|e| IntegerError::signed(e, $span))?)), - Integer::I16($integer) => Some(Integer::I16($expression.map_err(|e| IntegerError::signed(e, $span))?)), - Integer::I32($integer) => Some(Integer::I32($expression.map_err(|e| IntegerError::signed(e, $span))?)), - Integer::I64($integer) => Some(Integer::I64($expression.map_err(|e| IntegerError::signed(e, $span))?)), - Integer::I128($integer) => Some(Integer::I128($expression.map_err(|e| IntegerError::signed(e, $span))?)), + Integer::I8($integer) => Some(Integer::I8( + $expression.map_err(|e| CompilerError::integer_value_signed(e, $span))?, + )), + Integer::I16($integer) => Some(Integer::I16( + $expression.map_err(|e| CompilerError::integer_value_signed(e, $span))?, + )), + Integer::I32($integer) => Some(Integer::I32( + $expression.map_err(|e| CompilerError::integer_value_signed(e, $span))?, + )), + Integer::I64($integer) => Some(Integer::I64( + $expression.map_err(|e| CompilerError::integer_value_signed(e, $span))?, + )), + Integer::I128($integer) => Some(Integer::I128( + $expression.map_err(|e| CompilerError::integer_value_signed(e, $span))?, + )), _ => None, } @@ -90,37 +100,37 @@ macro_rules! match_integers { macro_rules! match_integers_span { (($a: ident, $b: ident), $span: ident => $expression:expr) => { match ($a, $b) { - (Integer::U8($a), Integer::U8($b)) => { - Some(Integer::U8($expression.map_err(|e| IntegerError::unsigned(e, $span))?)) - } - (Integer::U16($a), Integer::U16($b)) => { - Some(Integer::U16($expression.map_err(|e| IntegerError::unsigned(e, $span))?)) - } - (Integer::U32($a), Integer::U32($b)) => { - Some(Integer::U32($expression.map_err(|e| IntegerError::unsigned(e, $span))?)) - } - (Integer::U64($a), Integer::U64($b)) => { - Some(Integer::U64($expression.map_err(|e| IntegerError::unsigned(e, $span))?)) - } + (Integer::U8($a), Integer::U8($b)) => Some(Integer::U8( + $expression.map_err(|e| CompilerError::integer_value_unsigned(e, $span))?, + )), + (Integer::U16($a), Integer::U16($b)) => Some(Integer::U16( + $expression.map_err(|e| CompilerError::integer_value_unsigned(e, $span))?, + )), + (Integer::U32($a), Integer::U32($b)) => Some(Integer::U32( + $expression.map_err(|e| CompilerError::integer_value_unsigned(e, $span))?, + )), + (Integer::U64($a), Integer::U64($b)) => Some(Integer::U64( + $expression.map_err(|e| CompilerError::integer_value_unsigned(e, $span))?, + )), (Integer::U128($a), Integer::U128($b)) => Some(Integer::U128( - $expression.map_err(|e| IntegerError::unsigned(e, $span))?, + $expression.map_err(|e| CompilerError::integer_value_unsigned(e, $span))?, )), - (Integer::I8($a), Integer::I8($b)) => { - Some(Integer::I8($expression.map_err(|e| IntegerError::signed(e, $span))?)) - } - (Integer::I16($a), Integer::I16($b)) => { - Some(Integer::I16($expression.map_err(|e| IntegerError::signed(e, $span))?)) - } - (Integer::I32($a), Integer::I32($b)) => { - Some(Integer::I32($expression.map_err(|e| IntegerError::signed(e, $span))?)) - } - (Integer::I64($a), Integer::I64($b)) => { - Some(Integer::I64($expression.map_err(|e| IntegerError::signed(e, $span))?)) - } - (Integer::I128($a), Integer::I128($b)) => { - Some(Integer::I128($expression.map_err(|e| IntegerError::signed(e, $span))?)) - } + (Integer::I8($a), Integer::I8($b)) => Some(Integer::I8( + $expression.map_err(|e| CompilerError::integer_value_unsigned(e, $span))?, + )), + (Integer::I16($a), Integer::I16($b)) => Some(Integer::I16( + $expression.map_err(|e| CompilerError::integer_value_unsigned(e, $span))?, + )), + (Integer::I32($a), Integer::I32($b)) => Some(Integer::I32( + $expression.map_err(|e| CompilerError::integer_value_unsigned(e, $span))?, + )), + (Integer::I64($a), Integer::I64($b)) => Some(Integer::I64( + $expression.map_err(|e| CompilerError::integer_value_unsigned(e, $span))?, + )), + (Integer::I128($a), Integer::I128($b)) => Some(Integer::I128( + $expression.map_err(|e| CompilerError::integer_value_unsigned(e, $span))?, + )), (_, _) => None, } }; @@ -131,7 +141,7 @@ macro_rules! allocate_type { let option = $option .map(|s| { s.parse::<$rust_ty>() - .map_err(|_| IntegerError::invalid_integer(s, $span)) + .map_err(|_| CompilerError::integer_value_invalid_integer(s, $span)) }) .transpose()?; @@ -139,7 +149,7 @@ macro_rules! allocate_type { $cs.ns(|| { format!( "`{}: {}` {}:{}", - $name, + $name.to_string(), stringify!($rust_ty), $span.line_start, $span.col_start @@ -147,7 +157,12 @@ macro_rules! allocate_type { }), || option.ok_or(SynthesisError::AssignmentMissing), ) - .map_err(|_| IntegerError::missing_integer(format!("{}: {}", $name, stringify!($rust_ty)), $span))?; + .map_err(|_| { + CompilerError::integer_value_missing_integer( + format!("{}: {}", $name.to_string(), stringify!($rust_ty)), + $span, + ) + })?; $leo_ty(result) }}; diff --git a/compiler/src/value/value.rs b/compiler/src/value/value.rs index 158879d57a..2a227ba845 100644 --- a/compiler/src/value/value.rs +++ b/compiler/src/value/value.rs @@ -16,8 +16,9 @@ //! The in memory stored value for a defined name in a compiled Leo program. -use crate::{errors::ValueError, Address, Char, FieldType, GroupType, Integer}; -use leo_asg::{Circuit, Identifier, Span, Type}; +use crate::{Address, Char, FieldType, GroupType, Integer}; +use leo_asg::{Circuit, Identifier, Type}; +use leo_errors::{Result, Span}; use snarkvm_fields::PrimeField; use snarkvm_gadgets::{ @@ -51,7 +52,7 @@ pub enum ConstrainedValue<'a, F: PrimeField, G: GroupType> { } impl<'a, F: PrimeField, G: GroupType> ConstrainedValue<'a, F, G> { - pub(crate) fn to_type(&self, span: &Span) -> Result, ValueError> { + pub(crate) fn to_type(&self, span: &Span) -> Result> { Ok(match self { // Data types ConstrainedValue::Address(_address) => Type::Address, diff --git a/docs/rfc/009-bit-byte-conversions.md b/docs/rfc/009-bit-byte-conversions.md new file mode 100644 index 0000000000..ff3b4eb51d --- /dev/null +++ b/docs/rfc/009-bit-byte-conversions.md @@ -0,0 +1,284 @@ +# Leo RFC 009: Conversions with Bits and Bytes + +## Authors + +- Max Bruce +- Collin Chin +- Alessandro Coglio +- Eric McCarthy +- Jon Pavlik +- Damir Shamanaev +- Damon Sicore +- Howard Wu + +## Status + +DRAFT + +# Summary + +This RFC proposes the addition of natively implemented global functions to perform conversions +between Leo integer values and sequences of bits or bytes in big endian or little endian order. +This RFC also proposes a future transition from these functions to methods associated to the integer types. + +# Motivation + +Conversions of integers to bits and bytes are fairly common in programming languages. +Use case include communication with the external world +(since external data is sometimes represented as bits and bytes rather than higher-level data structures), +and serialization/deserialization for cryptographic purposes (e.g. hashing data). + +# Design + +## Concepts + +The Leo integer values can be thought of sequences of bits. +Therefore, it makes sense to convert between integer values and their corresponding sequences of bits; +the sequences of bits can be in little or big endian order (i.e. least vs. most significant bit first), +naturally leading to two possible conversions. +Obviously, the bits represent the integers in base 2. + +Since all the Leo integer values consist of multiples of 8 bits, +it also makes sense to convert between integer values and squences of bytes, +which represents the integers in base 256. +Again, the bytes may be in little or big endian order. + +It could also make sense to convert between integers consisting of `N` bits +and sequences of "words" of `M` bits if `N` is a multiple of `M`, +e.g. convert a `u32` into a sequence of two `u16`s, or convert a `u128` into a sequence of four `u32`s. +However, the case in which `M` is 1 (bits) or 8 (bytes) is by far the most common, +and therefore the initial focus of this RFC; +nonetheless, it seems valuable to keep these possible generalizations in mind as we work though this initial design. + +Another possible generalization is to lift these conversions to sequences, +e.g. converting from a sequence of integer values to a sequence of bits or bytes +by concatenating the results of converting the integer values, +and converting from a sequence of bits or bytes to a sequence of integer values +by grouping the bits or bytes into chunks and converting each chunk into an integer. +For instance, a sequence of 4 `u32` values can be turned into a sequence of 32 bytes or a sequence of 128 bits. +Note that, in these cases, the endianness only applies to the individual element conversion, +not to the ordering of the integer values, which should be preserved by the conversion. + +Besides integers, it could make sense to consider converting other Leo values between bits and bytes, +namely characters, field elements, group elements, and addresses (but perhaps not booleans). +If this is further extended to aggregate values (tuples, arrays, and circuits), +then this moves towards a general serialization/deserialization library for Leo, which could be a separate feature. + +## Representation of Bits + +In Leo's current type system, bits can be represented as `bool` values. +These are not quite the numbers 0 and 1, but they are isomorphic, and it is easy to convert between booleans and bits: +```ts +// convert a boolean x to a bit: +(x ? 1 : 0) + +// convert f bit y to a boolean: +(y == 1) +``` + +If Leo had a type `u1` for unsigned 1-bit integers, we could use that instead of `bool`. +Separately from this RFC, such a type could be added. +There is also an outstanding proposal (not in an RFC currently) to support types `uN` and `iN` for every positive `N`, +in which case `u1` would be an instance of that. + +## Representation of Bytes + +The type `u8` is the natural way to represent a byte. +The type `i8` is isomorphic to that, but we tend to think of bytes as unsigned. + +## Representation of Sequences + +This applies to the sequence of bits or bytes that a Leo integer converts to or from. +E.g. a `u32` is converted to/from a sequence of bits or bytes. + +Sequences in Leo may be ntaurally represented as arrays or tuples. +Arrays are more flexible; in particular, they allow indexing via expressions rather than just numbers, unlike tuples. +Thus, arrays are the natural choice to represent these sequences. + +## Conversion Functions + +We propose the following global functions, +for which we write declarations without bodies below, +since the implementation is native. +(It is a separate issue whether the syntax below should be allowed, +in order to represent natively implemented functions, +or whether there should be a more explicit indication such as `native` in Java). + +These are tentative names, which we can tweak. +What is more important is the selection of operations, and their input/output types. + +### Conversions between Integers and Bits + +```ts +// unsigned to bits, little and big endian +function u8_to_bits_le(x: u8) -> [bool; 8]; +function u8_to_bits_be(x: u8) -> [bool; 8]; +function u16_to_bits_le(x: u16) -> [bool; 16]; +function u16_to_bits_be(x: u16) -> [bool; 16]; +function u32_to_bits_le(x: u32) -> [bool; 32]; +function u32_to_bits_be(x: u32) -> [bool; 32]; +function u64_to_bits_le(x: u64) -> [bool; 64]; +function u64_to_bits_be(x: u64) -> [bool; 64]; +function u128_to_bits_le(x: u128) -> [bool; 128]; +function u128_to_bits_be(x: u128) -> [bool; 128]; + +// signed to bits, little and big endian +function i8_to_bits_le(x: i8) -> [bool; 8]; +function i8_to_bits_be(x: i8) -> [bool; 8]; +function i16_to_bits_le(x: i16) -> [bool; 16]; +function i16_to_bits_be(x: i16) -> [bool; 16]; +function i32_to_bits_le(x: i32) -> [bool; 32]; +function i32_to_bits_be(x: i32) -> [bool; 32]; +function i64_to_bits_le(x: i64) -> [bool; 64]; +function i64_to_bits_be(x: i64) -> [bool; 64]; +function i128_to_bits_le(x: i128) -> [bool; 128]; +function i128_to_bits_be(x: i128) -> [bool; 128]; + +// unsigned from bits, little and big endian +function u8_from_bits_le(x: [bool; 8]) -> u8; +function u8_from_bits_be(x: [bool; 8]) -> u8; +function u16_from_bits_le(x: [bool; 16]) -> u16; +function u16_from_bits_be(x: [bool; 16]) -> u16; +function u32_from_bits_le(x: [bool; 32]) -> u32; +function u32_from_bits_be(x: [bool; 32]) -> u32; +function u64_from_bits_le(x: [bool; 64]) -> u64; +function u64_from_bits_be(x: [bool; 64]) -> u64; +function u128_from_bits_le(x: [bool; 128]) -> u128; +function u128_from_bits_be(x: [bool; 128]) -> u128; + +// signed from bits, little and big endian +function i8_from_bits_le(x: [bool; 8]) -> i8; +function i8_from_bits_be(x: [bool; 8]) -> i8; +function i16_from_bits_le(x: [bool; 16]) -> i16; +function i16_from_bits_be(x: [bool; 16]) -> i16; +function i32_from_bits_le(x: [bool; 32]) -> i32; +function i32_from_bits_be(x: [bool; 32]) -> i32; +function i64_from_bits_le(x: [bool; 64]) -> i64; +function i64_from_bits_be(x: [bool; 64]) -> i64; +function i128_from_bits_le(x: [bool; 128]) -> i128; +function i128_from_bits_be(x: [bool; 128]) -> i128; +``` + +### Conversions between Integers and Bytes + +```ts +// unsigned to bytes, little and big endian +function u16_to_bytes_le(x: u16) -> [u8; 2]; +function u16_to_bytes_be(x: u16) -> [u8; 2]; +function u32_to_bytes_le(x: u32) -> [u8; 4]; +function u32_to_bytes_be(x: u32) -> [u8; 4]; +function u64_to_bytes_le(x: u64) -> [u8; 8]; +function u64_to_bytes_be(x: u64) -> [u8; 8]; +function u128_to_bytes_le(x: u128) -> [u8; 16]; +function u128_to_bytes_be(x: u128) -> [u8; 16]; + +// signed to bytes, little and big endian +function i16_to_bytes_le(x: i16) -> [u8; 2]; +function i16_to_bytes_be(x: i16) -> [u8; 2]; +function i32_to_bytes_le(x: i32) -> [u8; 4]; +function i32_to_bytes_be(x: i32) -> [u8; 4]; +function i64_to_bytes_le(x: i64) -> [u8; 8]; +function i64_to_bytes_be(x: i64) -> [u8; 8]; +function i128_to_bytes_le(x: i128) -> [u8; 16]; +function i128_to_bytes_be(x: i128) -> [u8; 16]; + +// unsigned from bytes, little and big endian +function u16_from_bytes_le(x: [u8; 2]) -> u16; +function u16_from_bytes_be(x: [u8; 2]) -> u16; +function u32_from_bytes_le(x: [u8; 4]) -> u32; +function u32_from_bytes_be(x: [u8; 4]) -> u32; +function u64_from_bytes_le(x: [u8; 8]) -> u64; +function u64_from_bytes_be(x: [u8; 8]) -> u64; +function u128_from_bytes_le(x: [u8; 16]) -> u128; +function u128_from_bytes_be(x: [u8; 16]) -> u128; + +// signed from bytes, little and big endian +function i16_from_bytes_le(x: [u8; 2]) -> i16; +function i16_from_bytes_be(x: [u8; 2]) -> i16; +function i32_from_bytes_le(x: [u8; 4]) -> i32; +function i32_from_bytes_be(x: [u8; 4]) -> i32; +function i64_from_bytes_le(x: [u8; 8]) -> i64; +function i64_from_bytes_be(x: [u8; 8]) -> i64; +function i128_from_bytes_le(x: [u8; 16]) -> i128; +function i128_from_bytes_be(x: [u8; 16]) -> i128; +``` + +## Handling of the Native Functions + +Given the relatively large number and regular structure of the functions above, +it makes sense to generate them programmatically (e.g. via Rust macros), +rather than enumerating all of them explicitly in the implementation. +It may also makes sense, at R1CS generation time, +to use generated or suitably parameterized code to recognize them and turn them into the corresponding gadgets. + +## Transition to Methods + +Once a separate proposal for adding methods to Leo scalar types is realized, +we may want to turn the global functions listed above into methods, +deprecating the global functions, and eventually eliminating them. + +Conversions to bits or bytes will be instance methods of the integer types, +e.g. `u8` will include an instance method `to_bits_le` that takes no arguments and that returns a `[bool; 8]`. +Example: +```ts +let int: u8 = 12; +let bits: [bool; 8] = int.to_bits_le(); +console.assert(bits == [false, false, true, true, false, false, false, false]); // 00110000 (little endian) +``` + +Conversions from bits or bytes will be static methods of the integer types, +e.g. `u8` will include a static metod `from_bits_le` that takes a `[bool; 8]` argument and returns a `u8`. +Example: +```ts +let bits: [bool; 8] = [false, false, true, true, false, false, false, false]; // 00110000 (little endian) +let int = u8::from_bits_le(bits); +console.assert(int == 12); +``` + +# Drawbacks + +This does not seem to bring any drawbacks. + +# Effect on Ecosystem + +None. + +# Alternatives + +## Pure Leo Implementation + +These conversions can be realized in Leo (i.e. without native implementations), +provided that Leo is extended with certain operations that are already separately planned: +* Integer division and remainder, along with type casts, could be used. +* Bitwise shifts and masks, along with type casts, could be used. + +However, compiling the Leo code that realizes the conversions may result in less efficient R1CS than the native ones. + +## Naming Bit and Byte Types Explicitly + +Names like `u8_to_bits_le` and `u32_to_bytes_le` talk about bits and bytes, +therefore relying on a choice of representation for bits and bytes, +which is `bool` for bits and `u8` for bytes as explained above. +An alternative is to have names like `u8_to_bools_le` and `u32_to_u8s_le`, +which explicate the representation of bits and bytes in the name, +and open the door to additional conversions to different representations. +In particular, if and when Leo is extended with a type `u1` for bits, +there could be additional operations like `u8_to_u1s_le`. + +This more explicit naming scheme also provides a path towards extending +bit and byte conversions to more generic "word" conversions, +such as `u64_to_u16s_le`, which would turn a `u64` into a `[u16; 4]`. +In general, it makes sense to convert between `uN` or `iN` and `[uM; P]` when `N == M * P`. +If Leo were extended with types `uN` and `iN` for all positive `N` as proposed elsewhere, +there could be a family of all such conversions. + +## Methods Directly + +Given that we eventually plan to use methods on scalar types for these conversions, +it may make sense to do that right away. +This is predicated on having support for methods on scalar types, +for which a separate RFC is in the works. + +If we decide for this approach, we will revise the above proposal to reflect that. +The concepts and (essential) names and input/output types remain unchanged, +but the conversions are packaged in slightly different form. diff --git a/docs/rfc/010-native-functions.md b/docs/rfc/010-native-functions.md new file mode 100644 index 0000000000..17b28d6440 --- /dev/null +++ b/docs/rfc/010-native-functions.md @@ -0,0 +1,218 @@ +# Leo RFC 010: Improved Native Functions + +## Authors + +- Max Bruce +- Collin Chin +- Alessandro Coglio +- Eric McCarthy +- Jon Pavlik +- Damir Shamanaev +- Damon Sicore +- Howard Wu + +## Status + +DRAFT + +# Summary + +This RFC proposes an improved approach to handling natively implemented functions ('native functions', for short) in Leo, +that is functions implemented not via Leo code but (in essence) via Rust code. +Currently there is just one such function, namely BLAKE2s. +The scope of this proposal is limited to native functions defined by the developers of Leo itself, +not by users of Leo (i.e. developers of applications written in Leo). + +The approach proposed here is to allow (global and member) Leo functions to have no defining bodies, +in which case they are regarded as natively implemented; +this is only allowed in Leo files that contain standard/core libraries, provided with the Leo toolchain. +Most of the compiler can work essentially in the same way as it does now; +at R1CS generation time, native functions must be recognized, and turned into the known gadgets that implement them. + +# Motivation + +Many languages support native functions (here we generically use 'functions' to also denote methods), +where 'native' refers to the fact that the functions are implemented not in the language under consideration, +but rather in the language used to implement the language under consideration. +For instance, Java supports native methods that are implemented in C rather than Java. + +There are two main reasons for native functions in programming languages: +1. The functionality cannot be expressed at all in the language under consideration, + e.g. Java has no constructs to print on screen, making a native implementation necessary. +2. The functionality can be realized more efficiently in the native language. + +The first reason above may not apply to Leo, at least currently, +as Leo's intended use is mainly for "pure computations" rather than interactions with the external world. +However, we note that console statements could be regarded as native functions (as opposed to "ad hoc" statements), +and this may be in fact the path to pursue if we extend the scope of console features (e.g. even to full GUIs), +as has been recently proposed (we emphasize that the console code is not meant to be compiled to R1CS). + +The second reason above applies to Leo right now. +While there is currently just one native function supported in Leo, namely BLAKE2s, +it is conceivable that there may be other cryptographic (or non-cryptographic) functions +for which hand-crafted R1CS gadgets are available +that are more efficient than what the Leo compiler would generate if their functionality were written in Leo. +While we will continue working towards making the Leo compiler better, +and perhaps eventually capable to generate R1CS whose efficiency is competitive with hand-crafted gadgets, +this will take time, and in the meanwhile new and more native functions may be added, +resulting in a sort of arms race. +In other words, it is conceivable that Leo will need to support native functions in the foreseeable future. + +Languages typically come with standard/core libraries that application developers can readily use. +Even though the Leo standard/core libraries are currently limited (perhaps just to BLAKE2s), +it seems likely that we will want to provide more extensive standard/core libraries, +not just for cryptographic functions, but also for data structures and operations on them. + +The just mentioned use case of data structures brings about an important point. +Leo circuit types are reasonable ways to provide library data structures, +as they support static and instance member functions that realize operations on those data structures. +Just like some Java library classes provide a mix of native and non-native methods, +we could imagine certain Leo library circuit types providing a mix of native and non-native member functions, e.g.: +```ts +circuit Point2D { + x: u32; + y: u32; + function origin() -> Point2D { ... } // probably non-native + function move(mut self, delta_x: u32, delta_y: u32) { ... } // probably non-native + function distance(self, other:Point2D); // maybe native (involves square root) +} +``` + +Our initial motivation for naive functions is limited to Leo standard/core libraries, +not to user-defined libraries or applications. +That is, only the developers of the Leo language will be able to create native functions. +Leo users, i.e. developers of Leo applications, will be able to use the provided native functions, +but not to create their own. +If support for user-defined native functions may become desired in the future, it will be discussed in a separate RFC. + +# Design + +## Background + +### Current Approach to Native Functions + +The BLAKE2s native function is currently implemented as follows (as a high-level view): +1. Prior to type checking/inference, its declaration (without a defining body) + is programmatically added to the program under consideration. + This way, the input and output types of the BLAKE2s function can be used to type-check code that calls it. +2. At R1CS generation time, when the BLAKE2s function is compiled, it is recognized as native and, + instead of translating its body to R1CS (which is not possible as the function has no Leo body), + a known BLAKE2s gadget is used. + +This approach is fine for a single native function, but may not be the best for a richer collection of native functions. +In particular, consider the `Point2D` example above, which has a mix of native and non-native functions: +presumably, we would like to write at least the non-native functions of `Point2D` directly in a Leo file, +as opposed to programmatically generating them prior to type checking/inference. + +### Multi-File Compilation + +Leo already supports the compilation of multiple files that form a program, via packages and importing. +This capability is independent from native functions. + +We note that, for the purpose of type checking code that calls a function `f`, +the defining body of `f` is irrelevant: only the input and output types of `f` are relevant. +The defining body is of course type-checked when `f` itself is type-checked, +and furthermore the defining body is obviously needed to generate R1CS, +but the point here is that only the input and output types of `f` are needed to type-check code that calls `f`. +In particular, this means that, if a Leo file imports a package, +only the type information from the package is needed to type-check the file that imports the package. +Conceptually, each package exports a symbol table, used (and sufficient) to type-check files that import that package. + +## Proposal + +we propose to: +1. Allow declarations of (global and member) functions to have no defining body, signaling that the function is native. +2. Extend the AST and ASG to allow functions to have no bodies. +3. Have the compiler allow empty function bodies only in standard/core library files, which should be known. +4. Have type checking/inference "skip over" absent function bodies. +5. At R1CS generation time, when a function without body is encountered, find and use the known gadget for it. + +Currently the ABNF grammar requires function declarations to have a defining body (a block), i.e. to be implemented in Leo: +``` +function-declaration = *annotation %s"function" identifier + "(" [ function-parameters ] ")" [ "->" type ] + block +``` +We propose to relax the rule as follows: +``` +function-declaration = *annotation %s"function" identifier + "(" [ function-parameters ] ")" [ "->" type ] + ( block / ";" ) +``` +This allows a function declaration to have a terminating semicolon instead of a block. + +Since we do not have anything like abstract methods in Leo, this is a workable way to indicate native functions. +However, it is easy, if desired, to have a more promiment indication, such as a `native` keyword, or an annotation. + +It may be necessary to extend the AST and ASG to accommodate function bodies to be optional, +although this may be already the case for representing BLAKE2s in its current form described above. + +The compiler should know which files are part of the Leo standard/core libraries and which ones are not. +Functions without bodies will be only allowed to appear in those files. +It will be an error if any other file (e.g. user-defined) contains functions without bodies. +Type checking/inference may be where we make this check, or perhaps in some other phase. + +Because of the already existing support for multi-file compilation described above, +no essential change is needed in the compiler's type checking/inference. +We just need to make sure that functions without bodies are expected and properly handled +(i.e. their input and output types must be checked and added to the proper symbol tables, +but their absent bodies must be skipped); +this may already be the case, for the treatment of BLAKE2s described above. + +The main change is in R1CS generation. +Normally, when a function definition is encountered, its Leo body is translated to R1CS. +For a native function, we need to find and use a known gadget instead. +The compiler must know a mapping from native functions in the standard/core libraries +to the R1CS gadgets that implement them, so it should be just a matter of selecting the appropriate one. +Some of this logic must be already present, in order to detect and select the BLAkE2s gadget. + +This approach is used in Java, where Java files may declare certain methods as `native`, +without a body but with a declaration of input and output types. +The actual native implementations, i.e. the native method bodies live in different files, as they are written in C. + +# Drawbacks + +This does not seem to bring any drawbacks. +A capability for native functions (for BLAKE2s) already exists; +this RFC proposes a way to make it more flexible, +with mild (and likely simplifying) changes to the compiler. + +# Effect on Ecosystem + +This should help support richer standard/core libraries for Leo. + +# Alternatives + +## Programmatic Generation + +Instead of storing declarations of native functions in standard/core files as proposed above, +we could programmatically generate them as currently done for BLAKE2s. +Macros may be used to generate families of similar function declarations. + +However, consider `Point2D` above, which has a mix or native and non-native functions. +One approach is to programmatically generate the whole `Point2D` declarative, +with both native and non-native functions. +But it seems that a Leo file would be clearer and more maintainable than a Rust string in the compiler. +We could think of splitting the non-native and native functions of `Point2D`: +the former in a Leo file, and the latter programmatically added. +Again, this looks more complicated than just declaring native funcions in Leo files. + +## Leo Code in Rust Files + +It has been pointed out that it would be beneficial to have +both the Leo code (for the non-native functions) +and the Rust code (for the native functions) +in the same place (i.e. file). +This is not possible if the non-native code is in a Leo file, because Leo files cannot contain Rust code +(and there is no plan to allow that, i.e. no inline Rust code). + +However, we can turn things around and leverage Rust's macro system to accommodate Leo code in Rust files. +That is, we can have Rust files that include both the non-native Leo code, +written as Leo code (with some surrounding macro call or something like that), +along with the Rust code that implements the naive functions. + +This may turn out to be in fact the preferred design in the end, +as it combines the advantage of writing non-native code in Leo +with the advantage of having native and non-native code in the same place. +In that case, we will revise this RFC to swap this design proposal with the one in the main section, +moving the proposal for Leo files to this section as an alternative. \ No newline at end of file diff --git a/docs/rfc/011-scalar-type-accesses-and-methods.md b/docs/rfc/011-scalar-type-accesses-and-methods.md new file mode 100644 index 0000000000..02b1fb731d --- /dev/null +++ b/docs/rfc/011-scalar-type-accesses-and-methods.md @@ -0,0 +1,78 @@ +# Leo RFC 011: Scalar Type Accesses And Methods + +## Authors + +- Max Bruce +- Collin Chin +- Alessandro Coglio +- Eric McCarthy +- Jon Pavlik +- Damir Shamanaev +- Damon Sicore +- Howard Wu + +## Status + +DRAFT + +## Summary + +This RFC proposes two things: + +1. The scalar types in Leo (integers, fields, etc.) can have static methods. +2. The scalar types in Leo (integers, fields, etc.) can have static constants. +3. Those values that have a scalar type can have methods directly on them. + +## Motivation + +This approach allows for a clean interface to provide built-in methods or static members for these basic types. + +## Design + +### Semantics + +Firstly we would have to modify both the ABNF and parsing of Leo to allow static method calls onto a scalar type. + +The ABNF would look as follows: + +```abnf +; This is an existing old rule +scalar-type = boolean-type / arithmetic-type / address-type / character-type + +; This is an existing old rule +circuit-type = identifier / self-type + +; Add this rule. +named-type = circuit-type / scalar-type ; new rule + +; Modify this rule: +postfix-expression = primary-expression + / postfix-expression "." natural + / postfix-expression "." identifier + / identifier function-arguments + / postfix-expression "." identifier function-arguments + / named-type "::" identifier function-arguments ; this used to be a circuit-type + / named-type "::" identifier ; this is new to allow static members on + / postfix-expression "[" expression "]" + / postfix-expression "[" [expression] ".." [expression] "]" +``` + +Now methods and static members would be first-class citizens of scalar types and their values. For example, the following could be done: + +```ts +let x = 1u8.to_bits(); // A method call on on a scalar value itself +let x = u8::MAX; // A constant value on the scalar type +let y = u8::to_bits(1u8); // A static method on the scalar type +``` + +## Drawbacks + +This change adds more complexity to the language. + +## Effect on Ecosystem + +None. The new parsing changes would not break any older programs. + +## Alternatives + +None. diff --git a/errors/Cargo.toml b/errors/Cargo.toml new file mode 100644 index 0000000000..362716882b --- /dev/null +++ b/errors/Cargo.toml @@ -0,0 +1,51 @@ +[package] +name = "leo-errors" +version = "1.5.3" +authors = [ "The Aleo Team " ] +description = "Errors 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 = "2018" + +[dependencies] +colored = "2.0.0" + +[dependencies.leo-input] +path = "../input" +version = "1.5.3" + +[dependencies.color-backtrace] +version = "0.5.1" + +[dependencies.derivative] +version = "2.2.0" + +[dependencies.eyre] +version = "0.6.5" +default-features = false + +[dependencies.backtrace] +version = "0.3.61" + +[dependencies.pest] +version = "2.0" + +[dependencies.serde] +version = "1.0.126" +features = [ "derive", "rc" ] + +[dependencies.tendril] +version = "0.4.2" + +[dependencies.thiserror] +version = "1.0.26" diff --git a/errors/ERROR_INDEX.md b/errors/ERROR_INDEX.md new file mode 100644 index 0000000000..039d20d286 --- /dev/null +++ b/errors/ERROR_INDEX.md @@ -0,0 +1,17 @@ +# Leo Error Index + +## Parser Errors: Error Code Range 370_000 - 370_999 + +## State Errors: Error Code Range 371_000 - 371_999 + +## AST Errors: Error Code Range 372_000 - 372_999 + +## ASG Errors: Error Code Range 373_000 - 373_999 + +## Import Errors: Error Code Range 374_000 - 374_999 + +## Package Errors: Error Code Range 375_000 - 375_999 + +## Compiler Errors: Error Code Range 376_000 - 376_999 + +## CLI Errors: Error Code Range 377_000 - 377_999 diff --git a/errors/LICENSE.md b/errors/LICENSE.md new file mode 100644 index 0000000000..b95c626e2a --- /dev/null +++ b/errors/LICENSE.md @@ -0,0 +1,596 @@ +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/errors/README.md b/errors/README.md new file mode 100644 index 0000000000..ce05b1ed5d --- /dev/null +++ b/errors/README.md @@ -0,0 +1,64 @@ +# leo-errors + +[![Crates.io](https://img.shields.io/crates/v/leo-ast.svg?color=neon)](https://crates.io/crates/leo-errors) +[![Authors](https://img.shields.io/badge/authors-Aleo-orange.svg)](../AUTHORS) +[![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](./LICENSE.md) + +This directory contains the code for the Errors for all the Leo crates. + +## [Common](./src/common) + +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)). +- [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. + +## Error Types + +These are the different kinds of errors that are made in this crate. Note that if you want more information about the errors please check the crates documentation or the [Error Index](./ERROR_INDEX.md). All errors here with the exception of [SnarkVM Errors](#snarkvm) have a 037 prefixed to their error codes. + +### ASG + +The errors for the `leo-asg` crate. Its error codes will range from 3_000-3_999 and be prefixed with the characters `ASG`. + +### AST + +The errors for the `leo-ast` crate. Its error codes will range from 2_000-2_999 and be prefixed with the characters `AST`. + +### CLI + +The errors for the `leo-lang` crate. Its error codes will range from 7_000-7_999 and be prefixed with the characters `CLI`. + +### Compiler + +The errors for the `leo-compiler` crate. Its error codes will range from 6_000-6_999 and be prefixed with the characters `CMP`. + +### Import + +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 + +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. + +### Package + +The errors for the `leo-package` crate. Its error codes will range from 5_000-5_999 and be prefixed with the characters `PAK`. + +### Parser + +The errors for the `leo-parser` crate. Its error codes will range from 0-999 and be prefixed with the characters `PAR`. + +### SnarkVM + +The errors from SnarkVM that bubble up into Leo in some situations. For right now, they have an exit code of 1. +When SnarkVM implements better error codes and messages, we can bubble them up. + +### State + +The errors for the `leo-state` crate. Its error codes will range from 1_000-1_999 and be prefixed with the characters `STA`. diff --git a/errors/src/asg/asg_errors.rs b/errors/src/asg/asg_errors.rs new file mode 100644 index 0000000000..89a4f9bf12 --- /dev/null +++ b/errors/src/asg/asg_errors.rs @@ -0,0 +1,414 @@ +// 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::create_errors; + +use std::fmt::{Debug, Display}; + +create_errors!( + /// AsgError enum that represents all the errors for the `leo-asg` crate. + AsgError, + exit_code_mask: 3000i32, + error_code_prefix: "ASG", + + /// For when a circuit of the specified type is unresolved. + /// Note that the type for a circuit is represented by a name. + @formatted + unresolved_circuit { + args: (name: impl Display), + msg: format!("failed to resolve circuit: '{}'", name), + help: None, + } + + /// For when a import of the specified name is unresolved. + @formatted + unresolved_import { + args: (name: impl Display), + msg: format!("failed to resolve import: '{}'", name), + help: None, + } + + /// For when a circuit member of the specified name is unresolved. + @formatted + unresolved_circuit_member { + args: (circuit_name: impl Display, name: impl Display), + msg: format!( + "illegal reference to non-existant member '{}' of circuit '{}'", + name, circuit_name + ), + help: None, + } + + /// For when a user is initializing a circuit, and it's missing circuit member. + @formatted + missing_circuit_member { + args: (circuit_name: impl Display, name: impl Display), + msg: format!( + "missing circuit member '{}' for initialization of circuit '{}'", + name, circuit_name + ), + help: None, + } + + /// For when a user is initializing a circuit, and they declare a cirucit member twice. + @formatted + overridden_circuit_member { + args: (circuit_name: impl Display, name: impl Display), + msg: format!( + "cannot declare circuit member '{}' more than once for initialization of circuit '{}'", + name, circuit_name + ), + help: None, + } + + /// For when a user is defining a circuit, and they define a circuit member multiple times. + @formatted + redefined_circuit_member { + args: (circuit_name: impl Display, name: impl Display), + msg: format!( + "cannot declare circuit member '{}' multiple times in circuit '{}'", + name, circuit_name + ), + help: None, + } + + /// For when a user is initializing a circuit, and they add an extra circuit member. + @formatted + extra_circuit_member { + args: (circuit_name: impl Display, name: impl Display), + msg: format!( + "extra circuit member '{}' for initialization of circuit '{}' is not allowed", + name, circuit_name + ), + help: None, + } + + /// For when a user attempts to assign to a function. + @formatted + illegal_function_assign { + args: (name: impl Display), + msg: format!("attempt to assign to function '{}'", name), + help: None, + } + + /// For when a user tries to call a circuit variable as a function. + @formatted + circuit_variable_call { + args: (circuit_name: impl Display, name: impl Display), + msg: format!("cannot call variable member '{}' of circuit '{}'", name, circuit_name), + help: None, + } + + /// For when a user tries to call an invalid circuit static function. + @formatted + circuit_static_call_invalid { + args: (circuit_name: impl Display, name: impl Display), + msg: format!( + "cannot call static function '{}' of circuit '{}' from target", + name, circuit_name + ), + help: None, + } + + /// For when a user tries to call a mutable circuit member function from immutable context. + @formatted + circuit_member_mut_call_invalid { + args: (circuit_name: impl Display, name: impl Display), + msg: format!( + "cannot call mutable member function '{}' of circuit '{}' from immutable context", + name, circuit_name + ), + help: None, + } + + /// For when a user tries to call a circuit member function from static context. + @formatted + circuit_member_call_invalid { + args: (circuit_name: impl Display, name: impl Display), + msg: format!( + "cannot call member function '{}' of circuit '{}' from static context", + name, circuit_name + ), + help: None, + } + + /// For when a user tries to index into a non-array type. + @formatted + index_into_non_array { + args: (name: impl Display), + msg: format!("failed to index into non-array '{}'", name), + help: None, + } + + /// For when a user tries index with an invalid integer. + @formatted + invalid_assign_index { + args: (name: impl Display, num: impl Display), + msg: format!("failed to index array with invalid integer '{}'[{}]", name, num), + help: None, + } + + /// For when a user tries to index an array range, with a left value greater than right value. + @formatted + invalid_backwards_assignment { + args: (name: impl Display, left: impl Display, right: impl Display), + msg: format!( + "failed to index array range for assignment with left > right '{}'[{}..{}]", + name, left, right + ), + help: None, + } + + /// For when a user tries to create a constant varaible from non constant values. + @formatted + invalid_const_assign { + args: (name: impl Display), + msg: format!( + "failed to create const variable(s) '{}' with non constant values.", + name + ), + help: None, + } + + /// For when a user defines function with the same name twice. + @formatted + duplicate_function_definition { + args: (name: impl Display), + msg: format!("a function named \"{}\" already exists in this scope", name), + help: None, + } + + /// For when a user defines variable with the same name twice. + @formatted + duplicate_variable_definition { + args: (name: impl Display), + msg: format!("a variable named \"{}\" already exists in this scope", name), + help: None, + } + + /// For when a user tries to index into a non-tuple type. + @formatted + index_into_non_tuple { + args: (name: impl Display), + msg: format!("failed to index into non-tuple '{}'", name), + help: None, + } + + /// For when a user tries access a tuple index out of bounds. + @formatted + tuple_index_out_of_bounds { + args: (index: impl Display), + msg: format!("tuple index out of bounds: '{}'", index), + help: None, + } + + /// For when a user tries access a array index out of bounds. + @formatted + array_index_out_of_bounds { + args: (index: impl Display), + msg: format!("array index out of bounds: '{}'", index), + help: None, + } + + /// For when a user tries have either side of a ternary return different variable types. + @formatted + ternary_different_types { + args: (left: impl Display, right: impl Display), + msg: format!("ternary sides had different types: left {}, right {}", left, right), + help: None, + } + + /// For when an array size cannot be inferred. + @formatted + unknown_array_size { + args: (), + msg: "array size cannot be inferred, add explicit types", + help: None, + } + + /// For when a user passes more arguements to a function than expected. + @formatted + unexpected_call_argument_count { + args: (expected: impl Display, got: impl Display), + msg: format!("function call expected {} arguments, got {}", expected, got), + help: None, + } + + /// For whan a function is unresolved. + @formatted + unresolved_function { + args: (name: impl Display), + msg: format!("failed to resolve function: '{}'", name), + help: None, + } + + /// For when a type cannot be resolved. + @formatted + unresolved_type { + args: (name: impl Display), + msg: format!("failed to resolve type for variable definition '{}'", name), + help: None, + } + + /// For when a user passes a type, but another was expected. + @formatted + unexpected_type { + args: (expected: impl Display, received: impl Display), + msg: format!( + "unexpected type, expected: '{}', received: '{}'", + expected, + received, + ), + help: None, + } + + /// For when a constant value was expected, but a non-constant one was received. + @formatted + unexpected_nonconst { + args: (), + msg: "expected const, found non-const value", + help: None, + } + + /// For whan a variable is unresolved. + @formatted + unresolved_reference { + args: (name: impl Display), + msg: format!("failed to resolve variable reference '{}'", name), + help: None, + } + + /// For when a boolean value cannot be parsed. + @formatted + invalid_boolean { + args: (value: impl Display), + msg: format!("failed to parse boolean value '{}'", value), + help: None, + } + + /// For when a char value cannot be parsed. + @formatted + invalid_char { + args: (value: impl Display), + msg: format!("failed to parse char value '{}'", value), + help: None, + } + + /// For when an int value cannot be parsed. + @formatted + invalid_int { + args: (value: impl Display), + msg: format!("failed to parse int value '{}'", value), + help: None, + } + + /// For when a user tries to negate an unsigned integer. + @formatted + unsigned_negation { + args: (), + msg: "cannot negate unsigned integer", + help: None, + } + + /// For when a user tries to assign to an immutable variable. + @formatted + immutable_assignment { + args: (name: impl Display), + msg: format!("illegal assignment to immutable variable '{}'", name), + help: None, + } + + /// For when a function is missing a return statement. + @formatted + function_missing_return { + args: (name: impl Display), + msg: format!("function '{}' missing return for all paths", name), + help: None, + } + + /// For when a function fails to resolve the correct return. + @formatted + function_return_validation { + args: (name: impl Display, description: impl Display), + msg: format!("function '{}' failed to validate return path: '{}'", name, description), + help: None, + } + + /// For when the type for an input variable could not be infered. + @formatted + input_ref_needs_type { + args: (category: impl Display, name: impl Display), + msg: format!("could not infer type for input in '{}': '{}'", category, name), + help: None, + } + + /// For when a user tries to call a test function. + @formatted + call_test_function { + args: (), + msg: "cannot call test function", + help: None, + } + + /// For when a user tries to define a circuit function as a test function. + @formatted + circuit_test_function { + args: (), + msg: "cannot have test function as member of circuit", + help: None, + } + + /// Failed to parse index. + @formatted + parse_index_error { + args: (), + msg: "failed to parse index", + help: None, + } + + /// Failed to parse array dimensions. + @formatted + parse_dimension_error { + args: (), + msg: "failed to parse dimension", + help: None, + } + + /// For when there is an illegal ast structure. + @formatted + illegal_ast_structure { + args: (details: impl Display), + msg: format!("illegal ast structure: {}", details), + help: None, + } + + /// For when a user tries to reference an input varaible but none is in scope. + @formatted + illegal_input_variable_reference { + args: (), + msg: "attempted to reference input when none is in scope", + help: None, + } + + /// For the ASG receives an big Self, which should never happen + /// as they should be resolved in an earlier compiler phase. + @formatted + unexpected_big_self { + args: (), + msg: "received a Self statement, which should never happen.", + help: Some("Something went wrong during canonicalization, or you ran the ASG on an uncanonicalized AST.".to_string()), + } +); diff --git a/package/src/errors/imports/mod.rs b/errors/src/asg/mod.rs similarity index 87% rename from package/src/errors/imports/mod.rs rename to errors/src/asg/mod.rs index 35ff3d6fab..8e7bb75e7d 100644 --- a/package/src/errors/imports/mod.rs +++ b/errors/src/asg/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 directory; -pub use directory::*; +/// This module contains the ASG error definitions. +pub mod asg_errors; +pub use self::asg_errors::*; diff --git a/errors/src/ast/ast_errors.rs b/errors/src/ast/ast_errors.rs new file mode 100644 index 0000000000..0d13ab94da --- /dev/null +++ b/errors/src/ast/ast_errors.rs @@ -0,0 +1,105 @@ +// 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::create_errors; +use std::{error::Error as ErrorArg, fmt::Debug}; + +create_errors!( + /// AstError enum that represents all the errors for the `leo-ast` crate. + AstError, + exit_code_mask: 2000i32, + error_code_prefix: "AST", + + /// For when the AST fails to be represented as a JSON string. + @backtraced + failed_to_convert_ast_to_json_string { + args: (error: impl ErrorArg), + msg: format!("failed to convert ast to a json string {}", error), + help: None, + } + + /// For when the AST fails to create the AST JSON file. + @backtraced + failed_to_create_ast_json_file { + args: (path: impl Debug, error: impl ErrorArg), + msg: format!("failed to creat ast json file `{:?}` {}", path, error), + help: None, + } + + /// For when the AST fails to write the AST JSON file. + @backtraced + failed_to_write_ast_to_json_file { + args: (path: impl Debug, error: impl ErrorArg), + msg: format!("failed to write ast to a json file `{:?}` {}", path, error), + help: None, + } + + /// For when the a JSON string fails to be represented as an AST. + @backtraced + failed_to_read_json_string_to_ast { + args: (error: impl ErrorArg), + msg: format!("failed to convert json string to an ast {}", error), + help: None, + } + + /// For when the a JSON files fails to be represented as an AST. + @backtraced + failed_to_read_json_file { + args: (path: impl Debug, error: impl ErrorArg), + msg: format!("failed to convert json file `{:?}` to an ast {}", path, error), + help: None, + } + + /// For when a user tries to use the `Self` keyword outside of a cricuit. + @formatted + big_self_outside_of_circuit { + args: (), + msg: "cannot call keyword `Self` outside of a circuit function", + help: None, + } + + /// For when a user tries to define a array dimension of 0. + @formatted + invalid_array_dimension_size { + args: (), + msg: "received dimension size of 0, expected it to be 1 or larger.", + help: None, + } + + /// For when a user tries to give certain statements a block rather than another statement. + @formatted + ast_statement_not_block { + args: (), + msg: "AstStatement should be be a block", + help: None, + } + + /// For when a user tries to construct an empty string, which is a zero size array. + @formatted + empty_string { + args: (), + msg: "Cannot constrcut an empty string: it has the type of [char; 0] which is not possible.", + help: None, + } + + /// This error should never be reached, but represents trying to expand a console assert. + @formatted + impossible_console_assert_call { + args: (), + msg: "Console::Assert cannot be matched here, its handled in another case.", + help: None, + } +); diff --git a/imports/src/errors/mod.rs b/errors/src/ast/mod.rs similarity index 87% rename from imports/src/errors/mod.rs rename to errors/src/ast/mod.rs index bf08c78578..b783e63d57 100644 --- a/imports/src/errors/mod.rs +++ b/errors/src/ast/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 import_parser; -pub use self::import_parser::*; +/// This module contains the AST error definitions. +pub mod ast_errors; +pub use self::ast_errors::*; diff --git a/errors/src/cli/cli_errors.rs b/errors/src/cli/cli_errors.rs new file mode 100644 index 0000000000..09a060439b --- /dev/null +++ b/errors/src/cli/cli_errors.rs @@ -0,0 +1,403 @@ +// 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::create_errors; +use std::{ + error::Error as ErrorArg, + fmt::{Debug, Display}, +}; + +create_errors!( + /// CliError enum that represents all the errors for the `leo-lang` crate. + CliError, + exit_code_mask: 7000i32, + error_code_prefix: "CLI", + + /// Not actually ever returned anywhere outside a test. + @backtraced + opt_args_error { + args: (error: impl ErrorArg), + msg: format!("opt arg error {}", error), + help: None, + } + + /// For when APM returns an unidentifed API error. + @backtraced + unidentified_api { + args: (), + msg: "Unidentified API error", + help: None, + } + + /// For when the CLI is unable to connect to a Leo Package Manager. + @backtraced + unable_to_connect_aleo_pm { + args: (), + msg: "Unable to connect to Aleo PM. If you specified custom API endpoint, then check the URL for errors", + help: None, + } + + /// For when APM is unable to find to a package. + @backtraced + package_not_found { + args: (), + msg: "Package is not found - check author and/or package name", + help: None, + } + + /// For when APM returns an unknown API error. + @backtraced + unkown_api_error { + args: (status: impl Display), + msg: format!("Unknown API error: {}", status), + help: None, + } + + /// For when the APM account username is not registered, or password is incorrect. + @backtraced + account_not_found { + args: (), + msg: "This username is not yet registered or the password is incorrect", + help: None, + } + + /// For when APM account password is incorrect. + @backtraced + incorrect_password { + args: (), + msg: "Incorrect password", + help: None, + } + + /// For when a request to APM fails witha bad request status. + @backtraced + bad_request { + args: (msg: impl Display), + msg: msg, + help: None, + } + + /// For when the user is performing some APM action that + /// requires the user to be logged in first. + @backtraced + not_logged_in { + args: (), + msg: "You are not logged in. Please use `leo login` to login", + help: None, + } + + /// For when a package with the same name and author name is already published. + @backtraced + already_published { + args: (), + msg: "This package version is already published", + help: None, + } + + /// For when APM is experiencing a HTTP Status of 500. + @backtraced + internal_server_error { + args: (), + msg: "Server error, please contact us at https://github.com/AleoHQ/leo/issues", + help: None, + } + + /// For when the reqwest library fails to get the request JSON. + @backtraced + reqwest_json_error { + args: (error: impl ErrorArg), + msg: format!("request JSON failed {}", error), + help: None, + } + + /// For when the user provides an incorrect command argument. + @backtraced + incorrect_command_argument { + args: (), + msg: "Incorrect argument, please use --help for information on command use", + help: None, + } + + /// For when the CLI experiences an IO error. + @backtraced + cli_io_error { + args: (error: impl ErrorArg), + msg: format!("cli io error {}", error), + help: None, + } + + /// For when the CLI experiences a bytes conversion error. + @backtraced + cli_bytes_conversion_error { + args: (error: impl ErrorArg), + msg: format!("cli bytes conversion error {}", error), + help: None, + } + + /// For when the CLI experiences a zip error. + @backtraced + cli_zip_error { + args: (error: impl ErrorArg), + msg: format!("cli zip error {}", error), + help: None, + } + + /// For when the CLI cannot find the manifest file. + @backtraced + mainifest_file_not_found { + args: (), + msg: "Package manifest not found, try running `leo init`", + help: None, + } + + /// For when the CLI was unable to get the user token. + @backtraced + unable_to_get_user_token { + args: (), + msg: "Unable to get token", + help: None, + } + + /// For when the CLI was supplied an incorrect user token. + @backtraced + supplied_token_is_incorrect { + args: (), + msg: "Supplied token is incorrect", + help: None, + } + + /// For when the CLI user's stored credentials expire. + @backtraced + stored_credentials_expired { + args: (), + msg: "Stored credentials are incorrect or expired, please login again", + help: None, + } + + /// For when the user does not provide credentials to the CLI. + @backtraced + no_credentials_provided { + args: (), + msg: "No credentials provided", + help: None, + } + + /// For when the CLI does not have persmission to modify the .leo folder + /// and cannot logout the user. + @backtraced + logout_permision_denied { + args: (), + msg: "permission denied - check file permission in .leo folder", + help: None, + } + + /// For when the CLI cannot access the logout file. + @backtraced + cannot_access_logout_file { + args: (), + msg: "something went wrong, can't access the file", + help: None, + } + + /// For when the user tries to name a package after a Leo keyword. + @backtraced + package_cannot_be_named_after_a_keyword { + args: (), + msg: "Cannot be named a package after a keyword", + help: None, + } + + /// For when the user has not provided a package description. + @backtraced + no_package_description { + args: (), + msg: "No package description", + help: None, + } + + /// For when the user has not provided a package license. + @backtraced + missing_package_license { + args: (), + msg: "Missing package license", + help: None, + } + + /// For when the package is missing its remote section in the Leo.toml file. + @backtraced + missing_package_remote { + args: (), + msg: "Missing package remote", + help: None, + } + + /// For when the user has not provided the package author field in the Leo.toml file. + @backtraced + package_author_is_not_set { + args: (), + msg: "Package author is not set. Specify package author in [remote] section of Leo.toml", + help: None, + } + + /// For when the CLI fails to convert an object to TOML. + @backtraced + failed_to_convert_to_toml { + args: (error: impl ErrorArg), + msg: format!("failed to covnert to TOML {}", error), + help: None, + } + + /// For when the CLI fails to TOML an object. + @backtraced + failed_to_convert_from_toml { + args: (error: impl ErrorArg), + msg: format!("failed to covnert from TOML {}", error), + help: None, + } + + /// For when the current package directory doesn't exist. + @backtraced + package_directory_does_not_exist { + args: (), + msg: "Directory does not exist", + help: None, + } + + /// For when the current project has an invalid name. + @backtraced + invalid_project_name { + args: (), + msg: "Project name invalid", + help: None, + } + + /// For when the current package has an invalid name. + @backtraced + invalid_package_name { + args: (name: impl Display), + msg: format!("Invalid Leo package name: {}", name), + help: None, + } + + /// For when the package main.leo file is not found. + @backtraced + package_main_file_not_found { + args: (), + msg: "File main.leo not found in src/ directory", + help: None, + } + + /// For when the package directory already exists. + @backtraced + package_directory_already_exists { + args: (path: impl Debug), + msg: format!("Directory already exists {:?}", path), + help: None, + } + + /// For when the CLI could not a directory. + @backtraced + package_could_not_create_directory { + args: (error: impl ErrorArg), + msg: format!("Could not create directory {}", error), + help: None, + } + + /// For when the CLI could not setup a Leo command. + @backtraced + unable_to_setup { + args: (), + msg: "Unable to setup, see command output for more details", + help: None, + } + + /// For when the program file does not exist. + @backtraced + program_file_does_not_exist { + args: (path: impl Display), + msg: format!("Program file does not exist {}", path), + help: None, + } + + /// For when the CLI could not fetch the versions. + @backtraced + could_not_fetch_versions { + args: (error: impl ErrorArg), + msg: format!("Could not fetch versions: {}", error), + help: None, + } + + /// For when the CLI failed to watch the Leo package. + @backtraced + unable_to_watch { + args: (error: impl ErrorArg), + msg: format!("Unable to watch, check that directory contains Leo.toml file. Error: {}", error), + help: None, + } + + /// For when the CLI fails to enable ansi support. + @backtraced + failed_to_enable_ansi_support { + args: (), + msg: "failed to enable ansi_support", + help: None, + } + + /// For when the CLI fails to self update. + @backtraced + self_update_error { + args: (error: impl ErrorArg), + msg: format!("self update crate Error: {}", error), + help: None, + } + + /// For when the CLI fails to self update. + @backtraced + self_update_build_error { + args: (error: impl ErrorArg), + msg: format!("self update crate failed to build Error: {}", error), + help: None, + } + + /// For when the CLI has an old release version. + @backtraced + old_release_version { + args: (current: impl Display, latest: impl Display), + msg: format!("Old release version {} {}", current, latest), + help: None, + } +); + +impl CliError { + /// Possible errors that can be thrown when the CLI is removing the token and username. + pub fn remove_token_and_username(error: std::io::Error) -> Self { + use std::io::ErrorKind; + match error.kind() { + ErrorKind::NotFound => { + // tracing::info!("you are not logged in"); + Self::not_logged_in() + } + ErrorKind::PermissionDenied => { + // tracing::error!("permission denied - check file permission in .leo folder"); + Self::logout_permision_denied() + } + _ => { + // tracing::error!("something went wrong, can't access the file"); + Self::cannot_access_logout_file() + } + } + } +} diff --git a/package/src/errors/source/mod.rs b/errors/src/cli/mod.rs similarity index 87% rename from package/src/errors/source/mod.rs rename to errors/src/cli/mod.rs index 0e073f0423..1ed1b9473f 100644 --- a/package/src/errors/source/mod.rs +++ b/errors/src/cli/mod.rs @@ -14,11 +14,6 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -pub mod directory; -pub use directory::*; - -pub mod lib; -pub use lib::*; - -pub mod main; -pub use main::*; +/// This module contains the CLI error definitions. +pub mod cli_errors; +pub use self::cli_errors::*; diff --git a/errors/src/common/backtraced.rs b/errors/src/common/backtraced.rs new file mode 100644 index 0000000000..4d28bfe1b9 --- /dev/null +++ b/errors/src/common/backtraced.rs @@ -0,0 +1,150 @@ +// 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 std::fmt; + +use backtrace::Backtrace; +use color_backtrace::{BacktracePrinter, Verbosity}; +use colored::Colorize; +use derivative::Derivative; + +/// The indent for an error message. +pub(crate) const INDENT: &str = " "; + +/// Backtraced compiler error type +/// undefined value `x` +/// --> file.leo: 2:8 +/// = help: Initialize a variable `x` first. +#[derive(Derivative)] +#[derivative(Clone, Debug, Default, Hash, PartialEq)] +pub struct BacktracedError { + /// The error message. + pub message: String, + /// The error help message if it exists. + pub help: Option, + /// The error exit code. + pub exit_code: i32, + /// The error leading digits identifier. + pub code_identifier: i8, + /// The characters representing the type of error. + pub error_type: String, + #[derivative(PartialEq = "ignore")] + #[derivative(Hash = "ignore")] + /// The backtrace representing where the error occured in Leo. + pub backtrace: Backtrace, +} + +impl BacktracedError { + /// Creates a backtraced error from a backtrace. + pub fn new_from_backtrace( + message: S, + help: Option, + exit_code: i32, + code_identifier: i8, + error_type: String, + backtrace: Backtrace, + ) -> Self + where + S: ToString, + { + Self { + message: message.to_string(), + help, + exit_code, + code_identifier, + error_type, + backtrace, + } + } + + /// Gets the backtraced error error code. + pub fn exit_code(&self) -> i32 { + let mut code: i32; + if self.code_identifier > 99 { + code = self.code_identifier as i32 * 100_000; + } else if self.code_identifier as i32 > 9 { + code = self.code_identifier as i32 * 10_000; + } else { + code = self.code_identifier as i32 * 1_000; + } + code += self.exit_code; + + code + } +} + +impl fmt::Display for BacktracedError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let error_message = format!( + "Error [E{error_type}{code_identifier:0>3}{exit_code:0>4}]: {message}", + error_type = self.error_type, + code_identifier = self.code_identifier, + exit_code = self.exit_code, + message = self.message, + ); + + // To avoid the color enabling characters for comparison with test expectations. + if std::env::var("LEO_TESTFRAMEWORK") + .unwrap_or_default() + .trim() + .to_owned() + .is_empty() + { + write!(f, "{}", error_message.bold().red())?; + } else { + write!(f, "{}", error_message)?; + }; + + if let Some(help) = &self.help { + write!( + f, + "\n{indent } |\n\ + {indent } = {help}", + indent = INDENT, + help = help + )?; + } + + let leo_backtrace = std::env::var("LEO_BACKTRACE").unwrap_or_default().trim().to_owned(); + match leo_backtrace.as_ref() { + "1" => { + let mut printer = BacktracePrinter::default(); + printer = printer.lib_verbosity(Verbosity::Medium); + let trace = printer + .format_trace_to_string(&self.backtrace) + .map_err(|_| fmt::Error)?; + write!(f, "{}", trace)?; + } + "full" => { + let mut printer = BacktracePrinter::default(); + printer = printer.lib_verbosity(Verbosity::Full); + let trace = printer + .format_trace_to_string(&self.backtrace) + .map_err(|_| fmt::Error)?; + write!(f, "{}", trace)?; + } + _ => {} + } + + Ok(()) + } +} + +impl std::error::Error for BacktracedError { + fn description(&self) -> &str { + &self.message + } +} diff --git a/errors/src/common/formatted.rs b/errors/src/common/formatted.rs new file mode 100644 index 0000000000..f4262e0de4 --- /dev/null +++ b/errors/src/common/formatted.rs @@ -0,0 +1,186 @@ +// 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::{BacktracedError, Span, INDENT}; + +use std::fmt; + +use backtrace::Backtrace; +use color_backtrace::{BacktracePrinter, Verbosity}; +use colored::Colorize; + +/// Formatted compiler error type +/// undefined value `x` +/// --> file.leo: 2:8 +/// | +/// 2 | let a = x; +/// | ^ +/// | +/// = help: Initialize a variable `x` first. +/// Makes use of the same fields as a BacktracedError. +#[derive(Clone, Debug, Default, Hash, PartialEq)] +pub struct FormattedError { + /// The formatted error span information. + pub span: Span, + /// The backtrace to track where the Leo error originated. + pub backtrace: BacktracedError, +} + +impl FormattedError { + /// Creates a backtraced error from a span and a backtrace. + pub fn new_from_span( + message: S, + help: Option, + exit_code: i32, + code_identifier: i8, + error_type: String, + span: &Span, + backtrace: Backtrace, + ) -> Self + where + S: ToString, + { + Self { + span: span.clone(), + backtrace: BacktracedError::new_from_backtrace( + message.to_string(), + help, + exit_code, + code_identifier, + error_type, + backtrace, + ), + } + } + + /// Calls the backtraces error code. + pub fn exit_code(&self) -> i32 { + self.backtrace.exit_code() + } +} + +impl fmt::Display for FormattedError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let underline = |mut start: usize, mut end: usize| -> String { + if start > end { + std::mem::swap(&mut start, &mut end) + } + + let mut underline = String::new(); + + for _ in 0..start { + underline.push(' '); + end -= 1; + } + + for _ in 0..end { + underline.push('^'); + } + + underline + }; + + let underlined = underline(self.span.col_start, self.span.col_stop); + + let error_message = format!( + "Error [E{error_type}{code_identifier:0>3}{exit_code:0>4}]: {message}", + error_type = self.backtrace.error_type, + code_identifier = self.backtrace.code_identifier, + exit_code = self.backtrace.exit_code, + message = self.backtrace.message, + ); + + // To avoid the color enabling characters for comparison with test expectations. + if std::env::var("LEO_TESTFRAMEWORK") + .unwrap_or_default() + .trim() + .to_owned() + .is_empty() + { + write!(f, "{}", error_message.bold().red())?; + } else { + write!(f, "{}", error_message)?; + }; + + write!( + f, + "\n{indent }--> {path}:{line_start}:{start}\n\ + {indent } |\n", + indent = INDENT, + path = &*self.span.path, + line_start = self.span.line_start, + start = self.span.col_start, + )?; + + for (line_no, line) in self.span.content.lines().enumerate() { + writeln!( + f, + "{line_no:width$} | {text}", + width = INDENT.len(), + line_no = self.span.line_start + line_no, + text = line, + )?; + } + + write!( + f, + "{indent } |{underlined}", + indent = INDENT, + underlined = underlined, + )?; + + if let Some(help) = &self.backtrace.help { + write!( + f, + "\n{indent } |\n\ + {indent } = {help}", + indent = INDENT, + help = help + )?; + } + + let leo_backtrace = std::env::var("LEO_BACKTRACE").unwrap_or_default().trim().to_owned(); + match leo_backtrace.as_ref() { + "1" => { + let mut printer = BacktracePrinter::default(); + printer = printer.verbosity(Verbosity::Medium); + printer = printer.lib_verbosity(Verbosity::Medium); + let trace = printer + .format_trace_to_string(&self.backtrace.backtrace) + .map_err(|_| fmt::Error)?; + write!(f, "\n{}", trace)?; + } + "full" => { + let mut printer = BacktracePrinter::default(); + printer = printer.verbosity(Verbosity::Full); + printer = printer.lib_verbosity(Verbosity::Full); + let trace = printer + .format_trace_to_string(&self.backtrace.backtrace) + .map_err(|_| fmt::Error)?; + write!(f, "\n{}", trace)?; + } + _ => {} + } + + Ok(()) + } +} + +impl std::error::Error for FormattedError { + fn description(&self) -> &str { + &self.backtrace.message + } +} diff --git a/errors/src/common/macros.rs b/errors/src/common/macros.rs new file mode 100644 index 0000000000..9dfa00f67c --- /dev/null +++ b/errors/src/common/macros.rs @@ -0,0 +1,116 @@ +// 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 . + +/// A macro that given an enum, exit code mask, error code string prefix, +/// and error methods generated through a DSL creates and generates errors +/// with a unique error code. +#[macro_export] +macro_rules! create_errors { + (@step $_code:expr,) => {}; + ($(#[$error_type_docs:meta])* $error_type:ident, exit_code_mask: $exit_code_mask:expr, error_code_prefix: $error_code_prefix:expr, $($(#[$docs:meta])* @$formatted_or_backtraced_list:ident $names:ident { args: ($($arg_names:ident: $arg_types:ty$(,)?)*), msg: $messages:expr, help: $helps:expr, })*) => { + #[allow(unused_imports)] // Allow unused for errors that only use formatted or backtraced errors. + use crate::{BacktracedError, FormattedError, LeoErrorCode, Span}; + + use backtrace::Backtrace; + + // Generates the enum and implements from FormattedError and BacktracedErrors. + #[derive(Debug, Error)] + $(#[$error_type_docs])* + pub enum $error_type { + #[error(transparent)] + FormattedError(#[from] FormattedError), + + #[error(transparent)] + BacktracedError(#[from] BacktracedError), + } + + /// Implements the trait for LeoError Codes. + impl LeoErrorCode for $error_type { + #[inline(always)] + fn exit_code(&self) -> i32 { + match self { + Self::FormattedError(formatted) => { + formatted.exit_code() + }, + Self::BacktracedError(backtraced) => { + backtraced.exit_code() + } + } + + } + + #[inline(always)] + fn exit_code_mask() -> i32 { + $exit_code_mask + } + + #[inline(always)] + fn error_type() -> String { + $error_code_prefix.to_string() + } + } + + // Steps over the list of functions with an initial error code of 0. + impl $error_type { + create_errors!(@step 0i32, $(($(#[$docs])* $formatted_or_backtraced_list, $names($($arg_names: $arg_types,)*), $messages, $helps),)*); + } + }; + // Matches the function if it is a formatted error. + (@step $code:expr, ($(#[$error_func_docs:meta])* formatted, $error_name:ident($($arg_names:ident: $arg_types:ty,)*), $message:expr, $help:expr), $(($(#[$docs:meta])* $formatted_or_backtraced_tail:ident, $names:ident($($tail_arg_names:ident: $tail_arg_types:ty,)*), $messages:expr, $helps:expr),)*) => { + // Formatted errors always takes a span. + $(#[$error_func_docs])* + // Expands additional arguments for the error defining function. + pub fn $error_name($($arg_names: $arg_types,)* span: &Span) -> Self { + Self::FormattedError( + FormattedError::new_from_span( + $message, + $help, + $code + Self::exit_code_mask(), + Self::code_identifier(), + Self::error_type(), + span, + // Each function always generates its own backtrace for backtrace clarity to originate from the error function. + Backtrace::new(), + ) + ) + } + + // Steps the error code value by one and calls on the rest of the functions. + create_errors!(@step $code + 1i32, $(($(#[$docs])* $formatted_or_backtraced_tail, $names($($tail_arg_names: $tail_arg_types,)*), $messages, $helps),)*); + }; + // matches the function if it is a backtraced error. + (@step $code:expr, ($(#[$error_func_docs:meta])* backtraced, $error_name:ident($($arg_names:ident: $arg_types:ty,)*), $message:expr, $help:expr), $(($(#[$docs:meta])* $formatted_or_backtraced_tail:ident, $names:ident($($tail_arg_names:ident: $tail_arg_types:ty,)*), $messages:expr, $helps:expr),)*) => { + $(#[$error_func_docs])* + // Expands additional arguments for the error defining function. + pub fn $error_name($($arg_names: $arg_types,)*) -> Self { + Self::BacktracedError( + BacktracedError::new_from_backtrace( + $message, + $help, + $code + Self::exit_code_mask(), + Self::code_identifier(), + Self::error_type(), + // Each function always generates its own backtrace for backtrace clarity to originate from the error function. + Backtrace::new(), + ) + ) + } + + // Steps the error code value by one and calls on the rest of the functions. + create_errors!(@step $code + 1i32, $(($(#[$docs])* $formatted_or_backtraced_tail, $names($($tail_arg_names: $tail_arg_types,)*), $messages, $helps),)*); + }; + +} diff --git a/errors/src/common/mod.rs b/errors/src/common/mod.rs new file mode 100644 index 0000000000..9ec9731a6b --- /dev/null +++ b/errors/src/common/mod.rs @@ -0,0 +1,49 @@ +// 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 . + +/// This module contains a backtraced error and its methods. +pub mod backtraced; +pub use self::backtraced::*; + +/// This module contains a formatted error and its methods. +pub mod formatted; +pub use self::formatted::*; + +/// This module contains the macros for making errors easily. +#[macro_use] +pub mod macros; +pub use self::macros::*; + +/// This module contains the common span object for Leo crates. +pub mod span; +pub use self::span::Span; + +/// This module contains information on how to serialize and +/// deserialze StrTendril type. +pub mod tendril_json; +pub use self::tendril_json::*; + +/// This module contains traits for making errors easily. +pub mod traits; +pub use self::traits::*; + +// Right now for cleanliness of calling error functions we say each argument implments one of the follow types rather than giving a specific type. +// This allows us to just pass many types rather doing conversions cleaning up the code. +// The args can be made cleaneronce https://github.com/rust-lang/rust/issues/41517 or https://github.com/rust-lang/rust/issues/63063 hits stable. +// Either of why would allows to generate a type alias for these trait implmenting types. +// pub(crate) type DisplayArg = impl std::fmt::Display; +// pub(crate) type DebugArg = impl std::fmt::Debug; +// pub(crate) type ErrorArg = impl std::error::Error; diff --git a/ast/src/common/span.rs b/errors/src/common/span.rs similarity index 52% rename from ast/src/common/span.rs rename to errors/src/common/span.rs index 830437a39b..c10d259642 100644 --- a/ast/src/common/span.rs +++ b/errors/src/common/span.rs @@ -14,22 +14,86 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use std::{fmt, sync::Arc}; +use std::{fmt, sync::Arc, usize}; -use serde::{Deserialize, Serialize}; +use pest::Span as PestSpan; +use serde::ser::{Serialize, SerializeStruct, Serializer}; +use serde::Deserialize; use tendril::StrTendril; -#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq, Hash)] +/// The span type which tracks where formatted errors originate from in a Leo file. +/// This is used in many spots throughout the rest of the Leo crates. +#[derive(Clone, Debug, Default, Deserialize, Eq, Hash, PartialEq)] pub struct Span { + /// The line number where the error started. pub line_start: usize, + /// The line number where the error stopped. pub line_stop: usize, + /// The column number where the error started. pub col_start: usize, + /// The column number where the error stopped. pub col_stop: usize, + /// The path to the Leo file containing the error. pub path: Arc, - #[serde(with = "crate::common::tendril_json")] + #[serde(with = "crate::tendril_json")] + /// The content of the file between the above boundries. 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. + pub fn new( + line_start: usize, + line_stop: usize, + col_start: usize, + col_stop: usize, + path: Arc, + content: StrTendril, + ) -> Self { + Self { + line_start, + line_stop, + col_start, + col_stop, + path, + content, + } + } +} + +impl Serialize for Span { + /// Custom serialization for testing purposes. + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + let mut state = serializer.serialize_struct("Color", 3)?; + state.serialize_field("line_start", &self.line_start)?; + state.serialize_field("line_stop", &self.line_stop)?; + state.serialize_field("col_start", &self.col_start)?; + state.serialize_field("col_stop", &self.col_stop)?; + if std::env::var("LEO_TESTFRAMEWORK") + .unwrap_or_default() + .trim() + .to_owned() + .is_empty() + { + state.serialize_field("path", &self.path)?; + } else { + state.serialize_field("path", "")?; + } + state.serialize_field("content", &self.content[..])?; + state.end() + } +} + +/// 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 { @@ -44,19 +108,19 @@ impl fmt::Display for Span { } } -impl<'ast> From> for Span { - fn from(span: pest::Span) -> Self { +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 { - line_start: start.0, - line_stop: end.0, - col_start: start.1, - col_stop: end.1, - path: Arc::new(String::new()), - content: span.as_str().into(), - } + Span::new( + start.0, + end.0, + start.1, + end.1, + Arc::new(String::new()), + span.as_str().into(), + ) } } @@ -88,11 +152,23 @@ impl std::ops::Add for Span { let other_lines = other.content.lines().collect::>(); for line in self.line_start.min(other.line_start)..self.line_stop.max(other.line_stop) + 1 { if line >= self.line_start && line <= self.line_stop { - new_content.push(self_lines.get(line - self.line_start).copied().unwrap_or_default()); + new_content.push( + self_lines + .get(line - self.line_start) + .copied() + .unwrap_or_default() + .to_string(), + ); } else if line >= other.line_start && line <= other.line_stop { - new_content.push(other_lines.get(line - other.line_start).copied().unwrap_or_default()); + new_content.push( + other_lines + .get(line - other.line_start) + .copied() + .unwrap_or_default() + .to_string(), + ); } else if new_content.last().map(|x| *x != "...").unwrap_or(true) { - new_content.push("..."); + new_content.push(format!("{:<1$}...", " ", other.col_start + 4)); } } let new_content = new_content.join("\n").into(); diff --git a/ast/src/common/tendril_json.rs b/errors/src/common/tendril_json.rs similarity index 92% rename from ast/src/common/tendril_json.rs rename to errors/src/common/tendril_json.rs index 35c9b45759..bbbe571bcd 100644 --- a/ast/src/common/tendril_json.rs +++ b/errors/src/common/tendril_json.rs @@ -17,10 +17,12 @@ use serde::{Deserialize, Deserializer, Serializer}; use tendril::StrTendril; +/// Serialization for the StrTendril type. pub fn serialize(tendril: &StrTendril, serializer: S) -> Result { serializer.serialize_str(&tendril[..]) } +/// Deserialization for the StrTendril type. pub fn deserialize<'de, D: Deserializer<'de>>(deserializer: D) -> Result { Ok(String::deserialize(deserializer)?.into()) } diff --git a/compiler/src/errors/output_file.rs b/errors/src/common/traits.rs similarity index 55% rename from compiler/src/errors/output_file.rs rename to errors/src/common/traits.rs index 014327c3ad..b171cb5bfc 100644 --- a/compiler/src/errors/output_file.rs +++ b/errors/src/common/traits.rs @@ -14,25 +14,22 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use std::{io, path::PathBuf}; +/// ErrorCode trait that all Errors should implement. +pub trait LeoErrorCode: Sized { + /// Returns the error's exit code for the program. + fn exit_code(&self) -> i32; -#[derive(Debug, Error)] -pub enum OutputFileError { - #[error("{}: {}", _0, _1)] - Crate(&'static str, String), + /// Returns the error's exit code mask, as to avoid conflicts. + fn exit_code_mask() -> i32; - #[error("Cannot read from the provided file path - {:?}", _0)] - FileReadError(PathBuf), + /// Returns the error's code type for the program. + fn error_type() -> String; - #[error("Cannot remove the provided file - {:?}", _0)] - FileRemovalError(PathBuf), - - #[error("writing: {}", _0)] - Writing(io::Error), -} - -impl From for OutputFileError { - fn from(error: std::io::Error) -> Self { - OutputFileError::Crate("std::io", error.to_string()) + /// The LeoErrorCode which has a default code identifier of 037 + /// (Leo upsidedown and backwards). This is to make the exit codes + /// unique to Leo itself. + #[inline(always)] + fn code_identifier() -> i8 { + 37 } } diff --git a/errors/src/compiler/compiler_errors.rs b/errors/src/compiler/compiler_errors.rs new file mode 100644 index 0000000000..f46b4e9566 --- /dev/null +++ b/errors/src/compiler/compiler_errors.rs @@ -0,0 +1,837 @@ +// 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::create_errors; + +use std::{ + error::Error as ErrorArg, + fmt::{Debug, Display}, +}; + +create_errors!( + /// CompilerError enum that represents all the errors for the `leo-compiler` crate. + CompilerError, + exit_code_mask: 6000i32, + error_code_prefix: "CMP", + + /// For when the test function has invalid test context. + @backtraced + invalid_test_context { + args: (name: impl Display), + msg: format!("Cannot find input files with context name `{}`", name), + help: None, + } + + /// For when the compiler can't read a file from the provided path. + @backtraced + file_read_error { + args: (path: impl Debug, error: impl ErrorArg), + msg: format!("Cannot read from the provided file path '{:?}': {}", path, error), + help: None, + } + + /// For when there is no main function in a Leo program. + @backtraced + no_main_function { + args: (), + msg: "There must be a function named `main`", + help: None, + } + + /// For when the compiler can't find the test input files with the specified name. + @backtraced + no_test_input { + args: (), + msg: "Failed to find input files for the current test", + help: None, + } + + /// For when the console formatter expected a left or right brace after a left brace. + @formatted + console_fmt_expected_left_or_right_brace { + args: (), + msg: "Formatter given a {. Expected a { or } after", + help: None, + } + + /// For when the console formatter expected a right brace after a right brace. + @formatted + console_fmt_expected_escaped_right_brace { + args: (), + msg: "Formatter given a }. Expected a container {} or }}", + help: None, + } + + /// For when the amount of arguments, and number of containers mismatch + /// in a format statement. + @formatted + console_container_parameter_length_mismatch { + args: (containers: impl Display, parameters: impl Display), + msg: format!( + "Formatter given {} containers and found {} parameters", + containers, parameters + ), + help: None, + } + + /// For when a user tries to user console assert outside of a test function. + @formatted + console_assertion_depends_on_input { + args: (), + msg: "console.assert() does not produce constraints and cannot use inputs. \ + Assertions should only be used in @test functions", + help: None, + } + + /// For when a console assert fails. + @formatted + console_assertion_failed { + args: (), + msg: "console.assert(...) failed", + help: None, + } + + /// For when a console assert value is not a boolean. + @formatted + console_assertion_must_be_boolean { + args: (), + msg: "Assertion expression must evaluate to a boolean value", + help: None, + } + + /// For when a experssion gadget oepration cannot be enforced due to a SnarkVM syntehsis error. + @formatted + cannot_enforce_expression { + args: (operation: impl Display, error: impl ErrorArg), + msg: format!( + "the gadget operation `{}` failed due to synthesis error `{:?}`", + operation, error, + ), + help: None, + } + + /// For when an expression has mismatching types for an operation. + @formatted + cannot_evaluate_expression { + args: (operation: impl Display), + msg: format!("Mismatched types found for operation `{}`", operation), + help: None, + } + + /// For when an array length goes out of the legal bounds of 2^32. + @formatted + array_length_out_of_bounds { + args: (), + msg: "array length cannot be >= 2^32", + help: None, + } + + /// For when an array index goes out of the legal bounds of 2^32. + @formatted + array_index_out_of_legal_bounds { + args: (), + msg: "array index cannot be >= 2^32", + help: None, + } + + /// For when a boolean expression does not resolve to a boolean type. + @formatted + conditional_boolean_expression_fails_to_resolve_to_bool { + args: (actual: impl Display), + msg: format!("if, else conditional must resolve to a boolean, found `{}`", actual), + help: None, + } + + /// For when the expected circuit member could not be found. + @formatted + expected_circuit_member { + args: (expected: impl Display), + msg: format!("expected circuit member `{}`, not found", expected), + help: None, + } + + /// For when the operation has no implmentation on the type of variable received. + @formatted + incompatible_types { + args: (operation: impl Display), + msg: format!("no implementation for `{}`", operation), + help: None, + } + + /// For when a tuple index goes out of the tuples size bounds. + @formatted + tuple_index_out_of_bounds { + args: (index: impl Display), + msg: format!("cannot access index {} of tuple out of bounds", index), + help: None, + } + + /// For when an array index goes out of the arrays size bounds. + @formatted + array_index_out_of_bounds { + args: (index: impl Display), + msg: format!("cannot access index {} of array out of bounds", index), + help: None, + } + + /// For when a invalid array slice length is requested. + @formatted + array_invalid_slice_length { + args: (), + msg: "illegal length of slice", + help: None, + } + + /// For when an array index does not resolve to an integer type. + @formatted + invalid_index_expression { + args: (actual: impl Display), + msg: format!("index must resolve to an integer, found `{}`", actual), + help: None, + } + + /// For when a typed array receives an assignment of an array with a different length. + @formatted + unexpected_array_length { + args: (expected: impl Display, actual: impl Display), + msg: format!("expected array length {}, found one with length {}", expected, actual), + help: None, + } + + /// For when the circuit static member does not exist. + @formatted + invalid_circuit_static_member_access { + args: (member: impl Display), + msg: format!("invalid circuit static member `{}` must be accessed using `::` syntax", member), + help: None, + } + + /// For when a user is trying to use an array in access expression before it is declared. + @formatted + undefined_array { + args: (actual: impl Display), + msg: format!("array `{}` must be declared before it is used in an expression", actual), + help: None, + } + + /// For when the user is trying to us a circuit that is not yet declared. + @formatted + undefined_circuit { + args: (actual: impl Display), + msg: format!( + "circuit `{}` must be declared before it is used in an expression", + actual + ), + help: None, + } + + /// For when the user tries to use an identifier not declared in scope. + @formatted + undefined_identifier { + args: (name: impl Display), + msg: format!("Cannot find value `{}` in this scope", name), + help: None, + } + + /// For when the user tries to access an undefined circuit member. + @formatted + undefined_circuit_member_access { + args: (circuit: impl Display, member: impl Display), + msg: format!("Circuit `{}` has no member `{}`", circuit, member), + help: None, + } + + /// For when the input variable type mismatches the declared function input type. + @formatted + input_variable_type_mismatch { + args: (expected: impl Display, actual: impl Display, variable: impl Display), + msg: format!( + "Expected input variable `{}` to be type `{}`, found type `{}`", + variable, expected, actual + ), + help: None, + } + + /// For when the declared function input variable was expected to be constant + /// but the input file did not have it in the constants section. + @formatted + expected_const_input_variable { + args: (variable: impl Display), + msg: format!( + "Expected input variable `{}` to be constant. Move input variable `{}` to [constants] section of input file", + variable, variable + ), + help: None, + } + + /// For when the declared function input variable was expected to be mutable + /// but the input file did not have it in the main section. + @formatted + expected_non_const_input_variable { + args: (variable: impl Display), + msg: format!( + "Expected input variable `{}` to be non-constant. Move input variable `{}` to [main] section of input file", + variable, variable + ), + help: None, + } + + /// For when the declared function input variable was expected to be a valid array + /// in the input file. + @formatted + invalid_function_input_array { + args: (actual: impl Display), + msg: format!("Expected function input array, found `{}`", actual), + help: None, + } + + /// For when the declared function input variable was expected to be an array with differing dimensions. + @formatted + invalid_input_array_dimensions { + args: (expected: impl Display, actual: impl Display), + msg: format!( + "Input array dimensions mismatch expected {}, found array dimensions {}", + expected, actual + ), + help: None, + } + + /// For when the declared function input variable was expected to be a tuple + /// with a different number of arguments. + @formatted + input_tuple_size_mismatch { + args: (expected: impl Display, actual: impl Display), + msg: format!( + "Input tuple size mismatch expected {}, found tuple with length {}", + expected, actual + ), + help: None, + } + + /// For when the declared function input variable was expected to be a valid tuple + /// in the input file. + @formatted + invalid_function_input_tuple { + args: (actual: impl Display), + msg: format!("Expected function input tuple, found `{}`", actual), + help: None, + } + + /// For when the declared function input variable was expected to be a valid tuple + /// in the input file. + @formatted + function_input_not_found { + args: (function: impl Display, expected: impl Display), + msg: format!("function `{}` input {} not found", function, expected), + help: None, + } + + /// For when the declared function input variable was defined twice + /// in the input file. + @formatted + double_input_declaration { + args: (input_name: impl Display), + msg: format!("Input variable {} declared twice", input_name), + help: None, + } + + /// For when the input file does not define enough registers. + @formatted + output_not_enough_registers { + args: (), + msg: "number of input registers must be greater than or equal to output registers", + help: None, + } + + /// For when the input file register types do not match the output types being generated. + @formatted + output_mismatched_types { + args: (left: impl Display, right: impl Display), + msg: format!( + "Mismatched types. Expected register output type `{}`, found type `{}`.", + left, right + ), + help: None, + } + + /// For when there's an IO error with the output file. + @backtraced + output_file_io_error { + args: (error: impl ErrorArg), + msg: error, + help: None, + } + + /// For when the output file cannot be read. + @backtraced + output_file_cannot_read { + args: (path: impl Debug), + msg: format!("Cannot read the provided ouput file - {:?}", path), + help: None, + } + + /// For when the output file cannot be removed. + @backtraced + output_file_cannot_remove { + args: (path: impl Debug), + msg: format!("Cannot remove the provided ouput file - {:?}", path), + help: None, + } + + /// For when the user tries to index a single array more than once. + @formatted + statement_array_assign_index { + args: (), + msg: "Cannot assign single index to array of values", + help: None, + } + + /// For when the user tries to use a non const value as an index. + @formatted + statement_array_assign_index_const { + args: (), + msg: "Cannot assign to non-const array index", + help: None, + } + + /// For when the user tries to assign an index to something not an array of length >= 1; + @formatted + statement_array_assign_interior_index { + args: (), + msg: "Cannot assign single index to interior of array of values", + help: None, + } + + /// For when the user tries to assign a range of values to something that expected a single value. + @formatted + statement_array_assign_range { + args: (), + msg: "Cannot assign range of array values to single value", + help: None, + } + + /// For when the user tries to index a value from an array that is >= the array length. + @formatted + statement_array_assign_index_bounds { + args: (index: impl Display, length: impl Display), + msg: format!( + "Array assign index `{}` out of range for array of length `{}`", + index, length + ), + help: None, + } + + /// For when the user defines an array range values that is >= the array length. + @formatted + statement_array_assign_range_order { + args: (start: impl Display, stop: impl Display, length: impl Display), + msg: format!( + "Array assign range `{}`..`{}` out of range for array of length `{}`", + start, stop, length + ), + help: None, + } + + /// For when the statement conditional boolean fails to resolve to a boolean. + @formatted + statement_conditional_boolean_fails_to_resolve_to_boolean { + args: (actual: impl Display), + msg: format!("If, else conditional must resolve to a boolean, found `{}`", actual), + help: None, + } + + /// For when there was an error in SnarkVM trying to do a bit and operation. + @formatted + statement_indicator_calculation { + args: (name: impl Display), + msg: format!( + "Constraint system failed to evaluate branch selection indicator `{}`", + name + ), + help: None, + } + + /// For when a multi definition statement found a differing number of values and variable names. + @formatted + statement_invalid_number_of_definitions { + args: (expected: impl Display, actual: impl Display), + msg: format!( + "Multiple definition statement expected {} values, found {} variable names", + expected, actual + ), + help: None, + } + + /// For when the user tries to assign multiple variables to a single value. + @formatted + statement_multiple_definition { + args: (value: impl Display), + msg: format!("cannot assign multiple variables to a single value: {}", value), + help: None, + } + + /// For when a function returns multiple times. + @formatted + statement_multiple_returns { + args: (), + msg: "This function returns multiple times and produces unreachable circuits with undefined behavior.", + help: None, + } + + /// For when a function expects a return type and has no valid return statements. + @formatted + statement_no_returns { + args: (expected: impl Display), + msg: format!( + "function expected `{}` return type but no valid branches returned a result", + expected + ), + help: None, + } + + /// For when SnarkVM fails to conditionally select between values for a gadget. + @formatted + statement_select_fail { + args: (first: impl Display, second: impl Display), + msg: format!( + "Conditional select gadget failed to select between `{}` or `{}`", + first, second + ), + help: None, + } + + /// For when the user tries to index a single tuple more than once. + @formatted + statement_tuple_assign_index { + args: (), + msg: "Cannot assign single index to tuple of values", + help: None, + } + + /// For when the user tries to index a value from an tuple that is >= the tuple length. + @formatted + statement_tuple_assign_index_bounds { + args: (index: impl Display, length: impl Display), + msg: format!( + "Tuple assign index `{}` out of range for tuple of length `{}`", + index, length + ), + help: None, + } + + /// For when the user doesn't assign or return the expression. + @formatted + statement_unassigned { + args: (), + msg: "Expected assignment of return values for expression", + help: None, + } + + /// For when a statement tries to use an unknown variable. + @formatted + statement_undefined_variable { + args: (name: impl Display), + msg: format!("Attempted to assign to unknown variable `{}`", name), + help: None, + } + + /// For when the user defines a statement that tries to access an unknown circuit member variable. + @formatted + statement_undefined_circuit_variable { + args: (name: impl Display), + msg: format!("Attempted to assign to unknown circuit member variable `{}`", name), + help: None, + } + + /// For when the user uses a nont const value for an iteration range. + @formatted + statement_loop_index_const { + args: (), + msg: "iteration range must be const", + help: None, + } + + /// For when there is an issue with an address value account. + @formatted + address_value_account_error { + args: (error: impl ErrorArg), + msg: format!("account creation failed due to `{}`", error), + help: None, + } + + /// For when there is an invalid address value. + @formatted + address_value_invalid_address { + args: (actual: impl Display), + msg: format!("expected address input type, found `{}`", actual), + help: None, + } + + /// For when an a address value was expected but none was found. + @formatted + address_value_missing_address { + args: (), + msg: "expected address input not found", + help: None, + } + + /// For when an a boolean operation cannot be enforced due to a SnarkVM synthesis error. + @formatted + boolean_value_cannot_enforce { + args: (operation: impl Display, error: impl ErrorArg), + msg: format!( + "the boolean operation `{}` failed due to the synthesis error `{}`", + operation, error, + ), + help: None, + } + + /// For when an a invalid boolean operation is called. + @formatted + boolean_value_cannot_evaluate { + args: (operation: impl Display), + msg: format!("no implementation found for `{}`", operation), + help: None, + } + + /// For when there is an invalid boolean value. + @formatted + boolean_value_invalid_boolean { + args: (actual: impl Display), + msg: format!("expected boolean input type, found `{}`", actual), + help: None, + } + + /// For when an a boolean value was expected but none was found. + @formatted + boolean_value_missing_boolean { + args: (expected: impl Display), + msg: format!("expected boolean input `{}` not found", expected), + help: None, + } + + /// For when there is an invalid char value. + @formatted + char_value_invalid_char { + args: (actual: impl Display), + msg: format!("expected char element input type, found `{}`", actual), + help: None, + } + + /// For when negating a field value fails due to a SnarkVM synthesis error. + @formatted + field_value_negate_operation { + args: (error: impl ErrorArg), + msg: format!("field negation failed due to synthesis error `{}`", error), + help: None, + } + + /// For when an a field operation cannot be enforced due to a SnarkVM synthesis error. + @formatted + field_value_binary_operation { + args: (operation: impl Display, error: impl ErrorArg), + msg: format!( + "the field binary operation `{}` failed due to synthesis error `{}`", + operation, error, + ), + help: None, + } + + /// For when there is an invalid field value. + @formatted + field_value_invalid_field { + args: (actual: impl Display), + msg: format!("expected field element input type, found `{}`", actual), + help: None, + } + + /// For when an a field value was expected but none was found. + @formatted + field_value_missing_field { + args: (expected: impl Display), + msg: format!("expected field input `{}` not found", expected), + help: None, + } + + /// For when negating a group value fails due to a SnarkVM synthesis error. + @formatted + group_value_negate_operation { + args: (error: impl ErrorArg), + msg: format!("group negation failed due to the synthesis error `{}`", error), + help: None, + } + + /// For when an a group operation cannot be enforced due to a SnarkVM synthesis error. + @formatted + group_value_binary_operation { + args: (operation: impl Display, error: impl ErrorArg), + msg: format!( + "the group binary operation `{}` failed due to the synthesis error `{}`", + operation, error, + ), + help: None, + } + + /// For when there is an invalid group value. + @formatted + group_value_invalid_group { + args: (actual: impl Display), + msg: format!("expected group affine point input type, found `{}`", actual), + help: None, + } + + /// For when an a group value was expected but none was found. + @formatted + group_value_missing_group { + args: (expected: impl Display), + msg: format!("expected group input `{}` not found", expected), + help: None, + } + + /// For when the synthesis of a group failed due to a SnarkVM synthesis error. + @formatted + group_value_synthesis_error { + args: (error: impl ErrorArg), + msg: format!("compilation failed due to group synthesis error `{}`", error), + help: None, + } + + /// For when the x coordinate of a group is invalid. + @formatted + group_value_x_invalid { + args: (x: impl Display), + msg: format!("invalid x coordinate `{}`", x), + help: None, + } + + /// For when the y coordinate of a group is invalid. + @formatted + group_value_y_invalid { + args: (y: impl Display), + msg: format!("invalid y coordinate `{}`", y), + help: None, + } + + /// For when the current group value is not on the current supported curve. + @formatted + group_value_not_on_curve { + args: (element: impl Display), + msg: format!("group element `{}` is not on the supported curve", element), + help: None, + } + + /// For when the x coordinate of a group could not be recovered. + @formatted + group_value_x_recover { + args: (), + msg: "could not recover group element from x coordinate", + help: None, + } + + /// For when the y coordinate of a group could not be recovered. + @formatted + group_value_y_recover { + args: (), + msg: "could not recover group element from y coordinate", + help: None, + } + + /// For when a group generator cannot be multiplied by some number. + @formatted + group_value_n_group { + args: (number: impl Display), + msg: format!("cannot multiply group generator by \"{}\"", number), + help: None, + } + + /// For when an a signed integer operation cannot be enforced due to a SnarkVM synthesis error. + @formatted + integer_value_signed { + args: (error: impl ErrorArg), + msg: format!("integer operation failed due to the signed integer error `{}`", error), + help: None, + } + + /// For when an a unsigned integer operation cannot be enforced due to a SnarkVM synthesis error. + @formatted + integer_value_unsigned { + args: (error: impl ErrorArg), + msg: format!( + "integer operation failed due to the unsigned integer error `{}`", + error + ), + help: None, + } + + /// For when an a integer operation cannot be enforced due to a SnarkVM synthesis error. + @formatted + integer_value_synthesis { + args: (error: impl ErrorArg), + msg: format!("integer operation failed due to the synthesis error `{}`", error), + help: None, + } + + /// For when negating a integer value fails due to a SnarkVM synthesis error. + @formatted + integer_value_negate_operation { + args: (), + msg: "integer negation can only be enforced on signed integers", + help: None, + } + + /// For when an a binary integer operation cannot be enforced due to a SnarkVM synthesis error. + @formatted + integer_value_binary_operation { + args: (operation: impl Display), + msg: format!( + "the integer binary operation `{}` can only be enforced on integers of the same type", + operation + ), + help: None, + } + + /// For when there is an integer type mismatch, one kind was expected but another was received. + @formatted + integer_value_integer_type_mismatch { + args: (expected: impl Display, received: impl Display), + msg: format!("expected data type `{}`, found `{}`", expected, received), + help: None, + } + + /// For when there is an invalid integer value. + @formatted + integer_value_invalid_integer { + args: (actual: impl Display), + msg: format!("failed to parse `{}` as expected integer type", actual), + help: None, + } + + /// For when an a integer value was expected but none was found. + @formatted + integer_value_missing_integer { + args: (expected: impl Display), + msg: format!("expected integer input `{}` not found", expected), + help: None, + } + + /// For when an a integer operation has no implementation. + @formatted + integer_value_cannot_evaluate { + args: (operation: impl Display), + msg: format!("no implementation found for `{}`", operation), + help: None, + } +); diff --git a/errors/src/compiler/mod.rs b/errors/src/compiler/mod.rs new file mode 100644 index 0000000000..826e7c3274 --- /dev/null +++ b/errors/src/compiler/mod.rs @@ -0,0 +1,19 @@ +// 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 . + +/// This module contains the Compiler error definitions. +pub mod compiler_errors; +pub use self::compiler_errors::*; diff --git a/errors/src/import/import_errors.rs b/errors/src/import/import_errors.rs new file mode 100644 index 0000000000..16250f2b63 --- /dev/null +++ b/errors/src/import/import_errors.rs @@ -0,0 +1,100 @@ +// 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::create_errors; + +use std::{ + error::Error as ErrorArg, + fmt::{Debug, Display}, +}; + +create_errors!( + /// ImportError enum that represents all the errors for the `leo-import` crate. + ImportError, + exit_code_mask: 4000i32, + error_code_prefix: "IMP", + + /// For when an imported package has the same name as an imported core_package. + @formatted + conflicting_imports { + args: (name: impl Display), + msg: format!("conflicting imports found for `{}`.", name), + help: None, + } + + /// For when imports are recursive. + @formatted + recursive_imports { + args: (package: impl Display), + msg: format!("recursive imports for `{}`.", package), + help: None, + } + + /// For when the crate failed to convert a file path into an os string. + @formatted + convert_os_string { + args: (), + msg: "Failed to convert file string name, maybe an illegal character?", + help: None, + } + + /// For when the crate failed to find the directory of the current file. + @formatted + current_directory_error { + args: (error: impl ErrorArg), + msg: format!("Compilation failed trying to find current directory - {:?}.", error), + help: None, + } + + /// For when the crate failed to open or get the name of a directory. + @formatted + directory_error { + args: (error: impl ErrorArg, path:impl Debug), + msg: format!( + "Compilation failed due to directory error @ '{:?}' - {:?}.", + path, + error + ), + help: None, + } + + /// For when the crate failed to find a main file for the current package. + @formatted + expected_main_file { + args: (entry: impl Debug), + msg: format!("Expected main file at `{:?}`.", entry), + help: None, + } + + /// For when the crate failed to import a package name. + @formatted + unknown_package { + args: (name: impl Display), + msg: format!( + "Cannot find imported package `{}` in source files or import directory.", + name + ), + help: None, + } + + /// / For when the crate failed due to an IO error. + @formatted + io_error { + args: (path: impl Display, error: impl ErrorArg), + msg: format!("cannot read imported file '{}': {:?}", path, error), + help: None, + } +); diff --git a/errors/src/import/mod.rs b/errors/src/import/mod.rs new file mode 100644 index 0000000000..2bb4c05771 --- /dev/null +++ b/errors/src/import/mod.rs @@ -0,0 +1,19 @@ +// 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 . + +/// This module contains the Import error definitions. +pub mod import_errors; +pub use self::import_errors::*; diff --git a/errors/src/lib.rs b/errors/src/lib.rs new file mode 100644 index 0000000000..27dc6be2c2 --- /dev/null +++ b/errors/src/lib.rs @@ -0,0 +1,158 @@ +// 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 . + +#![deny(clippy::all, clippy::missing_docs_in_private_items)] +#![doc = include_str!("../README.md")] + +/// Contains the ASG error definitions. +pub mod asg; +pub use self::asg::*; + +/// Contains the AST error definitions. +pub mod ast; +pub use self::ast::*; + +/// Contains the CLI error definitions. +pub mod cli; +pub use self::cli::*; + +/// Contains the common functionalities for defining errors.. +#[macro_use] +pub mod common; +pub use self::common::*; + +/// Contains the Compiler error definitions. +pub mod compiler; +pub use self::compiler::*; + +/// Contains the Import error definitions. +pub mod import; +pub use self::import::*; + +/// Contains the Package error definitions. +pub mod package; +pub use self::package::*; + +/// Contains the Parser error definitions. +pub mod parser; +pub use self::parser::*; + +/// Contains the SnarkVM error definitions. +pub mod snarkvm; +pub use self::snarkvm::*; + +/// Contains the State error definitions. +pub mod state; +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)] +pub enum LeoError { + /// Represents an ASG Error in a Leo Error. + #[error(transparent)] + AsgError(#[from] AsgError), + + /// Represents an AST Error in a Leo Error. + #[error(transparent)] + AstError(#[from] AstError), + + /// Represents an CLI Error in a Leo Error. + #[error(transparent)] + CliError(#[from] CliError), + + /// Represents an Compiler Error in a Leo Error. + #[error(transparent)] + CompilerError(#[from] CompilerError), + + /// Represents an Import Error in a Leo Error. + #[error(transparent)] + ImportError(#[from] ImportError), + + /// Represents an Input Error in a Leo Error. + #[error(transparent)] + InputError(#[from] InputParserError), + + /// Represents an Package Error in a Leo Error. + #[error(transparent)] + PackageError(#[from] PackageError), + + /// Represents an Parser Error in a Leo Error. + #[error(transparent)] + ParserError(#[from] ParserError), + + /// Represents an SnarkVM Error in a Leo Error. + #[error(transparent)] + SnarkVMError(#[from] SnarkVMError), + + /// Represents an State Error in a Leo Error. + #[error(transparent)] + StateError(#[from] StateError), +} + +impl LeoError { + /// Implment exit code for each type of Error, even the ones that don't have one. + pub fn exit_code(&self) -> i32 { + use LeoError::*; + + match self { + AsgError(error) => error.exit_code(), + AstError(error) => error.exit_code(), + 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. + 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. + StateError(error) => error.exit_code(), + } + } +} + +/// A global result type for all Leo crates, that defaults the errors to be a LeoError. +pub type Result = core::result::Result; + +// #[test] +// fn test_error() { +// let err = FormattedError { +// path: std::sync::Arc::new("file.leo".to_string()), +// line_start: 2, +// line_stop: 2, +// col_start: 9, +// col_stop: 10, +// content: "let a = x;".into(), +// message: "undefined value `x`".to_string(), +// }; + +// assert_eq!( +// err.to_string(), +// vec![ +// " --> file.leo:2:9", +// " |", +// " 2 | let a = x;", +// " | ^", +// " |", +// " = undefined value `x`", +// ] +// .join("\n") +// ); +// } diff --git a/errors/src/package/mod.rs b/errors/src/package/mod.rs new file mode 100644 index 0000000000..451e2d99f9 --- /dev/null +++ b/errors/src/package/mod.rs @@ -0,0 +1,19 @@ +// 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 . + +/// This module contains the Package error definitions. +pub mod package_errors; +pub use self::package_errors::*; diff --git a/errors/src/package/package_errors.rs b/errors/src/package/package_errors.rs new file mode 100644 index 0000000000..fca8c663f8 --- /dev/null +++ b/errors/src/package/package_errors.rs @@ -0,0 +1,484 @@ +// 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::create_errors; + +use std::{ + error::Error as ErrorArg, + fmt::{Debug, Display}, +}; + +create_errors!( + /// PackageError enum that represents all the errors for the `leo-package` crate. + PackageError, + exit_code_mask: 5000i32, + error_code_prefix: "PAK", + + /// For when creating the imports directory failed. + @backtraced + failed_to_create_imports_directory { + args: (error: impl ErrorArg), + msg: format!("failed creating imports directory {}", error), + help: None, + } + + /// For when the specified import does not exist. + @backtraced + import_does_not_exist { + args: (package: impl Display), + msg: format!("package {} does not exist as an import", package), + help: None, + } + + /// For when removing the imports directory failed. + @backtraced + failed_to_remove_imports_directory { + args: (error: impl ErrorArg), + msg: format!("failed removing imports directory {}", error), + help: None, + } + + /// For when creating the inputs directory failed. + @backtraced + failed_to_create_inputs_directory { + args: (error: impl ErrorArg), + msg: format!("failed creating inputs directory {}", error), + help: None, + } + + /// For when getting a input file entry failed. + @backtraced + failed_to_get_input_file_entry { + args: (error: impl ErrorArg), + msg: format!("failed to get input file entry: {}", error), + help: None, + } + + /// For when getting the input file name failed. + @backtraced + failed_to_get_input_file_name { + args: (file: impl Debug), + msg: format!("failed to get input file name: {:?}", file), + help: None, + } + + /// For when getting the input file type failed. + @backtraced + failed_to_get_input_file_type { + args: (file: impl Debug, error: impl ErrorArg), + msg: format!("failed to get input file `{:?}` type: {}", file, error), + help: None, + } + + /// For when getting the input file has an invalid file type. + @backtraced + invalid_input_file_type { + args: (file: impl Debug, type_: std::fs::FileType), + msg: format!("input file `{:?}` has invalid type: {:?}", file, type_), + help: None, + } + + /// For when reading the input directory failed. + @backtraced + failed_to_read_inputs_directory { + args: (error: impl ErrorArg), + msg: format!("failed reading inputs directory {}", error), + help: None, + } + + /// For when reading the input file failed. + @backtraced + failed_to_read_input_file { + args: (path: impl Debug), + msg: format!("Cannot read input file from the provided file path - {:?}", path), + help: None, + } + + /// For when the input file has an IO error. + @backtraced + io_error_input_file { + args: (error: impl ErrorArg), + msg: format!("IO error input file from the provided file path - {}", error), + help: None, + } + + /// For when reading the state file failed. + @backtraced + failed_to_read_state_file { + args: (path: impl Debug), + msg: format!("Cannot read state file from the provided file path - {:?}", path), + help: None, + } + + /// For when the state file has an IO error. + @backtraced + io_error_state_file { + args: (error: impl ErrorArg), + msg: format!("IO error state file from the provided file path - {}", error), + help: None, + } + + /// For when reading the checksum file failed. + @backtraced + failed_to_read_checksum_file { + args: (path: impl Debug), + msg: format!("Cannot read checksum file from the provided file path - {:?}", path), + help: None, + } + + /// For when removing the checksum file failed. + @backtraced + failed_to_remove_checksum_file { + args: (path: impl Debug), + msg: format!("Cannot remove checksum file from the provided file path - {:?}", path), + help: None, + } + + /// For when the checksum file has an IO error. + @backtraced + io_error_checksum_file { + args: (error: impl ErrorArg), + msg: format!("IO cannot read checksum file from the provided file path - {}", error), + help: None, + } + + /// For when reading the circuit file failed. + @backtraced + failed_to_read_circuit_file { + args: (path: impl Debug), + msg: format!("Cannot read circuit file from the provided file path - {:?}", path), + help: None, + } + + /// For when removing the circuit file failed. + @backtraced + failed_to_remove_circuit_file { + args: (path: impl Debug), + msg: format!("Cannot remove circuit file from the provided file path - {:?}", path), + help: None, + } + + /// For when the circuit file has an IO error. + @backtraced + io_error_circuit_file { + args: (error: impl ErrorArg), + msg: format!("IO error circuit file from the provided file path - {}", error), + help: None, + } + + /// For when creating the outputs directory failed. + @backtraced + failed_to_create_outputs_directory { + args: (error: impl ErrorArg), + msg: format!("failed creating outputs directory {}", error), + help: None, + } + + @backtraced + failed_to_remove_outputs_directory { + args: (error: impl ErrorArg), + msg: format!("failed removing outputs directory {}", error), + help: None, + } + + /// For when reading the proof file failed. + @backtraced + failed_to_read_proof_file { + args: (path: impl Debug), + msg: format!("Cannot read proof file from the provided file path - {:?}", path), + help: None, + } + + /// For when removing the proof file failed. + @backtraced + failed_to_remove_proof_file { + args: (path: impl Debug), + msg: format!("Cannot remove proof file from the provided file path - {:?}", path), + help: None, + } + + /// For when the proof file has an IO error. + @backtraced + io_error_proof_file { + args: (error: impl ErrorArg), + msg: format!("IO error proof file from the provided file path - {}", error), + help: None, + } + + /// For when reading the prooving key failed. + @backtraced + failed_to_read_proving_key_file { + args: (path: impl Debug), + msg: format!("Cannot read prooving key file from the provided file path - {:?}", path), + help: None, + } + + /// For when removing the prooving key file failed. + @backtraced + failed_to_remove_proving_key_file { + args: (path: impl Debug), + msg: format!("Cannot remove prooving key file from the provided file path - {:?}", path), + help: None, + } + + /// For when the proving key file has an IO error. + @backtraced + io_error_proving_key_file { + args: (error: impl ErrorArg), + msg: format!("IO error proving key file from the provided file path - {}", error), + help: None, + } + + /// For when reading the verification key file failed. + @backtraced + failed_to_read_verification_key_file { + args: (path: impl Debug), + msg: format!("Cannot read verification key file from the provided file path - {:?}", path), + help: None, + } + + /// For when removing the verification key file failed. + @backtraced + failed_to_remove_verification_key_file { + args: (path: impl Debug), + msg: format!("Cannot remove verification key file from the provided file path - {:?}", path), + help: None, + } + + /// For when the verification key file has an IO error. + @backtraced + io_error_verification_key_file { + args: (error: impl ErrorArg), + msg: format!("IO error verification key file from the provided file path - {}", error), + help: None, + } + + /// For when the gitignore file has an IO error. + @backtraced + io_error_gitignore_file { + args: (error: impl ErrorArg), + msg: format!("IO error gitignore file from the provided file path - {}", error), + help: None, + } + + /// For when creating the manifest file failed. + @backtraced + failed_to_create_manifest_file { + args: (filename: impl Display, error: impl ErrorArg), + msg: format!("failed creating manifest file `{}` {}", filename, error), + help: None, + } + + /// For when getting the manifest file metadata failed. + @backtraced + failed_to_get_manifest_metadata_file { + args: (filename: impl Display, error: impl ErrorArg), + msg: format!("failed getting manifest file metadata `{}` {}", filename, error), + help: None, + } + + /// For when opening the manifest file failed. + @backtraced + failed_to_open_manifest_file { + args: (filename: impl Display, error: impl ErrorArg), + msg: format!("failed openining manifest file `{}` {}", filename, error), + help: None, + } + + /// For when parsing the manifest file failed. + @backtraced + failed_to_parse_manifest_file { + args: (filename: impl Display, error: impl ErrorArg), + msg: format!("failed parsing manifest file `{}` {}", filename, error), + help: None, + } + + /// For when reading the manifest file failed. + @backtraced + failed_to_read_manifest_file { + args: (filename: impl Display, error: impl ErrorArg), + msg: format!("failed reading manifest file `{}` {}", filename, error), + help: None, + } + + /// For when writing the manifest file failed. + @backtraced + failed_to_write_manifest_file { + args: (filename: impl Display, error: impl ErrorArg), + msg: format!("failed writing manifest file `{}` {}", filename, error), + help: None, + } + + /// For when the manifest file has an IO error. + @backtraced + io_error_manifest_file { + args: (error: impl ErrorArg), + msg: format!("IO error manifest file from the provided file path - {}", error), + help: None, + } + + /// For when the readme file has an IO error. + @backtraced + io_error_readme_file { + args: (error: impl ErrorArg), + msg: format!("IO error readme file from the provided file path - {}", error), + help: None, + } + + /// For when creating the zip file failed. + @backtraced + failed_to_create_zip_file { + args: (error: impl ErrorArg), + msg: format!("failed creating zip file {}", error), + help: None, + } + + /// For when opening the zip file failed. + @backtraced + failed_to_open_zip_file { + args: (error: impl ErrorArg), + msg: format!("failed opening zip file {}", error), + help: None, + } + + /// For when reading the zip file failed. + @backtraced + failed_to_read_zip_file { + args: (error: impl ErrorArg), + msg: format!("failed reading zip file {}", error), + help: None, + } + + /// For when writing the zip file failed. + @backtraced + failed_to_write_zip_file { + args: (error: impl ErrorArg), + msg: format!("failed writing zip file {}", error), + help: None, + } + + /// For when removing the zip file failed. + @backtraced + failed_to_remove_zip_file { + args: (path: impl Debug), + msg: format!("failed removing zip file from the provided file path - {:?}", path), + help: None, + } + + /// For when zipping fails. + @backtraced + failed_to_zip { + args: (error: impl ErrorArg), + msg: error, + help: None, + } + + /// For when the zip file has an IO error. + @backtraced + io_error_zip_file { + args: (error: impl ErrorArg), + msg: format!("IO error zip file from the provided file path - {}", error), + help: None, + } + + /// For when the library file has an IO error. + @backtraced + io_error_library_file { + args: (error: impl ErrorArg), + msg: format!("IO error library file from the provided file path - {}", error), + help: None, + } + + /// For when the main file has an IO error. + @backtraced + io_error_main_file { + args: (error: impl ErrorArg), + msg: format!("IO error main file from the provided file path - {}", error), + help: None, + } + + /// For when creating the source directory failed. + @backtraced + failed_to_create_source_directory { + args: (error: impl ErrorArg), + msg: format!("failed creating source directory {}", error), + help: None, + } + + /// For when getting a source file entry failed. + @backtraced + failed_to_get_source_file_entry { + args: (error: impl ErrorArg), + msg: format!("failed to get input file entry: {}", error), + help: None, + } + + /// For when getting the source file extension failed. + @backtraced + failed_to_get_source_file_extension { + args: (extension: impl Debug), + msg: format!("failed to get source file extension: {:?}", extension), + help: None, + } + + /// For when getting the source file type failed. + @backtraced + failed_to_get_source_file_type { + args: (file: impl Debug, error: impl ErrorArg), + msg: format!("failed to get source file `{:?}` type: {}", file, error), + help: None, + } + + /// For when getting the source file has an invalid extension. + @backtraced + invalid_source_file_extension { + args: (file: impl Debug, extension: impl Debug), + msg: format!("source file `{:?}` has invalid extension: {:?}", file, extension), + help: None, + } + + /// For when getting the source file has an invalid file type. + @backtraced + invalid_source_file_type { + args: (file: impl Debug, type_: std::fs::FileType), + msg: format!("source file `{:?}` has invalid type: {:?}", file, type_), + help: None, + } + + /// For when reading the source directory failed. + @backtraced + failed_to_read_source_directory { + args: (error: impl ErrorArg), + msg: format!("failed reading source directory {}", error), + help: None, + } + + /// For when the package failed to initalize. + @backtraced + failed_to_initialize_package { + args: (package: impl Display, path: impl Debug), + msg: format!("failed to initialize package {} {:?}", package, path), + help: None, + } + + /// For when the package has an invalid name. + @backtraced + invalid_package_name { + args: (package: impl Display), + msg: format!("invalid project name {}", package), + help: None, + } +); diff --git a/errors/src/parser/mod.rs b/errors/src/parser/mod.rs new file mode 100644 index 0000000000..92b31e4718 --- /dev/null +++ b/errors/src/parser/mod.rs @@ -0,0 +1,19 @@ +// 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 . + +/// This module contains the Parser error definitions. +pub mod parser_errors; +pub use self::parser_errors::*; diff --git a/errors/src/parser/parser_errors.rs b/errors/src/parser/parser_errors.rs new file mode 100644 index 0000000000..35f9b90cb5 --- /dev/null +++ b/errors/src/parser/parser_errors.rs @@ -0,0 +1,178 @@ +// 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::create_errors; + +use std::fmt::Display; + +create_errors!( + /// ParserError enum that represents all the errors for the `leo-parser` crate. + ParserError, + exit_code_mask: 0000i32, + error_code_prefix: "PAR", + + /// For when the parser encountered an unexpected token. + @formatted + unexpected_token { + args: (message: impl Display, help: String), + msg: message, + help: Some(help), + } + + /// For when the parser encoutnered an invalid address literal. + @formatted + invalid_address_lit { + args: (token: impl Display), + msg: format!("invalid address literal: '{}'", token), + help: None, + } + + /// For when the parser encoutnered an empty import list. + @formatted + invalid_import_list { + args: (), + msg: "Cannot import empty list", + help: None, + } + + /// For when the parser encoutnered an unexpected End of File. + @formatted + unexpected_eof { + args: (), + msg: "unexpected EOF", + help: None, + } + + /// For when the parser encoutnered an unexpected whitespace. + @formatted + unexpected_whitespace { + args: (left: impl Display, right: impl Display), + msg: format!("Unexpected white space between terms {} and {}", left, right), + help: None, + } + + /// For when the parser encoutnered an unexpected list of tokens. + @formatted + unexpected { + args: (got: impl Display, expected: impl Display), + msg: format!("expected {} -- got '{}'", expected, got), + help: None, + } + + /// For when the parser encoutnered a mix of commas and semi-colons in circuit member variables. + @formatted + mixed_commas_and_semicolons { + args: (), + msg: "Cannot mix use of commas and semi-colons for circuit member variable declarations.", + help: None, + } + + /// For when the parser encoutnered an unexpected identifier. + @formatted + unexpected_ident { + args: (got: impl Display, expected: &[impl Display]), + msg: format!( + "unexpected identifier: expected {} -- got '{}'", + expected + .iter() + .map(|x| format!("'{}'", x)) + .collect::>() + .join(", "), + got + ), + help: None, + } + + /// For when the parser encoutnered an unexpected statement. + @formatted + unexpected_statement { + args: (got: impl Display, expected: impl Display), + msg: format!("unexpected statement: expected '{}', got '{}'", expected, got), + help: None, + } + + /// For when the parser encoutnered an unexpected string. + @formatted + unexpected_str { + args: (got: impl Display, expected: impl Display), + msg: format!("unexpected string: expected '{}', got '{}'", expected, got), + help: None, + } + + /// For when the parser encoutnered an unexpected spread in an array init expression. + @formatted + spread_in_array_init { + args: (), + msg: "illegal spread in array initializer", + help: None, + } + + /// For when the parser encoutnered an invalid assignment target. + @formatted + invalid_assignment_target { + args: (), + msg: "invalid assignment target", + help: None, + } + + /// For when the parser encoutnered an invalid package name. + @formatted + invalid_package_name { + args: (), + msg: "package names must be lowercase alphanumeric ascii with underscores and singular dashes", + help: None, + } + + /// For when the parser encoutnered an illegal `const self` argument. + @formatted + illegal_self_const { + args: (), + msg: "cannot have const self", + help: None, + } + + /// For when the parser encoutnered a deprecated `mut` argument in a function. + @formatted + mut_function_input { + args: (), + msg: "function func(mut a: u32) { ... } is deprecated. Passed variables are mutable by default.", + help: None, + } + + /// For when the parser encoutnered a deprecated `mut` argument in a let statement. + @formatted + let_mut_statement { + args: (), + msg: "let mut = ... is deprecated. `let` keyword implies mutabality by default.", + help: None, + } + + /// For when the parser encoutnered a deprecated `test function`. + @formatted + test_function { + args: (), + msg: "\"test function...\" is deprecated. Did you mean @test annotation?", + help: None, + } + + /// For when the parser encoutnered a deprecated `@context(...)` annotation. + @formatted + context_annotation { + args: (), + msg: "\"@context(...)\" is deprecated. Did you mean @test annotation?", + help: None, + } +); diff --git a/errors/src/snarkvm/mod.rs b/errors/src/snarkvm/mod.rs new file mode 100644 index 0000000000..deea455023 --- /dev/null +++ b/errors/src/snarkvm/mod.rs @@ -0,0 +1,19 @@ +// 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 . + +/// This module contains the SnarkVM error definitions. +pub mod snarkvm_errors; +pub use self::snarkvm_errors::*; diff --git a/ast/src/errors/combiner.rs b/errors/src/snarkvm/snarkvm_errors.rs similarity index 57% rename from ast/src/errors/combiner.rs rename to errors/src/snarkvm/snarkvm_errors.rs index 8ad146d1cd..1007223d78 100644 --- a/ast/src/errors/combiner.rs +++ b/errors/src/snarkvm/snarkvm_errors.rs @@ -14,24 +14,21 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{FormattedError, LeoError, Span}; +use eyre::{eyre, ErrReport}; +/// SnarkVMError enum that represents all the errors from SnarkVM. +/// Currently implements default for some SnarkVM locations. +/// Ideally SnarkVM would implement a similar error code system to LeoError +/// then we could just bubble the error up with additional information. #[derive(Debug, Error)] -pub enum CombinerError { - #[error("{}", _0)] - Error(#[from] FormattedError), +pub enum SnarkVMError { + /// Implments from a eyre ErrReport which is a fork of anyhow. + #[error(transparent)] + SnarkVMError(#[from] ErrReport), } -impl LeoError for CombinerError {} - -impl CombinerError { - fn new_from_span(message: String, span: &Span) -> Self { - CombinerError::Error(FormattedError::new_from_span(message, span)) - } - - pub fn asg_statement_not_block(span: &Span) -> Self { - let message = "AstStatement should be be a block".to_string(); - - Self::new_from_span(message, span) +impl Default for SnarkVMError { + fn default() -> Self { + Self::SnarkVMError(eyre!("snarkvm error")) } } diff --git a/package/src/errors/inputs/mod.rs b/errors/src/state/mod.rs similarity index 87% rename from package/src/errors/inputs/mod.rs rename to errors/src/state/mod.rs index ff9df5e267..70561aae86 100644 --- a/package/src/errors/inputs/mod.rs +++ b/errors/src/state/mod.rs @@ -14,11 +14,6 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -pub mod directory; -pub use directory::*; - -pub mod input; -pub use input::*; - -pub mod state; -pub use state::*; +/// This module contains the State error definitions. +pub mod state_errors; +pub use self::state_errors::*; diff --git a/errors/src/state/state_errors.rs b/errors/src/state/state_errors.rs new file mode 100644 index 0000000000..97b948b82a --- /dev/null +++ b/errors/src/state/state_errors.rs @@ -0,0 +1,77 @@ +// 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::create_errors; + +use std::{ + error::Error as ErrorArg, + fmt::{Debug, Display}, +}; + +create_errors!( + /// StateError enum that represents all the errors for the `leo-state` crate. + StateError, + exit_code_mask: 1000i32, + error_code_prefix: "STA", + + /// For when it cannot parse the state boolean value. + @backtraced + parse_bool_error { + args: (error: impl ErrorArg), + msg: format!("failed to parse state file bool: {}", error), + help: None, + } + + /// For when it cannot parse the state int value. + @backtraced + parse_int_error { + args: (error: impl ErrorArg), + msg: format!("failed to parse state file int: {}", error), + help: None, + } + + /// For when it expected an array of u8 bytes but found something else. + @backtraced + expected_bytes { + args: (found: impl Display), + msg: format!("expected parameter array of u8 bytes, found `{}`", found), + help: None, + } + + /// For when an int was expected but received something else. + @backtraced + expected_int { + args: (found: impl Display), + msg: format!("expected integer parameter, found `{}`", found), + help: None, + } + + /// For when it cannot parse the state int value. + @backtraced + missing_parameter { + args: (parameter: impl Display), + msg: format!("input parameter `{}` not found in state file", parameter), + help: None, + } + + /// For when the crate encounters an IO error. + @backtraced + state_io_error { + args: (error: impl ErrorArg), + msg: format!("io error found {}", error), + help: None, + } +); diff --git a/grammar/README.md b/grammar/README.md index 13bbc6de82..0067d1eab3 100644 --- a/grammar/README.md +++ b/grammar/README.md @@ -466,7 +466,7 @@ described above. newline = line-feed / carriage-return / carriage-return line-feed ``` -Go to: _[carriage-return](#user-content-carriage-return), [line-feed](#user-content-line-feed)_; +Go to: _[line-feed](#user-content-line-feed), [carriage-return](#user-content-carriage-return)_; Line terminators form whitespace, along with spaces and horizontal tabs. @@ -476,7 +476,7 @@ Line terminators form whitespace, along with spaces and horizontal tabs. whitespace = space / horizontal-tab / newline ``` -Go to: _[horizontal-tab](#user-content-horizontal-tab), [newline](#user-content-newline), [space](#user-content-space)_; +Go to: _[space](#user-content-space), [horizontal-tab](#user-content-horizontal-tab), [newline](#user-content-newline)_; There are two kinds of comments in Leo, as in other languages. @@ -494,7 +494,7 @@ the ones used in the Java language reference. comment = block-comment / end-of-line-comment ``` -Go to: _[end-of-line-comment](#user-content-end-of-line-comment), [block-comment](#user-content-block-comment)_; +Go to: _[block-comment](#user-content-block-comment), [end-of-line-comment](#user-content-end-of-line-comment)_; @@ -521,7 +521,7 @@ rest-of-block-comment-after-star = "/" / not-star-or-slash rest-of-block-comment ``` -Go to: _[not-star-or-slash](#user-content-not-star-or-slash), [rest-of-block-comment](#user-content-rest-of-block-comment), [rest-of-block-comment-after-star](#user-content-rest-of-block-comment-after-star)_; +Go to: _[rest-of-block-comment](#user-content-rest-of-block-comment), [rest-of-block-comment-after-star](#user-content-rest-of-block-comment-after-star), [not-star-or-slash](#user-content-not-star-or-slash)_; @@ -589,7 +589,7 @@ lowercase-letter = %x61-7A ; a-z letter = uppercase-letter / lowercase-letter ``` -Go to: _[uppercase-letter](#user-content-uppercase-letter), [lowercase-letter](#user-content-lowercase-letter)_; +Go to: _[lowercase-letter](#user-content-lowercase-letter), [uppercase-letter](#user-content-uppercase-letter)_; The following rules defines (ASCII) decimal, octal, and hexadecimal digits. @@ -762,7 +762,7 @@ and Unicode escapes with one to six hexadecimal digits character-literal = single-quote character-literal-element single-quote ``` -Go to: _[single-quote](#user-content-single-quote), [character-literal-element](#user-content-character-literal-element)_; +Go to: _[character-literal-element](#user-content-character-literal-element), [single-quote](#user-content-single-quote)_; @@ -773,7 +773,7 @@ character-literal-element = not-single-quote-or-backslash / unicode-character-escape ``` -Go to: _[not-single-quote-or-backslash](#user-content-not-single-quote-or-backslash), [ascii-character-escape](#user-content-ascii-character-escape), [unicode-character-escape](#user-content-unicode-character-escape), [simple-character-escape](#user-content-simple-character-escape)_; +Go to: _[unicode-character-escape](#user-content-unicode-character-escape), [not-single-quote-or-backslash](#user-content-not-single-quote-or-backslash), [simple-character-escape](#user-content-simple-character-escape), [ascii-character-escape](#user-content-ascii-character-escape)_; @@ -828,7 +828,7 @@ simple-character-escape = single-quote-escape / null-character-escape ``` -Go to: _[carriage-return-escape](#user-content-carriage-return-escape), [horizontal-tab-escape](#user-content-horizontal-tab-escape), [null-character-escape](#user-content-null-character-escape), [double-quote-escape](#user-content-double-quote-escape), [single-quote-escape](#user-content-single-quote-escape), [backslash-escape](#user-content-backslash-escape), [line-feed-escape](#user-content-line-feed-escape)_; +Go to: _[carriage-return-escape](#user-content-carriage-return-escape), [horizontal-tab-escape](#user-content-horizontal-tab-escape), [double-quote-escape](#user-content-double-quote-escape), [backslash-escape](#user-content-backslash-escape), [null-character-escape](#user-content-null-character-escape), [single-quote-escape](#user-content-single-quote-escape), [line-feed-escape](#user-content-line-feed-escape)_; @@ -864,7 +864,7 @@ string-literal-element = not-double-quote-or-backslash / unicode-character-escape ``` -Go to: _[ascii-character-escape](#user-content-ascii-character-escape), [unicode-character-escape](#user-content-unicode-character-escape), [simple-character-escape](#user-content-simple-character-escape), [not-double-quote-or-backslash](#user-content-not-double-quote-or-backslash)_; +Go to: _[not-double-quote-or-backslash](#user-content-not-double-quote-or-backslash), [simple-character-escape](#user-content-simple-character-escape), [unicode-character-escape](#user-content-unicode-character-escape), [ascii-character-escape](#user-content-ascii-character-escape)_; The ones above are all the atomic literals @@ -884,7 +884,7 @@ atomic-literal = untyped-literal / string-literal ``` -Go to: _[signed-literal](#user-content-signed-literal), [untyped-literal](#user-content-untyped-literal), [product-group-literal](#user-content-product-group-literal), [unsigned-literal](#user-content-unsigned-literal), [character-literal](#user-content-character-literal), [string-literal](#user-content-string-literal), [field-literal](#user-content-field-literal), [boolean-literal](#user-content-boolean-literal), [address-literal](#user-content-address-literal)_; +Go to: _[field-literal](#user-content-field-literal), [untyped-literal](#user-content-untyped-literal), [address-literal](#user-content-address-literal), [unsigned-literal](#user-content-unsigned-literal), [character-literal](#user-content-character-literal), [boolean-literal](#user-content-boolean-literal), [signed-literal](#user-content-signed-literal), [string-literal](#user-content-string-literal), [product-group-literal](#user-content-product-group-literal)_; After defining the (mostly) alphanumeric tokens above, @@ -928,7 +928,7 @@ token = keyword / symbol ``` -Go to: _[identifier](#user-content-identifier), [keyword](#user-content-keyword), [symbol](#user-content-symbol), [package-name](#user-content-package-name), [annotation-name](#user-content-annotation-name), [atomic-literal](#user-content-atomic-literal)_; +Go to: _[identifier](#user-content-identifier), [symbol](#user-content-symbol), [keyword](#user-content-keyword), [atomic-literal](#user-content-atomic-literal), [package-name](#user-content-package-name), [annotation-name](#user-content-annotation-name)_; Tokens, comments, and whitespace are lexemes, i.e. lexical units. @@ -995,7 +995,7 @@ group-type = %s"group" arithmetic-type = integer-type / field-type / group-type ``` -Go to: _[integer-type](#user-content-integer-type), [field-type](#user-content-field-type), [group-type](#user-content-group-type)_; +Go to: _[field-type](#user-content-field-type), [integer-type](#user-content-integer-type), [group-type](#user-content-group-type)_; The arithmetic types, along with the boolean, address, and character types, @@ -1021,7 +1021,7 @@ character-type = %s"char" scalar-type = boolean-type / arithmetic-type / address-type / character-type ``` -Go to: _[character-type](#user-content-character-type), [arithmetic-type](#user-content-arithmetic-type), [boolean-type](#user-content-boolean-type), [address-type](#user-content-address-type)_; +Go to: _[boolean-type](#user-content-boolean-type), [arithmetic-type](#user-content-arithmetic-type), [character-type](#user-content-character-type), [address-type](#user-content-address-type)_; Circuit types are denoted by identifiers and the keyword `Self`. @@ -1038,7 +1038,7 @@ self-type = %s"Self" circuit-type = identifier / self-type ``` -Go to: _[identifier](#user-content-identifier), [self-type](#user-content-self-type)_; +Go to: _[self-type](#user-content-self-type), [identifier](#user-content-identifier)_; A tuple type consists of zero, two, or more component types. @@ -1082,7 +1082,7 @@ i.e. types whose values contain (sub-)values aggregate-type = tuple-type / array-type / circuit-type ``` -Go to: _[circuit-type](#user-content-circuit-type), [tuple-type](#user-content-tuple-type), [array-type](#user-content-array-type)_; +Go to: _[array-type](#user-content-array-type), [tuple-type](#user-content-tuple-type), [circuit-type](#user-content-circuit-type)_; Scalar and aggregate types form all the types. @@ -1128,7 +1128,7 @@ A literal is either an atomic one or an affine group literal. literal = atomic-literal / affine-group-literal ``` -Go to: _[affine-group-literal](#user-content-affine-group-literal), [atomic-literal](#user-content-atomic-literal)_; +Go to: _[atomic-literal](#user-content-atomic-literal), [affine-group-literal](#user-content-affine-group-literal)_; The following rule is not directly referenced in the rules for expressions @@ -1170,7 +1170,7 @@ primary-expression = identifier / circuit-expression ``` -Go to: _[array-expression](#user-content-array-expression), [expression](#user-content-expression), [circuit-expression](#user-content-circuit-expression), [identifier](#user-content-identifier), [tuple-expression](#user-content-tuple-expression), [literal](#user-content-literal)_; +Go to: _[tuple-expression](#user-content-tuple-expression), [expression](#user-content-expression), [circuit-expression](#user-content-circuit-expression), [identifier](#user-content-identifier), [array-expression](#user-content-array-expression), [literal](#user-content-literal)_; Tuple expressions construct tuples. @@ -1318,7 +1318,7 @@ postfix-expression = primary-expression / postfix-expression "[" [expression] ".." [expression] "]" ``` -Go to: _[identifier](#user-content-identifier), [circuit-type](#user-content-circuit-type), [function-arguments](#user-content-function-arguments), [natural](#user-content-natural), [primary-expression](#user-content-primary-expression), [expression](#user-content-expression), [postfix-expression](#user-content-postfix-expression)_; +Go to: _[function-arguments](#user-content-function-arguments), [primary-expression](#user-content-primary-expression), [identifier](#user-content-identifier), [postfix-expression](#user-content-postfix-expression), [circuit-type](#user-content-circuit-type), [expression](#user-content-expression), [natural](#user-content-natural)_; Unary operators have the highest operator precedence. @@ -1346,7 +1346,7 @@ exponential-expression = unary-expression / unary-expression "**" exponential-expression ``` -Go to: _[unary-expression](#user-content-unary-expression), [exponential-expression](#user-content-exponential-expression)_; +Go to: _[exponential-expression](#user-content-exponential-expression), [unary-expression](#user-content-unary-expression)_; Next in precedence come multiplication and division, both left-associative. @@ -1428,12 +1428,12 @@ Finally we have conditional expressions. ```abnf conditional-expression = disjunctive-expression - / conditional-expression + / disjunctive-expression "?" expression ":" conditional-expression ``` -Go to: _[disjunctive-expression](#user-content-disjunctive-expression), [expression](#user-content-expression), [conditional-expression](#user-content-conditional-expression)_; +Go to: _[conditional-expression](#user-content-conditional-expression), [disjunctive-expression](#user-content-disjunctive-expression), [expression](#user-content-expression)_; Those above are all the expressions. @@ -1466,7 +1466,7 @@ statement = expression-statement / block ``` -Go to: _[loop-statement](#user-content-loop-statement), [assignment-statement](#user-content-assignment-statement), [variable-declaration](#user-content-variable-declaration), [expression-statement](#user-content-expression-statement), [conditional-statement](#user-content-conditional-statement), [block](#user-content-block), [console-statement](#user-content-console-statement), [return-statement](#user-content-return-statement), [constant-declaration](#user-content-constant-declaration)_; +Go to: _[constant-declaration](#user-content-constant-declaration), [conditional-statement](#user-content-conditional-statement), [expression-statement](#user-content-expression-statement), [return-statement](#user-content-return-statement), [console-statement](#user-content-console-statement), [block](#user-content-block), [loop-statement](#user-content-loop-statement), [assignment-statement](#user-content-assignment-statement), [variable-declaration](#user-content-variable-declaration)_; @@ -1509,7 +1509,7 @@ variable-declaration = %s"let" identifier-or-identifiers [ ":" type ] "=" expression ";" ``` -Go to: _[type](#user-content-type), [identifier-or-identifiers](#user-content-identifier-or-identifiers), [expression](#user-content-expression)_; +Go to: _[identifier-or-identifiers](#user-content-identifier-or-identifiers), [expression](#user-content-expression), [type](#user-content-type)_; @@ -1563,7 +1563,7 @@ The body is a block. loop-statement = %s"for" identifier %s"in" expression ".." [ "=" ] expression block ``` -Go to: _[expression](#user-content-expression), [block](#user-content-block), [identifier](#user-content-identifier)_; +Go to: _[expression](#user-content-expression), [identifier](#user-content-identifier), [block](#user-content-block)_; An assignment statement is straightforward. @@ -1649,7 +1649,7 @@ annotation = annotation-name [ "(" identifier *( "," identifier ) ")" ] ``` -Go to: _[annotation-name](#user-content-annotation-name), [identifier](#user-content-identifier)_; +Go to: _[identifier](#user-content-identifier), [annotation-name](#user-content-annotation-name)_; A function declaration defines a function. @@ -1666,7 +1666,7 @@ function-declaration = *annotation %s"function" identifier block ``` -Go to: _[identifier](#user-content-identifier), [function-parameters](#user-content-function-parameters), [type](#user-content-type), [block](#user-content-block)_; +Go to: _[block](#user-content-block), [identifier](#user-content-identifier), [type](#user-content-type), [function-parameters](#user-content-function-parameters)_; @@ -1676,7 +1676,7 @@ function-parameters = self-parameter / function-inputs ``` -Go to: _[self-parameter](#user-content-self-parameter), [function-inputs](#user-content-function-inputs)_; +Go to: _[function-inputs](#user-content-function-inputs), [self-parameter](#user-content-self-parameter)_; @@ -1697,7 +1697,7 @@ Go to: _[function-input](#user-content-function-input)_; function-input = [ %s"const" ] identifier ":" type ``` -Go to: _[type](#user-content-type), [identifier](#user-content-identifier)_; +Go to: _[identifier](#user-content-identifier), [type](#user-content-type)_; A circuit member variable declaration consists of @@ -1745,7 +1745,7 @@ circuit-declaration = %s"circuit" identifier *member-function-declaration "}" ``` -Go to: _[member-variable-declarations](#user-content-member-variable-declarations), [identifier](#user-content-identifier)_; +Go to: _[identifier](#user-content-identifier), [member-variable-declarations](#user-content-member-variable-declarations)_; An import declaration consists of the `import` keyword @@ -1767,7 +1767,7 @@ by using an explicit package name before the package path. import-declaration = %s"import" package-name "." package-path ";" ``` -Go to: _[package-name](#user-content-package-name), [package-path](#user-content-package-path)_; +Go to: _[package-path](#user-content-package-path), [package-name](#user-content-package-name)_; diff --git a/grammar/abnf-grammar.txt b/grammar/abnf-grammar.txt index e25a8aef02..845c4a1530 100644 --- a/grammar/abnf-grammar.txt +++ b/grammar/abnf-grammar.txt @@ -871,7 +871,7 @@ disjunctive-expression = conjunctive-expression ; Finally we have conditional expressions. conditional-expression = disjunctive-expression - / conditional-expression + / disjunctive-expression "?" expression ":" conditional-expression diff --git a/imports/Cargo.toml b/imports/Cargo.toml index 5e9ede2cb7..1be305c917 100644 --- a/imports/Cargo.toml +++ b/imports/Cargo.toml @@ -21,6 +21,10 @@ edition = "2018" path = "../ast" version = "1.5.3" +[dependencies.leo-errors] +path = "../errors" +version = "1.5.3" + [dependencies.leo-asg] path = "../asg" version = "1.5.3" @@ -33,8 +37,5 @@ version = "1.5.3" version = "1.7.0" features = [ "serde-1" ] -[dependencies.thiserror] -version = "1.0" - [dependencies.tracing] version = "0.1" diff --git a/imports/src/errors/import_parser.rs b/imports/src/errors/import_parser.rs deleted file mode 100644 index c653d4dbf9..0000000000 --- a/imports/src/errors/import_parser.rs +++ /dev/null @@ -1,127 +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 leo_asg::AsgConvertError; -use leo_ast::{AstError, FormattedError, Identifier, LeoError, Span}; -use leo_parser::SyntaxError; - -use std::{io, path::Path}; - -#[derive(Debug, Error)] -pub enum ImportParserError { - #[error("{}", _0)] - Error(#[from] FormattedError), - - #[error("{}", _0)] - SyntaxError(#[from] SyntaxError), - - #[error("{}", _0)] - AstError(#[from] AstError), - - #[error("{}", _0)] - AsgConvertError(#[from] AsgConvertError), -} - -impl LeoError for ImportParserError {} - -impl Into for ImportParserError { - fn into(self) -> AsgConvertError { - match self { - ImportParserError::Error(x) => AsgConvertError::ImportError(x), - ImportParserError::SyntaxError(x) => x.into(), - ImportParserError::AstError(x) => AsgConvertError::AstError(x), - ImportParserError::AsgConvertError(x) => x, - } - } -} - -impl ImportParserError { - fn new_from_span(message: String, span: &Span) -> Self { - ImportParserError::Error(FormattedError::new_from_span(message, span)) - } - - /// - /// An imported package has the same name as an imported core_package. - /// - pub fn conflicting_imports(identifier: Identifier) -> Self { - let message = format!("conflicting imports found for `{}`.", identifier.name); - - Self::new_from_span(message, &identifier.span) - } - - pub fn recursive_imports(package: &str, span: &Span) -> Self { - let message = format!("recursive imports for `{}`.", package); - - Self::new_from_span(message, span) - } - - /// - /// Failed to convert a file path into an os string. - /// - pub fn convert_os_string(span: &Span) -> Self { - let message = "Failed to convert file string name, maybe an illegal character?".to_string(); - - Self::new_from_span(message, span) - } - - /// - /// Failed to find the directory of the current file. - /// - pub fn current_directory_error(error: io::Error) -> Self { - let message = format!("Compilation failed trying to find current directory - {:?}.", error); - - Self::new_from_span(message, &Span::default()) - } - - /// - /// Failed to open or get the name of a directory. - /// - pub fn directory_error(error: io::Error, span: &Span, path: &Path) -> Self { - let message = format!( - "Compilation failed due to directory error @ '{}' - {:?}.", - path.to_str().unwrap_or_default(), - error - ); - - Self::new_from_span(message, span) - } - - /// - /// Failed to find a main file for the current package. - /// - pub fn expected_main_file(entry: String, span: &Span) -> Self { - let message = format!("Expected main file at `{}`.", entry,); - - Self::new_from_span(message, span) - } - - /// - /// Failed to import a package name. - /// - pub fn unknown_package(identifier: Identifier) -> Self { - let message = format!( - "Cannot find imported package `{}` in source files or import directory.", - identifier.name - ); - - Self::new_from_span(message, &identifier.span) - } - - pub fn io_error(span: &Span, path: &str, error: std::io::Error) -> Self { - let message = format!("cannot read imported file '{}': {:?}", path, error,); - - Self::new_from_span(message, span) - } -} diff --git a/imports/src/lib.rs b/imports/src/lib.rs index 3cda1b33de..cc7e046520 100644 --- a/imports/src/lib.rs +++ b/imports/src/lib.rs @@ -15,12 +15,7 @@ // along with the Leo library. If not, see . #![allow(clippy::from_over_into)] - -#[macro_use] -extern crate thiserror; - -pub mod errors; -pub use self::errors::*; +#![doc = include_str!("../README.md")] pub mod parser; pub use self::parser::*; diff --git a/imports/src/parser/import_parser.rs b/imports/src/parser/import_parser.rs index c8fcfdf43a..0212800d1a 100644 --- a/imports/src/parser/import_parser.rs +++ b/imports/src/parser/import_parser.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 . -use crate::errors::ImportParserError; -use leo_asg::{AsgContext, AsgConvertError, ImportResolver, Program, Span}; +use leo_asg::{AsgContext, ImportResolver, Program}; +use leo_errors::{ImportError, LeoError, Result, Span}; use indexmap::{IndexMap, IndexSet}; use std::path::PathBuf; @@ -47,21 +47,20 @@ impl<'a> ImportResolver<'a> for ImportParser<'a> { context: AsgContext<'a>, package_segments: &[&str], span: &Span, - ) -> Result>, AsgConvertError> { + ) -> Result>> { let full_path = package_segments.join("."); if self.partial_imports.contains(&full_path) { - return Err(ImportParserError::recursive_imports(&full_path, span).into()); + return Err(ImportError::recursive_imports(full_path, span).into()); } if let Some(program) = self.imports.get(&full_path) { return Ok(Some(program.clone())); } - let mut imports = Self::default(); let path = self.program_path.clone(); - self.partial_imports.insert(full_path.clone()); + let mut imports = self.clone(); // Self::default() was previously let program = imports .parse_package(context, path, package_segments, span) - .map_err(|x| -> AsgConvertError { x.into() })?; + .map_err(|x| -> LeoError { x })?; self.partial_imports.remove(&full_path); self.imports.insert(full_path, program.clone()); Ok(Some(program)) diff --git a/imports/src/parser/parse_package.rs b/imports/src/parser/parse_package.rs index a14f12a2cc..3f2079598b 100644 --- a/imports/src/parser/parse_package.rs +++ b/imports/src/parser/parse_package.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{errors::ImportParserError, ImportParser}; -use leo_asg::{AsgContext, Identifier, Program, Span}; +use crate::ImportParser; +use leo_asg::{AsgContext, Program}; +use leo_errors::{ImportError, Result, Span}; use std::{fs, fs::DirEntry, path::PathBuf}; @@ -30,7 +31,7 @@ impl<'a> ImportParser<'a> { package: &DirEntry, remaining_segments: &[&str], span: &Span, - ) -> Result, ImportParserError> { + ) -> Result> { if !remaining_segments.is_empty() { return self.parse_package(context, package.path(), remaining_segments, span); } @@ -51,7 +52,7 @@ impl<'a> ImportParser<'a> { mut path: PathBuf, segments: &[&str], span: &Span, - ) -> Result, ImportParserError> { + ) -> Result> { let error_path = path.clone(); let package_name = segments[0]; @@ -82,9 +83,9 @@ impl<'a> ImportParser<'a> { // Get a vector of all packages in the source directory. let entries = fs::read_dir(path) - .map_err(|error| ImportParserError::directory_error(error, span, &error_path))? + .map_err(|error| ImportError::directory_error(error, &error_path, span))? .collect::, std::io::Error>>() - .map_err(|error| ImportParserError::directory_error(error, span, &error_path))?; + .map_err(|error| ImportError::directory_error(error, &error_path, span))?; // Check if the imported package name is in the source directory. let matched_source_entry = entries.into_iter().find(|entry| { @@ -99,9 +100,9 @@ impl<'a> ImportParser<'a> { if imports_directory.exists() { // Get a vector of all packages in the imports directory. let entries = fs::read_dir(imports_directory) - .map_err(|error| ImportParserError::directory_error(error, span, &error_path))? + .map_err(|error| ImportError::directory_error(error, &error_path, span))? .collect::, std::io::Error>>() - .map_err(|error| ImportParserError::directory_error(error, span, &error_path))?; + .map_err(|error| ImportError::directory_error(error, error_path, span))?; // Check if the imported package name is in the imports directory. let matched_import_entry = entries @@ -110,25 +111,16 @@ impl<'a> ImportParser<'a> { // Check if the package name was found in both the source and imports directory. match (matched_source_entry, matched_import_entry) { - (Some(_), Some(_)) => Err(ImportParserError::conflicting_imports(Identifier::new_with_span( - package_name, - span.clone(), - ))), + (Some(_), Some(_)) => Err(ImportError::conflicting_imports(package_name, span).into()), (Some(source_entry), None) => self.parse_package_access(context, &source_entry, &segments[1..], span), (None, Some(import_entry)) => self.parse_package_access(context, &import_entry, &segments[1..], span), - (None, None) => Err(ImportParserError::unknown_package(Identifier::new_with_span( - package_name, - span.clone(), - ))), + (None, None) => Err(ImportError::unknown_package(package_name, span).into()), } } else { // Enforce local package access with no found imports directory match matched_source_entry { Some(source_entry) => self.parse_package_access(context, &source_entry, &segments[1..], span), - None => Err(ImportParserError::unknown_package(Identifier::new_with_span( - package_name, - span.clone(), - ))), + None => Err(ImportError::unknown_package(package_name, span).into()), } } } diff --git a/imports/src/parser/parse_symbol.rs b/imports/src/parser/parse_symbol.rs index 1b8183f7b0..aa7f52a9fe 100644 --- a/imports/src/parser/parse_symbol.rs +++ b/imports/src/parser/parse_symbol.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{errors::ImportParserError, ImportParser}; -use leo_ast::{Program, Span}; +use crate::ImportParser; +use leo_ast::Program; +use leo_errors::{ImportError, Result, Span}; use std::fs::DirEntry; @@ -27,25 +28,22 @@ impl<'a> ImportParser<'a> { /// /// Builds an abstract syntax tree from the given file and then builds the Leo syntax tree. /// - pub(crate) fn parse_import_file(package: &DirEntry, span: &Span) -> Result { + pub(crate) fn parse_import_file(package: &DirEntry, span: &Span) -> Result { // Get the package file type. let file_type = package .file_type() - .map_err(|error| ImportParserError::directory_error(error, span, &package.path()))?; + .map_err(|error| ImportError::directory_error(error, package.path(), span))?; let file_name = package .file_name() .into_string() - .map_err(|_| ImportParserError::convert_os_string(span))?; + .map_err(|_| ImportError::convert_os_string(span))?; let mut file_path = package.path(); if file_type.is_dir() { file_path.push(MAIN_FILE); if !file_path.exists() { - return Err(ImportParserError::expected_main_file( - format!("{:?}", file_path.as_path()), - span, - )); + return Err(ImportError::expected_main_file(file_path.as_path(), span).into()); } } @@ -53,7 +51,7 @@ impl<'a> ImportParser<'a> { // Build the package abstract syntax tree. let program_string = - &std::fs::read_to_string(&file_path).map_err(|x| ImportParserError::io_error(span, file_path_str, x))?; + &std::fs::read_to_string(&file_path).map_err(|x| ImportError::io_error(file_path_str, x, span))?; let mut program = leo_parser::parse(file_path_str, program_string)?; program.name = file_name; let mut ast = leo_ast::Ast::new(program); diff --git a/input/src/lib.rs b/input/src/lib.rs index c8f709b229..1b73fdb778 100644 --- a/input/src/lib.rs +++ b/input/src/lib.rs @@ -13,6 +13,9 @@ // 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] diff --git a/leo/api.rs b/leo/api.rs index 124f68b182..d028578917 100644 --- a/leo/api.rs +++ b/leo/api.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use anyhow::{anyhow, Error, Result}; +use leo_errors::{CliError, LeoError, Result}; + use reqwest::{ blocking::{multipart::Form, Client, Response}, Method, StatusCode, @@ -60,8 +61,8 @@ pub trait Route { /// Transform specific status codes into correct errors for this route. /// For example 404 on package fetch should mean that 'Package is not found' - fn status_to_err(&self, _status: StatusCode) -> Error { - anyhow!("Unidentified API error") + fn status_to_err(&self, _status: StatusCode) -> LeoError { + CliError::unidentified_api().into() } } @@ -129,9 +130,7 @@ impl Api { }; // only one error is possible here - let res = res.send().map_err(|_| { - anyhow!("Unable to connect to Aleo PM. If you specified custom API endpoint, then check the URL for errors") - })?; + let res = res.send().map_err(|_| CliError::unable_to_connect_aleo_pm())?; // where magic begins route.process(res) @@ -169,14 +168,14 @@ impl Route for Fetch { Ok(res) } - fn status_to_err(&self, status: StatusCode) -> Error { + fn status_to_err(&self, status: StatusCode) -> LeoError { match status { - StatusCode::BAD_REQUEST => anyhow!("Package is not found - check author and/or package name"), + StatusCode::BAD_REQUEST => CliError::package_not_found().into(), // TODO: we should return 404 on not found author/package // and return BAD_REQUEST if data format is incorrect or some of the arguments // were not passed - StatusCode::NOT_FOUND => anyhow!("Package not found"), - _ => anyhow!("Unknown API error: {}", status), + StatusCode::NOT_FOUND => CliError::package_not_found().into(), + _ => CliError::unkown_api_error(status).into(), } } } @@ -205,12 +204,12 @@ impl Route for Login { Ok(res) } - fn status_to_err(&self, status: StatusCode) -> Error { + fn status_to_err(&self, status: StatusCode) -> LeoError { match status { - StatusCode::BAD_REQUEST => anyhow!("This username is not yet registered or the password is incorrect"), + StatusCode::BAD_REQUEST => CliError::account_not_found().into(), // TODO: NOT_FOUND here should be replaced, this error code has no relation to what this route is doing - StatusCode::NOT_FOUND => anyhow!("Incorrect password"), - _ => anyhow!("Unknown API error: {}", status), + StatusCode::NOT_FOUND => CliError::incorrect_password().into(), + _ => CliError::unkown_api_error(status).into(), } } } @@ -249,18 +248,16 @@ impl Route for Publish { let status = res.status(); if status == StatusCode::OK { - let body: PublishResponse = res.json()?; + let body: PublishResponse = res.json().map_err(CliError::reqwest_json_error)?; Ok(body.package_id) } else { - let res: HashMap = res.json()?; + let res: HashMap = res.json().map_err(CliError::reqwest_json_error)?; Err(match status { - StatusCode::BAD_REQUEST => anyhow!("{}", res.get("message").unwrap()), - StatusCode::UNAUTHORIZED => anyhow!("You are not logged in. Please use `leo login` to login"), - StatusCode::FAILED_DEPENDENCY => anyhow!("This package version is already published"), - StatusCode::INTERNAL_SERVER_ERROR => { - anyhow!("Server error, please contact us at https://github.com/AleoHQ/leo/issues") - } - _ => anyhow!("Unknown status code"), + StatusCode::BAD_REQUEST => CliError::bad_request(res.get("message").unwrap()).into(), + StatusCode::UNAUTHORIZED => CliError::not_logged_in().into(), + StatusCode::FAILED_DEPENDENCY => CliError::already_published().into(), + StatusCode::INTERNAL_SERVER_ERROR => CliError::internal_server_error().into(), + _ => CliError::unkown_api_error(status).into(), }) } } @@ -290,7 +287,7 @@ impl Route for Profile { // this may be extended for more precise error handling let status = res.status(); if status == StatusCode::OK { - let body: ProfileResponse = res.json()?; + let body: ProfileResponse = res.json().map_err(CliError::reqwest_json_error)?; return Ok(Some(body.username)); } diff --git a/leo/commands/build.rs b/leo/commands/build.rs index 45fbaf9e9d..214f56a6f3 100644 --- a/leo/commands/build.rs +++ b/leo/commands/build.rs @@ -20,6 +20,7 @@ use leo_compiler::{ group::targets::edwards_bls12::EdwardsGroupType, AstSnapshotOptions, CompilerOptions, }; +use leo_errors::{CliError, Result}; use leo_package::{ inputs::*, outputs::{ChecksumFile, CircuitFile, OutputsDirectory, OUTPUTS_DIRECTORY_NAME}, @@ -27,7 +28,6 @@ use leo_package::{ }; use leo_synthesizer::{CircuitSynthesizer, SerializedCircuit}; -use anyhow::{anyhow, Result}; use snarkvm_curves::{bls12_377::Bls12_377, edwards_bls12::Fq}; use snarkvm_r1cs::ConstraintSystem; use structopt::StructOpt; @@ -37,8 +37,6 @@ use tracing::span::Span; /// require Build command output as their input. #[derive(StructOpt, Clone, Debug)] pub struct BuildOptions { - #[structopt(long, help = "Disable canonicaliztion compiler optimization")] - pub disable_canonicalization: bool, #[structopt(long, help = "Disable constant folding compiler optimization")] pub disable_constant_folding: bool, #[structopt(long, help = "Disable dead code elimination compiler optimization")] @@ -58,7 +56,6 @@ pub struct BuildOptions { impl Default for BuildOptions { fn default() -> Self { Self { - disable_canonicalization: true, disable_constant_folding: true, disable_code_elimination: true, disable_all_optimizations: true, @@ -74,13 +71,11 @@ impl From for CompilerOptions { fn from(options: BuildOptions) -> Self { if !options.disable_all_optimizations { CompilerOptions { - canonicalization_enabled: true, constant_folding_enabled: true, dead_code_elimination_enabled: true, } } else { CompilerOptions { - canonicalization_enabled: !options.disable_canonicalization, constant_folding_enabled: !options.disable_constant_folding, dead_code_elimination_enabled: !options.disable_code_elimination, } @@ -144,7 +139,7 @@ impl Command for Build { // Compile the main.leo file along with constraints if !MainFile::exists_at(&package_path) { - return Err(anyhow!("File main.leo not found in src/ directory")); + return Err(CliError::package_main_file_not_found().into()); } // Create the output directory @@ -164,12 +159,6 @@ impl Command for Build { // Log compilation of files to console tracing::info!("Compiling main program... ({:?})", main_file_path); - if self.compiler_options.disable_canonicalization && self.compiler_options.enable_canonicalized_ast_snapshot { - tracing::warn!( - "Can not ask for canonicalization theorem without having canonicalization compiler feature enabled." - ); - } - // Load the program at `main_file_path` let program = Compiler::::parse_program_with_input( package_name.clone(), diff --git a/leo/commands/clean.rs b/leo/commands/clean.rs index 83c2503555..54ba1344f3 100644 --- a/leo/commands/clean.rs +++ b/leo/commands/clean.rs @@ -16,9 +16,9 @@ use crate::{commands::Command, context::Context}; use leo_compiler::OutputFile; +use leo_errors::Result; use leo_package::outputs::{ChecksumFile, CircuitFile, ProofFile, ProvingKeyFile, VerificationKeyFile}; -use anyhow::Result; use structopt::StructOpt; use tracing::span::Span; diff --git a/leo/commands/deploy.rs b/leo/commands/deploy.rs index fa421e14ab..576165e598 100644 --- a/leo/commands/deploy.rs +++ b/leo/commands/deploy.rs @@ -15,8 +15,8 @@ // along with the Leo library. If not, see . use crate::{commands::Command, context::Context}; +use leo_errors::Result; -use anyhow::Result; use structopt::StructOpt; use tracing::span::Span; diff --git a/leo/commands/init.rs b/leo/commands/init.rs index 18711d6923..e513a31296 100644 --- a/leo/commands/init.rs +++ b/leo/commands/init.rs @@ -15,9 +15,9 @@ // along with the Leo library. If not, see . use crate::{commands::Command, config::*, context::Context}; +use leo_errors::{CliError, Result}; use leo_package::LeoPackage; -use anyhow::{anyhow, Result}; use structopt::StructOpt; use tracing::span::Span; @@ -44,17 +44,17 @@ impl Command for Init { // Check that the current package directory path exists. if !path.exists() { - return Err(anyhow!("Directory does not exist")); + return Err(CliError::package_directory_does_not_exist().into()); } // Check that the given package name is valid. let package_name = path .file_stem() - .ok_or_else(|| anyhow!("Project name invalid"))? + .ok_or_else(CliError::invalid_project_name)? .to_string_lossy() .to_string(); if !LeoPackage::is_package_name_valid(&package_name) { - return Err(anyhow!("Invalid Leo project name: {}", package_name)); + return Err(CliError::invalid_package_name(&package_name).into()); } let username = read_username().ok(); diff --git a/leo/commands/lint.rs b/leo/commands/lint.rs index c3f948acc9..1fba917222 100644 --- a/leo/commands/lint.rs +++ b/leo/commands/lint.rs @@ -15,8 +15,8 @@ // along with the Leo library. If not, see . use crate::{commands::Command, context::Context}; +use leo_errors::Result; -use anyhow::Result; use structopt::StructOpt; use tracing::span::Span; diff --git a/leo/commands/mod.rs b/leo/commands/mod.rs index 7f5f2349fb..b20bde89fe 100644 --- a/leo/commands/mod.rs +++ b/leo/commands/mod.rs @@ -15,8 +15,8 @@ // along with the Leo library. If not, see . use crate::context::Context; +use leo_errors::Result; -use anyhow::Result; use std::time::Instant; use tracing::span::Span; diff --git a/leo/commands/new.rs b/leo/commands/new.rs index 9f72988bb4..aa9e462cc1 100644 --- a/leo/commands/new.rs +++ b/leo/commands/new.rs @@ -15,9 +15,9 @@ // along with the Leo library. If not, see . use crate::{commands::Command, config::*, context::Context}; +use leo_errors::{CliError, Result}; use leo_package::LeoPackage; -use anyhow::{anyhow, Result}; use std::fs; use structopt::StructOpt; use tracing::span::Span; @@ -46,7 +46,7 @@ impl Command for New { // Check that the given package name is valid. let package_name = self.name; if !LeoPackage::is_package_name_valid(&package_name) { - return Err(anyhow!("Invalid Leo project name")); + return Err(CliError::invalid_project_name().into()); } let username = read_username().ok(); @@ -57,11 +57,11 @@ impl Command for New { // Verify the package directory path does not exist yet. if path.exists() { - return Err(anyhow!("Directory already exists {:?}", path)); + return Err(CliError::package_directory_already_exists(&path).into()); } // Create the package directory - fs::create_dir_all(&path).map_err(|err| anyhow!("Could not create directory {}", err))?; + fs::create_dir_all(&path).map_err(CliError::package_could_not_create_directory)?; LeoPackage::initialize(&package_name, &path, username)?; diff --git a/leo/commands/package/add.rs b/leo/commands/package/add.rs index 5b540617ba..e5e7a4635b 100644 --- a/leo/commands/package/add.rs +++ b/leo/commands/package/add.rs @@ -15,9 +15,9 @@ // along with the Leo library. If not, see . use crate::{api::Fetch, commands::Command, context::Context}; +use leo_errors::{CliError, Result}; use leo_package::imports::{ImportsDirectory, IMPORTS_DIRECTORY_NAME}; -use anyhow::{anyhow, Result}; use std::{ fs::{create_dir_all, File}, io::{Read, Write}, @@ -64,16 +64,12 @@ impl Add { if v.len() == 2 { Ok((v[0].to_string(), v[1].to_string())) } else { - Err(anyhow!( - "Incorrect argument, please use --help for information on command use" - )) + Err(CliError::incorrect_command_argument().into()) } } else if let (Some(author), Some(package)) = (&self.author, &self.package) { Ok((author.clone(), package.clone())) } else { - Err(anyhow!( - "Incorrect argument, please use --help for information on command use" - )) + Err(CliError::incorrect_command_argument().into()) } } } @@ -92,11 +88,11 @@ impl Command for Add { fn apply(self, context: Context, _: Self::Input) -> Result { // Check that a manifest exists for the current package. - if context.manifest().is_err() { - return Err(anyhow!("Package manifest not found, try running `leo init`")); - }; + context.manifest().map_err(|_| CliError::mainifest_file_not_found())?; - let (author, package_name) = self.try_read_arguments()?; + let (author, package_name) = self + .try_read_arguments() + .map_err(CliError::cli_bytes_conversion_error)?; // Attempt to fetch the package. let reader = { @@ -105,7 +101,11 @@ impl Command for Add { package_name: package_name.clone(), version: self.version, }; - let bytes = context.api.run_route(fetch)?.bytes()?; + let bytes = context + .api + .run_route(fetch)? + .bytes() + .map_err(CliError::cli_bytes_conversion_error)?; std::io::Cursor::new(bytes) }; @@ -115,19 +115,13 @@ impl Command for Add { ImportsDirectory::create(&path)?; path.push(IMPORTS_DIRECTORY_NAME); path.push(package_name); - create_dir_all(&path)?; + create_dir_all(&path).map_err(CliError::cli_io_error)?; }; // Proceed to unzip and parse the fetched bytes. - let mut zip_archive = match zip::ZipArchive::new(reader) { - Ok(zip) => zip, - Err(error) => return Err(anyhow!(error)), - }; + let mut zip_archive = zip::ZipArchive::new(reader).map_err(CliError::cli_zip_error)?; for i in 0..zip_archive.len() { - let file = match zip_archive.by_index(i) { - Ok(file) => file, - Err(error) => return Err(anyhow!(error)), - }; + let file = zip_archive.by_index(i).map_err(CliError::cli_zip_error)?; let file_name = file.name(); @@ -135,13 +129,16 @@ impl Command for Add { file_path.push(file_name); if file_name.ends_with('/') { - create_dir_all(file_path)?; + create_dir_all(file_path).map_err(CliError::cli_io_error)?; } else { if let Some(parent_directory) = path.parent() { - create_dir_all(parent_directory)?; + create_dir_all(parent_directory).map_err(CliError::cli_io_error)?; } - File::create(file_path)?.write_all(&file.bytes().map(|e| e.unwrap()).collect::>())?; + let mut created = File::create(file_path).map_err(CliError::cli_io_error)?; + created + .write_all(&file.bytes().map(|e| e.unwrap()).collect::>()) + .map_err(CliError::cli_bytes_conversion_error)?; } } diff --git a/leo/commands/package/clone.rs b/leo/commands/package/clone.rs index 3daf00897a..8c5d583a44 100644 --- a/leo/commands/package/clone.rs +++ b/leo/commands/package/clone.rs @@ -15,8 +15,8 @@ // along with the Leo library. If not, see . use crate::{api::Fetch, commands::Command, context::Context}; +use leo_errors::{CliError, Result}; -use anyhow::{anyhow, Result}; use std::{ borrow::Cow, fs::{ @@ -67,16 +67,12 @@ impl Clone { if v.len() == 2 { Ok((v[0].to_string(), v[1].to_string())) } else { - Err(anyhow!( - "Incorrect argument, please use --help for information on command use" - )) + Err(CliError::incorrect_command_argument().into()) } } else if let (Some(author), Some(package)) = (&self.author, &self.package) { Ok((author.clone(), package.clone())) } else { - Err(anyhow!( - "Incorrect argument, please use --help for information on command use" - )) + Err(CliError::incorrect_command_argument().into()) } } @@ -90,7 +86,7 @@ impl Clone { path.to_mut().push(directory_name); } - Ok(fs::create_dir_all(&path)?) + Ok(fs::create_dir_all(&path).map_err(CliError::cli_io_error)?) } } @@ -116,7 +112,11 @@ impl Command for Clone { package_name: package_name.clone(), version: self.version, }; - let bytes = context.api.run_route(fetch)?.bytes()?; + let bytes = context + .api + .run_route(fetch)? + .bytes() + .map_err(CliError::cli_bytes_conversion_error)?; std::io::Cursor::new(bytes) }; @@ -126,15 +126,10 @@ impl Command for Clone { Self::create_directory(&path, &package_name)?; // Proceed to unzip and parse the fetched bytes. - let mut zip_archive = match zip::ZipArchive::new(reader) { - Ok(zip) => zip, - Err(error) => return Err(anyhow!(error)), - }; + let mut zip_archive = zip::ZipArchive::new(reader).map_err(CliError::cli_io_error)?; + for i in 0..zip_archive.len() { - let file = match zip_archive.by_index(i) { - Ok(file) => file, - Err(error) => return Err(anyhow!(error)), - }; + let file = zip_archive.by_index(i).map_err(CliError::cli_zip_error)?; let file_name = file.name(); @@ -142,13 +137,16 @@ impl Command for Clone { file_path.push(file_name); if file_name.ends_with('/') { - fs::create_dir_all(file_path)?; + fs::create_dir_all(file_path).map_err(CliError::cli_io_error)?; } else { if let Some(parent_directory) = path.parent() { - fs::create_dir_all(parent_directory)?; + fs::create_dir_all(parent_directory).map_err(CliError::cli_io_error)?; } - File::create(file_path)?.write_all(&file.bytes().map(|e| e.unwrap()).collect::>())?; + let mut created = File::create(file_path).map_err(CliError::cli_io_error)?; + created + .write_all(&file.bytes().map(|e| e.unwrap()).collect::>()) + .map_err(CliError::cli_bytes_conversion_error)?; } } diff --git a/leo/commands/package/login.rs b/leo/commands/package/login.rs index 960b7727fc..e27d923058 100644 --- a/leo/commands/package/login.rs +++ b/leo/commands/package/login.rs @@ -20,8 +20,8 @@ use crate::{ config::*, context::Context, }; +use leo_errors::{CliError, Result}; -use anyhow::{anyhow, Result}; use std::collections::HashMap; use structopt::StructOpt; use tracing::Span; @@ -72,11 +72,11 @@ impl Command for Login { }; let res = api.run_route(login)?; - let mut res: HashMap = res.json()?; + let mut res: HashMap = res.json().map_err(CliError::reqwest_json_error)?; let tok_opt = res.remove("token"); if tok_opt.is_none() { - return Err(anyhow!("Unable to get token")); + return Err(CliError::unable_to_get_user_token().into()); }; (tok_opt.unwrap(), email_username) @@ -90,7 +90,7 @@ impl Command for Login { match api.run_route(ProfileRoute {})? { Some(username) => (token, username), - None => return Err(anyhow!("Supplied token is incorrect")), + None => return Err(CliError::supplied_token_is_incorrect().into()), } } @@ -107,12 +107,10 @@ impl Command for Login { (token, username) } else { remove_token_and_username()?; - return Err(anyhow!( - "Stored credentials are incorrect or expired, please login again" - )); + return Err(CliError::stored_credentials_expired().into()); } } - None => return Err(anyhow!("No credentials provided")), + None => return Err(CliError::no_credentials_provided().into()), } } }; diff --git a/leo/commands/package/logout.rs b/leo/commands/package/logout.rs index a18e29351b..09fcdfdafd 100644 --- a/leo/commands/package/logout.rs +++ b/leo/commands/package/logout.rs @@ -15,9 +15,8 @@ // along with the Leo library. If not, see . use crate::{commands::Command, config::remove_token_and_username, context::Context}; +use leo_errors::Result; -use anyhow::Result; -use std::io::ErrorKind; use structopt::StructOpt; use tracing::Span; @@ -41,24 +40,8 @@ impl Command for Logout { fn apply(self, _context: Context, _: Self::Input) -> Result { // the only error we're interested here is NotFound // however err in this case can also be of kind PermissionDenied or other - if let Err(err) = remove_token_and_username() { - match err.kind() { - ErrorKind::NotFound => { - tracing::info!("you are not logged in"); - Ok(()) - } - ErrorKind::PermissionDenied => { - tracing::error!("permission denied - check file permission in .leo folder"); - Ok(()) - } - _ => { - tracing::error!("something went wrong, can't access the file"); - Ok(()) - } - } - } else { - tracing::info!("success"); - Ok(()) - } + remove_token_and_username()?; + tracing::info!("success"); + Ok(()) } } diff --git a/leo/commands/package/publish.rs b/leo/commands/package/publish.rs index a3d7f165c7..52c9dffab8 100644 --- a/leo/commands/package/publish.rs +++ b/leo/commands/package/publish.rs @@ -16,13 +16,13 @@ use super::build::Build; use crate::{api::Publish as PublishRoute, commands::Command, context::Context}; +use leo_errors::{CliError, Result}; use leo_package::{ outputs::OutputsDirectory, root::{ZipFile, AUTHOR_PLACEHOLDER}, }; use leo_parser::KEYWORD_TOKENS; -use anyhow::{anyhow, Result}; use structopt::StructOpt; /// Publish package to Aleo Package Manager @@ -49,7 +49,7 @@ impl Command for Publish { let package_name = manifest.get_package_name(); if KEYWORD_TOKENS.iter().any(|keyword| keyword.to_string() == package_name) { - return Err(anyhow!("Cannot name a package after a keyword")); + return Err(CliError::package_cannot_be_named_after_a_keyword().into()); } let package_version = manifest.get_package_version(); @@ -59,9 +59,9 @@ impl Command for Publish { manifest.get_package_license(), manifest.get_package_remote(), ) { - (None, _, _) => return Err(anyhow!("No package description")), - (_, None, _) => return Err(anyhow!("Missing package license")), - (_, _, None) => return Err(anyhow!("Missing package remote")), + (None, _, _) => return Err(CliError::no_package_description().into()), + (_, None, _) => return Err(CliError::missing_package_license().into()), + (_, _, None) => return Err(CliError::missing_package_remote().into()), (_, _, _) => (), }; @@ -70,9 +70,7 @@ impl Command for Publish { // Prevent most common error before accessing API. if username == AUTHOR_PLACEHOLDER { - return Err(anyhow!( - "Package author is not set. Specify package author in [remote] section of Leo.toml" - )); + return Err(CliError::package_author_is_not_set().into()); } // Create the output directory. diff --git a/leo/commands/package/remove.rs b/leo/commands/package/remove.rs index 1f5426062c..6d8ba229f9 100644 --- a/leo/commands/package/remove.rs +++ b/leo/commands/package/remove.rs @@ -15,9 +15,9 @@ // along with the Leo library. If not, see . use crate::{commands::Command, context::Context}; +use leo_errors::Result; use leo_package::LeoPackage; -use anyhow::Result; use structopt::StructOpt; use tracing::span::Span; diff --git a/leo/commands/prove.rs b/leo/commands/prove.rs index 46fdac1dad..4447f1631a 100644 --- a/leo/commands/prove.rs +++ b/leo/commands/prove.rs @@ -16,6 +16,7 @@ use super::{build::BuildOptions, setup::Setup}; use crate::{commands::Command, context::Context}; +use leo_errors::{CliError, Result, SnarkVMError}; use leo_package::outputs::ProofFile; use snarkvm_algorithms::{ snark::groth16::{Groth16, PreparedVerifyingKey, Proof}, @@ -24,7 +25,6 @@ use snarkvm_algorithms::{ use snarkvm_curves::bls12_377::{Bls12_377, Fr}; use snarkvm_utilities::bytes::ToBytes; -use anyhow::Result; use rand::thread_rng; use structopt::StructOpt; use tracing::span::Span; @@ -66,11 +66,13 @@ impl Command for Prove { tracing::info!("Starting..."); let rng = &mut thread_rng(); - let program_proof = Groth16::>::prove(¶meters, &program, rng)?; + // TODO fix this once snarkvm has better errors. + let program_proof = + Groth16::>::prove(¶meters, &program, rng).map_err(|_| SnarkVMError::default())?; // Write the proof file to the output directory let mut proof = vec![]; - program_proof.write_le(&mut proof)?; + program_proof.write_le(&mut proof).map_err(CliError::cli_io_error)?; ProofFile::new(&package_name).write_to(&path, &proof)?; Ok((program_proof, prepared_verifying_key)) diff --git a/leo/commands/run.rs b/leo/commands/run.rs index 601441f507..49e3622557 100644 --- a/leo/commands/run.rs +++ b/leo/commands/run.rs @@ -17,8 +17,8 @@ use super::{build::BuildOptions, prove::Prove}; use crate::{commands::Command, context::Context}; use leo_compiler::{compiler::Compiler, group::targets::edwards_bls12::EdwardsGroupType}; +use leo_errors::{Result, SnarkVMError}; -use anyhow::Result; use snarkvm_algorithms::{snark::groth16::Groth16, traits::SNARK}; use snarkvm_curves::bls12_377::{Bls12_377, Fr}; use structopt::StructOpt; @@ -61,7 +61,8 @@ impl Command for Run { &prepared_verifying_key, &vec![], &proof, - )?; + ) + .map_err(|_| SnarkVMError::default())?; // Log the verifier output match is_success { diff --git a/leo/commands/setup.rs b/leo/commands/setup.rs index cfa15c6871..cc915730fa 100644 --- a/leo/commands/setup.rs +++ b/leo/commands/setup.rs @@ -17,6 +17,7 @@ use super::build::{Build, BuildOptions}; use crate::{commands::Command, context::Context}; use leo_compiler::{compiler::Compiler, group::targets::edwards_bls12::EdwardsGroupType}; +use leo_errors::{CliError, Result}; use leo_package::outputs::{ProvingKeyFile, VerificationKeyFile}; use snarkvm_algorithms::{ @@ -26,7 +27,6 @@ use snarkvm_algorithms::{ use snarkvm_curves::bls12_377::{Bls12_377, Fr}; use snarkvm_utilities::ToBytes; -use anyhow::{anyhow, Result}; use rand::thread_rng; use structopt::StructOpt; use tracing::span::Span; @@ -80,14 +80,16 @@ impl Command for Setup { let rng = &mut thread_rng(); let (proving_key, prepared_verifying_key) = Groth16::, Vec>::setup(&program, rng) - .map_err(|_| anyhow!("{}", "Unable to setup, see command output for more details"))?; + .map_err(|_| CliError::unable_to_setup())?; // TODO (howardwu): Convert parameters to a 'proving key' struct for serialization. // Write the proving key file to the output directory let proving_key_file = ProvingKeyFile::new(&package_name); tracing::info!("Saving proving key ({:?})", proving_key_file.full_path(&path)); let mut proving_key_bytes = vec![]; - proving_key.write_le(&mut proving_key_bytes)?; + proving_key + .write_le(&mut proving_key_bytes) + .map_err(CliError::cli_io_error)?; let _ = proving_key_file.write_to(&path, &proving_key_bytes)?; tracing::info!("Complete"); @@ -95,7 +97,10 @@ impl Command for Setup { let verification_key_file = VerificationKeyFile::new(&package_name); tracing::info!("Saving verification key ({:?})", verification_key_file.full_path(&path)); let mut verification_key = vec![]; - proving_key.vk.write_le(&mut verification_key)?; + proving_key + .vk + .write_le(&mut verification_key) + .map_err(CliError::cli_io_error)?; let _ = verification_key_file.write_to(&path, &verification_key)?; tracing::info!("Complete"); @@ -110,13 +115,17 @@ impl Command for Setup { tracing::info!("Skipping curve check"); } let proving_key_bytes = ProvingKeyFile::new(&package_name).read_from(&path)?; - let proving_key = ProvingKey::::read(proving_key_bytes.as_slice(), !self.skip_key_check)?; + let proving_key = ProvingKey::::read(proving_key_bytes.as_slice(), !self.skip_key_check) + .map_err(CliError::cli_io_error)?; tracing::info!("Complete"); // Read the verification key file from the output directory tracing::info!("Loading verification key..."); - let verifying_key_bytes = VerificationKeyFile::new(&package_name).read_from(&path)?; - let verifying_key = VerifyingKey::::read(verifying_key_bytes.as_slice())?; + let verifying_key_bytes = VerificationKeyFile::new(&package_name) + .read_from(&path) + .map_err(CliError::cli_io_error)?; + let verifying_key = + VerifyingKey::::read(verifying_key_bytes.as_slice()).map_err(CliError::cli_io_error)?; // Derive the prepared verifying key file from the verifying key let prepared_verifying_key = PreparedVerifyingKey::::from(verifying_key); diff --git a/leo/commands/test.rs b/leo/commands/test.rs index 3de2c52715..773ac53488 100644 --- a/leo/commands/test.rs +++ b/leo/commands/test.rs @@ -20,13 +20,13 @@ use leo_compiler::{ compiler::{thread_leaked_context, Compiler}, group::targets::edwards_bls12::EdwardsGroupType, }; +use leo_errors::{CliError, Result}; use leo_package::{ inputs::*, outputs::{OutputsDirectory, OUTPUTS_DIRECTORY_NAME}, source::{MainFile, MAIN_FILENAME, SOURCE_DIRECTORY_NAME}, }; -use anyhow::{anyhow, Result}; use snarkvm_curves::edwards_bls12::Fq; use std::{convert::TryFrom, path::PathBuf, time::Instant}; use structopt::StructOpt; @@ -80,10 +80,7 @@ impl Command for Test { // when no main file and no files marked - error } else { - return Err(anyhow!( - "Program file does not exist {}", - package_path.to_string_lossy() - )); + return Err(CliError::program_file_does_not_exist(package_path.to_string_lossy()).into()); } // Construct the path to the output directory; diff --git a/leo/commands/update.rs b/leo/commands/update.rs index 07b382a1a0..a8f3ff5fbc 100644 --- a/leo/commands/update.rs +++ b/leo/commands/update.rs @@ -15,8 +15,8 @@ // along with the Leo library. If not, see . use crate::{commands::Command, config::Config, context::Context, updater::Updater}; +use leo_errors::Result; -use anyhow::{anyhow, Result}; use structopt::StructOpt; use tracing::span::Span; @@ -61,7 +61,7 @@ impl Command for Update { fn apply(self, _: Context, _: Self::Input) -> Result { // If --list is passed, list all available versions and return. if self.list { - return Updater::show_available_releases().map_err(|e| anyhow!("Could not fetch versions: {}", e)); + return Updater::show_available_releases(); } // Handles enabling and disabling automatic updates in the config file. diff --git a/leo/commands/watch.rs b/leo/commands/watch.rs index 0bbd546047..7b612c9479 100644 --- a/leo/commands/watch.rs +++ b/leo/commands/watch.rs @@ -16,10 +16,10 @@ use super::build::{Build, BuildOptions}; use crate::{commands::Command, context::Context}; +use leo_errors::{CliError, Result}; use std::{sync::mpsc::channel, time::Duration}; -use anyhow::{anyhow, Result}; use notify::{watcher, DebouncedEvent, RecursiveMode, Watcher}; use structopt::StructOpt; use tracing::span::Span; @@ -54,12 +54,9 @@ impl Command for Watch { let (tx, rx) = channel(); let mut watcher = watcher(tx, Duration::from_secs(self.interval)).unwrap(); - watcher.watch(LEO_SOURCE_DIR, RecursiveMode::Recursive).map_err(|e| { - anyhow!( - "Unable to watch, check that directory contains Leo.toml file. Error: {}", - e - ) - })?; + watcher + .watch(LEO_SOURCE_DIR, RecursiveMode::Recursive) + .map_err(CliError::unable_to_watch)?; tracing::info!("Watching Leo source code"); diff --git a/leo/config.rs b/leo/config.rs index 7e08c6088a..4435c7223e 100644 --- a/leo/config.rs +++ b/leo/config.rs @@ -14,16 +14,16 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . +use leo_errors::{CliError, Result}; + use std::{ fs::{ create_dir_all, File, {self}, }, - io, io::prelude::*, path::{Path, PathBuf}, }; -use anyhow::Error; use dirs::home_dir; use lazy_static::lazy_static; use serde::{Deserialize, Serialize}; @@ -81,44 +81,46 @@ impl Default for Config { impl Config { /// Read the config from the `config.toml` file - pub fn read_config() -> Result { + pub fn read_config() -> Result { let config_dir = LEO_CONFIG_DIRECTORY.clone(); let config_path = LEO_CONFIG_PATH.clone(); if !Path::exists(&config_path) { // Create a new default `config.toml` file if it doesn't already exist - create_dir_all(&config_dir)?; + create_dir_all(&config_dir).map_err(CliError::cli_io_error)?; - let default_config_string = toml::to_string(&Config::default())?; + let default_config_string = + toml::to_string(&Config::default()).map_err(CliError::failed_to_convert_to_toml)?; - fs::write(&config_path, default_config_string)?; + fs::write(&config_path, default_config_string).map_err(CliError::cli_io_error)?; } let toml_string = match fs::read_to_string(&config_path) { Ok(mut toml) => { // If the config is using an incorrect format, rewrite it. if toml::from_str::(&toml).is_err() { - let default_config_string = toml::to_string(&Config::default())?; - fs::write(&config_path, default_config_string.clone())?; + let default_config_string = + toml::to_string(&Config::default()).map_err(CliError::failed_to_convert_to_toml)?; + fs::write(&config_path, default_config_string.clone()).map_err(CliError::cli_io_error)?; toml = default_config_string; } toml } Err(_) => { - create_dir_all(&config_dir)?; - toml::to_string(&Config::default())? + create_dir_all(&config_dir).map_err(CliError::cli_io_error)?; + toml::to_string(&Config::default()).map_err(CliError::failed_to_convert_to_toml)? } }; // Parse the contents into the `Config` struct - let config: Config = toml::from_str(&toml_string)?; + let config: Config = toml::from_str(&toml_string).map_err(CliError::failed_to_convert_from_toml)?; Ok(config) } /// Update the `automatic` configuration in the `config.toml` file. - pub fn set_update_automatic(automatic: bool) -> Result<(), Error> { + pub fn set_update_automatic(automatic: bool) -> Result<()> { let mut config = Self::read_config()?; if config.update.automatic != automatic { @@ -126,46 +128,58 @@ impl Config { // Update the config file let config_path = LEO_CONFIG_PATH.clone(); - fs::write(&config_path, toml::to_string(&config)?)?; + fs::write( + &config_path, + toml::to_string(&config).map_err(CliError::failed_to_convert_to_toml)?, + ) + .map_err(CliError::cli_io_error)?; } Ok(()) } } -pub fn write_token_and_username(token: &str, username: &str) -> Result<(), io::Error> { +pub fn write_token_and_username(token: &str, username: &str) -> Result<()> { let config_dir = LEO_CONFIG_DIRECTORY.clone(); // Create Leo config directory if it not exists if !Path::new(&config_dir).exists() { - create_dir_all(&config_dir)?; + create_dir_all(&config_dir).map_err(CliError::cli_io_error)?; } - let mut credentials = File::create(&LEO_CREDENTIALS_PATH.to_path_buf())?; - credentials.write_all(token.as_bytes())?; + let mut credentials = File::create(&LEO_CREDENTIALS_PATH.to_path_buf()).map_err(CliError::cli_io_error)?; + credentials + .write_all(token.as_bytes()) + .map_err(CliError::cli_io_error)?; - let mut username_file = File::create(&LEO_USERNAME_PATH.to_path_buf())?; - username_file.write_all(username.as_bytes())?; + let mut username_file = File::create(&LEO_USERNAME_PATH.to_path_buf()).map_err(CliError::cli_io_error)?; + username_file + .write_all(username.as_bytes()) + .map_err(CliError::cli_io_error)?; Ok(()) } -pub fn read_token() -> Result { - let mut credentials = File::open(&LEO_CREDENTIALS_PATH.to_path_buf())?; +pub fn read_token() -> Result { + let mut credentials = File::open(&LEO_CREDENTIALS_PATH.to_path_buf()).map_err(CliError::cli_io_error)?; let mut buf = String::new(); - credentials.read_to_string(&mut buf)?; + credentials.read_to_string(&mut buf).map_err(CliError::cli_io_error)?; Ok(buf) } -pub fn read_username() -> Result { - let mut username = File::open(&LEO_USERNAME_PATH.to_path_buf())?; +pub fn read_username() -> Result { + let mut username = File::open(&LEO_USERNAME_PATH.to_path_buf()).map_err(CliError::cli_io_error)?; let mut buf = String::new(); - username.read_to_string(&mut buf)?; + username.read_to_string(&mut buf).map_err(CliError::cli_io_error)?; Ok(buf) } -pub fn remove_token_and_username() -> Result<(), io::Error> { - fs::remove_file(&LEO_CREDENTIALS_PATH.to_path_buf())?; - fs::remove_file(&LEO_USERNAME_PATH.to_path_buf())?; +pub fn remove_token_and_username() -> Result<()> { + if let Err(err) = fs::remove_file(&LEO_CREDENTIALS_PATH.to_path_buf()) { + return Err(CliError::remove_token_and_username(err).into()); + } + if let Err(err) = fs::remove_file(&LEO_USERNAME_PATH.to_path_buf()) { + return Err(CliError::remove_token_and_username(err).into()); + } Ok(()) } diff --git a/leo/context.rs b/leo/context.rs index 0fb96f0a11..d7c7beaeed 100644 --- a/leo/context.rs +++ b/leo/context.rs @@ -15,9 +15,9 @@ // along with the Leo library. If not, see . use crate::{api::Api, config}; +use leo_errors::{CliError, Result}; use leo_package::root::Manifest; -use anyhow::Result; use std::{convert::TryFrom, env::current_dir, path::PathBuf}; pub const PACKAGE_MANAGER_URL: &str = "https://api.aleo.pm/"; @@ -37,7 +37,7 @@ impl Context { pub fn dir(&self) -> Result { match &self.path { Some(path) => Ok(path.clone()), - None => Ok(current_dir()?), + None => Ok(current_dir().map_err(CliError::cli_io_error)?), } } diff --git a/leo/lib.rs b/leo/lib.rs index 94ce90e005..6c0c3470b2 100644 --- a/leo/lib.rs +++ b/leo/lib.rs @@ -14,6 +14,8 @@ // 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")] + pub mod api; pub mod commands; pub mod config; diff --git a/leo/logger.rs b/leo/logger.rs index f7f145a4c2..c359c91f48 100644 --- a/leo/logger.rs +++ b/leo/logger.rs @@ -14,9 +14,10 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . +use leo_errors::Result; + use std::{fmt, sync::Once}; -use anyhow::Result; use colored::Colorize; use tracing::{event::Event, subscriber::Subscriber}; use tracing_subscriber::{ @@ -213,10 +214,7 @@ where pub fn init_logger(_app_name: &'static str, verbosity: usize) -> Result<()> { // This line enables Windows 10 ANSI coloring API. #[cfg(target_family = "windows")] - match ansi_term::enable_ansi_support() { - Ok(_) => {} - Err(_) => return Err(anyhow::anyhow!("Error: Failed to enable ansi_support")), - }; + ansi_term::enable_ansi_support().map_err(|_| leo_errors::CliError::failed_to_enable_ansi_support())?; use tracing_subscriber::fmt::writer::MakeWriterExt; diff --git a/leo/main.rs b/leo/main.rs index 178f2e8e3b..38a25f722c 100644 --- a/leo/main.rs +++ b/leo/main.rs @@ -25,9 +25,8 @@ use commands::{ package::{Add, Clone, Login, Logout, Publish, Remove}, Build, Clean, Command, Deploy, Init, Lint, New, Prove, Run, Setup, Test, Update, Watch, }; +use leo_errors::Result; -use anyhow::Result; -use colored::Colorize; use std::{path::PathBuf, process::exit}; use structopt::{clap::AppSettings, StructOpt}; @@ -221,21 +220,8 @@ fn handle_error(res: Result) -> T { match res { Ok(t) => t, Err(err) => { - eprintln!( - "{} {}", - "Error:".bold().red(), - err.to_string() - .lines() - .enumerate() - .map(|(i, l)| if i == 0 { - l.bold().red().to_string() - } else { - l.to_string() - }) - .collect::>() - .join("\n") - ); - exit(1); + eprintln!("{}", err); + exit(err.exit_code()); } } } @@ -243,8 +229,8 @@ fn handle_error(res: Result) -> T { #[cfg(test)] mod cli_tests { use crate::{run_with_args, Opt}; + use leo_errors::{CliError, Result}; - use anyhow::Result; use std::path::PathBuf; use structopt::StructOpt; use test_dir::{DirBuilder, FileType, TestDir}; @@ -252,7 +238,7 @@ mod cli_tests { // Runs Command from cmd-like argument "leo run --arg1 --arg2". fn run_cmd(args: &str, path: &Option) -> Result<()> { let args = args.split(' ').collect::>(); - let mut opts = Opt::from_iter_safe(args)?; + let mut opts = Opt::from_iter_safe(args).map_err(CliError::opt_args_error)?; if path.is_some() { opts.path = path.clone(); @@ -277,9 +263,6 @@ mod cli_tests { assert!(run_cmd("leo build", &path).is_ok()); assert!(run_cmd("leo -q build", &path).is_ok()); - - assert!(run_cmd("leo --path ../../examples/no-directory-there build", &None).is_err()); - assert!(run_cmd("leo -v build", &None).is_err()); } #[test] diff --git a/leo/tests/mod.rs b/leo/tests/mod.rs index 3281fb71a4..8a39330221 100644 --- a/leo/tests/mod.rs +++ b/leo/tests/mod.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use anyhow::Result; +use leo_errors::Result; use std::path::PathBuf; use crate::{ @@ -143,7 +143,8 @@ pub fn test_pedersen_hash() -> Result<()> { #[test] pub fn test_logout() -> Result<()> { - (Logout {}).apply(context()?, ())?; + let logout = (Logout {}).apply(context()?, ()); + assert!(logout.is_err()); Ok(()) } @@ -172,6 +173,7 @@ pub fn login_incorrect_credentials_or_token() -> Result<()> { Ok(()) } +#[cfg(not(target_os = "macos"))] #[test] pub fn leo_update_and_update_automatic() -> Result<()> { let update = Update { diff --git a/leo/updater.rs b/leo/updater.rs index a5e5b7668a..cce14d3e58 100644 --- a/leo/updater.rs +++ b/leo/updater.rs @@ -15,8 +15,8 @@ // along with the Leo library. If not, see . use crate::config::Config; +use leo_errors::{CliError, Result}; -use anyhow::{anyhow, Result}; use colored::Colorize; use self_update::{backends::github, version::bump_is_greater, Status}; @@ -33,8 +33,10 @@ impl Updater { let releases = github::ReleaseList::configure() .repo_owner(Self::LEO_REPO_OWNER) .repo_name(Self::LEO_REPO_NAME) - .build()? - .fetch()?; + .build() + .map_err(CliError::self_update_error)? + .fetch() + .map_err(CliError::could_not_fetch_versions)?; let mut output = "\nList of available versions\n".to_string(); for release in releases { @@ -57,8 +59,10 @@ impl Updater { .show_download_progress(show_output) .no_confirm(true) .show_output(show_output) - .build()? - .update()?; + .build() + .map_err(CliError::self_update_build_error)? + .update() + .map_err(CliError::self_update_error)?; Ok(status) } @@ -70,19 +74,16 @@ impl Updater { .repo_name(Self::LEO_REPO_NAME) .bin_name(Self::LEO_BIN_NAME) .current_version(env!("CARGO_PKG_VERSION")) - .build()?; + .build() + .map_err(CliError::self_update_error)?; let current_version = updater.current_version(); - let latest_release = updater.get_latest_release()?; + let latest_release = updater.get_latest_release().map_err(CliError::self_update_error)?; - if bump_is_greater(¤t_version, &latest_release.version)? { + if bump_is_greater(¤t_version, &latest_release.version).map_err(CliError::self_update_error)? { Ok(latest_release.version) } else { - Err(anyhow!( - "Old release version {} {}", - current_version, - latest_release.version - )) + Err(CliError::old_release_version(current_version, latest_release.version).into()) } } diff --git a/package/Cargo.toml b/package/Cargo.toml index 807f015829..2e79acfb60 100644 --- a/package/Cargo.toml +++ b/package/Cargo.toml @@ -17,13 +17,14 @@ include = [ "Cargo.toml", "src", "README.md", "LICENSE.md" ] license = "GPL-3.0" edition = "2018" +[dependencies.leo-errors] +path = "../errors" +version = "1.5.3" + [dependencies.serde] version = "1.0" features = [ "derive" ] -[dependencies.thiserror] -version = "1.0" - [dependencies.toml] version = "0.5" diff --git a/package/src/errors/imports/directory.rs b/package/src/errors/imports/directory.rs deleted file mode 100644 index e027babdec..0000000000 --- a/package/src/errors/imports/directory.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 std::{ffi::OsString, io}; - -#[derive(Debug, Error)] -pub enum ImportsDirectoryError { - #[error("creating: {}", _0)] - Creating(io::Error), - - #[error("package {:?} does not exist as an import", _0)] - ImportDoesNotExist(OsString), - - #[error("removing: {}", _0)] - Removing(io::Error), -} diff --git a/package/src/errors/inputs/directory.rs b/package/src/errors/inputs/directory.rs deleted file mode 100644 index 0a36e53836..0000000000 --- a/package/src/errors/inputs/directory.rs +++ /dev/null @@ -1,46 +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::{InputFileError, StateFileError}; - -use std::{ffi::OsString, fs::FileType, io}; - -#[derive(Debug, Error)] -pub enum InputsDirectoryError { - #[error("creating: {}", _0)] - Creating(io::Error), - - #[error("file entry getting: {}", _0)] - GettingFileEntry(io::Error), - - #[error("file {:?} name getting", _0)] - GettingFileName(OsString), - - #[error("file {:?} type getting: {}", _0, _1)] - GettingFileType(OsString, io::Error), - - #[error("{}", _0)] - InputFileError(#[from] InputFileError), - - #[error("invalid file {:?} type: {:?}", _0, _1)] - InvalidFileType(OsString, FileType), - - #[error("reading: {}", _0)] - Reading(io::Error), - - #[error("{}", _0)] - StateFileError(#[from] StateFileError), -} diff --git a/package/src/errors/inputs/input.rs b/package/src/errors/inputs/input.rs deleted file mode 100644 index 0dbbbb0a0c..0000000000 --- a/package/src/errors/inputs/input.rs +++ /dev/null @@ -1,32 +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 std::path::PathBuf; - -#[derive(Debug, Error)] -pub enum InputFileError { - #[error("{}: {}", _0, _1)] - Crate(&'static str, String), - - #[error("Cannot read from the provided file path - {:?}", _0)] - FileReadError(PathBuf), -} - -impl From for InputFileError { - fn from(error: std::io::Error) -> Self { - InputFileError::Crate("std::io", error.to_string()) - } -} diff --git a/package/src/errors/inputs/state.rs b/package/src/errors/inputs/state.rs deleted file mode 100644 index e944f93469..0000000000 --- a/package/src/errors/inputs/state.rs +++ /dev/null @@ -1,32 +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 std::path::PathBuf; - -#[derive(Debug, Error)] -pub enum StateFileError { - #[error("{}: {}", _0, _1)] - Crate(&'static str, String), - - #[error("Cannot read from the provided file path - {:?}", _0)] - FileReadError(PathBuf), -} - -impl From for StateFileError { - fn from(error: std::io::Error) -> Self { - StateFileError::Crate("std::io", error.to_string()) - } -} diff --git a/package/src/errors/mod.rs b/package/src/errors/mod.rs deleted file mode 100644 index 32bf1fc55c..0000000000 --- a/package/src/errors/mod.rs +++ /dev/null @@ -1,33 +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 imports; -pub use imports::*; - -pub mod inputs; -pub use inputs::*; - -pub mod outputs; -pub use outputs::*; - -pub mod package; -pub use self::package::*; - -pub mod root; -pub use self::root::*; - -pub mod source; -pub use self::source::*; diff --git a/package/src/errors/outputs/checksum.rs b/package/src/errors/outputs/checksum.rs deleted file mode 100644 index 7d52981bd8..0000000000 --- a/package/src/errors/outputs/checksum.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 std::path::PathBuf; - -#[derive(Debug, Error)] -pub enum ChecksumFileError { - #[error("{}: {}", _0, _1)] - Crate(&'static str, String), - - #[error("Cannot read from the provided file path - {:?}", _0)] - FileReadError(PathBuf), - - #[error("Cannot remove the provided file - {:?}", _0)] - FileRemovalError(PathBuf), -} - -impl From for ChecksumFileError { - fn from(error: std::io::Error) -> Self { - ChecksumFileError::Crate("std::io", error.to_string()) - } -} diff --git a/package/src/errors/outputs/circuit.rs b/package/src/errors/outputs/circuit.rs deleted file mode 100644 index 69b172c05d..0000000000 --- a/package/src/errors/outputs/circuit.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 std::path::PathBuf; - -#[derive(Debug, Error)] -pub enum CircuitFileError { - #[error("{}: {}", _0, _1)] - Crate(&'static str, String), - - #[error("Cannot read from the provided file path - {:?}", _0)] - FileReadError(PathBuf), - - #[error("Cannot remove the provided file - {:?}", _0)] - FileRemovalError(PathBuf), -} - -impl From for CircuitFileError { - fn from(error: std::io::Error) -> Self { - CircuitFileError::Crate("std::io", error.to_string()) - } -} diff --git a/package/src/errors/outputs/directory.rs b/package/src/errors/outputs/directory.rs deleted file mode 100644 index 8945526cfa..0000000000 --- a/package/src/errors/outputs/directory.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 std::io; - -#[derive(Debug, Error)] -pub enum OutputsDirectoryError { - #[error("creating: {}", _0)] - Creating(io::Error), - - #[error("removing: {}", _0)] - Removing(io::Error), -} diff --git a/package/src/errors/outputs/mod.rs b/package/src/errors/outputs/mod.rs deleted file mode 100644 index e936884a57..0000000000 --- a/package/src/errors/outputs/mod.rs +++ /dev/null @@ -1,33 +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 circuit; -pub use circuit::*; - -pub mod checksum; -pub use checksum::*; - -pub mod directory; -pub use self::directory::*; - -pub mod proof; -pub use proof::*; - -pub mod proving_key; -pub use proving_key::*; - -pub mod verification_key; -pub use verification_key::*; diff --git a/package/src/errors/outputs/proof.rs b/package/src/errors/outputs/proof.rs deleted file mode 100644 index adce5b7bf5..0000000000 --- a/package/src/errors/outputs/proof.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 std::path::PathBuf; - -#[derive(Debug, Error)] -pub enum ProofFileError { - #[error("{}: {}", _0, _1)] - Crate(&'static str, String), - - #[error("Cannot read from the provided file path - {:?}", _0)] - FileReadError(PathBuf), - - #[error("Cannot remove the provided file - {:?}", _0)] - FileRemovalError(PathBuf), -} - -impl From for ProofFileError { - fn from(error: std::io::Error) -> Self { - ProofFileError::Crate("std::io", error.to_string()) - } -} diff --git a/package/src/errors/outputs/proving_key.rs b/package/src/errors/outputs/proving_key.rs deleted file mode 100644 index 6431af92fd..0000000000 --- a/package/src/errors/outputs/proving_key.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 std::path::PathBuf; - -#[derive(Debug, Error)] -pub enum ProvingKeyFileError { - #[error("{}: {}", _0, _1)] - Crate(&'static str, String), - - #[error("Cannot read from the provided file path - {:?}", _0)] - FileReadError(PathBuf), - - #[error("Cannot remove the provided file - {:?}", _0)] - FileRemovalError(PathBuf), -} - -impl From for ProvingKeyFileError { - fn from(error: std::io::Error) -> Self { - ProvingKeyFileError::Crate("std::io", error.to_string()) - } -} diff --git a/package/src/errors/outputs/verification_key.rs b/package/src/errors/outputs/verification_key.rs deleted file mode 100644 index 6a9f437b8a..0000000000 --- a/package/src/errors/outputs/verification_key.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 std::path::PathBuf; - -#[derive(Debug, Error)] -pub enum VerificationKeyFileError { - #[error("{}: {}", _0, _1)] - Crate(&'static str, String), - - #[error("Cannot read from the provided file path - {:?}", _0)] - FileReadError(PathBuf), - - #[error("Cannot remove the provided file - {:?}", _0)] - FileRemovalError(PathBuf), -} - -impl From for VerificationKeyFileError { - fn from(error: std::io::Error) -> Self { - VerificationKeyFileError::Crate("std::io", error.to_string()) - } -} diff --git a/package/src/errors/package.rs b/package/src/errors/package.rs deleted file mode 100644 index 47f4808924..0000000000 --- a/package/src/errors/package.rs +++ /dev/null @@ -1,100 +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 std::ffi::OsString; - -#[derive(Debug, Error)] -pub enum PackageError { - #[error("{}: {}", _0, _1)] - Crate(&'static str, String), - - #[error("Failed to initialize package {:?} ({:?})", _0, _1)] - FailedToInitialize(String, OsString), - - #[error("Invalid project name: {:?}", _0)] - InvalidPackageName(String), -} - -impl From for PackageError { - fn from(error: std::io::Error) -> Self { - PackageError::Crate("std::io", error.to_string()) - } -} - -impl From for PackageError { - fn from(error: crate::errors::GitignoreError) -> Self { - PackageError::Crate("leo-package", error.to_string()) - } -} - -impl From for PackageError { - fn from(error: crate::errors::InputFileError) -> Self { - PackageError::Crate("leo-package", error.to_string()) - } -} - -impl From for PackageError { - fn from(error: crate::errors::InputsDirectoryError) -> Self { - PackageError::Crate("leo-package", error.to_string()) - } -} - -impl From for PackageError { - fn from(error: crate::errors::ImportsDirectoryError) -> Self { - PackageError::Crate("leo-package", error.to_string()) - } -} - -impl From for PackageError { - fn from(error: crate::errors::OutputsDirectoryError) -> Self { - PackageError::Crate("leo-package", error.to_string()) - } -} - -impl From for PackageError { - fn from(error: crate::errors::READMEError) -> Self { - PackageError::Crate("leo-package", error.to_string()) - } -} - -impl From for PackageError { - fn from(error: crate::errors::SourceDirectoryError) -> Self { - PackageError::Crate("leo-package", error.to_string()) - } -} - -impl From for PackageError { - fn from(error: crate::errors::StateFileError) -> Self { - PackageError::Crate("leo-package", error.to_string()) - } -} - -impl From for PackageError { - fn from(error: crate::errors::LibraryFileError) -> Self { - PackageError::Crate("leo-package", error.to_string()) - } -} - -impl From for PackageError { - fn from(error: crate::errors::ManifestError) -> Self { - PackageError::Crate("leo-package", error.to_string()) - } -} - -impl From for PackageError { - fn from(error: crate::errors::MainFileError) -> Self { - PackageError::Crate("leo-package", error.to_string()) - } -} diff --git a/package/src/errors/root/gitignore.rs b/package/src/errors/root/gitignore.rs deleted file mode 100644 index bf047ddabb..0000000000 --- a/package/src/errors/root/gitignore.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 . - -#[derive(Debug, Error)] -pub enum GitignoreError { - #[error("{}: {}", _0, _1)] - Crate(&'static str, String), -} - -impl From for GitignoreError { - fn from(error: std::io::Error) -> Self { - GitignoreError::Crate("std::io", error.to_string()) - } -} diff --git a/package/src/errors/root/manifest.rs b/package/src/errors/root/manifest.rs deleted file mode 100644 index 1e732a817f..0000000000 --- a/package/src/errors/root/manifest.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 std::io; - -#[derive(Debug, Error)] -pub enum ManifestError { - #[error("{}: {}", _0, _1)] - Crate(&'static str, String), - - #[error("`{}` creating: {}", _0, _1)] - Creating(&'static str, io::Error), - - #[error("`{}` metadata: {}", _0, _1)] - Metadata(&'static str, io::Error), - - #[error("`{}` opening: {}", _0, _1)] - Opening(&'static str, io::Error), - - #[error("`{}` parsing: {}", _0, _1)] - Parsing(&'static str, toml::de::Error), - - #[error("`{}` reading: {}", _0, _1)] - Reading(&'static str, io::Error), - - #[error("`{}` writing: {}", _0, _1)] - Writing(&'static str, io::Error), -} - -impl From for ManifestError { - fn from(error: crate::errors::PackageError) -> Self { - ManifestError::Crate("leo-package", error.to_string()) - } -} diff --git a/package/src/errors/root/mod.rs b/package/src/errors/root/mod.rs deleted file mode 100644 index 6b90439ca1..0000000000 --- a/package/src/errors/root/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 gitignore; -pub use self::gitignore::*; - -pub mod manifest; -pub use self::manifest::*; - -pub mod readme; -pub use self::readme::*; - -pub mod zip; -pub use self::zip::*; diff --git a/package/src/errors/root/readme.rs b/package/src/errors/root/readme.rs deleted file mode 100644 index f5d99216c5..0000000000 --- a/package/src/errors/root/readme.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 . - -#[allow(clippy::upper_case_acronyms)] -#[derive(Debug, Error)] -pub enum READMEError { - #[error("{}: {}", _0, _1)] - Crate(&'static str, String), -} - -impl From for READMEError { - fn from(error: std::io::Error) -> Self { - READMEError::Crate("std::io", error.to_string()) - } -} diff --git a/package/src/errors/root/zip.rs b/package/src/errors/root/zip.rs deleted file mode 100644 index af9f4e231b..0000000000 --- a/package/src/errors/root/zip.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 std::path::PathBuf; -use zip::result::ZipError; - -#[derive(Debug, Error)] -pub enum ZipFileError { - #[error("{}: {}", _0, _1)] - Crate(&'static str, String), - - #[error("Cannot read from the provided file path - {:?}", _0)] - FileReadError(PathBuf), - - #[error("Cannot remove the provided file - {:?}", _0)] - FileRemovalError(PathBuf), - - #[error("{}", _0)] - ZipError(#[from] ZipError), -} - -impl From for ZipFileError { - fn from(error: std::io::Error) -> Self { - ZipFileError::Crate("std::io", error.to_string()) - } -} diff --git a/package/src/errors/source/directory.rs b/package/src/errors/source/directory.rs deleted file mode 100644 index 00d0629ec2..0000000000 --- a/package/src/errors/source/directory.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 std::{ffi::OsString, fs::FileType, io}; - -#[derive(Debug, Error)] -pub enum SourceDirectoryError { - #[error("creating: {}", _0)] - Creating(io::Error), - - #[error("file entry getting: {}", _0)] - GettingFileEntry(io::Error), - - #[error("file {:?} extension getting", _0)] - GettingFileExtension(OsString), - - #[error("file {:?} type getting: {}", _0, _1)] - GettingFileType(OsString, io::Error), - - #[error("invalid file {:?} extension: {:?}", _0, _1)] - InvalidFileExtension(OsString, OsString), - - #[error("invalid file {:?} type: {:?}", _0, _1)] - InvalidFileType(OsString, FileType), - - #[error("reading: {}", _0)] - Reading(io::Error), -} diff --git a/package/src/errors/source/lib.rs b/package/src/errors/source/lib.rs deleted file mode 100644 index 149257085c..0000000000 --- a/package/src/errors/source/lib.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 . - -#[derive(Debug, Error)] -pub enum LibraryFileError { - #[error("{}: {}", _0, _1)] - Crate(&'static str, String), -} - -impl From for LibraryFileError { - fn from(error: std::io::Error) -> Self { - LibraryFileError::Crate("std::io", error.to_string()) - } -} diff --git a/package/src/errors/source/main.rs b/package/src/errors/source/main.rs deleted file mode 100644 index fc1de8d998..0000000000 --- a/package/src/errors/source/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 . - -#[derive(Debug, Error)] -pub enum MainFileError { - #[error("{}: {}", _0, _1)] - Crate(&'static str, String), -} - -impl From for MainFileError { - fn from(error: std::io::Error) -> Self { - MainFileError::Crate("std::io", error.to_string()) - } -} diff --git a/package/src/imports/directory.rs b/package/src/imports/directory.rs index 1f01597d2e..beb1439b45 100644 --- a/package/src/imports/directory.rs +++ b/package/src/imports/directory.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::errors::ImportsDirectoryError; +use leo_errors::{PackageError, Result}; use std::{borrow::Cow, fs, path::Path}; @@ -24,17 +24,18 @@ pub struct ImportsDirectory; impl ImportsDirectory { /// Creates a directory at the provided path with the default directory name. - pub fn create(path: &Path) -> Result<(), ImportsDirectoryError> { + pub fn create(path: &Path) -> Result<()> { let mut path = Cow::from(path); if path.is_dir() && !path.ends_with(IMPORTS_DIRECTORY_NAME) { path.to_mut().push(IMPORTS_DIRECTORY_NAME); } - fs::create_dir_all(&path).map_err(ImportsDirectoryError::Creating) + fs::create_dir_all(&path).map_err(PackageError::failed_to_create_imports_directory)?; + Ok(()) } /// Removes an imported package in the imports directory at the provided path. - pub fn remove_import(path: &Path, package_name: &str) -> Result<(), ImportsDirectoryError> { + pub fn remove_import(path: &Path, package_name: &str) -> Result<()> { let mut path = Cow::from(path); if path.is_dir() && !path.ends_with(IMPORTS_DIRECTORY_NAME) { path.to_mut().push(IMPORTS_DIRECTORY_NAME); @@ -43,10 +44,10 @@ impl ImportsDirectory { path.to_mut().push(package_name); if !path.exists() || !path.is_dir() { - return Err(ImportsDirectoryError::ImportDoesNotExist(package_name.into())); + return Err(PackageError::import_does_not_exist(package_name).into()); } - fs::remove_dir_all(&path).map_err(ImportsDirectoryError::Removing)?; + fs::remove_dir_all(&path).map_err(PackageError::failed_to_remove_imports_directory)?; Ok(()) } diff --git a/package/src/inputs/directory.rs b/package/src/inputs/directory.rs index 77b4701501..92718b4f76 100644 --- a/package/src/inputs/directory.rs +++ b/package/src/inputs/directory.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::errors::InputsDirectoryError; +use leo_errors::{PackageError, Result}; use std::{ borrow::Cow, @@ -29,21 +29,22 @@ pub struct InputsDirectory; impl InputsDirectory { /// Creates a directory at the provided path with the default directory name. - pub fn create(path: &Path) -> Result<(), InputsDirectoryError> { + pub fn create(path: &Path) -> Result<()> { let mut path = Cow::from(path); if path.is_dir() && !path.ends_with(INPUTS_DIRECTORY_NAME) { path.to_mut().push(INPUTS_DIRECTORY_NAME); } - fs::create_dir_all(&path).map_err(InputsDirectoryError::Creating) + fs::create_dir_all(&path).map_err(PackageError::failed_to_create_inputs_directory)?; + Ok(()) } /// Returns a list of files in the input directory. - pub fn files(path: &Path) -> Result, InputsDirectoryError> { + pub fn files(path: &Path) -> Result> { let mut path = path.to_owned(); path.push(INPUTS_DIRECTORY_NAME); - let directory = fs::read_dir(&path).map_err(InputsDirectoryError::Reading)?; + let directory = fs::read_dir(&path).map_err(PackageError::failed_to_read_inputs_directory)?; let mut file_paths = Vec::new(); parse_file_paths(directory, &mut file_paths)?; @@ -51,25 +52,22 @@ impl InputsDirectory { } } -fn parse_file_paths(directory: ReadDir, file_paths: &mut Vec) -> Result<(), InputsDirectoryError> { +fn parse_file_paths(directory: ReadDir, file_paths: &mut Vec) -> Result<()> { for file_entry in directory.into_iter() { - let file_entry = file_entry.map_err(InputsDirectoryError::GettingFileEntry)?; + let file_entry = file_entry.map_err(PackageError::failed_to_get_input_file_entry)?; let file_path = file_entry.path(); // Verify that the entry is structured as a valid file or directory let file_type = file_entry .file_type() - .map_err(|error| InputsDirectoryError::GettingFileType(file_path.as_os_str().to_owned(), error))?; + .map_err(|e| PackageError::failed_to_get_input_file_type(file_path.as_os_str().to_owned(), e))?; if file_type.is_dir() { - let directory = fs::read_dir(&file_path).map_err(InputsDirectoryError::Reading)?; + let directory = fs::read_dir(&file_path).map_err(PackageError::failed_to_read_inputs_directory)?; parse_file_paths(directory, file_paths)?; continue; } else if !file_type.is_file() { - return Err(InputsDirectoryError::InvalidFileType( - file_path.as_os_str().to_owned(), - file_type, - )); + return Err(PackageError::invalid_input_file_type(file_path.as_os_str().to_owned(), file_type).into()); } file_paths.push(file_path); diff --git a/package/src/inputs/input.rs b/package/src/inputs/input.rs index 74ca67484a..0d708c6643 100644 --- a/package/src/inputs/input.rs +++ b/package/src/inputs/input.rs @@ -16,7 +16,9 @@ //! The `program.in` file. -use crate::{errors::InputFileError, inputs::INPUTS_DIRECTORY_NAME}; +use crate::inputs::INPUTS_DIRECTORY_NAME; + +use leo_errors::{PackageError, Result}; use serde::Deserialize; use std::{ @@ -52,21 +54,22 @@ impl InputFile { } /// Reads the program input variables from the given file path if it exists. - pub fn read_from<'a>(&self, path: &'a Path) -> Result<(String, Cow<'a, Path>), InputFileError> { + pub fn read_from<'a>(&self, path: &'a Path) -> Result<(String, Cow<'a, Path>)> { let path = self.setup_file_path(path); - match fs::read_to_string(&path) { - Ok(input) => Ok((input, path)), - Err(_) => Err(InputFileError::FileReadError(path.into_owned())), - } + let input = fs::read_to_string(&path) + .map_err(|_| PackageError::failed_to_read_input_file(path.clone().into_owned()))?; + Ok((input, path)) } /// Writes the standard input format to a file. - pub fn write_to(self, path: &Path) -> Result<(), InputFileError> { + pub fn write_to(self, path: &Path) -> Result<()> { let path = self.setup_file_path(path); + let mut file = File::create(&path).map_err(PackageError::io_error_input_file)?; - let mut file = File::create(&path)?; - Ok(file.write_all(self.template().as_bytes())?) + file.write_all(self.template().as_bytes()) + .map_err(PackageError::io_error_input_file)?; + Ok(()) } fn template(&self) -> String { diff --git a/package/src/inputs/pairs.rs b/package/src/inputs/pairs.rs index 0d21e7c7f4..427349c656 100644 --- a/package/src/inputs/pairs.rs +++ b/package/src/inputs/pairs.rs @@ -14,10 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{ - inputs::{InputFile, InputsDirectory, StateFile, INPUT_FILE_EXTENSION, STATE_FILE_EXTENSION}, - InputsDirectoryError, -}; +use crate::inputs::{InputFile, InputsDirectory, StateFile, INPUT_FILE_EXTENSION, STATE_FILE_EXTENSION}; +use leo_errors::{LeoError, PackageError}; use std::{collections::HashMap, convert::TryFrom, path::Path}; @@ -40,7 +38,7 @@ impl InputPairs { } impl TryFrom<&Path> for InputPairs { - type Error = InputsDirectoryError; + type Error = LeoError; fn try_from(directory: &Path) -> Result { let files = InputsDirectory::files(directory)?; @@ -55,11 +53,18 @@ impl TryFrom<&Path> for InputPairs { None => continue, }; - let file_name = file - .file_stem() - .ok_or_else(|| InputsDirectoryError::GettingFileName(file.as_os_str().to_owned()))? - .to_str() - .ok_or_else(|| InputsDirectoryError::GettingFileName(file.as_os_str().to_owned()))?; + // Have to handle error mapping this way because of rust error: https://github.com/rust-lang/rust/issues/42424. + let file_name = match file.file_stem() { + Some(stem) => match stem.to_str() { + Some(file_name) => file_name, + None => { + return Err(PackageError::failed_to_get_input_file_name(file.as_os_str()).into()); + } + }, + None => { + return Err(PackageError::failed_to_get_input_file_name(file.as_os_str()).into()); + } + }; if file_extension == INPUT_FILE_EXTENSION.trim_start_matches('.') { let input_file = InputFile::new(file_name).read_from(&file)?.0; diff --git a/package/src/inputs/state.rs b/package/src/inputs/state.rs index 4c7994291e..df3ceffa64 100644 --- a/package/src/inputs/state.rs +++ b/package/src/inputs/state.rs @@ -16,7 +16,8 @@ //! The `program.state` file. -use crate::{errors::StateFileError, inputs::INPUTS_DIRECTORY_NAME}; +use crate::inputs::INPUTS_DIRECTORY_NAME; +use leo_errors::{PackageError, Result}; use serde::Deserialize; use std::{ @@ -52,21 +53,22 @@ impl StateFile { } /// Reads the state input variables from the given file path if it exists. - pub fn read_from<'a>(&self, path: &'a Path) -> Result<(String, Cow<'a, Path>), StateFileError> { + pub fn read_from<'a>(&self, path: &'a Path) -> Result<(String, Cow<'a, Path>)> { let path = self.setup_file_path(path); - match fs::read_to_string(&path) { - Ok(input) => Ok((input, path)), - Err(_) => Err(StateFileError::FileReadError(path.into_owned())), - } + let input = fs::read_to_string(&path) + .map_err(|_| PackageError::failed_to_read_state_file(path.clone().into_owned()))?; + Ok((input, path)) } /// Writes the standard input format to a file. - pub fn write_to(self, path: &Path) -> Result<(), StateFileError> { + pub fn write_to(self, path: &Path) -> Result<()> { let path = self.setup_file_path(path); + let mut file = File::create(&path).map_err(PackageError::io_error_state_file)?; - let mut file = File::create(&path)?; - Ok(file.write_all(self.template().as_bytes())?) + Ok(file + .write_all(self.template().as_bytes()) + .map_err(PackageError::io_error_state_file)?) } fn template(&self) -> String { diff --git a/package/src/lib.rs b/package/src/lib.rs index 1ae814a303..aa8a7f082a 100644 --- a/package/src/lib.rs +++ b/package/src/lib.rs @@ -14,11 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -#[macro_use] -extern crate thiserror; - -pub mod errors; -pub use errors::*; +#![doc = include_str!("../README.md")] pub mod imports; pub mod inputs; @@ -29,11 +25,13 @@ pub mod source; use std::path::Path; +use leo_errors::Result; + pub struct LeoPackage; impl LeoPackage { /// Initializes a Leo package at the given path. - pub fn initialize(package_name: &str, path: &Path, author: Option) -> Result<(), PackageError> { + pub fn initialize(package_name: &str, path: &Path, author: Option) -> Result<()> { package::Package::initialize(package_name, path, author) } @@ -43,7 +41,7 @@ impl LeoPackage { } /// Removes an imported Leo package - pub fn remove_imported_package(package_name: &str, path: &Path) -> Result<(), PackageError> { + pub fn remove_imported_package(package_name: &str, path: &Path) -> Result<()> { package::Package::remove_imported_package(package_name, path) } } diff --git a/package/src/outputs/checksum.rs b/package/src/outputs/checksum.rs index 3f56c22a76..b538ffa282 100644 --- a/package/src/outputs/checksum.rs +++ b/package/src/outputs/checksum.rs @@ -16,7 +16,8 @@ //! The build checksum file. -use crate::{errors::ChecksumFileError, outputs::OUTPUTS_DIRECTORY_NAME}; +use crate::outputs::OUTPUTS_DIRECTORY_NAME; +use leo_errors::{PackageError, Result}; use serde::Deserialize; use std::{ @@ -48,31 +49,33 @@ impl ChecksumFile { } /// Reads the checksum from the given file path if it exists. - pub fn read_from(&self, path: &Path) -> Result { + pub fn read_from(&self, path: &Path) -> Result { let path = self.setup_file_path(path); - fs::read_to_string(&path).map_err(|_| ChecksumFileError::FileReadError(path.into_owned())) + let string = + fs::read_to_string(&path).map_err(|_| PackageError::failed_to_read_checksum_file(path.into_owned()))?; + Ok(string) } /// Writes the given checksum to a file. - pub fn write_to(&self, path: &Path, checksum: String) -> Result<(), ChecksumFileError> { + pub fn write_to(&self, path: &Path, checksum: String) -> Result<()> { let path = self.setup_file_path(path); + let mut file = File::create(&path).map_err(PackageError::io_error_checksum_file)?; - let mut file = File::create(&path)?; - file.write_all(checksum.as_bytes())?; - + file.write_all(checksum.as_bytes()) + .map_err(PackageError::io_error_checksum_file)?; Ok(()) } /// Removes the checksum at the given path if it exists. Returns `true` on success, /// `false` if the file doesn't exist, and `Error` if the file system fails during operation. - pub fn remove(&self, path: &Path) -> Result { + pub fn remove(&self, path: &Path) -> Result { let path = self.setup_file_path(path); if !path.exists() { return Ok(false); } - fs::remove_file(&path).map_err(|_| ChecksumFileError::FileRemovalError(path.into_owned()))?; + fs::remove_file(&path).map_err(|_| PackageError::failed_to_remove_checksum_file(path.into_owned()))?; Ok(true) } diff --git a/package/src/outputs/circuit.rs b/package/src/outputs/circuit.rs index 81a528f310..983bb3001f 100644 --- a/package/src/outputs/circuit.rs +++ b/package/src/outputs/circuit.rs @@ -16,7 +16,8 @@ //! The serialized circuit output file. -use crate::{errors::CircuitFileError, outputs::OUTPUTS_DIRECTORY_NAME}; +use crate::outputs::OUTPUTS_DIRECTORY_NAME; +use leo_errors::{PackageError, Result}; use serde::Deserialize; use std::{ @@ -48,31 +49,33 @@ impl CircuitFile { } /// Reads the serialized circuit from the given file path if it exists. - pub fn read_from(&self, path: &Path) -> Result { + pub fn read_from(&self, path: &Path) -> Result { let path = self.setup_file_path(path); - fs::read_to_string(&path).map_err(|_| CircuitFileError::FileReadError(path.into_owned())) + let string = + fs::read_to_string(&path).map_err(|_| PackageError::failed_to_read_circuit_file(path.into_owned()))?; + Ok(string) } /// Writes the given serialized circuit to a file. - pub fn write_to(&self, path: &Path, circuit: String) -> Result<(), CircuitFileError> { + pub fn write_to(&self, path: &Path, circuit: String) -> Result<()> { let path = self.setup_file_path(path); + let mut file = File::create(&path).map_err(PackageError::io_error_circuit_file)?; - let mut file = File::create(&path)?; - file.write_all(circuit.as_bytes())?; - + file.write_all(circuit.as_bytes()) + .map_err(PackageError::io_error_circuit_file)?; Ok(()) } /// Removes the serialized circuit at the given path if it exists. Returns `true` on success, /// `false` if the file doesn't exist, and `Error` if the file system fails during operation. - pub fn remove(&self, path: &Path) -> Result { + pub fn remove(&self, path: &Path) -> Result { let path = self.setup_file_path(path); if !path.exists() { return Ok(false); } - fs::remove_file(&path).map_err(|_| CircuitFileError::FileRemovalError(path.into_owned()))?; + fs::remove_file(&path).map_err(|_| PackageError::failed_to_remove_circuit_file(path))?; Ok(true) } diff --git a/package/src/outputs/directory.rs b/package/src/outputs/directory.rs index e2557f343c..e94dd40d2e 100644 --- a/package/src/outputs/directory.rs +++ b/package/src/outputs/directory.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::errors::OutputsDirectoryError; +use leo_errors::{PackageError, Result}; use std::{borrow::Cow, fs, path::Path}; @@ -24,24 +24,25 @@ pub struct OutputsDirectory; impl OutputsDirectory { /// Creates a directory at the provided path with the default directory name. - pub fn create(path: &Path) -> Result<(), OutputsDirectoryError> { + pub fn create(path: &Path) -> Result<()> { let mut path = Cow::from(path); if path.is_dir() && !path.ends_with(OUTPUTS_DIRECTORY_NAME) { path.to_mut().push(OUTPUTS_DIRECTORY_NAME); } - fs::create_dir_all(&path).map_err(OutputsDirectoryError::Creating) + fs::create_dir_all(&path).map_err(PackageError::failed_to_create_inputs_directory)?; + Ok(()) } /// Removes the directory at the provided path. - pub fn remove(path: &Path) -> Result<(), OutputsDirectoryError> { + pub fn remove(path: &Path) -> Result<()> { let mut path = Cow::from(path); if path.is_dir() && !path.ends_with(OUTPUTS_DIRECTORY_NAME) { path.to_mut().push(OUTPUTS_DIRECTORY_NAME); } if path.exists() { - fs::remove_dir_all(&path).map_err(OutputsDirectoryError::Removing)?; + fs::remove_dir_all(&path).map_err(PackageError::failed_to_create_inputs_directory)?; } Ok(()) diff --git a/package/src/outputs/proof.rs b/package/src/outputs/proof.rs index 6a9419b889..144b46dcce 100644 --- a/package/src/outputs/proof.rs +++ b/package/src/outputs/proof.rs @@ -16,7 +16,8 @@ //! The proof file. -use crate::{errors::ProofFileError, outputs::OUTPUTS_DIRECTORY_NAME}; +use crate::outputs::OUTPUTS_DIRECTORY_NAME; +use leo_errors::{PackageError, Result}; use serde::Deserialize; use std::{ @@ -48,20 +49,20 @@ impl ProofFile { } /// Reads the proof from the given file path if it exists. - pub fn read_from(&self, path: &Path) -> Result { + pub fn read_from(&self, path: &Path) -> Result { let path = self.setup_file_path(path); - let proof = fs::read_to_string(&path).map_err(|_| ProofFileError::FileReadError(path.into_owned()))?; - Ok(proof) + let string = + fs::read_to_string(&path).map_err(|_| PackageError::failed_to_read_proof_file(path.into_owned()))?; + Ok(string) } /// Writes the given proof to a file. - pub fn write_to(&self, path: &Path, proof: &[u8]) -> Result<(), ProofFileError> { + pub fn write_to(&self, path: &Path, proof: &[u8]) -> Result<()> { let path = self.setup_file_path(path); + let mut file = File::create(&path).map_err(PackageError::io_error_proof_file)?; - let mut file = File::create(&path)?; - file.write_all(proof)?; - + file.write_all(proof).map_err(PackageError::io_error_proof_file)?; tracing::info!("Saving proof... ({:?})", path); Ok(()) @@ -69,13 +70,13 @@ impl ProofFile { /// Removes the proof at the given path if it exists. Returns `true` on success, /// `false` if the file doesn't exist, and `Error` if the file system fails during operation. - pub fn remove(&self, path: &Path) -> Result { + pub fn remove(&self, path: &Path) -> Result { let path = self.setup_file_path(path); if !path.exists() { return Ok(false); } - fs::remove_file(&path).map_err(|_| ProofFileError::FileRemovalError(path.into_owned()))?; + fs::remove_file(&path).map_err(|_| PackageError::failed_to_remove_proof_file(path))?; Ok(true) } diff --git a/package/src/outputs/proving_key.rs b/package/src/outputs/proving_key.rs index 35f054554d..6e52a9094f 100644 --- a/package/src/outputs/proving_key.rs +++ b/package/src/outputs/proving_key.rs @@ -16,7 +16,8 @@ //! The proving key file. -use crate::{errors::ProvingKeyFileError, outputs::OUTPUTS_DIRECTORY_NAME}; +use crate::outputs::OUTPUTS_DIRECTORY_NAME; +use leo_errors::{PackageError, Result}; use serde::Deserialize; use std::{ @@ -52,31 +53,32 @@ impl ProvingKeyFile { } /// Reads the proving key from the given file path if it exists. - pub fn read_from(&self, path: &Path) -> Result, ProvingKeyFileError> { + pub fn read_from(&self, path: &Path) -> Result> { let path = self.setup_file_path(path); - fs::read(&path).map_err(|_| ProvingKeyFileError::FileReadError(path.into_owned())) + let bytes = fs::read(&path).map_err(|_| PackageError::failed_to_read_proving_key_file(path))?; + Ok(bytes) } /// Writes the given proving key to a file. - pub fn write_to<'a>(&self, path: &'a Path, proving_key: &[u8]) -> Result, ProvingKeyFileError> { + pub fn write_to<'a>(&self, path: &'a Path, proving_key: &[u8]) -> Result> { let path = self.setup_file_path(path); + let mut file = File::create(&path).map_err(PackageError::io_error_proving_key_file)?; - let mut file = File::create(&path)?; - file.write_all(proving_key)?; - + file.write_all(proving_key) + .map_err(PackageError::io_error_proving_key_file)?; Ok(path) } /// Removes the proving key at the given path if it exists. Returns `true` on success, /// `false` if the file doesn't exist, and `Error` if the file system fails during operation. - pub fn remove(&self, path: &Path) -> Result { + pub fn remove(&self, path: &Path) -> Result { let path = self.setup_file_path(path); if !path.exists() { return Ok(false); } - fs::remove_file(&path).map_err(|_| ProvingKeyFileError::FileRemovalError(path.into_owned()))?; + fs::remove_file(&path).map_err(|_| PackageError::failed_to_remove_proving_key_file(path))?; Ok(true) } diff --git a/package/src/outputs/verification_key.rs b/package/src/outputs/verification_key.rs index 9acfe62fc4..1f67f999a2 100644 --- a/package/src/outputs/verification_key.rs +++ b/package/src/outputs/verification_key.rs @@ -16,7 +16,8 @@ //! The verification key file. -use crate::{errors::VerificationKeyFileError, outputs::OUTPUTS_DIRECTORY_NAME}; +use crate::outputs::OUTPUTS_DIRECTORY_NAME; +use leo_errors::{PackageError, Result}; use serde::Deserialize; use std::{ @@ -52,35 +53,33 @@ impl VerificationKeyFile { } /// Reads the verification key from the given file path if it exists. - pub fn read_from(&self, path: &Path) -> Result, VerificationKeyFileError> { + pub fn read_from(&self, path: &Path) -> Result> { let path = self.setup_file_path(path); - fs::read(&path).map_err(|_| VerificationKeyFileError::FileReadError(path.into_owned())) + let bytes = + fs::read(&path).map_err(|_| PackageError::failed_to_read_verification_key_file(path.into_owned()))?; + Ok(bytes) } /// Writes the given verification key to a file. - pub fn write_to<'a>( - &self, - path: &'a Path, - verification_key: &[u8], - ) -> Result, VerificationKeyFileError> { + pub fn write_to<'a>(&self, path: &'a Path, verification_key: &[u8]) -> Result> { let path = self.setup_file_path(path); + let mut file = File::create(&path).map_err(PackageError::io_error_verification_key_file)?; - let mut file = File::create(&path)?; - file.write_all(verification_key)?; - + file.write_all(verification_key) + .map_err(PackageError::io_error_verification_key_file)?; Ok(path) } /// Removes the verification key at the given path if it exists. Returns `true` on success, /// `false` if the file doesn't exist, and `Error` if the file system fails during operation. - pub fn remove(&self, path: &Path) -> Result { + pub fn remove(&self, path: &Path) -> Result { let path = self.setup_file_path(path); if !path.exists() { return Ok(false); } - fs::remove_file(&path).map_err(|_| VerificationKeyFileError::FileRemovalError(path.into_owned()))?; + fs::remove_file(&path).map_err(|_| PackageError::failed_to_remove_verification_key_file(path))?; Ok(true) } diff --git a/package/src/package.rs b/package/src/package.rs index 1a6b8273de..9cb628421e 100644 --- a/package/src/package.rs +++ b/package/src/package.rs @@ -15,13 +15,14 @@ // along with the Leo library. If not, see . use crate::{ - errors::PackageError, imports::ImportsDirectory, inputs::{InputFile, InputsDirectory, StateFile}, root::{Gitignore, Manifest, README}, source::{MainFile, SourceDirectory}, }; +use leo_errors::{PackageError, Result}; + use serde::Deserialize; use std::path::Path; @@ -34,10 +35,10 @@ pub struct Package { } impl Package { - pub fn new(package_name: &str) -> Result { + pub fn new(package_name: &str) -> Result { // Check that the package name is valid. if !Self::is_package_name_valid(package_name) { - return Err(PackageError::InvalidPackageName(package_name.to_string())); + return Err(PackageError::invalid_package_name(package_name).into()); } Ok(Self { @@ -182,14 +183,11 @@ impl Package { } /// Creates a package at the given path - pub fn initialize(package_name: &str, path: &Path, author: Option) -> Result<(), PackageError> { + pub fn initialize(package_name: &str, path: &Path, author: Option) -> Result<()> { // First, verify that this directory is not already initialized as a Leo package. { if !Self::can_initialize(package_name, path) { - return Err(PackageError::FailedToInitialize( - package_name.to_owned(), - path.as_os_str().to_owned(), - )); + return Err(PackageError::failed_to_initialize_package(package_name, path.as_os_str()).into()); } } // Next, initialize this directory as a Leo package. @@ -227,10 +225,7 @@ impl Package { // Next, verify that a valid Leo package has been initialized in this directory { if !Self::is_initialized(package_name, path) { - return Err(PackageError::FailedToInitialize( - package_name.to_owned(), - path.as_os_str().to_owned(), - )); + return Err(PackageError::failed_to_initialize_package(package_name, path.as_os_str()).into()); } } @@ -238,8 +233,8 @@ impl Package { } /// Removes the package at the given path - pub fn remove_imported_package(package_name: &str, path: &Path) -> Result<(), PackageError> { - Ok(ImportsDirectory::remove_import(path, package_name)?) + pub fn remove_imported_package(package_name: &str, path: &Path) -> Result<()> { + ImportsDirectory::remove_import(path, package_name) } } diff --git a/package/src/root/gitignore.rs b/package/src/root/gitignore.rs index 756c51be05..ea16afdd6f 100644 --- a/package/src/root/gitignore.rs +++ b/package/src/root/gitignore.rs @@ -16,7 +16,7 @@ //! The `.gitignore` file. -use crate::errors::GitignoreError; +use leo_errors::{PackageError, Result}; use serde::Deserialize; use std::{borrow::Cow, fs::File, io::Write, path::Path}; @@ -39,14 +39,16 @@ impl Gitignore { path.exists() } - pub fn write_to(self, path: &Path) -> Result<(), GitignoreError> { + pub fn write_to(self, path: &Path) -> Result<()> { let mut path = Cow::from(path); if path.is_dir() { path.to_mut().push(GITIGNORE_FILENAME); } - let mut file = File::create(&path)?; - Ok(file.write_all(self.template().as_bytes())?) + let mut file = File::create(&path).map_err(PackageError::io_error_gitignore_file)?; + file.write_all(self.template().as_bytes()) + .map_err(PackageError::io_error_gitignore_file)?; + Ok(()) } fn template(&self) -> String { diff --git a/package/src/root/manifest.rs b/package/src/root/manifest.rs index 9167f402bb..fc08033cff 100644 --- a/package/src/root/manifest.rs +++ b/package/src/root/manifest.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{errors::ManifestError, package::Package}; +use crate::package::Package; +use leo_errors::{PackageError, Result}; use serde::Deserialize; use std::{ @@ -40,7 +41,7 @@ pub struct Manifest { } impl Manifest { - pub fn new(package_name: &str, author: Option) -> Result { + pub fn new(package_name: &str, author: Option) -> Result { Ok(Self { project: Package::new(package_name)?, remote: author.map(|author| Remote { author }), @@ -79,15 +80,18 @@ impl Manifest { self.remote.clone() } - pub fn write_to(self, path: &Path) -> Result<(), ManifestError> { + pub fn write_to(self, path: &Path) -> Result<()> { let mut path = Cow::from(path); if path.is_dir() { path.to_mut().push(MANIFEST_FILENAME); } - let mut file = File::create(&path).map_err(|error| ManifestError::Creating(MANIFEST_FILENAME, error))?; + let mut file = + File::create(&path).map_err(|e| PackageError::failed_to_create_manifest_file(MANIFEST_FILENAME, e))?; + file.write_all(self.template().as_bytes()) - .map_err(|error| ManifestError::Writing(MANIFEST_FILENAME, error)) + .map_err(PackageError::io_error_manifest_file)?; + Ok(()) } fn template(&self) -> String { @@ -113,7 +117,7 @@ author = "{author}" # Add your Aleo Package Manager username or team name. } impl TryFrom<&Path> for Manifest { - type Error = ManifestError; + type Error = PackageError; fn try_from(path: &Path) -> Result { let mut path = Cow::from(path); @@ -121,15 +125,18 @@ impl TryFrom<&Path> for Manifest { path.to_mut().push(MANIFEST_FILENAME); } - let mut file = File::open(path.clone()).map_err(|error| ManifestError::Opening(MANIFEST_FILENAME, error))?; + let mut file = + File::open(path.clone()).map_err(|e| PackageError::failed_to_open_manifest_file(MANIFEST_FILENAME, e))?; + let size = file .metadata() - .map_err(|error| ManifestError::Metadata(MANIFEST_FILENAME, error))? + .map_err(|e| PackageError::failed_to_get_manifest_metadata_file(MANIFEST_FILENAME, e))? .len() as usize; let mut buffer = String::with_capacity(size); + file.read_to_string(&mut buffer) - .map_err(|error| ManifestError::Reading(MANIFEST_FILENAME, error))?; + .map_err(|e| PackageError::failed_to_read_manifest_file(MANIFEST_FILENAME, e))?; // Determine if the old remote format is being used, and update to new convention @@ -215,12 +222,14 @@ author = "{author}" // Rewrite the toml file if it has been updated if buffer != refactored_toml { - let mut file = File::create(&path).map_err(|error| ManifestError::Creating(MANIFEST_FILENAME, error))?; + let mut file = + File::create(&path).map_err(|e| PackageError::failed_to_create_manifest_file(MANIFEST_FILENAME, e))?; + file.write_all(refactored_toml.as_bytes()) - .map_err(|error| ManifestError::Writing(MANIFEST_FILENAME, error))?; + .map_err(|e| PackageError::failed_to_write_manifest_file(MANIFEST_FILENAME, e))?; } // Read the toml file - toml::from_str(&final_toml).map_err(|error| ManifestError::Parsing(MANIFEST_FILENAME, error)) + toml::from_str(&final_toml).map_err(|e| PackageError::failed_to_parse_manifest_file(MANIFEST_FILENAME, e)) } } diff --git a/package/src/root/readme.rs b/package/src/root/readme.rs index ad4d6190f2..351d3efd51 100644 --- a/package/src/root/readme.rs +++ b/package/src/root/readme.rs @@ -17,7 +17,7 @@ //! The `README.md` file. -use crate::errors::READMEError; +use leo_errors::{PackageError, Result}; use serde::Deserialize; use std::{borrow::Cow, fs::File, io::Write, path::Path}; @@ -48,14 +48,17 @@ impl README { path.exists() } - pub fn write_to(self, path: &Path) -> Result<(), READMEError> { + pub fn write_to(self, path: &Path) -> Result<()> { let mut path = Cow::from(path); if path.is_dir() { path.to_mut().push(README_FILENAME); } - let mut file = File::create(&path)?; - Ok(file.write_all(self.template().as_bytes())?) + let mut file = File::create(&path).map_err(PackageError::io_error_readme_file)?; + + file.write_all(self.template().as_bytes()) + .map_err(PackageError::io_error_readme_file)?; + Ok(()) } fn template(&self) -> String { diff --git a/package/src/root/zip.rs b/package/src/root/zip.rs index 13a4336a65..bf95a9aaf7 100644 --- a/package/src/root/zip.rs +++ b/package/src/root/zip.rs @@ -17,7 +17,6 @@ //! The program package zip file. use crate::{ - errors::ZipFileError, imports::IMPORTS_DIRECTORY_NAME, inputs::{INPUTS_DIRECTORY_NAME, INPUT_FILE_EXTENSION, STATE_FILE_EXTENSION}, outputs::{ @@ -27,6 +26,7 @@ use crate::{ root::{MANIFEST_FILENAME, README_FILENAME}, source::{SOURCE_DIRECTORY_NAME, SOURCE_FILE_EXTENSION}, }; +use leo_errors::{PackageError, Result}; use serde::Deserialize; use std::{ @@ -64,21 +64,21 @@ impl ZipFile { } // /// Reads the program bytes from the given file path if it exists. - // pub fn read_from(&self, path: &Path) -> Result, ZipFileError> { + // pub fn read_from(&self, path: &Path) -> Result> { // let path = self.setup_file_path(path); // - // Ok(fs::read(&path).map_err(|_| ZipFileError::FileReadError(path.clone()))?) + // Ok(fs::read(&path).map_err(|_| PackageError::FileReadError(path.clone()))?) // } /// Writes the current package contents to a zip file. - pub fn write(&self, src_dir: &Path) -> Result<(), ZipFileError> { + pub fn write(&self, src_dir: &Path) -> Result<()> { // Build walkdir iterator from current package let walkdir = WalkDir::new(src_dir); // Create zip file let path = self.setup_file_path(src_dir); - let file = &mut File::create(&path)?; + let file = File::create(&path).map_err(PackageError::failed_to_create_zip_file)?; let mut zip = ZipWriter::new(file); let options = FileOptions::default() .compression_method(zip::CompressionMethod::Stored) @@ -102,22 +102,27 @@ impl ZipFile { if path.is_file() { tracing::info!("Adding file {:?} as {:?}", path, name); #[allow(deprecated)] - zip.start_file_from_path(name, options)?; - let mut f = File::open(path)?; + zip.start_file_from_path(name, options) + .map_err(PackageError::io_error_zip_file)?; + + let mut f = File::open(path).map_err(PackageError::failed_to_open_zip_file)?; + f.read_to_end(&mut buffer) + .map_err(PackageError::failed_to_read_zip_file)?; + zip.write_all(&*buffer) + .map_err(PackageError::failed_to_write_zip_file)?; - f.read_to_end(&mut buffer)?; - zip.write_all(&*buffer)?; buffer.clear(); } else if !name.as_os_str().is_empty() { // Only if not root Avoids path spec / warning // and mapname conversion failed error on unzip tracing::info!("Adding directory {:?} as {:?}", path, name); #[allow(deprecated)] - zip.add_directory_from_path(name, options)?; + zip.add_directory_from_path(name, options) + .map_err(PackageError::io_error_zip_file)?; } } - zip.finish()?; + zip.finish().map_err(PackageError::io_error_zip_file)?; tracing::info!("Package zip file created successfully {:?}", path); @@ -126,13 +131,13 @@ impl ZipFile { /// Removes the zip file at the given path if it exists. Returns `true` on success, /// `false` if the file doesn't exist, and `Error` if the file system fails during operation. - pub fn remove(&self, path: &Path) -> Result { + pub fn remove(&self, path: &Path) -> Result { let path = self.setup_file_path(path); if !path.exists() { return Ok(false); } - fs::remove_file(&path).map_err(|_| ZipFileError::FileRemovalError(path.into_owned()))?; + fs::remove_file(&path).map_err(|_| PackageError::failed_to_remove_zip_file(path))?; Ok(true) } diff --git a/package/src/source/directory.rs b/package/src/source/directory.rs index 5764f972df..692f0261e4 100644 --- a/package/src/source/directory.rs +++ b/package/src/source/directory.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::errors::SourceDirectoryError; +use leo_errors::{PackageError, Result}; use std::{ borrow::Cow, @@ -30,46 +30,46 @@ pub struct SourceDirectory; impl SourceDirectory { /// Creates a directory at the provided path with the default directory name. - pub fn create(path: &Path) -> Result<(), SourceDirectoryError> { + pub fn create(path: &Path) -> Result<()> { let mut path = Cow::from(path); if path.is_dir() && !path.ends_with(SOURCE_DIRECTORY_NAME) { path.to_mut().push(SOURCE_DIRECTORY_NAME); } - fs::create_dir_all(&path).map_err(SourceDirectoryError::Creating) + fs::create_dir_all(&path).map_err(PackageError::failed_to_create_source_directory)?; + Ok(()) } /// Returns a list of files in the source directory. - pub fn files(path: &Path) -> Result, SourceDirectoryError> { + pub fn files(path: &Path) -> Result> { let mut path = Cow::from(path); path.to_mut().push(SOURCE_DIRECTORY_NAME); - let directory = fs::read_dir(&path).map_err(SourceDirectoryError::Reading)?; + + let directory = fs::read_dir(&path).map_err(PackageError::failed_to_read_inputs_directory)?; let mut file_paths = Vec::new(); for file_entry in directory.into_iter() { - let file_entry = file_entry.map_err(SourceDirectoryError::GettingFileEntry)?; + let file_entry = file_entry.map_err(PackageError::failed_to_get_source_file_entry)?; let file_path = file_entry.path(); // Verify that the entry is structured as a valid file let file_type = file_entry .file_type() - .map_err(|error| SourceDirectoryError::GettingFileType(file_path.as_os_str().to_owned(), error))?; + .map_err(|e| PackageError::failed_to_get_source_file_type(file_path.as_os_str().to_owned(), e))?; if !file_type.is_file() { - return Err(SourceDirectoryError::InvalidFileType( - file_path.as_os_str().to_owned(), - file_type, - )); + return Err(PackageError::invalid_source_file_type(file_path.as_os_str().to_owned(), file_type).into()); } // Verify that the file has the default file extension let file_extension = file_path .extension() - .ok_or_else(|| SourceDirectoryError::GettingFileExtension(file_path.as_os_str().to_owned()))?; + .ok_or_else(|| PackageError::failed_to_get_source_file_extension(file_path.as_os_str().to_owned()))?; if file_extension != SOURCE_FILE_EXTENSION.trim_start_matches('.') { - return Err(SourceDirectoryError::InvalidFileExtension( + return Err(PackageError::invalid_source_file_extension( file_path.as_os_str().to_owned(), file_extension.to_owned(), - )); + ) + .into()); } file_paths.push(file_path); diff --git a/package/src/source/main.rs b/package/src/source/main.rs index 842c85c7eb..479c669e7d 100644 --- a/package/src/source/main.rs +++ b/package/src/source/main.rs @@ -16,7 +16,8 @@ //! The `main.leo` file. -use crate::{errors::MainFileError, source::directory::SOURCE_DIRECTORY_NAME}; +use crate::source::directory::SOURCE_DIRECTORY_NAME; +use leo_errors::{PackageError, Result}; use serde::Deserialize; use std::{borrow::Cow, fs::File, io::Write, path::Path}; @@ -50,7 +51,7 @@ impl MainFile { path.exists() } - pub fn write_to(self, path: &Path) -> Result<(), MainFileError> { + pub fn write_to(self, path: &Path) -> Result<()> { let mut path = Cow::from(path); if path.is_dir() { if !path.ends_with(SOURCE_DIRECTORY_NAME) { @@ -59,8 +60,10 @@ impl MainFile { path.to_mut().push(MAIN_FILENAME); } - let mut file = File::create(&path)?; - Ok(file.write_all(self.template().as_bytes())?) + let mut file = File::create(&path).map_err(PackageError::io_error_main_file)?; + Ok(file + .write_all(self.template().as_bytes()) + .map_err(PackageError::io_error_main_file)?) } fn template(&self) -> String { diff --git a/parser/Cargo.toml b/parser/Cargo.toml index 10529e693a..f32cab30ec 100644 --- a/parser/Cargo.toml +++ b/parser/Cargo.toml @@ -26,6 +26,10 @@ harness = false path = "../ast" version = "1.5.3" +[dependencies.leo-errors] +path = "../errors" +version = "1.5.3" + [dependencies.lazy_static] version = "1.3.0" @@ -33,12 +37,6 @@ version = "1.3.0" version = "1.0" features = [ "derive" ] -[dependencies.serde_json] -version = "1.0" - -[dependencies.thiserror] -version = "1.0" - [dependencies.tracing] version = "0.1" @@ -51,6 +49,9 @@ version = "0.4" [dev-dependencies.criterion] version = "0.3" +[dev-dependencies.serde_json] +version = "1.0" + [dev-dependencies.serde_yaml] version = "0.8" diff --git a/parser/examples/parser.rs b/parser/examples/parser.rs index 2c7788f49c..04cb943625 100644 --- a/parser/examples/parser.rs +++ b/parser/examples/parser.rs @@ -15,10 +15,10 @@ // along with the Leo library. If not, see . use leo_ast::Ast; -use leo_parser::errors::SyntaxError; +use leo_errors::Result; use std::{env, fs, path::Path}; -fn to_leo_tree(filepath: &Path) -> Result { +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"); @@ -31,7 +31,7 @@ fn to_leo_tree(filepath: &Path) -> Result { Ok(serialized_leo_ast) } -fn main() -> Result<(), SyntaxError> { +fn main() -> Result<()> { // Parse the command-line arguments as strings. let cli_arguments = env::args().collect::>(); diff --git a/parser/src/errors/mod.rs b/parser/src/errors/mod.rs index 6138a74a98..ff53f73aae 100644 --- a/parser/src/errors/mod.rs +++ b/parser/src/errors/mod.rs @@ -13,12 +13,3 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . - -pub mod token; -pub use token::*; - -pub mod syntax; -pub use syntax::*; - -pub mod deprecated; -pub use deprecated::*; diff --git a/parser/src/errors/token.rs b/parser/src/errors/token.rs index 2b9beca504..ec07fbe4ba 100644 --- a/parser/src/errors/token.rs +++ b/parser/src/errors/token.rs @@ -3,7 +3,7 @@ // 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 +o// 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, diff --git a/parser/src/lib.rs b/parser/src/lib.rs index b896eee0b8..7b1a0d83aa 100644 --- a/parser/src/lib.rs +++ b/parser/src/lib.rs @@ -20,26 +20,22 @@ //! method to create a new program ast. #![allow(clippy::vec_init_then_push)] - -#[macro_use] -extern crate thiserror; +#![doc = include_str!("../README.md")] pub(crate) mod tokenizer; pub use tokenizer::KEYWORD_TOKENS; pub(crate) use tokenizer::*; -pub mod errors; -pub use errors::*; - pub mod parser; pub use parser::*; use leo_ast::Ast; +use leo_errors::Result; #[cfg(test)] mod test; /// Creates a new AST from a given file path and source code text. -pub fn parse_ast, Y: AsRef>(path: T, source: Y) -> SyntaxResult { +pub fn parse_ast, Y: AsRef>(path: T, source: Y) -> Result { Ok(Ast::new(parser::parse(path.as_ref(), source.as_ref())?)) } diff --git a/parser/src/parser/context.rs b/parser/src/parser/context.rs index c83cf2a4dd..af64bd9c43 100644 --- a/parser/src/parser/context.rs +++ b/parser/src/parser/context.rs @@ -16,8 +16,9 @@ use std::{borrow::Cow, unimplemented}; -use crate::{assert_no_whitespace, tokenizer::*, SyntaxError, SyntaxResult, Token, KEYWORD_TOKENS}; +use crate::{assert_no_whitespace, tokenizer::*, Token, KEYWORD_TOKENS}; use leo_ast::*; +use leo_errors::{LeoError, ParserError, Result, Span}; use tendril::format_tendril; /// Stores a program in tokenized format plus additional context. @@ -62,21 +63,21 @@ impl ParserContext { /// /// Returns an unexpected end of function [`SyntaxError`]. /// - pub fn eof(&self) -> SyntaxError { - SyntaxError::unexpected_eof(&self.end_span) + pub fn eof(&self) -> LeoError { + ParserError::unexpected_eof(&self.end_span).into() } /// /// Returns a reference to the next next token or error if it does not exist. /// - pub fn peek_next(&self) -> SyntaxResult<&SpannedToken> { + pub fn peek_next(&self) -> Result<&SpannedToken> { self.tokens.get(self.tokens.len() - 2).ok_or_else(|| self.eof()) } /// /// Returns a reference to the next token or error if it does not exist. /// - pub fn peek(&self) -> SyntaxResult<&SpannedToken> { + pub fn peek(&self) -> Result<&SpannedToken> { self.tokens.last().ok_or_else(|| self.eof()) } @@ -88,7 +89,7 @@ impl ParserContext { .unwrap_or_else(|| Cow::Owned(Token::Eof)) } - // pub fn peek_oneof(&self, token: &[Token]) -> SyntaxResult<&SpannedToken> { + // pub fn peek_oneof(&self, token: &[Token]) -> Result<&SpannedToken> { // if let Some(spanned_token) = self.inner.last() { // if token.iter().any(|x| x == &spanned_token.token) { // Ok(spanned_token) @@ -189,7 +190,7 @@ impl ParserContext { /// Removes the next two tokens if they are a pair of [`GroupCoordinate`] and returns them, /// or [None] if the next token is not a [`GroupCoordinate`]. /// - pub fn eat_group_partial(&mut self) -> Option> { + pub fn eat_group_partial(&mut self) -> Option> { let mut i = self.tokens.len(); if i < 1 { return None; @@ -294,12 +295,12 @@ impl ParserContext { /// /// Returns the span of the next token if it is equal to the given [`Token`], or error. /// - pub fn expect(&mut self, token: Token) -> SyntaxResult { + pub fn expect(&mut self, token: Token) -> Result { if let Some(SpannedToken { token: inner, span }) = self.tokens.last() { if &token == inner { Ok(self.tokens.pop().unwrap().span) } else { - Err(SyntaxError::unexpected(inner, &[token], span)) + Err(ParserError::unexpected(inner, token, span).into()) } } else { Err(self.eof()) @@ -309,12 +310,17 @@ impl ParserContext { /// /// Returns the span of the next token if it is equal to one of the given [`Token`]s, or error. /// - pub fn expect_oneof(&mut self, token: &[Token]) -> SyntaxResult { + pub fn expect_oneof(&mut self, token: &[Token]) -> Result { if let Some(SpannedToken { token: inner, span }) = self.tokens.last() { if token.iter().any(|x| x == inner) { Ok(self.tokens.pop().unwrap()) } else { - Err(SyntaxError::unexpected(inner, token, span)) + return Err(ParserError::unexpected( + inner, + token.iter().map(|x| format!("'{}'", x)).collect::>().join(", "), + span, + ) + .into()); } } else { Err(self.eof()) @@ -325,7 +331,7 @@ impl ParserContext { /// Returns the [`Identifier`] of the next token if it is a keyword, /// [`Token::Int(_)`], or an [`Identifier`], or error. /// - pub fn expect_loose_identifier(&mut self) -> SyntaxResult { + pub fn expect_loose_identifier(&mut self) -> Result { if let Some(token) = self.eat_any(KEYWORD_TOKENS) { return Ok(Identifier { name: token.token.to_string().into(), @@ -341,7 +347,7 @@ impl ParserContext { /// /// Returns the [`Identifier`] of the next token if it is an [`Identifier`], or error. /// - pub fn expect_ident(&mut self) -> SyntaxResult { + pub fn expect_ident(&mut self) -> Result { if let Some(SpannedToken { token: inner, span }) = self.tokens.last() { if let Token::Ident(_) = inner { let token = self.tokens.pop().unwrap(); @@ -355,7 +361,7 @@ impl ParserContext { unimplemented!() } } else { - Err(SyntaxError::unexpected_str(inner, "ident", span)) + Err(ParserError::unexpected_str(inner, "ident", span).into()) } } else { Err(self.eof()) @@ -365,7 +371,7 @@ impl ParserContext { /// /// Returns the next token if it exists or return end of function. /// - pub fn expect_any(&mut self) -> SyntaxResult { + pub fn expect_any(&mut self) -> Result { if let Some(x) = self.tokens.pop() { Ok(x) } else { diff --git a/parser/src/parser/expression.rs b/parser/src/parser/expression.rs index 789ecaf9de..d257da3718 100644 --- a/parser/src/parser/expression.rs +++ b/parser/src/parser/expression.rs @@ -16,6 +16,8 @@ use tendril::format_tendril; +use leo_errors::{ParserError, Result}; + use super::*; const INT_TYPES: &[Token] = &[ @@ -38,7 +40,7 @@ impl ParserContext { /// Returns an [`Expression`] AST node if the next token is an expression. /// Includes circuit init expressions. /// - pub fn parse_expression(&mut self) -> SyntaxResult { + pub fn parse_expression(&mut self) -> Result { // Store current parser state. let prior_fuzzy_state = self.fuzzy_struct_state; @@ -60,7 +62,7 @@ impl ParserContext { /// /// Otherwise, tries to parse the next token using [`parse_disjunctive_expression`]. /// - pub fn parse_conditional_expression(&mut self) -> SyntaxResult { + pub fn parse_conditional_expression(&mut self) -> Result { // Try to parse the next expression. Try BinaryOperation::Or. let mut expr = self.parse_disjunctive_expression()?; @@ -85,7 +87,7 @@ impl ParserContext { /// /// Otherwise, tries to parse the next token using [`parse_conjunctive_expression`]. /// - pub fn parse_disjunctive_expression(&mut self) -> SyntaxResult { + pub fn parse_disjunctive_expression(&mut self) -> Result { let mut expr = self.parse_conjunctive_expression()?; while self.eat(Token::Or).is_some() { let right = self.parse_conjunctive_expression()?; @@ -105,7 +107,7 @@ impl ParserContext { /// /// Otherwise, tries to parse the next token using [`parse_bit_or_expression`]. /// - pub fn parse_conjunctive_expression(&mut self) -> SyntaxResult { + pub fn parse_conjunctive_expression(&mut self) -> Result { let mut expr = self.parse_equality_expression()?; while self.eat(Token::And).is_some() { let right = self.parse_equality_expression()?; @@ -125,7 +127,7 @@ impl ParserContext { /// /// Otherwise, tries to parse the next token using [`parse_bit_xor_expression`]. /// - // pub fn parse_bit_or_expression(&mut self) -> SyntaxResult { + // pub fn parse_bit_or_expression(&mut self) -> Result { // let mut expr = self.parse_bit_xor_expression()?; // while self.eat(Token::BitOr).is_some() { // let right = self.parse_bit_xor_expression()?; @@ -145,7 +147,7 @@ impl ParserContext { /// /// Otherwise, tries to parse the next token using [`parse_bit_and_expression`]. /// - // pub fn parse_bit_xor_expression(&mut self) -> SyntaxResult { + // pub fn parse_bit_xor_expression(&mut self) -> Result { // let mut expr = self.parse_bit_and_expression()?; // while self.eat(Token::BitXor).is_some() { // let right = self.parse_bit_and_expression()?; @@ -165,7 +167,7 @@ impl ParserContext { /// /// Otherwise, tries to parse the next token using [`parse_equality_expression`]. /// - // pub fn parse_bit_and_expression(&mut self) -> SyntaxResult { + // pub fn parse_bit_and_expression(&mut self) -> Result { // let mut expr = self.parse_equality_expression()?; // while self.eat(Token::BitAnd).is_some() { // let right = self.parse_equality_expression()?; @@ -185,7 +187,7 @@ impl ParserContext { /// /// Otherwise, tries to parse the next token using [`parse_ordering_expression`]. /// - pub fn parse_equality_expression(&mut self) -> SyntaxResult { + pub fn parse_equality_expression(&mut self) -> Result { let mut expr = self.parse_ordering_expression()?; if let Some(SpannedToken { token: op, .. }) = self.eat_any(&[Token::Eq, Token::NotEq]) { let right = self.parse_ordering_expression()?; @@ -209,7 +211,7 @@ impl ParserContext { /// /// Otherwise, tries to parse the next token using [`parse_shift_expression`]. /// - pub fn parse_ordering_expression(&mut self) -> SyntaxResult { + pub fn parse_ordering_expression(&mut self) -> Result { let mut expr = self.parse_additive_expression()?; while let Some(SpannedToken { token: op, .. }) = self.eat_any(&[Token::Lt, Token::LtEq, Token::Gt, Token::GtEq]) { @@ -236,7 +238,7 @@ impl ParserContext { /// /// Otherwise, tries to parse the next token using [`parse_additive_expression`]. /// - // pub fn parse_shift_expression(&mut self) -> SyntaxResult { + // pub fn parse_shift_expression(&mut self) -> Result { // let mut expr = self.parse_additive_expression()?; // while let Some(SpannedToken { token: op, .. }) = self.eat_any(&[Token::Shl, Token::Shr, Token::ShrSigned]) { // let right = self.parse_additive_expression()?; @@ -261,7 +263,7 @@ impl ParserContext { /// /// Otherwise, tries to parse the next token using [`parse_mul_div_pow_expression`]. /// - pub fn parse_additive_expression(&mut self) -> SyntaxResult { + pub fn parse_additive_expression(&mut self) -> Result { let mut expr = self.parse_multiplicative_expression()?; while let Some(SpannedToken { token: op, .. }) = self.eat_any(&[Token::Add, Token::Minus]) { let right = self.parse_multiplicative_expression()?; @@ -285,7 +287,7 @@ impl ParserContext { /// /// Otherwise, tries to parse the next token using [`parse_exponential_expression`]. /// - pub fn parse_multiplicative_expression(&mut self) -> SyntaxResult { + pub fn parse_multiplicative_expression(&mut self) -> Result { let mut expr = self.parse_exponential_expression()?; while let Some(SpannedToken { token: op, .. }) = self.eat_any(&[Token::Mul, Token::Div]) { let right = self.parse_exponential_expression()?; @@ -310,7 +312,7 @@ impl ParserContext { /// /// Otherwise, tries to parse the next token using [`parse_cast_expression`]. /// - pub fn parse_exponential_expression(&mut self) -> SyntaxResult { + pub fn parse_exponential_expression(&mut self) -> Result { let mut exprs = vec![self.parse_cast_expression()?]; while self.eat(Token::Exp).is_some() { exprs.push(self.parse_cast_expression()?); @@ -334,7 +336,7 @@ impl ParserContext { /// /// Otherwise, tries to parse the next token using [`parse_unary_expression`]. /// - pub fn parse_cast_expression(&mut self) -> SyntaxResult { + pub fn parse_cast_expression(&mut self) -> Result { let mut expr = self.parse_unary_expression()?; while self.eat(Token::As).is_some() { let (type_, type_span) = self.parse_type()?; @@ -353,7 +355,7 @@ impl ParserContext { /// /// Otherwise, tries to parse the next token using [`parse_postfix_expression`]. /// - pub fn parse_unary_expression(&mut self) -> SyntaxResult { + pub fn parse_unary_expression(&mut self) -> Result { let mut ops = Vec::new(); while let Some(token) = self.eat_any(&[Token::Not, Token::Minus]) { ops.push(token); @@ -398,7 +400,7 @@ impl ParserContext { /// /// Otherwise, tries to parse the next token using [`parse_primary_expression`]. /// - pub fn parse_postfix_expression(&mut self) -> SyntaxResult { + pub fn parse_postfix_expression(&mut self) -> Result { let mut expr = self.parse_primary_expression()?; while let Some(token) = self.eat_any(&[Token::LeftSquare, Token::Dot, Token::LeftParen, Token::DoubleColon]) { match token.token { @@ -459,7 +461,7 @@ impl ParserContext { }); } else { let next = self.peek()?; - return Err(SyntaxError::unexpected_str(&next.token, "int or ident", &next.span)); + return Err(ParserError::unexpected_str(&next.token, "int or ident", &next.span).into()); } } Token::LeftParen => { @@ -503,7 +505,7 @@ impl ParserContext { /// /// This method should only be called in the context of an array access expression. /// - pub fn parse_spread_or_expression(&mut self) -> SyntaxResult { + pub fn parse_spread_or_expression(&mut self) -> Result { Ok(if self.eat(Token::DotDotDot).is_some() { SpreadOrExpression::Spread(self.parse_expression()?) } else { @@ -515,7 +517,7 @@ impl ParserContext { /// Returns an [`Expression`] AST node if the next tokens represent an /// circuit initialization expression. /// - pub fn parse_circuit_expression(&mut self, identifier: Identifier) -> SyntaxResult { + pub fn parse_circuit_expression(&mut self, identifier: Identifier) -> Result { self.expect(Token::LeftCurly)?; let mut members = Vec::new(); let end_span; @@ -553,7 +555,7 @@ impl ParserContext { /// Returns an [`Expression`] AST node if the next tokens represent an /// tuple initialization expression. /// - pub fn parse_tuple_expression(&mut self, span: &Span) -> SyntaxResult { + pub fn parse_tuple_expression(&mut self, span: &Span) -> Result { if let Some((left, right, span)) = self.eat_group_partial().transpose()? { return Ok(Expression::Value(ValueExpression::Group(Box::new(GroupValue::Tuple( GroupTuple { @@ -592,7 +594,7 @@ impl ParserContext { /// Returns an [`Expression`] AST node if the next tokens represent an /// array initialization expression. /// - pub fn parse_array_expression(&mut self, span: &Span) -> SyntaxResult { + pub fn parse_array_expression(&mut self, span: &Span) -> Result { if let Some(end) = self.eat(Token::RightSquare) { return Ok(Expression::ArrayInline(ArrayInlineExpression { elements: Vec::new(), @@ -606,7 +608,7 @@ impl ParserContext { let first = match first { SpreadOrExpression::Spread(first) => { let span = span + first.span(); - return Err(SyntaxError::spread_in_array_init(&span)); + return Err(ParserError::spread_in_array_init(&span).into()); } SpreadOrExpression::Expression(x) => x, }; @@ -652,7 +654,7 @@ impl ParserContext { /// /// Returns an expression error if the token cannot be matched. /// - pub fn parse_primary_expression(&mut self) -> SyntaxResult { + pub fn parse_primary_expression(&mut self) -> Result { let SpannedToken { token, span } = self.expect_any()?; Ok(match token { Token::Int(value) => { @@ -723,7 +725,7 @@ impl ParserContext { Expression::Identifier(ident) } token => { - return Err(SyntaxError::unexpected_str(&token, "expression", &span)); + return Err(ParserError::unexpected_str(token, "expression", &span).into()); } }) } diff --git a/parser/src/parser/file.rs b/parser/src/parser/file.rs index 289167e58f..02f6a7f103 100644 --- a/parser/src/parser/file.rs +++ b/parser/src/parser/file.rs @@ -16,6 +16,8 @@ use tendril::format_tendril; +use leo_errors::{ParserError, Result}; + use crate::KEYWORD_TOKENS; use super::*; @@ -24,7 +26,7 @@ impl ParserContext { /// /// Returns a [`Program`] AST if all tokens can be consumed and represent a valid Leo program. /// - pub fn parse_program(&mut self) -> SyntaxResult { + pub fn parse_program(&mut self) -> Result { let mut imports = Vec::new(); let mut circuits = IndexMap::new(); let mut functions = IndexMap::new(); @@ -46,9 +48,7 @@ impl ParserContext { functions.insert(id, function); } Token::Ident(ident) if ident.as_ref() == "test" => { - return Err(SyntaxError::DeprecatedError(DeprecatedError::test_function( - &token.span, - ))); + return Err(ParserError::test_function(&token.span).into()); // self.expect(Token::Test)?; // let (id, function) = self.parse_function_declaration()?; // tests.insert(id, TestFunction { @@ -61,17 +61,22 @@ impl ParserContext { global_consts.insert(name, global_const); } _ => { - return Err(SyntaxError::unexpected( + return Err(ParserError::unexpected( &token.token, - &[ + [ Token::Import, Token::Circuit, Token::Function, Token::Ident("test".into()), Token::At, - ], + ] + .iter() + .map(|x| format!("'{}'", x)) + .collect::>() + .join(", "), &token.span, - )); + ) + .into()); } } } @@ -88,13 +93,11 @@ impl ParserContext { /// /// Returns an [`Annotation`] AST node if the next tokens represent a supported annotation. /// - pub fn parse_annotation(&mut self) -> SyntaxResult { + pub fn parse_annotation(&mut self) -> Result { let start = self.expect(Token::At)?; let name = self.expect_ident()?; if name.name.as_ref() == "context" { - return Err(SyntaxError::DeprecatedError(DeprecatedError::context_annotation( - &name.span, - ))); + return Err(ParserError::context_annotation(&name.span).into()); } assert_no_whitespace(&start, &name.span, &name.name, "@")?; @@ -106,11 +109,16 @@ impl ParserContext { loop { if let Some(end) = self.eat(Token::RightParen) { if comma { - return Err(SyntaxError::unexpected( - &Token::RightParen, - &[Token::Ident("identifier".into()), Token::Int("number".into())], + return Err(ParserError::unexpected( + Token::RightParen, + [Token::Ident("identifier".into()), Token::Int("number".into())] + .iter() + .map(|x| format!("'{}'", x)) + .collect::>() + .join(", "), &end.span, - )); + ) + .into()); } end_span = end.span; break; @@ -122,7 +130,7 @@ impl ParserContext { args.push(int.value); } else { let token = self.peek()?; - return Err(SyntaxError::unexpected_str(&token.token, "ident or int", &token.span)); + return Err(ParserError::unexpected_str(&token.token, "ident or int", &token.span).into()); } if self.eat(Token::Comma).is_none() && !comma { end_span = self.expect(Token::RightParen)?; @@ -146,7 +154,7 @@ impl ParserContext { /// Returns a vector of [`PackageAccess`] AST nodes if the next tokens represent package access /// expressions within an import statement. /// - pub fn parse_package_accesses(&mut self, span: &Span) -> SyntaxResult> { + pub fn parse_package_accesses(&mut self, span: &Span) -> Result> { let mut out = Vec::new(); self.expect(Token::LeftParen)?; while self.eat(Token::RightParen).is_none() { @@ -159,7 +167,7 @@ impl ParserContext { } if out.is_empty() { - return Err(SyntaxError::invalid_import_list(span)); + return Err(ParserError::invalid_import_list(span).into()); } Ok(out) @@ -169,7 +177,7 @@ impl ParserContext { /// Returns a [`PackageAccess`] AST node if the next tokens represent a package access expression /// within an import statement. /// - pub fn parse_package_access(&mut self) -> SyntaxResult { + pub fn parse_package_access(&mut self) -> Result { if let Some(SpannedToken { span, .. }) = self.eat(Token::Mul) { Ok(PackageAccess::Star { span }) } else { @@ -214,7 +222,7 @@ impl ParserContext { /// /// Returns an [`Identifier`] AST node if the next tokens represent a valid package name. /// - pub fn parse_package_name(&mut self) -> SyntaxResult { + 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()?; @@ -249,7 +257,7 @@ impl ParserContext { // Return an error if the package name contains a keyword. if let Some(token) = KEYWORD_TOKENS.iter().find(|x| x.to_string() == base.name.as_ref()) { - return Err(SyntaxError::unexpected_str(token, "package name", &base.span)); + return Err(ParserError::unexpected_str(token, "package name", &base.span).into()); } // Return an error if the package name contains invalid characters. @@ -258,7 +266,7 @@ impl ParserContext { .chars() .all(|x| x.is_ascii_lowercase() || x.is_ascii_digit() || x == '-' || x == '_') { - return Err(SyntaxError::invalid_package_name(&base.span)); + return Err(ParserError::invalid_package_name(&base.span).into()); } // Return the package name. @@ -269,7 +277,7 @@ impl ParserContext { /// Returns a [`PackageOrPackages`] AST node if the next tokens represent a valid package import /// with accesses. /// - pub fn parse_package_path(&mut self) -> SyntaxResult { + pub fn parse_package_path(&mut self) -> Result { let package_name = self.parse_package_name()?; self.expect(Token::Dot)?; if self.peek()?.token == Token::LeftParen { @@ -292,7 +300,7 @@ impl ParserContext { /// /// Returns a [`ImportStatement`] AST node if the next tokens represent an import statement. /// - pub fn parse_import(&mut self) -> SyntaxResult { + pub fn parse_import(&mut self) -> Result { self.expect(Token::Import)?; let package_or_packages = self.parse_package_path()?; self.expect(Token::Semicolon)?; @@ -306,7 +314,7 @@ impl ParserContext { /// Returns a [`CircuitMember`] AST node if the next tokens represent a circuit member variable /// or circuit member function. /// - pub fn parse_circuit_declaration(&mut self) -> SyntaxResult> { + pub fn parse_circuit_declaration(&mut self) -> Result> { let mut members = Vec::new(); let peeked = &self.peek()?.token; let mut last_variable = peeked == &Token::Function || peeked == &Token::At; @@ -320,14 +328,14 @@ impl ParserContext { let peeked = &self.peek()?; if peeked.token == Token::Semicolon { if commas { - return Err(SyntaxError::mixed_commas_and_semicolons(&peeked.span)); + return Err(ParserError::mixed_commas_and_semicolons(&peeked.span).into()); } semi_colons = true; self.expect(Token::Semicolon)?; } else { if semi_colons { - return Err(SyntaxError::mixed_commas_and_semicolons(&peeked.span)); + return Err(ParserError::mixed_commas_and_semicolons(&peeked.span).into()); } commas = true; @@ -349,7 +357,7 @@ impl ParserContext { /// /// Returns a [`CircuitMember`] AST node if the next tokens represent a circuit member variable. /// - pub fn parse_member_variable_declaration(&mut self) -> SyntaxResult<(CircuitMember, bool)> { + pub fn parse_member_variable_declaration(&mut self) -> Result<(CircuitMember, bool)> { let name = self.expect_ident()?; self.expect(Token::Colon)?; let type_ = self.parse_type()?.0; @@ -370,18 +378,22 @@ impl ParserContext { /// /// Returns a [`CircuitMember`] AST node if the next tokens represent a circuit member function. /// - pub fn parse_member_function_declaration(&mut self) -> SyntaxResult { - let peeked = &self.peek()?; - let peeked_token = &peeked.token; - if peeked_token == &Token::Function || peeked_token == &Token::At { + pub fn parse_member_function_declaration(&mut self) -> Result { + let peeked = self.peek()?.clone(); + if peeked.token == Token::Function || peeked.token == Token::At { let function = self.parse_function_declaration()?; Ok(CircuitMember::CircuitFunction(function.1)) } else { - Err(SyntaxError::unexpected( - peeked_token, - &[Token::Function, Token::At], + return Err(ParserError::unexpected( + &peeked.token, + [Token::Function, Token::At] + .iter() + .map(|x| format!("'{}'", x)) + .collect::>() + .join(", "), &peeked.span, - )) + ) + .into()); } } @@ -389,7 +401,7 @@ impl ParserContext { /// Returns an [`(Identifier, Circuit)`] tuple of AST nodes if the next tokens represent a /// circuit name and definition statement. /// - pub fn parse_circuit(&mut self) -> SyntaxResult<(Identifier, Circuit)> { + pub fn parse_circuit(&mut self) -> Result<(Identifier, Circuit)> { self.expect(Token::Circuit)?; let name = self.expect_ident()?; self.expect(Token::LeftCurly)?; @@ -407,7 +419,7 @@ impl ParserContext { /// /// Returns a [`FunctionInput`] AST node if the next tokens represent a function parameter. /// - pub fn parse_function_parameters(&mut self) -> SyntaxResult { + pub fn parse_function_parameters(&mut self) -> Result { let const_ = self.eat(Token::Const); let mutable = self.eat(Token::Mut); let mut name = if let Some(token) = self.eat(Token::LittleSelf) { @@ -435,9 +447,7 @@ impl ParserContext { } if let Some(mutable) = &mutable { - return Err(SyntaxError::DeprecatedError(DeprecatedError::mut_function_input( - &mutable.span + &name.span, - ))); + return Err(ParserError::mut_function_input(&(&mutable.span + &name.span)).into()); } self.expect(Token::Colon)?; @@ -455,7 +465,7 @@ impl ParserContext { /// Returns an [`(Identifier, Function)`] AST node if the next tokens represent a function name /// and function definition. /// - pub fn parse_function_declaration(&mut self) -> SyntaxResult<(Identifier, Function)> { + pub fn parse_function_declaration(&mut self) -> Result<(Identifier, Function)> { let mut annotations = Vec::new(); while self.peek_token().as_ref() == &Token::At { annotations.push(self.parse_annotation()?); @@ -495,7 +505,7 @@ impl ParserContext { /// Returns an [`(String, DefinitionStatement)`] AST node if the next tokens represent a global /// const definition statement and assignment. /// - pub fn parse_global_const_declaration(&mut self) -> SyntaxResult<(String, DefinitionStatement)> { + pub fn parse_global_const_declaration(&mut self) -> Result<(String, DefinitionStatement)> { let statement = self.parse_definition_statement()?; let variable_names = statement .variable_names diff --git a/parser/src/parser/mod.rs b/parser/src/parser/mod.rs index 9a0cad7a4c..cf6ae0e5fc 100644 --- a/parser/src/parser/mod.rs +++ b/parser/src/parser/mod.rs @@ -29,14 +29,24 @@ pub mod type_; use std::unimplemented; -use crate::{errors::assert_no_whitespace, tokenizer::*, DeprecatedError, SyntaxError, Token}; +use crate::{tokenizer::*, Token}; use indexmap::IndexMap; use leo_ast::*; +use leo_errors::{ParserError, Result, Span}; -pub type SyntaxResult = Result; +pub(crate) fn assert_no_whitespace(left_span: &Span, right_span: &Span, left: &str, right: &str) -> Result<()> { + if left_span.col_stop != right_span.col_start { + let mut error_span = left_span + right_span; + error_span.col_start = left_span.col_stop - 1; + error_span.col_stop = right_span.col_start - 1; + return Err(ParserError::unexpected_whitespace(left, right, &error_span).into()); + } + + Ok(()) +} /// Creates a new program from a given file path and source code text. -pub fn parse(path: &str, source: &str) -> SyntaxResult { +pub fn parse(path: &str, source: &str) -> Result { let mut tokens = ParserContext::new(crate::tokenize(path, source.into())?); tokens.parse_program() diff --git a/parser/src/parser/statement.rs b/parser/src/parser/statement.rs index 1448dad6bc..c452549e62 100644 --- a/parser/src/parser/statement.rs +++ b/parser/src/parser/statement.rs @@ -16,6 +16,8 @@ use super::*; +use leo_errors::{ParserError, Result}; + const ASSIGN_TOKENS: &[Token] = &[ Token::Assign, Token::AddEq, @@ -39,7 +41,7 @@ impl ParserContext { /// Returns an [`Identifier`] AST node if the given [`Expression`] AST node evaluates to an /// identifier access. The access is stored in the given accesses. /// - pub fn construct_assignee_access(expr: Expression, accesses: &mut Vec) -> SyntaxResult { + pub fn construct_assignee_access(expr: Expression, accesses: &mut Vec) -> Result { let identifier; match expr { Expression::CircuitMemberAccess(expr) => { @@ -62,7 +64,7 @@ impl ParserContext { accesses.push(AssigneeAccess::ArrayIndex(*expr.index)); } Expression::Identifier(id) => identifier = id, - _ => return Err(SyntaxError::invalid_assignment_target(expr.span())), + _ => return Err(ParserError::invalid_assignment_target(expr.span()).into()), } Ok(identifier) } @@ -70,7 +72,7 @@ impl ParserContext { /// /// Returns an [`Assignee`] AST node from the given [`Expression`] AST node with accesses. /// - pub fn construct_assignee(expr: Expression) -> SyntaxResult { + pub fn construct_assignee(expr: Expression) -> Result { let expr_span = expr.span().clone(); let mut accesses = Vec::new(); let identifier = Self::construct_assignee_access(expr, &mut accesses)?; @@ -85,11 +87,11 @@ impl ParserContext { /// /// Returns a [`Statement`] AST node if the next tokens represent a statement. /// - pub fn parse_statement(&mut self) -> SyntaxResult { + pub fn parse_statement(&mut self) -> Result { match &self.peek()?.token { Token::Return => Ok(Statement::Return(self.parse_return_statement()?)), Token::If => Ok(Statement::Conditional(self.parse_conditional_statement()?)), - Token::For => Ok(Statement::Iteration(self.parse_loop_statement()?)), + Token::For => Ok(Statement::Iteration(Box::new(self.parse_loop_statement()?))), Token::Console => Ok(Statement::Console(self.parse_console_statement()?)), Token::Let | Token::Const => Ok(Statement::Definition(self.parse_definition_statement()?)), Token::LeftCurly => Ok(Statement::Block(self.parse_block()?)), @@ -100,14 +102,14 @@ impl ParserContext { /// /// Returns a [`Block`] AST node if the next tokens represent a assign, or expression statement. /// - pub fn parse_assign_statement(&mut self) -> SyntaxResult { + pub fn parse_assign_statement(&mut self) -> Result { let expr = self.parse_expression()?; if let Some(operator) = self.eat_any(ASSIGN_TOKENS) { let value = self.parse_expression()?; let assignee = Self::construct_assignee(expr)?; self.expect(Token::Semicolon)?; - Ok(Statement::Assign(AssignStatement { + Ok(Statement::Assign(Box::new(AssignStatement { span: &assignee.span + value.span(), assignee, operation: match operator.token { @@ -129,7 +131,7 @@ impl ParserContext { _ => unimplemented!(), }, value, - })) + }))) } else { self.expect(Token::Semicolon)?; Ok(Statement::Expression(ExpressionStatement { @@ -142,7 +144,7 @@ impl ParserContext { /// /// Returns a [`Block`] AST node if the next tokens represent a block of statements. /// - pub fn parse_block(&mut self) -> SyntaxResult { + pub fn parse_block(&mut self) -> Result { let start = self.expect(Token::LeftCurly)?; let mut statements = Vec::new(); @@ -164,7 +166,7 @@ impl ParserContext { /// /// Returns a [`ReturnStatement`] AST node if the next tokens represent a return statement. /// - pub fn parse_return_statement(&mut self) -> SyntaxResult { + pub fn parse_return_statement(&mut self) -> Result { let start = self.expect(Token::Return)?; let expr = self.parse_expression()?; self.expect(Token::Semicolon)?; @@ -178,7 +180,7 @@ impl ParserContext { /// /// Returns a [`ConditionalStatement`] AST node if the next tokens represent a conditional statement. /// - pub fn parse_conditional_statement(&mut self) -> SyntaxResult { + pub fn parse_conditional_statement(&mut self) -> Result { let start = self.expect(Token::If)?; self.fuzzy_struct_state = true; let expr = self.parse_conditional_expression()?; @@ -189,11 +191,7 @@ impl ParserContext { match s { Statement::Block(_) | Statement::Conditional(_) => Some(Box::new(s)), s => { - return Err(SyntaxError::unexpected_statement( - s.to_string(), - "Block or Conditional", - s.span(), - )); + return Err(ParserError::unexpected_statement(&s, "Block or Conditional", s.span()).into()); } } } else { @@ -211,7 +209,7 @@ impl ParserContext { /// /// Returns an [`IterationStatement`] AST node if the next tokens represent an iteration statement. /// - pub fn parse_loop_statement(&mut self) -> SyntaxResult { + pub fn parse_loop_statement(&mut self) -> Result { let start_span = self.expect(Token::For)?; let ident = self.expect_ident()?; self.expect(Token::In)?; @@ -236,7 +234,7 @@ impl ParserContext { /// /// Returns a [`ConsoleArgs`] AST node if the next tokens represent a formatted string. /// - pub fn parse_console_args(&mut self) -> SyntaxResult { + pub fn parse_console_args(&mut self) -> Result { let start_span; let string = match self.expect_any()? { SpannedToken { @@ -246,7 +244,9 @@ impl ParserContext { start_span = span; chars } - SpannedToken { token, span } => return Err(SyntaxError::unexpected_str(&token, "formatted string", &span)), + SpannedToken { token, span } => { + return Err(ParserError::unexpected_str(token, "formatted string", &span).into()); + } }; // let parts = FormatStringPart::from_string(string); @@ -267,7 +267,7 @@ impl ParserContext { /// /// Returns a [`ConsoleStatement`] AST node if the next tokens represent a console statement. /// - pub fn parse_console_statement(&mut self) -> SyntaxResult { + pub fn parse_console_statement(&mut self) -> Result { let keyword = self.expect(Token::Console)?; self.expect(Token::Dot)?; let function = self.expect_ident()?; @@ -280,11 +280,7 @@ impl ParserContext { "error" => ConsoleFunction::Error(self.parse_console_args()?), "log" => ConsoleFunction::Log(self.parse_console_args()?), x => { - return Err(SyntaxError::unexpected_ident( - x, - &["assert", "error", "log"], - &function.span, - )); + return Err(ParserError::unexpected_ident(x, &["assert", "error", "log"], &function.span).into()); } }; self.expect(Token::RightParen)?; @@ -300,12 +296,10 @@ impl ParserContext { /// Returns a [`VariableName`] AST node if the next tokens represent a variable name with /// valid keywords. /// - pub fn parse_variable_name(&mut self, span: &SpannedToken) -> SyntaxResult { + pub fn parse_variable_name(&mut self, span: &SpannedToken) -> Result { let mutable = self.eat(Token::Mut); if let Some(mutable) = &mutable { - return Err(SyntaxError::DeprecatedError(DeprecatedError::let_mut_statement( - &mutable.span + &span.span, - ))); + return Err(ParserError::let_mut_statement(&(&mutable.span + &span.span)).into()); } let name = self.expect_ident()?; @@ -319,7 +313,7 @@ impl ParserContext { /// /// Returns a [`DefinitionStatement`] AST node if the next tokens represent a definition statement. /// - pub fn parse_definition_statement(&mut self) -> SyntaxResult { + pub fn parse_definition_statement(&mut self) -> Result { let declare = self.expect_oneof(&[Token::Let, Token::Const])?; let mut variable_names = Vec::new(); diff --git a/parser/src/parser/type_.rs b/parser/src/parser/type_.rs index 7604770f38..e79cb494f4 100644 --- a/parser/src/parser/type_.rs +++ b/parser/src/parser/type_.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . use super::*; +use leo_errors::{ParserError, Result}; const TYPE_TOKENS: &[Token] = &[ Token::I8, @@ -57,7 +58,7 @@ impl ParserContext { /// /// Returns an [`ArrayDimensions`] AST node if the next tokens represent dimensions for an array type. /// - pub fn parse_array_dimensions(&mut self) -> SyntaxResult { + pub fn parse_array_dimensions(&mut self) -> Result { Ok(if let Some((int, _)) = self.eat_int() { ArrayDimensions(vec![int]) } else { @@ -68,7 +69,7 @@ impl ParserContext { dimensions.push(int); } else { let token = self.peek()?; - return Err(SyntaxError::unexpected_str(&token.token, "int", &token.span)); + return Err(ParserError::unexpected_str(&token.token, "int", &token.span).into()); } if self.eat(Token::Comma).is_none() { break; @@ -83,7 +84,7 @@ impl ParserContext { /// Returns a [`(Type, Span)`] tuple of AST nodes if the next token represents a type. Also /// returns the span of the parsed token. /// - pub fn parse_type(&mut self) -> SyntaxResult<(Type, Span)> { + pub fn parse_type(&mut self) -> Result<(Type, Span)> { Ok(if let Some(token) = self.eat(Token::BigSelf) { (Type::SelfType, token.span) } else if let Some(ident) = self.eat_identifier() { diff --git a/parser/src/test.rs b/parser/src/test.rs index 26d5f9a7d0..74352bb573 100644 --- a/parser/src/test.rs +++ b/parser/src/test.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_ast::{Expression, ExpressionStatement, Span, Statement, ValueExpression}; +use leo_ast::{Expression, ExpressionStatement, Statement, ValueExpression}; +use leo_errors::Span; use leo_test_framework::{ runner::{Namespace, ParseType, Runner}, Test, diff --git a/parser/src/tokenizer/lexer.rs b/parser/src/tokenizer/lexer.rs index 0b573409bb..415b82e71e 100644 --- a/parser/src/tokenizer/lexer.rs +++ b/parser/src/tokenizer/lexer.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::tokenizer::{Char, Token}; -use leo_ast::Span; +use leo_errors::Span; use serde::{Deserialize, Serialize}; use tendril::StrTendril; diff --git a/parser/src/tokenizer/mod.rs b/parser/src/tokenizer/mod.rs index 46547d481a..fccc611747 100644 --- a/parser/src/tokenizer/mod.rs +++ b/parser/src/tokenizer/mod.rs @@ -28,12 +28,12 @@ pub(crate) use self::token::*; pub(crate) mod lexer; pub(crate) use self::lexer::*; -use crate::TokenError; -use leo_ast::Span; +use leo_errors::{LeoError, ParserError, Span}; + use tendril::StrTendril; /// Creates a new vector of spanned tokens from a given file path and source code text. -pub(crate) fn tokenize(path: &str, input: StrTendril) -> Result, TokenError> { +pub(crate) fn tokenize(path: &str, input: StrTendril) -> Result, LeoError> { let path = Arc::new(path.to_string()); let mut tokens = vec![]; let mut index = 0usize; @@ -42,17 +42,17 @@ pub(crate) fn tokenize(path: &str, input: StrTendril) -> Result index { match Token::eat(input.subtendril(index as u32, (input.len() - index) as u32)) { (token_len, Some(token)) => { - let mut span = Span { - line_start: line_no, - line_stop: line_no, - col_start: index - line_start + 1, - col_stop: index - line_start + token_len + 1, - path: path.clone(), - content: input.subtendril( + let mut span = Span::new( + line_no, + line_no, + index - line_start + 1, + index - line_start + token_len + 1, + path.clone(), + input.subtendril( line_start as u32, input[line_start..].find('\n').unwrap_or(input.len() - line_start) as u32, ), - }; + ); match &token { Token::CommentLine(_) => { line_no += 1; @@ -70,7 +70,7 @@ pub(crate) fn tokenize(path: &str, input: StrTendril) -> Result { if !check_address(address) { - return Err(TokenError::invalid_address_lit(address, &span)); + return Err(ParserError::invalid_address_lit(address, &span).into()); } } _ => (), @@ -82,20 +82,22 @@ pub(crate) fn tokenize(path: &str, input: StrTendril) -> Result> >>= >>> >>>= % %= ||= &&= assert_eq!( output, diff --git a/parser/src/tokenizer/token.rs b/parser/src/tokenizer/token.rs index 700da12e9e..bcbfaa36d6 100644 --- a/parser/src/tokenizer/token.rs +++ b/parser/src/tokenizer/token.rs @@ -48,14 +48,14 @@ impl fmt::Display for Char { pub enum Token { // Lexical Grammar // Literals - CommentLine(#[serde(with = "leo_ast::common::tendril_json")] StrTendril), - CommentBlock(#[serde(with = "leo_ast::common::tendril_json")] StrTendril), + CommentLine(#[serde(with = "leo_errors::common::tendril_json")] StrTendril), + CommentBlock(#[serde(with = "leo_errors::common::tendril_json")] StrTendril), StringLit(Vec), - Ident(#[serde(with = "leo_ast::common::tendril_json")] StrTendril), - Int(#[serde(with = "leo_ast::common::tendril_json")] StrTendril), + Ident(#[serde(with = "leo_errors::common::tendril_json")] StrTendril), + Int(#[serde(with = "leo_errors::common::tendril_json")] StrTendril), True, False, - AddressLit(#[serde(with = "leo_ast::common::tendril_json")] StrTendril), + AddressLit(#[serde(with = "leo_errors::common::tendril_json")] StrTendril), CharLit(Char), // Symbols diff --git a/parser/tests/serialization/json.rs b/parser/tests/serialization/json.rs index 9e62f65072..b3ec1e6f6f 100644 --- a/parser/tests/serialization/json.rs +++ b/parser/tests/serialization/json.rs @@ -17,11 +17,11 @@ use leo_ast::Ast; #[cfg(not(feature = "ci_skip"))] use leo_ast::Program; -use leo_parser::SyntaxError; +use leo_errors::{LeoError, Result}; use std::path::{Path, PathBuf}; -fn to_ast(program_filepath: &Path) -> Result { +fn to_ast(program_filepath: &Path) -> Result { let program_string = std::fs::read_to_string(program_filepath).expect("failed to open test"); // Parses the Leo file and constructs a leo ast. @@ -96,7 +96,7 @@ fn test_generic_parser_error() { to_ast(&program_filepath) } - .map_err(|err| matches!(err, SyntaxError::Error(_))); + .map_err(|err| matches!(err, LeoError::ParserError(_))); assert!(error_result.err().unwrap()); } diff --git a/state/Cargo.toml b/state/Cargo.toml index c84a45b0d8..6e709fc9d2 100644 --- a/state/Cargo.toml +++ b/state/Cargo.toml @@ -17,23 +17,27 @@ include = [ "Cargo.toml", "src", "README.md", "LICENSE.md" ] license = "GPL-3.0" edition = "2018" -[dependencies.leo-input] -path = "../input" -version = "1.5.3" - [dependencies.leo-ast] path = "../ast" version = "1.5.3" +[dependencies.leo-errors] +path = "../errors" +version = "1.5.3" + +[dependencies.leo-input] +path = "../input" +version = "1.5.3" + [dependencies.snarkvm-algorithms] version = "0.7.6" [dependencies.snarkvm-curves] -version = "0.7.8" +version = "0.7.9" default-features = false [dependencies.snarkvm-dpc] -version = "0.7.8" +version = "0.7.9" features = [ "testnet1" ] [dependencies.snarkvm-utilities] @@ -49,8 +53,5 @@ version = "0.8" [dependencies.rand_xorshift] version = "0.3" -[dependencies.thiserror] -version = "1.0" - [dev-dependencies.rand_core] version = "0.6.3" diff --git a/state/src/errors/dpc_record_values.rs b/state/src/errors/dpc_record_values.rs deleted file mode 100644 index 437666bfea..0000000000 --- a/state/src/errors/dpc_record_values.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::InputValueError; - -use snarkvm_dpc::AccountError; - -use std::{num::ParseIntError, str::ParseBoolError}; - -#[derive(Debug, Error)] -pub enum DPCRecordValuesError { - #[error("{}", _0)] - AccountError(#[from] AccountError), - - #[error("{}", _0)] - InputValueError(#[from] InputValueError), - - #[error("{}", _0)] - ParseBoolError(#[from] ParseBoolError), - - #[error("{}", _0)] - ParseIntError(#[from] ParseIntError), -} diff --git a/state/src/errors/input_value.rs b/state/src/errors/input_value.rs deleted file mode 100644 index 2463d27d4b..0000000000 --- a/state/src/errors/input_value.rs +++ /dev/null @@ -1,32 +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 std::num::ParseIntError; - -#[derive(Debug, Error)] -pub enum InputValueError { - #[error("expected parameter array of u8 bytes, found `{}`", _0)] - ExpectedBytes(String), - - #[error("expected integer parameter, found `{}`", _0)] - ExpectedInteger(String), - - #[error("input parameter `{}` not found in state file", _0)] - MissingParameter(String), - - #[error("{}", _0)] - ParseIntError(#[from] ParseIntError), -} diff --git a/state/src/errors/local_data_commitment.rs b/state/src/errors/local_data_commitment.rs deleted file mode 100644 index a0f8465983..0000000000 --- a/state/src/errors/local_data_commitment.rs +++ /dev/null @@ -1,42 +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::{RecordVerificationError, StateLeafValuesError, StateValuesError}; - -use snarkvm_algorithms::{CommitmentError, MerkleError}; - -use std::io::Error as IOError; - -#[derive(Debug, Error)] -pub enum LocalDataVerificationError { - #[error("{}", _0)] - CommitmentError(#[from] CommitmentError), - - #[error("{}", _0)] - MerkleError(#[from] MerkleError), - - #[error("{}", _0)] - IOError(#[from] IOError), - - #[error("{}", _0)] - RecordVerificationError(#[from] RecordVerificationError), - - #[error("{}", _0)] - StateLeafValuesError(#[from] StateLeafValuesError), - - #[error("{}", _0)] - StateValuesError(#[from] StateValuesError), -} diff --git a/state/src/errors/mod.rs b/state/src/errors/mod.rs deleted file mode 100644 index 961b1fad08..0000000000 --- a/state/src/errors/mod.rs +++ /dev/null @@ -1,33 +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 dpc_record_values; -pub use self::dpc_record_values::*; - -pub mod input_value; -pub use self::input_value::*; - -pub mod state_leaf_values; -pub use self::state_leaf_values::*; - -pub mod state_values; -pub use self::state_values::*; - -pub mod local_data_commitment; -pub use self::local_data_commitment::*; - -pub mod record_commitment; -pub use self::record_commitment::*; diff --git a/state/src/errors/record_commitment.rs b/state/src/errors/record_commitment.rs deleted file mode 100644 index 507c5bb48f..0000000000 --- a/state/src/errors/record_commitment.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::DPCRecordValuesError; - -use snarkvm_algorithms::CommitmentError; - -use std::io::Error as IOError; - -#[derive(Debug, Error)] -pub enum RecordVerificationError { - #[error("record commitment does not match record data")] - CommitmentsDoNotMatch, - - #[error("{}", _0)] - CommitmentError(#[from] CommitmentError), - - #[error("{}", _0)] - DPCRecordValuesError(#[from] DPCRecordValuesError), - - #[error("{}", _0)] - IOError(#[from] IOError), -} diff --git a/state/src/errors/state_leaf_values.rs b/state/src/errors/state_leaf_values.rs deleted file mode 100644 index 83b377178a..0000000000 --- a/state/src/errors/state_leaf_values.rs +++ /dev/null @@ -1,31 +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::InputValueError; - -use std::{num::ParseIntError, str::ParseBoolError}; - -#[derive(Debug, Error)] -pub enum StateLeafValuesError { - #[error("{}", _0)] - InputValueError(#[from] InputValueError), - - #[error("{}", _0)] - ParseBoolError(#[from] ParseBoolError), - - #[error("{}", _0)] - ParseIntError(#[from] ParseIntError), -} diff --git a/state/src/errors/state_values.rs b/state/src/errors/state_values.rs deleted file mode 100644 index 94af651517..0000000000 --- a/state/src/errors/state_values.rs +++ /dev/null @@ -1,31 +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::InputValueError; - -use std::{num::ParseIntError, str::ParseBoolError}; - -#[derive(Debug, Error)] -pub enum StateValuesError { - #[error("{}", _0)] - InputValueError(#[from] InputValueError), - - #[error("{}", _0)] - ParseBoolError(#[from] ParseBoolError), - - #[error("{}", _0)] - ParseIntError(#[from] ParseIntError), -} diff --git a/state/src/lib.rs b/state/src/lib.rs index 65bd11e5d5..88531a4873 100644 --- a/state/src/lib.rs +++ b/state/src/lib.rs @@ -16,12 +16,7 @@ #![allow(clippy::module_inception)] #![allow(clippy::upper_case_acronyms)] - -#[macro_use] -extern crate thiserror; - -pub mod errors; -pub use self::errors::*; +#![doc = include_str!("../README.md")] pub mod local_data_commitment; pub use self::local_data_commitment::*; diff --git a/state/src/local_data_commitment/local_data_commitment.rs b/state/src/local_data_commitment/local_data_commitment.rs index 19b74c6f22..3cf8144ead 100644 --- a/state/src/local_data_commitment/local_data_commitment.rs +++ b/state/src/local_data_commitment/local_data_commitment.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{verify_record_commitment, LocalDataVerificationError, StateLeafValues, StateValues}; +use crate::{verify_record_commitment, StateLeafValues, StateValues}; use leo_ast::Input as AstInput; +use leo_errors::{Result, SnarkVMError, StateError}; use snarkvm_algorithms::{ commitment_tree::CommitmentMerklePath, @@ -31,10 +32,7 @@ use std::convert::TryFrom; /// Returns `true` if the path to the local data commitment leaf is a valid path in the record /// commitment Merkle tree. -pub fn verify_local_data_commitment( - dpc: &SystemParameters, - ast_input: &AstInput, -) -> Result { +pub fn verify_local_data_commitment(dpc: &SystemParameters, ast_input: &AstInput) -> Result { // Verify record commitment. let typed_record = ast_input.get_record(); let dpc_record_values = verify_record_commitment(dpc, typed_record)?; @@ -58,35 +56,41 @@ pub fn verify_local_data_commitment( // Select local data commitment input bytes. let is_death = leaf_index < (Components::NUM_INPUT_RECORDS as u32); let input_bytes = if is_death { - to_bytes_le![record_serial_number, record_commitment, memo, network_id]? + to_bytes_le![record_serial_number, record_commitment, memo, network_id].map_err(StateError::state_io_error)? } else { - to_bytes_le![record_commitment, memo, network_id]? + to_bytes_le![record_commitment, memo, network_id].map_err(StateError::state_io_error)? }; // Construct local data commitment leaf. let local_data_leaf_randomness = <::LocalDataCommitment as CommitmentScheme>::Randomness::read_le( &leaf_randomness[..], - )?; + ) + .map_err(StateError::state_io_error)?; let local_data_commitment_leaf = ::LocalDataCommitment::commit( &dpc.local_data_commitment, &input_bytes, &local_data_leaf_randomness, - )?; + ) + .map_err(|_| SnarkVMError::default())?; // Construct record commitment merkle path. let local_data_merkle_path = CommitmentMerklePath::< ::LocalDataCommitment, ::LocalDataCRH, - >::read_le(&path[..])?; + >::read_le(&path[..]) + .map_err(StateError::state_io_error)?; // Check record commitment merkle path is valid for the given local data commitment root. - let local_data_commitment_root = <::LocalDataCRH as CRH>::Output::read_le(&root[..])?; - let result = local_data_merkle_path.verify( - &dpc.local_data_crh, - &local_data_commitment_root, - &local_data_commitment_leaf, - )?; + let local_data_commitment_root = <::LocalDataCRH as CRH>::Output::read_le(&root[..]) + .map_err(StateError::state_io_error)?; + let result = local_data_merkle_path + .verify( + &dpc.local_data_crh, + &local_data_commitment_root, + &local_data_commitment_leaf, + ) + .map_err(|_| SnarkVMError::default())?; Ok(result) } diff --git a/state/src/local_data_commitment/state_leaf_values.rs b/state/src/local_data_commitment/state_leaf_values.rs index 8c7148741d..b0f60390cd 100644 --- a/state/src/local_data_commitment/state_leaf_values.rs +++ b/state/src/local_data_commitment/state_leaf_values.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{find_input, input_to_bytes, input_to_integer_string, StateLeafValuesError}; +use crate::{find_input, input_to_bytes, input_to_integer_string}; use leo_ast::StateLeaf as AstStateLeaf; +use leo_errors::{LeoError, Result, StateError}; use std::convert::TryFrom; @@ -34,9 +35,9 @@ pub struct StateLeafValues { } impl TryFrom<&AstStateLeaf> for StateLeafValues { - type Error = StateLeafValuesError; + type Error = LeoError; - fn try_from(ast_state_leaf: &AstStateLeaf) -> Result { + fn try_from(ast_state_leaf: &AstStateLeaf) -> Result { let parameters = ast_state_leaf.values(); // Lookup path @@ -49,7 +50,9 @@ impl TryFrom<&AstStateLeaf> for StateLeafValues { // Lookup network id let network_id_value = find_input(NETWORK_ID_PARAMETER_STRING.to_owned(), ¶meters)?; - let network_id = input_to_integer_string(network_id_value)?.parse::()?; + let network_id = input_to_integer_string(network_id_value)? + .parse::() + .map_err(StateError::parse_int_error)?; // Lookup leaf randomness let leaf_randomness_value = find_input(LEAF_RANDOMNESS_PARAMETER_STRING.to_owned(), ¶meters)?; diff --git a/state/src/local_data_commitment/state_values.rs b/state/src/local_data_commitment/state_values.rs index 0ba48af568..323d4ccf46 100644 --- a/state/src/local_data_commitment/state_values.rs +++ b/state/src/local_data_commitment/state_values.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{find_input, input_to_bytes, input_to_integer_string, StateValuesError}; +use crate::{find_input, input_to_bytes, input_to_integer_string}; use leo_ast::State as AstState; +use leo_errors::{LeoError, Result, StateError}; use std::convert::TryFrom; @@ -30,14 +31,16 @@ pub struct StateValues { } impl TryFrom<&AstState> for StateValues { - type Error = StateValuesError; + type Error = LeoError; - fn try_from(ast_state: &AstState) -> Result { + fn try_from(ast_state: &AstState) -> Result { let parameters = ast_state.values(); // Lookup leaf index let leaf_index_value = find_input(LEAF_INDEX_PARAMETER_STRING.to_owned(), ¶meters)?; - let leaf_index = input_to_integer_string(leaf_index_value)?.parse::()?; + let leaf_index = input_to_integer_string(leaf_index_value)? + .parse::() + .map_err(StateError::parse_int_error)?; // Lookup root let root_value = find_input(ROOT_PARAMETER_STRING.to_owned(), ¶meters)?; diff --git a/state/src/record_commitment/dpc_record_values.rs b/state/src/record_commitment/dpc_record_values.rs index 7de85e1cc0..945b541001 100644 --- a/state/src/record_commitment/dpc_record_values.rs +++ b/state/src/record_commitment/dpc_record_values.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{utilities::*, DPCRecordValuesError}; +use crate::utilities::*; use leo_ast::Record as AstRecord; +use leo_errors::{LeoError, Result, SnarkVMError, StateError}; use snarkvm_dpc::{testnet1::instantiated::Components, Address}; @@ -48,9 +49,9 @@ pub struct DPCRecordValues { } impl TryFrom<&AstRecord> for DPCRecordValues { - type Error = DPCRecordValuesError; + type Error = LeoError; - fn try_from(ast_record: &AstRecord) -> Result { + fn try_from(ast_record: &AstRecord) -> Result { let parameters = ast_record.values(); // Lookup serial number @@ -59,15 +60,20 @@ impl TryFrom<&AstRecord> for DPCRecordValues { // Lookup record owner let owner_value = find_input(OWNER_PARAMETER_STRING.to_owned(), ¶meters)?; - let owner = Address::::from_str(&owner_value.to_string())?; + let owner = Address::::from_str(&owner_value.to_string()).map_err(|_| SnarkVMError::default())?; // Lookup record is_dummy let is_dummy_value = find_input(IS_DUMMY_PARAMETER_STRING.to_owned(), ¶meters)?; - let is_dummy = is_dummy_value.to_string().parse::()?; + let is_dummy = is_dummy_value + .to_string() + .parse::() + .map_err(StateError::parse_bool_error)?; // Lookup record value let value_value = find_input(VALUE_PARAMETER_STRING.to_owned(), ¶meters)?; - let value = input_to_integer_string(value_value)?.parse::()?; + let value = input_to_integer_string(value_value)? + .parse::() + .map_err(StateError::parse_int_error)?; // Lookup record payload let payload_value = find_input(PAYLOAD_PARAMETER_STRING.to_owned(), ¶meters)?; diff --git a/state/src/record_commitment/record_commitment.rs b/state/src/record_commitment/record_commitment.rs index c4b7549b1d..fad0ed8241 100644 --- a/state/src/record_commitment/record_commitment.rs +++ b/state/src/record_commitment/record_commitment.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{DPCRecordValues, RecordVerificationError}; +use crate::DPCRecordValues; use leo_ast::Record as AstRecord; +use leo_errors::{Result, SnarkVMError, StateError}; use snarkvm_algorithms::traits::CommitmentScheme; use snarkvm_dpc::{ @@ -28,12 +29,9 @@ use std::convert::TryFrom; /// Returns a serialized [`DPCRecordValues`] type if the record commitment is valid given the /// system parameters. -pub fn verify_record_commitment( - dpc: &SystemParameters, - ast_record: &AstRecord, -) -> Result { +pub fn verify_record_commitment(dpc: &SystemParameters, ast_record: &AstRecord) -> Result { // generate a dpc record from the typed record - let record = DPCRecordValues::try_from(ast_record)?; + let record: DPCRecordValues = DPCRecordValues::try_from(ast_record)?; // verify record commitment let record_commitment_input = to_bytes_le![ @@ -44,24 +42,28 @@ pub fn verify_record_commitment( record.birth_program_id, record.death_program_id, record.serial_number_nonce - ]?; + ] + .map_err(StateError::state_io_error)?; let commitment = - <::RecordCommitment as CommitmentScheme>::Output::read_le(&record.commitment[..])?; + <::RecordCommitment as CommitmentScheme>::Output::read_le(&record.commitment[..]) + .map_err(StateError::state_io_error)?; let commitment_randomness = <::RecordCommitment as CommitmentScheme>::Randomness::read_le( &record.commitment_randomness[..], - )?; + ) + .map_err(StateError::state_io_error)?; let record_commitment = ::RecordCommitment::commit( &dpc.record_commitment, &record_commitment_input, &commitment_randomness, - )?; + ) + .map_err(|_| SnarkVMError::default())?; if record_commitment == commitment { Ok(record) } else { - Err(RecordVerificationError::CommitmentsDoNotMatch) + Err(SnarkVMError::default().into()) } } diff --git a/state/src/utilities/input_value.rs b/state/src/utilities/input_value.rs index a4e463f038..3d7ca2b92a 100644 --- a/state/src/utilities/input_value.rs +++ b/state/src/utilities/input_value.rs @@ -14,49 +14,46 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::InputValueError; use leo_ast::{InputValue, Parameter}; +use leo_errors::{Result, StateError}; use indexmap::IndexMap; /// Returns the input parameter with the given name. /// If a parameter with the given name does not exist, then an error is returned. -pub fn find_input( - name: String, - parameters: &IndexMap>, -) -> Result { +pub fn find_input(name: String, parameters: &IndexMap>) -> Result { let matched_parameter = parameters .iter() .find(|(parameter, _value)| parameter.variable.name.as_ref() == name); match matched_parameter { Some((_, Some(value))) => Ok(value.clone()), - _ => Err(InputValueError::MissingParameter(name)), + _ => Err(StateError::missing_parameter(name).into()), } } /// Returns the string of the integer input value. /// If the input value is not an integer, then an error is returned. -pub fn input_to_integer_string(input: InputValue) -> Result { +pub fn input_to_integer_string(input: InputValue) -> Result { match input { InputValue::Integer(_type, string) => Ok(string), - value => Err(InputValueError::ExpectedInteger(value.to_string())), + value => Err(StateError::expected_int(value).into()), } } /// Returns the given input value as u8 bytes. /// If the given input value cannot be serialized into bytes then an error is returned. -pub fn input_to_bytes(input: InputValue) -> Result, InputValueError> { +pub fn input_to_bytes(input: InputValue) -> Result> { let input_array = match input { InputValue::Array(values) => values, - value => return Err(InputValueError::ExpectedBytes(value.to_string())), + value => return Err(StateError::expected_bytes(value).into()), }; let mut result_vec = Vec::with_capacity(input_array.len()); for input in input_array { let integer_string = input_to_integer_string(input)?; - let byte = integer_string.parse::()?; + let byte = integer_string.parse::().map_err(StateError::parse_int_error)?; result_vec.push(byte); } @@ -66,10 +63,10 @@ pub fn input_to_bytes(input: InputValue) -> Result, InputValueError> { /// Returns the given input value as an array of u8 bytes. /// If the given input value cannot be serialized into an array of bytes then an error is returned. -pub fn input_to_nested_bytes(input: InputValue) -> Result>, InputValueError> { +pub fn input_to_nested_bytes(input: InputValue) -> Result>> { let inner_arrays = match input { InputValue::Array(arrays) => arrays, - value => return Err(InputValueError::ExpectedBytes(value.to_string())), + value => return Err(StateError::expected_bytes(value).into()), }; let mut result_vec = Vec::with_capacity(inner_arrays.len()); diff --git a/synthesizer/Cargo.toml b/synthesizer/Cargo.toml index cf681a35db..8b8bb23247 100644 --- a/synthesizer/Cargo.toml +++ b/synthesizer/Cargo.toml @@ -18,7 +18,15 @@ license = "GPL-3.0" edition = "2018" [dependencies.snarkvm-curves] -version = "0.7.8" +version = "0.7.9" +default-features = false + +[dependencies.leo-errors] +path = "../errors" +version = "1.5.3" + +[dependencies.eyre] +version = "0.6.5" default-features = false [dependencies.snarkvm-fields] diff --git a/synthesizer/src/lib.rs b/synthesizer/src/lib.rs index 80dbc44a44..36396dd78e 100644 --- a/synthesizer/src/lib.rs +++ b/synthesizer/src/lib.rs @@ -14,6 +14,8 @@ // 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")] + pub mod circuit_synthesizer; pub use self::circuit_synthesizer::*; diff --git a/synthesizer/src/serialized_circuit.rs b/synthesizer/src/serialized_circuit.rs index 5d7e3c379f..a70ba5e3ec 100644 --- a/synthesizer/src/serialized_circuit.rs +++ b/synthesizer/src/serialized_circuit.rs @@ -16,12 +16,13 @@ use std::convert::TryFrom; +use eyre::eyre; use serde::{Deserialize, Serialize}; use snarkvm_curves::{bls12_377::Bls12_377, traits::PairingEngine}; -use snarkvm_fields::FieldError; use snarkvm_r1cs::{ConstraintSystem, Index, OptionalVec}; use crate::{CircuitSynthesizer, ConstraintSet, SerializedField, SerializedIndex}; +use leo_errors::{LeoError, SnarkVMError}; #[derive(Serialize, Deserialize)] pub struct SerializedCircuit { @@ -38,12 +39,12 @@ pub struct SerializedCircuit { } impl SerializedCircuit { - pub fn to_json_string(&self) -> Result { - serde_json::to_string_pretty(&self) + pub fn to_json_string(&self) -> Result { + serde_json::to_string_pretty(&self).map_err(|e| LeoError::from(SnarkVMError::from(eyre!(e)))) } - pub fn from_json_string(json: &str) -> Result { - serde_json::from_str(json) + pub fn from_json_string(json: &str) -> Result { + serde_json::from_str(json).map_err(|e| LeoError::from(SnarkVMError::from(eyre!(e)))) } } @@ -114,17 +115,18 @@ impl From> for SerializedCircuit { } impl TryFrom for CircuitSynthesizer { - type Error = FieldError; + type Error = LeoError; fn try_from(serialized: SerializedCircuit) -> Result, Self::Error> { // Deserialize assignments fn get_deserialized_assignments( assignments: &[SerializedField], - ) -> Result::Fr>, FieldError> { + ) -> Result::Fr>, LeoError> { let mut deserialized = OptionalVec::with_capacity(assignments.len()); for serialized_assignment in assignments { - let field = ::Fr::try_from(serialized_assignment)?; + let field = ::Fr::try_from(serialized_assignment) + .map_err(|e| LeoError::from(SnarkVMError::from(eyre!(e))))?; deserialized.insert(field); } @@ -138,11 +140,12 @@ impl TryFrom for CircuitSynthesizer { // Deserialize constraints fn get_deserialized_constraints( constraints: &[(SerializedField, SerializedIndex)], - ) -> Result::Fr, Index)>, FieldError> { + ) -> Result::Fr, Index)>, LeoError> { let mut deserialized = Vec::with_capacity(constraints.len()); for &(ref serialized_coeff, ref serialized_index) in constraints { - let field = ::Fr::try_from(serialized_coeff)?; + let field = ::Fr::try_from(serialized_coeff) + .map_err(|e| LeoError::from(SnarkVMError::from(eyre!(e))))?; let index = Index::from(serialized_index); deserialized.push((field, index)); diff --git a/test-framework/README.md b/test-framework/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test-framework/src/lib.rs b/test-framework/src/lib.rs index 48860f2f56..86115089ca 100644 --- a/test-framework/src/lib.rs +++ b/test-framework/src/lib.rs @@ -22,6 +22,8 @@ //! To regenerate the tests after a syntax change or failing test, delete the [`tests/expectations/`] //! directory and run the [`parser_tests()`] test in [`parser/src/test.rs`]. +#![doc = include_str!("../README.md")] + pub mod error; pub mod fetch; diff --git a/test-framework/src/runner.rs b/test-framework/src/runner.rs index 15e39776ad..6e9a6ccd77 100644 --- a/test-framework/src/runner.rs +++ b/test-framework/src/runner.rs @@ -47,6 +47,7 @@ pub trait Runner { } pub fn run_tests(runner: &T, expectation_category: &str) { + std::env::set_var("LEO_TESTFRAMEWORK", "true"); let mut pass_categories = 0; let mut pass_tests = 0; let mut fail_tests = 0; @@ -226,4 +227,6 @@ pub fn run_tests(runner: &T, expectation_category: &str) { pass_categories ); } + + std::env::remove_var("LEO_TESTFRAMEWORK"); } diff --git a/tests/compiler/circuits/return_self_type_array.leo b/tests/compiler/circuits/return_self_type_array.leo new file mode 100644 index 0000000000..9ce1800a16 --- /dev/null +++ b/tests/compiler/circuits/return_self_type_array.leo @@ -0,0 +1,15 @@ +/* +namespace: Compile +expectation: Pass +input_file: input/dummy.in +*/ + +circuit Circ { + function fn () -> [Self; 1] { + return [Self {}]; + } +} + +function main (y: bool) -> bool { + return y; +} \ No newline at end of file diff --git a/tests/compiler/circuits/return_self_type_tuple.leo b/tests/compiler/circuits/return_self_type_tuple.leo new file mode 100644 index 0000000000..20fcae98c5 --- /dev/null +++ b/tests/compiler/circuits/return_self_type_tuple.leo @@ -0,0 +1,15 @@ +/* +namespace: Compile +expectation: Pass +input_file: input/dummy.in +*/ + +circuit Circ { + function fn () -> (Self,u8) { + return (Self {}, 1); + } +} + +function main (y: bool) -> bool { + return y; +} \ No newline at end of file diff --git a/tests/expectations/compiler/compiler/address/branch.leo.out b/tests/expectations/compiler/compiler/address/branch.leo.out index a4c062bc76..3d0a5f4dce 100644 --- a/tests/expectations/compiler/compiler/address/branch.leo.out +++ b/tests/expectations/compiler/compiler/address/branch.leo.out @@ -16,6 +16,6 @@ outputs: a: type: bool value: "true" - initial_ast: a7748573e4731753b76889c6d4c28e9589e114860a163da87957cf20b916f733 - canonicalized_ast: a7748573e4731753b76889c6d4c28e9589e114860a163da87957cf20b916f733 - type_inferenced_ast: af3663710ad6278c3d2e28a753d62084505746cd49de11949fe5e8e390ffcc60 + initial_ast: 0788eb39577304b655f147fe3045e1fad995b31811444afadc228bf99f505994 + canonicalized_ast: 0788eb39577304b655f147fe3045e1fad995b31811444afadc228bf99f505994 + type_inferenced_ast: 57aa71789a8ba7ac075f734ecc0450ae4b56b2343cff19e345cdab9c7715e1ee diff --git a/tests/expectations/compiler/compiler/address/equal.leo.out b/tests/expectations/compiler/compiler/address/equal.leo.out index 1cdb5f2fea..491c8bb576 100644 --- a/tests/expectations/compiler/compiler/address/equal.leo.out +++ b/tests/expectations/compiler/compiler/address/equal.leo.out @@ -22,6 +22,6 @@ outputs: a: type: bool value: "false" - initial_ast: 1b4069c1fe2f0b258116c5864b19dfb2205e3cd8e13ea79d78fcdb0e9c1a8d50 - canonicalized_ast: 1b4069c1fe2f0b258116c5864b19dfb2205e3cd8e13ea79d78fcdb0e9c1a8d50 - type_inferenced_ast: d2aefbdd9fd4c931d4ee60f1a435f3da0d827e7425d2fd0a9868de22cc11ed73 + initial_ast: e057591dddc93027645e671870d9bb932a32647a600a452657e0a8a3748f0921 + canonicalized_ast: e057591dddc93027645e671870d9bb932a32647a600a452657e0a8a3748f0921 + type_inferenced_ast: 1d32fc5c118dc328274a6e2c4048c0efeea2b128fa2d2733ddf7d4fde4daf46f diff --git a/tests/expectations/compiler/compiler/address/index.leo.out b/tests/expectations/compiler/compiler/address/index.leo.out index b4cda33ee6..59194f6bf4 100644 --- a/tests/expectations/compiler/compiler/address/index.leo.out +++ b/tests/expectations/compiler/compiler/address/index.leo.out @@ -16,6 +16,6 @@ outputs: a: type: bool value: "true" - initial_ast: 8934e4c1d645f6f98fe59f48bbf687623e811c99e504e87c6989bc00af62194a - canonicalized_ast: 8934e4c1d645f6f98fe59f48bbf687623e811c99e504e87c6989bc00af62194a - type_inferenced_ast: 70af835aeaec1d5bc1c4a3186635260ff44743e0d3a7aa5ac9f2c98ec03bd23e + initial_ast: 76cba1a1eb179db8b21c2e05403861e133983feec9b987c764a5584da78c16fb + canonicalized_ast: 76cba1a1eb179db8b21c2e05403861e133983feec9b987c764a5584da78c16fb + type_inferenced_ast: 822de2e0c4fdf74f7b476666b6a8a38782bd828dc2d216a7a68bf70edc444fbf diff --git a/tests/expectations/compiler/compiler/address/ternary.leo.out b/tests/expectations/compiler/compiler/address/ternary.leo.out index 6caf58d690..fb25d02dd7 100644 --- a/tests/expectations/compiler/compiler/address/ternary.leo.out +++ b/tests/expectations/compiler/compiler/address/ternary.leo.out @@ -22,6 +22,6 @@ outputs: a: type: bool value: "false" - initial_ast: 975c6893ed20b632a3dc9c39f7fe9f381e7dda4b17b6c1f05ff7480e3bf2ee9d - canonicalized_ast: 975c6893ed20b632a3dc9c39f7fe9f381e7dda4b17b6c1f05ff7480e3bf2ee9d - type_inferenced_ast: bbc3818f0267a746d6ab324ef9b9de489ca65cd1624f528dae941841f39517af + initial_ast: 8a34bf070edd7585daad47802214b7df49b6df6dd9a6344644a4f121b320e449 + canonicalized_ast: 8a34bf070edd7585daad47802214b7df49b6df6dd9a6344644a4f121b320e449 + type_inferenced_ast: 2254abca31e4326444ef2066c8f85b3280505a3ecbaffaf7e472276a3034cc2f diff --git a/tests/expectations/compiler/compiler/array/array_range_access_fail.leo.out b/tests/expectations/compiler/compiler/array/array_range_access_fail.leo.out index 4fa4f71894..e28da3683a 100644 --- a/tests/expectations/compiler/compiler/array/array_range_access_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/array_range_access_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:7:24\n |\n 7 | const z: [u8; 2] = y[..1u32][..x];\n | ^^^^^^^^^^^^^^\n |\n = array index out of bounds: '0'" + - "Error [EASG0373020]: array index out of bounds: '0'\n --> compiler-test:7:24\n |\n 7 | const z: [u8; 2] = y[..1u32][..x];\n | ^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/array/array_size_zero_fail.leo.out b/tests/expectations/compiler/compiler/array/array_size_zero_fail.leo.out index f76f2e73a4..018bc69003 100644 --- a/tests/expectations/compiler/compiler/array/array_size_zero_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/array_size_zero_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:13\n |\n 4 | let a = [true; (0)];\n | ^^^^^^^^^^^\n |\n = received dimension size of 0, expected it to be 1 or larger." + - "Error [EAST0372006]: received dimension size of 0, expected it to be 1 or larger.\n --> compiler-test:4:13\n |\n 4 | let a = [true; (0)];\n | ^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/array/complex_access.leo.out b/tests/expectations/compiler/compiler/array/complex_access.leo.out index b90f25e21b..d3cd24862e 100644 --- a/tests/expectations/compiler/compiler/array/complex_access.leo.out +++ b/tests/expectations/compiler/compiler/array/complex_access.leo.out @@ -16,6 +16,6 @@ outputs: out: type: bool value: "true" - initial_ast: 9808de8c342c41e060d3d3134eb168c8d8cc3ff0641cb8d9779a1746b9fa1687 - canonicalized_ast: 1479a9afd623ad11ca137555fd86a3f0a6da39641d5b2da712273242541c246e - type_inferenced_ast: 9bf998e088b9cce0f40a0326fa8e744c88d8168e04c563a2fbd6a57acd23da1f + initial_ast: 589670c04ad13f8dbe2ea01562fa6bdff1c6dfaf118730e60d0a55e5bb2168b9 + canonicalized_ast: 82fd732401abaced235b6522298a454fd0491ea1dc0a80170773e1a129320657 + type_inferenced_ast: 14321d2bd1a2d9da60f52372feee4c8bf6aa98d516c01bf309d219c903b7f241 diff --git a/tests/expectations/compiler/compiler/array/equal_initializer.leo.out b/tests/expectations/compiler/compiler/array/equal_initializer.leo.out index 720cfd8180..f593750149 100644 --- a/tests/expectations/compiler/compiler/array/equal_initializer.leo.out +++ b/tests/expectations/compiler/compiler/array/equal_initializer.leo.out @@ -22,6 +22,6 @@ outputs: x: type: bool value: "false" - initial_ast: 25f4af112eb1512952d78bb7fa1d5287e3ab778255307f69304bbe1756575085 - canonicalized_ast: 248b7cc7462c3f035f337c9232a08bb5a911d7f4e153dd804a32bc597adb0210 - type_inferenced_ast: ebc3a5632c2d65e51cd9934b1ee4e395867808deeda3ecddfeaebb1b08093ed7 + initial_ast: c4b7aca1f9002da95f8efab340d4dc5d38e64d97274b1815126e7f88f40e155a + canonicalized_ast: c8b633546058b56b76a0864ab0fce2aa7169554b716e17250ebc688708dcd206 + type_inferenced_ast: 9411e52e1ab1ddec7d5d1111aa8c10a5ec916b9d5e86d24ed5348462ec0adb71 diff --git a/tests/expectations/compiler/compiler/array/equal_initializer_2.leo.out b/tests/expectations/compiler/compiler/array/equal_initializer_2.leo.out index 4c4524fe2a..2068f31405 100644 --- a/tests/expectations/compiler/compiler/array/equal_initializer_2.leo.out +++ b/tests/expectations/compiler/compiler/array/equal_initializer_2.leo.out @@ -22,6 +22,6 @@ outputs: x: type: bool value: "true" - initial_ast: b3bae883863f88babaafa80d4c029974767fba5fea89ac8c2ab10512e61a38ba - canonicalized_ast: 9070de3276acf8d06ac58439247130e444c9b02de25b968ad1fc746650a1896c - type_inferenced_ast: 40a38002031be2cf0141c9ea33562fe69fc3891baeba9c92c487915b97d82507 + initial_ast: 2cbe00dbca8111c92a55dcb9a18766ddb9a407e71535ae62d3bf4d6ec409fca2 + canonicalized_ast: 75d8d33b9a5376fea14bb9821abe1bc5e1661cfccbf962f58facb42e539b1b04 + type_inferenced_ast: 45b1b5d994a229da8fb761d97c474778a65b8a5fdd87cfbd6e4aaa4a1ddef7a0 diff --git a/tests/expectations/compiler/compiler/array/input_nested_3x2.leo.out b/tests/expectations/compiler/compiler/array/input_nested_3x2.leo.out index 39dcd7c529..bc64293f28 100644 --- a/tests/expectations/compiler/compiler/array/input_nested_3x2.leo.out +++ b/tests/expectations/compiler/compiler/array/input_nested_3x2.leo.out @@ -16,6 +16,6 @@ outputs: x: type: bool value: "true" - initial_ast: f5e4014d45239734a04d57c7b130fdf9752de245a4341062063aa5e818c5aa05 - canonicalized_ast: 8c16a6b011fc067411acaa497386bc5df9b96b91ef739f4992ba416ecf98bafc - type_inferenced_ast: 17d810699ef381a0a9c4efcd2ad6da64b76ce5d629c05db7b2d07d563e077548 + initial_ast: 002647d1f55a3b5f358cbd27beff81736973fc142dc3d708f8df8d634c1e8fa4 + canonicalized_ast: b36a5f62c09093fcfce2797b89fe936c4bb94fe1e4aca6608cda4f529677b005 + type_inferenced_ast: 524e0682eec030dda6f12637fb92af0122a7cf3986a8d7c974a2bc8a1554552d diff --git a/tests/expectations/compiler/compiler/array/input_nested_3x2_fail.leo.out b/tests/expectations/compiler/compiler/array/input_nested_3x2_fail.leo.out index 35898c7997..498d522f18 100644 --- a/tests/expectations/compiler/compiler/array/input_nested_3x2_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/input_nested_3x2_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:29\n |\n 4 | return a == [[0u8; 2]; 3)]; // This should be written the right way as this test is for the input file.\n | ^\n |\n = expected ']' -- got ')'" + - "Error [EPAR0370005]: expected ] -- got ')'\n --> compiler-test:4:29\n |\n 4 | return a == [[0u8; 2]; 3)]; // This should be written the right way as this test is for the input file.\n | ^" diff --git a/tests/expectations/compiler/compiler/array/input_tuple_3x2.leo.out b/tests/expectations/compiler/compiler/array/input_tuple_3x2.leo.out index d77f05d984..16b86824b3 100644 --- a/tests/expectations/compiler/compiler/array/input_tuple_3x2.leo.out +++ b/tests/expectations/compiler/compiler/array/input_tuple_3x2.leo.out @@ -16,6 +16,6 @@ outputs: x: type: bool value: "true" - initial_ast: 25f4af112eb1512952d78bb7fa1d5287e3ab778255307f69304bbe1756575085 - canonicalized_ast: 248b7cc7462c3f035f337c9232a08bb5a911d7f4e153dd804a32bc597adb0210 - type_inferenced_ast: ebc3a5632c2d65e51cd9934b1ee4e395867808deeda3ecddfeaebb1b08093ed7 + initial_ast: c4b7aca1f9002da95f8efab340d4dc5d38e64d97274b1815126e7f88f40e155a + canonicalized_ast: c8b633546058b56b76a0864ab0fce2aa7169554b716e17250ebc688708dcd206 + type_inferenced_ast: 9411e52e1ab1ddec7d5d1111aa8c10a5ec916b9d5e86d24ed5348462ec0adb71 diff --git a/tests/expectations/compiler/compiler/array/multi_fail_initializer.leo.out b/tests/expectations/compiler/compiler/array/multi_fail_initializer.leo.out index c4b0fe28b7..c6849d72e8 100644 --- a/tests/expectations/compiler/compiler/array/multi_fail_initializer.leo.out +++ b/tests/expectations/compiler/compiler/array/multi_fail_initializer.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:31\n |\n 4 | const arr: [u8; (2, 2)] = [[1u8; 2]; 1]; // incorrect dimensions\n | ^^^^^^^^^^^^^\n |\n = unexpected type, expected: 'array of length 2', received: 'array of length 1'" + - "Error [EASG0373026]: unexpected type, expected: 'array of length 2', received: 'array of length 1'\n --> compiler-test:4:31\n |\n 4 | const arr: [u8; (2, 2)] = [[1u8; 2]; 1]; // incorrect dimensions\n | ^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/array/multi_fail_inline.leo.out b/tests/expectations/compiler/compiler/array/multi_fail_inline.leo.out index d753b40f73..08e07e5508 100644 --- a/tests/expectations/compiler/compiler/array/multi_fail_inline.leo.out +++ b/tests/expectations/compiler/compiler/array/multi_fail_inline.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:5:35\n |\n 5 | [1u8]]; // incorrect dimensions\n | ^^^^^\n |\n = unexpected type, expected: 'array of length 2', received: 'array of length 1'" + - "Error [EASG0373026]: unexpected type, expected: 'array of length 2', received: 'array of length 1'\n --> compiler-test:5:35\n |\n 5 | [1u8]]; // incorrect dimensions\n | ^^^^^" diff --git a/tests/expectations/compiler/compiler/array/multi_initializer.leo.out b/tests/expectations/compiler/compiler/array/multi_initializer.leo.out index bdaafd4168..b8fe56c3cb 100644 --- a/tests/expectations/compiler/compiler/array/multi_initializer.leo.out +++ b/tests/expectations/compiler/compiler/array/multi_initializer.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 21f90ee0a01e1238101360b72909766a148155d853fd903a3031d66340915101 - canonicalized_ast: cccb2040ce9b654f27e9a8e36976f220545c2888ed2aa9db73843b38407322f2 - type_inferenced_ast: 7cee4f94edf86b6c61af5dbb389b8901c57292810abf4cd6b4855dfee40370c7 + initial_ast: 411fd383234eaff206ddb89e59c53eb3cf89cc0584065cbcc6a407f7b6c657da + canonicalized_ast: 8730ae623fae334d698ea4169b630365f3026e6b39264da353e194feb07c0863 + type_inferenced_ast: 48ede78fbd4de76d6693bc2a50b813f119024f80d0a6c73f174f1a7ba56a92ce diff --git a/tests/expectations/compiler/compiler/array/multi_initializer_fail.leo.out b/tests/expectations/compiler/compiler/array/multi_initializer_fail.leo.out index 9a4256a73b..75c810dc3b 100644 --- a/tests/expectations/compiler/compiler/array/multi_initializer_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/multi_initializer_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:31\n |\n 4 | const arr: [u8; (2, 2)] = [1u8; (2, 1)]; // incorrect dimensions\n | ^^^^^^^^^^^^^\n |\n = unexpected type, expected: 'array of length 2', received: 'array of length 1'" + - "Error [EASG0373026]: unexpected type, expected: 'array of length 2', received: 'array of length 1'\n --> compiler-test:4:31\n |\n 4 | const arr: [u8; (2, 2)] = [1u8; (2, 1)]; // incorrect dimensions\n | ^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/array/nested.leo.out b/tests/expectations/compiler/compiler/array/nested.leo.out index 3e23b2d19b..a372f6cfae 100644 --- a/tests/expectations/compiler/compiler/array/nested.leo.out +++ b/tests/expectations/compiler/compiler/array/nested.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 796cfe23085a2fd72700df353d266d3e2f62e893faeba8ed1af5ee5178f8e706 - canonicalized_ast: d06970075b65456a138d9286fd3c445c928a55bf9819d98603b494c38563eae1 - type_inferenced_ast: 41b1e49c972a34ed3d4629feabe3cb37f2078ba44fd1f3bee0a1888ca86f7ae4 + initial_ast: 436ce80cb3f81cd43e5747a105b14947964f29c0c35070c394728cd2cd9b1fa3 + canonicalized_ast: 3097d80c877f857bd36f1e3ca56aefd7524a2fc46239959190ae9c5ef166ba9a + type_inferenced_ast: 873a71a8f9894e1967f0f750d63011597f17e0a51b5cd42ea0b74191ffa357a1 diff --git a/tests/expectations/compiler/compiler/array/nested_3x2_value.leo.out b/tests/expectations/compiler/compiler/array/nested_3x2_value.leo.out index a2f41114c4..5f11aa99e8 100644 --- a/tests/expectations/compiler/compiler/array/nested_3x2_value.leo.out +++ b/tests/expectations/compiler/compiler/array/nested_3x2_value.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 3c24983a1b881bd00f5f0fd3a40b471a35f5252798f4ed81784b68693529ad59 - canonicalized_ast: 177d06133dcc527a3110335158a888f4a0e5a5e904c2d6df57807563fd0ab386 - type_inferenced_ast: 06e32299c26e20b9a25104686911ecd4e94123bd8a90e7890a244b6288678f27 + initial_ast: 33a39a0f27f018eee2f2986d1356bcc9354ce3128447a60859f4392b8a4e4f29 + canonicalized_ast: c227ab0a4e864f62af90e4b1d843dcd41e65b65354107558cf26383831010a1d + type_inferenced_ast: c2515f900d7b2ae04c80ed1f7a3bf5729fec502dffc910cae03ac8cf02530dce diff --git a/tests/expectations/compiler/compiler/array/nested_3x2_value_fail.leo.out b/tests/expectations/compiler/compiler/array/nested_3x2_value_fail.leo.out index 75fe9847d8..ac7a7d9c6f 100644 --- a/tests/expectations/compiler/compiler/array/nested_3x2_value_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/nested_3x2_value_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:6:30\n |\n 6 | const a: [u32; (3, 2)] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^\n |\n = unexpected type, expected: 'array of length 3', received: 'array of length 2'" + - "Error [EASG0373026]: unexpected type, expected: 'array of length 3', received: 'array of length 2'\n --> compiler-test:6:30\n |\n 6 | const a: [u32; (3, 2)] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/array/registers.leo.out b/tests/expectations/compiler/compiler/array/registers.leo.out index 9960fc5374..f03de935e4 100644 --- a/tests/expectations/compiler/compiler/array/registers.leo.out +++ b/tests/expectations/compiler/compiler/array/registers.leo.out @@ -22,6 +22,6 @@ outputs: r: type: "[u8; 3]" value: "\"123\"" - initial_ast: 81dd2c459d5a1bff4963fb2cfdc67348183061934025b96739dc05c7b65a2a8b - canonicalized_ast: 81dd2c459d5a1bff4963fb2cfdc67348183061934025b96739dc05c7b65a2a8b - type_inferenced_ast: fcb8de69c92dff4a4adb8a160fc3b78042f394cd0dc627c5bf06820a095d7012 + initial_ast: c6b18b6fca7fda77a9eba151f4d27d084e1ad7aa616e6ec9deb1ef5f4bff2d24 + canonicalized_ast: c6b18b6fca7fda77a9eba151f4d27d084e1ad7aa616e6ec9deb1ef5f4bff2d24 + type_inferenced_ast: 6f6e6b35b55543bc87589005ac9a47830e3f65680a4db82e3f17d9280d6fa4ad diff --git a/tests/expectations/compiler/compiler/array/slice.leo.out b/tests/expectations/compiler/compiler/array/slice.leo.out index 9b847d5e42..4eb93da246 100644 --- a/tests/expectations/compiler/compiler/array/slice.leo.out +++ b/tests/expectations/compiler/compiler/array/slice.leo.out @@ -16,6 +16,6 @@ outputs: x: type: bool value: "true" - initial_ast: ca5fc7bf19d8e6ee1b1421f1a37ea84c42bc89e8ac90711488bc17e996e88a91 - canonicalized_ast: ca5fc7bf19d8e6ee1b1421f1a37ea84c42bc89e8ac90711488bc17e996e88a91 - type_inferenced_ast: 2823901914ffea0d4cfcf449b9e45b46f67255e0b50f7a946b0552b240bedc0d + initial_ast: e75ae154dab0f64ed38fc12e28289351e79787787e882847fbc020a780bc429f + canonicalized_ast: e75ae154dab0f64ed38fc12e28289351e79787787e882847fbc020a780bc429f + type_inferenced_ast: c5a14533d3c5d0751b98beb612a88eac2c7687ae77858dfcbc3424b160f1cd7d diff --git a/tests/expectations/compiler/compiler/array/slice_lower.leo.out b/tests/expectations/compiler/compiler/array/slice_lower.leo.out index b704c3d6ee..a93da800f0 100644 --- a/tests/expectations/compiler/compiler/array/slice_lower.leo.out +++ b/tests/expectations/compiler/compiler/array/slice_lower.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: a588964cfb6989b22b8bf7d6feaf90d09e228d61b09a48fd4e5e4b44473b5bd0 - canonicalized_ast: a588964cfb6989b22b8bf7d6feaf90d09e228d61b09a48fd4e5e4b44473b5bd0 - type_inferenced_ast: 838744e4d681a06ccb685d0c0de65897234d64f0a49887e896fbda087f3edfd6 + initial_ast: 748ad013543f1352f922fc5b566b38bf6a9de939a566c4484660f17460ef5cee + canonicalized_ast: 748ad013543f1352f922fc5b566b38bf6a9de939a566c4484660f17460ef5cee + type_inferenced_ast: 80f8d5b301bc982f189c63a4d908c7bf7a9a2d5ea351778d740035bad95f166a diff --git a/tests/expectations/compiler/compiler/array/spread.leo.out b/tests/expectations/compiler/compiler/array/spread.leo.out index 8399078a3b..09685b4e01 100644 --- a/tests/expectations/compiler/compiler/array/spread.leo.out +++ b/tests/expectations/compiler/compiler/array/spread.leo.out @@ -16,6 +16,6 @@ outputs: x: type: bool value: "true" - initial_ast: 2506cc8885eaae80a2ff90d1d231440dcfafd10fd8eb53317112ff2d2240d65e - canonicalized_ast: 2506cc8885eaae80a2ff90d1d231440dcfafd10fd8eb53317112ff2d2240d65e - type_inferenced_ast: bc0e1e40fcb7ac04e1dec943be5b93a1e39d43bee68a26713716765775674577 + initial_ast: 97004d55104bcf3b6698926656fb23c849cc1c488e387d151c1f3e2be4438fe0 + canonicalized_ast: 97004d55104bcf3b6698926656fb23c849cc1c488e387d151c1f3e2be4438fe0 + type_inferenced_ast: 7294dc3dee9189573cbf54b90692869b2a02a78fb3bbb6fe3e2436d2cca377fc diff --git a/tests/expectations/compiler/compiler/array/ternary_in_array.leo.out b/tests/expectations/compiler/compiler/array/ternary_in_array.leo.out index b8e13e745e..360c7d70c1 100644 --- a/tests/expectations/compiler/compiler/array/ternary_in_array.leo.out +++ b/tests/expectations/compiler/compiler/array/ternary_in_array.leo.out @@ -16,6 +16,6 @@ outputs: x: type: bool value: "true" - initial_ast: e238db049bc888e9243b421a188edbe5ae160127164b6bb75e54125052455565 - canonicalized_ast: e238db049bc888e9243b421a188edbe5ae160127164b6bb75e54125052455565 - type_inferenced_ast: e498240b5cb8c4d46a0b1035f208025df8e5feeabf9dddaa859a0a695ae8c5f6 + initial_ast: aa978e3283733cfee6cef1e6eff20b4847cf56962ccb3501b6501d31cd42ddb5 + canonicalized_ast: aa978e3283733cfee6cef1e6eff20b4847cf56962ccb3501b6501d31cd42ddb5 + type_inferenced_ast: edcba3eea639506ff172054105ac6533c6d184c131240e73f896f307983ba3c2 diff --git a/tests/expectations/compiler/compiler/array/tuple_3x2_value.leo.out b/tests/expectations/compiler/compiler/array/tuple_3x2_value.leo.out index 9658df9ec6..e31f9bed5d 100644 --- a/tests/expectations/compiler/compiler/array/tuple_3x2_value.leo.out +++ b/tests/expectations/compiler/compiler/array/tuple_3x2_value.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: d6195e7c9e70c521660ba312c607850110d864a1979004972a0f2908d476efd3 - canonicalized_ast: a3483e0912a5d47c95775b1b2d2c62fa5acd5f3c0432757dc261475183156490 - type_inferenced_ast: 54b0f61496c50ced01700f61d9c3eac6056d3835f38c2f39fe0c20e45447be63 + initial_ast: f92dd478e6c8fdb9a7f0dfd3ad0cf9e6e0239c59e5ee1fda0851fdcdfb2ca589 + canonicalized_ast: 0ce7eb5522cc65d45b259560b138eca8750b7a4231435f6b5df21c906db4d5ba + type_inferenced_ast: 1aeacac3268aed9b99f7d5a7736e9f32cd1a65905d3234d11ec5f6027bd68c66 diff --git a/tests/expectations/compiler/compiler/array/tuple_3x2_value_fail.leo.out b/tests/expectations/compiler/compiler/array/tuple_3x2_value_fail.leo.out index 307ef63fb6..1812da5de7 100644 --- a/tests/expectations/compiler/compiler/array/tuple_3x2_value_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/tuple_3x2_value_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:5:30\n |\n 5 | const a: [u32; (3, 2)] = [0; (2, 3)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^\n |\n = unexpected type, expected: 'array of length 3', received: 'array of length 2'" + - "Error [EASG0373026]: unexpected type, expected: 'array of length 3', received: 'array of length 2'\n --> compiler-test:5:30\n |\n 5 | const a: [u32; (3, 2)] = [0; (2, 3)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/array/type_fail.leo.out b/tests/expectations/compiler/compiler/array/type_fail.leo.out index c836958daa..06738a76cd 100644 --- a/tests/expectations/compiler/compiler/array/type_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/type_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:19\n |\n 4 | const a: [u8; -2] = [0u32; 2];\n | ^\n |\n = expected '(' -- got '-'" + - "Error [EPAR0370005]: expected ( -- got '-'\n --> compiler-test:4:19\n |\n 4 | const a: [u8; -2] = [0u32; 2];\n | ^" diff --git a/tests/expectations/compiler/compiler/array/type_input_3x2.leo.out b/tests/expectations/compiler/compiler/array/type_input_3x2.leo.out index e8f18bfbcc..66d3e5d43c 100644 --- a/tests/expectations/compiler/compiler/array/type_input_3x2.leo.out +++ b/tests/expectations/compiler/compiler/array/type_input_3x2.leo.out @@ -16,6 +16,6 @@ outputs: x: type: bool value: "true" - initial_ast: 42d14deb7baaf81b59723a453b1aa09e68bfc8677ce2903596de69ad6b7677ab - canonicalized_ast: 42d14deb7baaf81b59723a453b1aa09e68bfc8677ce2903596de69ad6b7677ab - type_inferenced_ast: 1559a3a4db454285ab969d20276d9112fca0b24f6726f64d4b0371dccde32abf + initial_ast: ab709670db7a5cc6642a175a78541054b53210f6be39a174d90ee57f3c5570f5 + canonicalized_ast: ab709670db7a5cc6642a175a78541054b53210f6be39a174d90ee57f3c5570f5 + type_inferenced_ast: f870e0b5181e4187da90ea8f7ea562596f0fea420425a403a972d761131718af diff --git a/tests/expectations/compiler/compiler/array/type_input_4x3x2.leo.out b/tests/expectations/compiler/compiler/array/type_input_4x3x2.leo.out index a7152bc822..03baa309e3 100644 --- a/tests/expectations/compiler/compiler/array/type_input_4x3x2.leo.out +++ b/tests/expectations/compiler/compiler/array/type_input_4x3x2.leo.out @@ -16,6 +16,6 @@ outputs: x: type: bool value: "true" - initial_ast: c7cf923f9ca2a963279a8ff7ae9aa0a11eaddc8ba3e107d48f3aef1d1c55a50f - canonicalized_ast: c7cf923f9ca2a963279a8ff7ae9aa0a11eaddc8ba3e107d48f3aef1d1c55a50f - type_inferenced_ast: 58b19d80de0abea85877257b60305e1f7b9d2e67044f60d0159699131d4ba6ec + initial_ast: 05ee62d30364f4d4ea3a6f680b049c3743d6fcb2cd7e751d798e61b38f1f0c70 + canonicalized_ast: 05ee62d30364f4d4ea3a6f680b049c3743d6fcb2cd7e751d798e61b38f1f0c70 + type_inferenced_ast: a1307016717f76519ff0f813ead70ed5460644e0e8414827665a1bd066159a76 diff --git a/tests/expectations/compiler/compiler/array/type_nested_value_nested_3x2.leo.out b/tests/expectations/compiler/compiler/array/type_nested_value_nested_3x2.leo.out index 2e2e0728b1..d77376c25f 100644 --- a/tests/expectations/compiler/compiler/array/type_nested_value_nested_3x2.leo.out +++ b/tests/expectations/compiler/compiler/array/type_nested_value_nested_3x2.leo.out @@ -16,6 +16,6 @@ outputs: x: type: bool value: "true" - initial_ast: dbc983cae35c2cd763e9bc4505a2d1e6c063fa62ccdc858a75644175512c1558 - canonicalized_ast: dbc983cae35c2cd763e9bc4505a2d1e6c063fa62ccdc858a75644175512c1558 - type_inferenced_ast: 42686f9d46c46c829259d4b68643d144d126e61a899e3c413ea09d0ed12d24d1 + initial_ast: 8caeaa858353e7f461b14364b898d538508c2e45c477c36dddc2960d4d626ed9 + canonicalized_ast: 8caeaa858353e7f461b14364b898d538508c2e45c477c36dddc2960d4d626ed9 + type_inferenced_ast: a61912871814695d648b0f176feaa0409b3d6bae3cb7c7a1234bf6543e015a5f diff --git a/tests/expectations/compiler/compiler/array/type_nested_value_nested_3x2_fail.leo.out b/tests/expectations/compiler/compiler/array/type_nested_value_nested_3x2_fail.leo.out index c2e1c7b7eb..217955800f 100644 --- a/tests/expectations/compiler/compiler/array/type_nested_value_nested_3x2_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/type_nested_value_nested_3x2_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:29\n |\n 4 | const b: [[u8; 2]; 3] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^\n |\n = unexpected type, expected: 'array of length 3', received: 'array of length 2'" + - "Error [EASG0373026]: unexpected type, expected: 'array of length 3', received: 'array of length 2'\n --> compiler-test:4:29\n |\n 4 | const b: [[u8; 2]; 3] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/array/type_nested_value_nested_4x3x2.leo.out b/tests/expectations/compiler/compiler/array/type_nested_value_nested_4x3x2.leo.out index 50fb2317b8..10106726b4 100644 --- a/tests/expectations/compiler/compiler/array/type_nested_value_nested_4x3x2.leo.out +++ b/tests/expectations/compiler/compiler/array/type_nested_value_nested_4x3x2.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 42a9307b4efda61137f9816a43e5c07a9d6b143bd88f609be7e549cb3b21d731 - canonicalized_ast: 42a9307b4efda61137f9816a43e5c07a9d6b143bd88f609be7e549cb3b21d731 - type_inferenced_ast: 67e643a53bb3efb99367869a1f3a937570f61658b004a4261e87b028f4976fad + initial_ast: 77b015384e8f21d34eef7f56465605fa133e739863a6bc33b01315232a86647e + canonicalized_ast: 77b015384e8f21d34eef7f56465605fa133e739863a6bc33b01315232a86647e + type_inferenced_ast: 4be69d8478185f5b9d4dcee3fc16ad4af858b7a47122bbc8e757d0dbc4bf92d8 diff --git a/tests/expectations/compiler/compiler/array/type_nested_value_nested_4x3x2_fail.leo.out b/tests/expectations/compiler/compiler/array/type_nested_value_nested_4x3x2_fail.leo.out index d6ca2e6d93..54c025b34a 100644 --- a/tests/expectations/compiler/compiler/array/type_nested_value_nested_4x3x2_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/type_nested_value_nested_4x3x2_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:34\n |\n 4 | const b: [[[u8; 2]; 3]; 4] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^^^^^^\n |\n = unexpected type, expected: 'array of length 4', received: 'array of length 2'" + - "Error [EASG0373026]: unexpected type, expected: 'array of length 4', received: 'array of length 2'\n --> compiler-test:4:34\n |\n 4 | const b: [[[u8; 2]; 3]; 4] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/array/type_nested_value_tuple_3x2.leo.out b/tests/expectations/compiler/compiler/array/type_nested_value_tuple_3x2.leo.out index e5632b4283..97d78e0fef 100644 --- a/tests/expectations/compiler/compiler/array/type_nested_value_tuple_3x2.leo.out +++ b/tests/expectations/compiler/compiler/array/type_nested_value_tuple_3x2.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 073b0033613b8c2f8ca027d0486697b5503943dbc65cec9cbbc6b5665e7432e4 - canonicalized_ast: 6751d75a95af032784678411bb4e0f59b509ec624daea475cab10b9cf14fe6a0 - type_inferenced_ast: 9b9ac4ba4533ecae7ec74da2ab929cfa85be393391887e95ffadf4d1df3004be + initial_ast: ce12666930386785c7a5afe142793c47eae62145ff1d50c590dc82c2b4baded6 + canonicalized_ast: 8220bc2881fe07bbfa873376696618fc182aff993d2a7d1a23ace5cc00965ff8 + type_inferenced_ast: c14a7e89debd9289883db476fdbc814d14bfc410d40d1ac100bbece88d35b7c8 diff --git a/tests/expectations/compiler/compiler/array/type_nested_value_tuple_3x2_fail.leo.out b/tests/expectations/compiler/compiler/array/type_nested_value_tuple_3x2_fail.leo.out index 830aec9ce6..d1af91c904 100644 --- a/tests/expectations/compiler/compiler/array/type_nested_value_tuple_3x2_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/type_nested_value_tuple_3x2_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:29\n |\n 4 | const b: [[u8; 2]; 3] = [0; (2, 3)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^\n |\n = unexpected type, expected: 'array of length 3', received: 'array of length 2'" + - "Error [EASG0373026]: unexpected type, expected: 'array of length 3', received: 'array of length 2'\n --> compiler-test:4:29\n |\n 4 | const b: [[u8; 2]; 3] = [0; (2, 3)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/array/type_nested_value_tuple_4x3x2.leo.out b/tests/expectations/compiler/compiler/array/type_nested_value_tuple_4x3x2.leo.out index 04cb12ed87..4c0c8b246d 100644 --- a/tests/expectations/compiler/compiler/array/type_nested_value_tuple_4x3x2.leo.out +++ b/tests/expectations/compiler/compiler/array/type_nested_value_tuple_4x3x2.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: d04220b24fd2648e859fab4caf69727b5532dbe1ee68db9d569153514e161a85 - canonicalized_ast: 36d30f97ff15f08a4a88b384a362168014d56bc90d6a3837fd213b2acfc42357 - type_inferenced_ast: 363bdf0ef5cf40b1b63a2cefa3d509ca731809568b7392899cbe73ec13104ecd + initial_ast: 609dfd962592e1dbf90051979163cead865cb69c0722c641517fad4f3091ec57 + canonicalized_ast: 4d6b8380c844ac6655c7dcc4c4a2ff45f14001577c82f21d87b4546e04c7e776 + type_inferenced_ast: d86da787361b7cea05474815138f2a1f98642b93232641bf399647788c0d5ecd diff --git a/tests/expectations/compiler/compiler/array/type_nested_value_tuple_4x3x2_fail.leo.out b/tests/expectations/compiler/compiler/array/type_nested_value_tuple_4x3x2_fail.leo.out index cead027c67..bf875ee25e 100644 --- a/tests/expectations/compiler/compiler/array/type_nested_value_tuple_4x3x2_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/type_nested_value_tuple_4x3x2_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:34\n |\n 4 | const b: [[[u8; 2]; 3]; 4] = [0; (2, 3, 4)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^^^^\n |\n = unexpected type, expected: 'array of length 4', received: 'array of length 2'" + - "Error [EASG0373026]: unexpected type, expected: 'array of length 4', received: 'array of length 2'\n --> compiler-test:4:34\n |\n 4 | const b: [[[u8; 2]; 3]; 4] = [0; (2, 3, 4)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/array/type_tuple_value_nested_3x2.leo.out b/tests/expectations/compiler/compiler/array/type_tuple_value_nested_3x2.leo.out index d341a7bbfc..621b4b1bed 100644 --- a/tests/expectations/compiler/compiler/array/type_tuple_value_nested_3x2.leo.out +++ b/tests/expectations/compiler/compiler/array/type_tuple_value_nested_3x2.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 15fa7dd3949e323b759a7290ff433fb0f6ec83308b1b9b1a6bb129650191bc80 - canonicalized_ast: 6a0262a7865ecf453b147449c52f23a1ffb38995c45d0a7c23a78255b9cbbb1b - type_inferenced_ast: 571acef2dd154ad80da051c43f402a9d10593c07b234de69fe9fc19284f09849 + initial_ast: 67cb2ae1b5b3e19a7c7aa8783d0f566b69bfb995e7848ec7746e1af0448c1aa8 + canonicalized_ast: 4aba053c866851bfcd22da037e0270ad43a7fabbdc263629af52eea38d577b7a + type_inferenced_ast: b44ceb7749802ff53c82221efad075565264531500665a01aa94f745e0c304cd diff --git a/tests/expectations/compiler/compiler/array/type_tuple_value_nested_3x2_fail.leo.out b/tests/expectations/compiler/compiler/array/type_tuple_value_nested_3x2_fail.leo.out index d04b4519f4..d9ade042ec 100644 --- a/tests/expectations/compiler/compiler/array/type_tuple_value_nested_3x2_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/type_tuple_value_nested_3x2_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:29\n |\n 4 | const b: [u8; (2, 3)] = [[0; 2]; 3]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^\n |\n = unexpected type, expected: 'array of length 2', received: 'array of length 3'" + - "Error [EASG0373026]: unexpected type, expected: 'array of length 2', received: 'array of length 3'\n --> compiler-test:4:29\n |\n 4 | const b: [u8; (2, 3)] = [[0; 2]; 3]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/array/type_tuple_value_nested_4x3x2.leo.out b/tests/expectations/compiler/compiler/array/type_tuple_value_nested_4x3x2.leo.out index 5e2b931939..29a8a9c198 100644 --- a/tests/expectations/compiler/compiler/array/type_tuple_value_nested_4x3x2.leo.out +++ b/tests/expectations/compiler/compiler/array/type_tuple_value_nested_4x3x2.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: ec1e31c0b1e2cc2cfa1476b9189d1b3e95e786d5b55e4c350a6888860613f4b2 - canonicalized_ast: dacc5bfe970669abcebe9363e0bc84fe7fb8e0c816dda756b00cc38ae993e781 - type_inferenced_ast: f8c48aff4a11661fe164e69af32a99a5259f05a10287de26aea2fd323d4744ef + initial_ast: 9867f722c5ce3ccbc3701238c216acc2b7e37bdc6163a8f7a4a4d88b7f19b73a + canonicalized_ast: d5f9deb2b7806ec665a6c6a5a6a0bee2c76310ecec4f34a8a479aa6934902b3a + type_inferenced_ast: ed9cee663a3a9dc51ba06a80e5f192fdcc49e62b8e4cb0ae9582f3a7f7b1de25 diff --git a/tests/expectations/compiler/compiler/array/type_tuple_value_nested_4x3x2_fail.leo.out b/tests/expectations/compiler/compiler/array/type_tuple_value_nested_4x3x2_fail.leo.out index e3d2fe1df3..f236a3578a 100644 --- a/tests/expectations/compiler/compiler/array/type_tuple_value_nested_4x3x2_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/type_tuple_value_nested_4x3x2_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:32\n |\n 4 | const b: [u8; (4, 3, 2)] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^^^^^^\n |\n = unexpected type, expected: 'array of length 4', received: 'array of length 2'" + - "Error [EASG0373026]: unexpected type, expected: 'array of length 4', received: 'array of length 2'\n --> compiler-test:4:32\n |\n 4 | const b: [u8; (4, 3, 2)] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_3x2.leo.out b/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_3x2.leo.out index 736befa2e7..20cd329a0c 100644 --- a/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_3x2.leo.out +++ b/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_3x2.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 37ec6089b9e1af0c552e259848d1ecd8bb361dd8a5c348d6b34f7f5262dc6f40 - canonicalized_ast: ad2b199caadb797e02aded3020468c9d7a2b3094652c3b27436b8f98cc71dc05 - type_inferenced_ast: cb373502d7141af431342592470482ef936a5fc9e6f4ede8a01e8e98537988de + initial_ast: 222950738e89721363dd15b8f5d240befa46d434c45f486857ec4898806d0e84 + canonicalized_ast: b89098b4159b284f07be789cfb5b196515c9d33821be1411c4bc25ae3c90425f + type_inferenced_ast: 4e0acee05ff837a30c1057dec0c5cc18a6ce573e5891218990f88584fef683a7 diff --git a/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_3x2_fail.leo.out b/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_3x2_fail.leo.out index 574ecb8b5d..243e146be8 100644 --- a/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_3x2_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_3x2_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:29\n |\n 4 | const b: [u8; (2, 3)] = [0; (3, 2)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^\n |\n = unexpected type, expected: 'array of length 2', received: 'array of length 3'" + - "Error [EASG0373026]: unexpected type, expected: 'array of length 2', received: 'array of length 3'\n --> compiler-test:4:29\n |\n 4 | const b: [u8; (2, 3)] = [0; (3, 2)]; // initializer (incorrectly reversed ordering)\n | ^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_4x3x2.leo.out b/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_4x3x2.leo.out index 026cb9b481..cb1620363c 100644 --- a/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_4x3x2.leo.out +++ b/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_4x3x2.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: b351c4655069ba4e5ae6759b10109406d64b74c652aab8be3547912df3e10c83 - canonicalized_ast: e9e15873ef2727704b7b4f711516e6f8833a177fe4ff9379823dca293ecb8a72 - type_inferenced_ast: d040a5aac628379fa32c3e36980f8dac3996a5240bc3482e44c2fdb1d8c3ef60 + initial_ast: a312fb26b99d2c4a7891d482079f0220663dba780bc68b9f651def2cd9bad960 + canonicalized_ast: 01c472ee0495bbb164f67159e86483a29421918178a7115ebd3b905d6909150f + type_inferenced_ast: ac2c37891e21027028b4a1e4b8f5972e5ee64f91f6b2ba6a85218c622192ce02 diff --git a/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_4x3x2_fail.leo.out b/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_4x3x2_fail.leo.out index 88fe3146e2..370d7730e6 100644 --- a/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_4x3x2_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/type_tuple_value_tuple_4x3x2_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:32\n |\n 4 | const b: [u8; (4, 3, 2)] = [0; (2, 3, 4)]; // initializer (incorrectly reversed order)\n | ^^^^^^^^^^^^^^\n |\n = unexpected type, expected: 'array of length 4', received: 'array of length 2'" + - "Error [EASG0373026]: unexpected type, expected: 'array of length 4', received: 'array of length 2'\n --> compiler-test:4:32\n |\n 4 | const b: [u8; (4, 3, 2)] = [0; (2, 3, 4)]; // initializer (incorrectly reversed order)\n | ^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/array/variable_slice_fail.leo.out b/tests/expectations/compiler/compiler/array/variable_slice_fail.leo.out index b38b3bbbf2..2362a9a01e 100644 --- a/tests/expectations/compiler/compiler/array/variable_slice_fail.leo.out +++ b/tests/expectations/compiler/compiler/array/variable_slice_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:7:17\n |\n 7 | console.debug(\"{}\", x);\n | ^^^^^\n |\n = expected identifier 'assert', 'error', 'log' -- got 'debug'" + - "Error [EPAR0370007]: unexpected identifier: expected 'assert', 'error', 'log' -- got 'debug'\n --> compiler-test:7:17\n |\n 7 | console.debug(\"{}\", x);\n | ^^^^^" diff --git a/tests/expectations/compiler/compiler/boolean/and.leo.out b/tests/expectations/compiler/compiler/boolean/and.leo.out index 80cf302a7a..5714d0de0b 100644 --- a/tests/expectations/compiler/compiler/boolean/and.leo.out +++ b/tests/expectations/compiler/compiler/boolean/and.leo.out @@ -34,6 +34,6 @@ outputs: x: type: bool value: "true" - initial_ast: 457931d2a45a5872b3f523ee9ed3ae922635750e38048927ee39dcd2fdaf338d - canonicalized_ast: 457931d2a45a5872b3f523ee9ed3ae922635750e38048927ee39dcd2fdaf338d - type_inferenced_ast: 5268ad28b10aedcd44c0aafced11ed0351999fceb6a202ed5a1faf833da5c2c4 + initial_ast: 9f6929c30448a269b4a22f3001085be75f91bc91503978f2804f4d6bf7dd246f + canonicalized_ast: 9f6929c30448a269b4a22f3001085be75f91bc91503978f2804f4d6bf7dd246f + type_inferenced_ast: b41ada9ca834d73d94641fa3f28c95bea6e6862819bab431ac4b02cc342fb659 diff --git a/tests/expectations/compiler/compiler/boolean/conditional.leo.out b/tests/expectations/compiler/compiler/boolean/conditional.leo.out index 1e0ae4c270..0551b1c42f 100644 --- a/tests/expectations/compiler/compiler/boolean/conditional.leo.out +++ b/tests/expectations/compiler/compiler/boolean/conditional.leo.out @@ -34,6 +34,6 @@ outputs: x: type: bool value: "true" - initial_ast: 57ab6c27f0cc1f947f533b8758a8d7643358eb972fa52d8e97fd12403a3a14e0 - canonicalized_ast: 57ab6c27f0cc1f947f533b8758a8d7643358eb972fa52d8e97fd12403a3a14e0 - type_inferenced_ast: 55a49f89b8b70b430ca8919b6dbbb3b350a98a8a9e498377d878dd4336a050e6 + initial_ast: 3de9d88d40969c01145790a5903ab2dfa1a7614ec4f4d62c20b86b917653008e + canonicalized_ast: 3de9d88d40969c01145790a5903ab2dfa1a7614ec4f4d62c20b86b917653008e + type_inferenced_ast: 53a91ffe37b6a96f1c239669f04ab600f51d2a200a8aed2dee0dc50bb5fa4f7d diff --git a/tests/expectations/compiler/compiler/boolean/equal.leo.out b/tests/expectations/compiler/compiler/boolean/equal.leo.out index 2883376a47..8e0ba59214 100644 --- a/tests/expectations/compiler/compiler/boolean/equal.leo.out +++ b/tests/expectations/compiler/compiler/boolean/equal.leo.out @@ -34,6 +34,6 @@ outputs: x: type: bool value: "true" - initial_ast: dcd562246dac98c86986cd3c8519ef6bab0d6ad9eb910ef2b797e25eebf66160 - canonicalized_ast: dcd562246dac98c86986cd3c8519ef6bab0d6ad9eb910ef2b797e25eebf66160 - type_inferenced_ast: ac5fc2712e702bdd3735bdac2885d028ed66ced47e0f3c310f8c17191a6aa9fe + initial_ast: 7fe0c7281b31c1f126d41c425f852930de3283b0deb54362fba0834b6eb83ae3 + canonicalized_ast: 7fe0c7281b31c1f126d41c425f852930de3283b0deb54362fba0834b6eb83ae3 + type_inferenced_ast: 5c851d6f023000766f370ec5bc048af431212368c68fb1ba674500ae7451a36e diff --git a/tests/expectations/compiler/compiler/boolean/not_equal.leo.out b/tests/expectations/compiler/compiler/boolean/not_equal.leo.out index 1384632ee4..04575f4f5e 100644 --- a/tests/expectations/compiler/compiler/boolean/not_equal.leo.out +++ b/tests/expectations/compiler/compiler/boolean/not_equal.leo.out @@ -34,6 +34,6 @@ outputs: x: type: bool value: "false" - initial_ast: aa57c32deb2ca3f69aac1c8d6ab1c9ca787d7539d15dd6ae1d132c4bdf1628f0 - canonicalized_ast: aa57c32deb2ca3f69aac1c8d6ab1c9ca787d7539d15dd6ae1d132c4bdf1628f0 - type_inferenced_ast: 730367497b7b56381f29321e18eade74d70107a6d8c657b47022215015f53801 + initial_ast: aae17ba5bd2ce376b5c440df42be442b0731feb499fa37b133b89f364a8790bf + canonicalized_ast: aae17ba5bd2ce376b5c440df42be442b0731feb499fa37b133b89f364a8790bf + type_inferenced_ast: 5b110c3aa3e0d65942f7a7fdbdccfc745aa810ea7d71137358f220d2bfecb0b7 diff --git a/tests/expectations/compiler/compiler/boolean/or.leo.out b/tests/expectations/compiler/compiler/boolean/or.leo.out index 451ad885f1..19ef883621 100644 --- a/tests/expectations/compiler/compiler/boolean/or.leo.out +++ b/tests/expectations/compiler/compiler/boolean/or.leo.out @@ -34,6 +34,6 @@ outputs: x: type: bool value: "true" - initial_ast: fe77500ebf653bfe8620287f2c9e52f0e985c915a09a285be3b659a308649a65 - canonicalized_ast: fe77500ebf653bfe8620287f2c9e52f0e985c915a09a285be3b659a308649a65 - type_inferenced_ast: 52112d0a4983f119ba82655780b8aead34d1cced758e5595ce62dbc717f95cae + initial_ast: 35fd6670d1c00d5c70861e58f988536f86dbe84d26cb1cdf601228a3b784296e + canonicalized_ast: 35fd6670d1c00d5c70861e58f988536f86dbe84d26cb1cdf601228a3b784296e + type_inferenced_ast: 3dd86ce4e1ecce14619b49e274f1c3275ec7561f82655eadda4752f20e771802 diff --git a/tests/expectations/compiler/compiler/char/circuit.leo.out b/tests/expectations/compiler/compiler/char/circuit.leo.out index 65ee2bb59e..727dce531b 100644 --- a/tests/expectations/compiler/compiler/char/circuit.leo.out +++ b/tests/expectations/compiler/compiler/char/circuit.leo.out @@ -100,6 +100,6 @@ outputs: r: type: char value: "'\\u{1f62d}'" - initial_ast: 680d480560e2a187669f5bf3c328cee1865021cbe4c19f3350db843d312b6406 - canonicalized_ast: 680d480560e2a187669f5bf3c328cee1865021cbe4c19f3350db843d312b6406 - type_inferenced_ast: 385365a7d46c458c2d5f94690acc53191bf234bcdb928a9efc454c33ba06718a + initial_ast: aa3eb0c4de0eebada9490b11e35c36923316559727a3afce28fe3852a805354a + canonicalized_ast: aa3eb0c4de0eebada9490b11e35c36923316559727a3afce28fe3852a805354a + type_inferenced_ast: 73309200d30bf2831847477f3da7ede4ba9f4aa377e6ebf15c9c34774f53bcb5 diff --git a/tests/expectations/compiler/compiler/char/invalid_char.leo.out b/tests/expectations/compiler/compiler/char/invalid_char.leo.out index c529e663ae..1044b2dbf1 100644 --- a/tests/expectations/compiler/compiler/char/invalid_char.leo.out +++ b/tests/expectations/compiler/compiler/char/invalid_char.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:23\n |\n 4 | const not_valid = '';\n | ^\n |\n = unexpected token: '''" + - "Error [EPAR0370000]: '\n --> compiler-test:4:23\n |\n 4 | const not_valid = '';\n | ^\n |\n = HELP TODO" diff --git a/tests/expectations/compiler/compiler/char/neq.leo.out b/tests/expectations/compiler/compiler/char/neq.leo.out index 650ac5b345..b78933acc7 100644 --- a/tests/expectations/compiler/compiler/char/neq.leo.out +++ b/tests/expectations/compiler/compiler/char/neq.leo.out @@ -100,6 +100,6 @@ outputs: r: type: char value: "'a'" - initial_ast: 66ea1340fc8ae77142ea3d254d8d3350a2775549ea7ba0ab550ec88b5c5721d4 - canonicalized_ast: 66ea1340fc8ae77142ea3d254d8d3350a2775549ea7ba0ab550ec88b5c5721d4 - type_inferenced_ast: 7b07de0d440a813b674c11dcc71fa4daee8224d5136844d66bc7fafa60f38725 + initial_ast: d3a773c0b0555cc2c3a6d2fafb9e567488ea8fd91ea965f758ec9f58a4679dd7 + canonicalized_ast: d3a773c0b0555cc2c3a6d2fafb9e567488ea8fd91ea965f758ec9f58a4679dd7 + type_inferenced_ast: 460b284982e0fb9819768800b2c84ab682929bba1b6056f03e5e90bfe7f92420 diff --git a/tests/expectations/compiler/compiler/char/nonprinting.leo.out b/tests/expectations/compiler/compiler/char/nonprinting.leo.out index 2acf2401e1..3ab1b59a50 100644 --- a/tests/expectations/compiler/compiler/char/nonprinting.leo.out +++ b/tests/expectations/compiler/compiler/char/nonprinting.leo.out @@ -19,6 +19,6 @@ outputs: r1: type: bool value: "true" - initial_ast: 3484f8dedfe79e122e5b4a7e7d00fa185fa08884b67e6824b29580694c5983f6 - canonicalized_ast: 3484f8dedfe79e122e5b4a7e7d00fa185fa08884b67e6824b29580694c5983f6 - type_inferenced_ast: 47dc1acd415b62312ed330c9ef12620f187858ea2b0572b3404936cfb902cdd4 + initial_ast: b03b0ea8ad821952fa64e477900b43c830e9fbd9693478018ad4b13abd12b027 + canonicalized_ast: b03b0ea8ad821952fa64e477900b43c830e9fbd9693478018ad4b13abd12b027 + type_inferenced_ast: 4ded1909fcd3fa1edf7de8111d3f7b97fced37b5b2d18b316f9fee3aad246f5e diff --git a/tests/expectations/compiler/compiler/char/out.leo.out b/tests/expectations/compiler/compiler/char/out.leo.out index ab57323b5e..52b322b5b0 100644 --- a/tests/expectations/compiler/compiler/char/out.leo.out +++ b/tests/expectations/compiler/compiler/char/out.leo.out @@ -100,6 +100,6 @@ outputs: r: type: char value: "'\\u{1f62d}'" - initial_ast: bfd9bc4584922f1010085bd8f2a44594eb07c5c3ffbca6efa5eecc08c5134c0b - canonicalized_ast: bfd9bc4584922f1010085bd8f2a44594eb07c5c3ffbca6efa5eecc08c5134c0b - type_inferenced_ast: 5986610003c35e0ad024bf0b3a002fe6228548ccd7d99fc2a18f140609851337 + initial_ast: 2e1dc058de58dbe98a1f19e7b883fed916d58fc5087de2c2bd06bb98324411d5 + canonicalized_ast: 2e1dc058de58dbe98a1f19e7b883fed916d58fc5087de2c2bd06bb98324411d5 + type_inferenced_ast: 40d126753bfa96341a167671ffc7244c6430d8f40934d8197c969baa9b49c785 diff --git a/tests/expectations/compiler/compiler/circuits/big_self_in_circuit_replacement.leo.out b/tests/expectations/compiler/compiler/circuits/big_self_in_circuit_replacement.leo.out index 7bd0bf3fb0..25c76f1edc 100644 --- a/tests/expectations/compiler/compiler/circuits/big_self_in_circuit_replacement.leo.out +++ b/tests/expectations/compiler/compiler/circuits/big_self_in_circuit_replacement.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: aa87a9d1c477e2d5b7ae824fb434188dd6c5c519dd27ebaecd30e44be401ee1b - canonicalized_ast: f188b62839a17478878fe1dfc9863bac20fa1c0c6cf51eae5e13c5f5f79f6c1a - type_inferenced_ast: 9e838aeeebdd2f800c2e7305614f123c27d8390fbadabf1bcb15dae6466669a6 + initial_ast: 776ea4bb946bb5d56430c22be58f3539dbecb25a11ec07e5e8bd3db49be7f937 + canonicalized_ast: 6a95acbcb25193b7b9f9e7a2bbcaeafa83ec09163e097b12076ea512a9daaf14 + type_inferenced_ast: d71ab34660bf998f236dfe59e55050f9f5fba8671bacbbdde04b4902927ec571 diff --git a/tests/expectations/compiler/compiler/circuits/big_self_outside_circuit_fail.leo.out b/tests/expectations/compiler/compiler/circuits/big_self_outside_circuit_fail.leo.out index e5395fd2d6..7d1e87d756 100644 --- a/tests/expectations/compiler/compiler/circuits/big_self_outside_circuit_fail.leo.out +++ b/tests/expectations/compiler/compiler/circuits/big_self_outside_circuit_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:16:3\n |\n 16 | let foo: Self = Foo::new();\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = cannot call keyword `Self` outside of a circuit function" + - "Error [EAST0372005]: cannot call keyword `Self` outside of a circuit function\n --> compiler-test:16:3\n |\n 16 | let foo: Self = Foo::new();\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/circuits/const_self_variable.leo.out b/tests/expectations/compiler/compiler/circuits/const_self_variable.leo.out index 0dec0b1733..cd5036c8e5 100644 --- a/tests/expectations/compiler/compiler/circuits/const_self_variable.leo.out +++ b/tests/expectations/compiler/compiler/circuits/const_self_variable.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: da9350459a9579ec5961fc26b81a67a88060caaaea27448fa02f86271227b213 - canonicalized_ast: da9350459a9579ec5961fc26b81a67a88060caaaea27448fa02f86271227b213 - type_inferenced_ast: 2dd2c4378253f239047ae310657e24dae70ba7181d1cf08d89007c2f1a37d332 + initial_ast: b438fb664bd7b8683beabd5044efba7669d3fcab093994b1c386a30ad63fff14 + canonicalized_ast: b438fb664bd7b8683beabd5044efba7669d3fcab093994b1c386a30ad63fff14 + type_inferenced_ast: 9094424be690a804ae2e5d3ca2787104de01dc6bca89fe6d349db5709c5161ac diff --git a/tests/expectations/compiler/compiler/circuits/const_self_variable_fail.leo.out b/tests/expectations/compiler/compiler/circuits/const_self_variable_fail.leo.out index 8a8dcf0be6..d3d1a707f1 100644 --- a/tests/expectations/compiler/compiler/circuits/const_self_variable_fail.leo.out +++ b/tests/expectations/compiler/compiler/circuits/const_self_variable_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:7:9\n |\n 7 | self.a = new;\n | ^^^^^^^^^^^^\n |\n = illegal assignment to immutable variable 'self'" + - "Error [EASG0373033]: illegal assignment to immutable variable 'self'\n --> compiler-test:7:9\n |\n 7 | self.a = new;\n | ^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/circuits/define_circuit_inside_circuit_function.leo.out b/tests/expectations/compiler/compiler/circuits/define_circuit_inside_circuit_function.leo.out index 8423b5b6ec..cc4b1e0369 100644 --- a/tests/expectations/compiler/compiler/circuits/define_circuit_inside_circuit_function.leo.out +++ b/tests/expectations/compiler/compiler/circuits/define_circuit_inside_circuit_function.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 583cb3219a67fcbb30d241dec9e2860d99db27b109c8d095c10838ea342efd3c - canonicalized_ast: 583cb3219a67fcbb30d241dec9e2860d99db27b109c8d095c10838ea342efd3c - type_inferenced_ast: bbb33dca916b1310a58492ecd4bc74ed03ef3ab87870391839fc8b627f31e941 + initial_ast: 7221141253b1998cbddad5f0c1385e7b53450a535112c0eb112b5af01474ce20 + canonicalized_ast: 7221141253b1998cbddad5f0c1385e7b53450a535112c0eb112b5af01474ce20 + type_inferenced_ast: f208046c46de9c4a42c47079504791711c9b0c8b3fb35dd413243fcbfd7dbd90 diff --git a/tests/expectations/compiler/compiler/circuits/duplicate_name_context.leo.out b/tests/expectations/compiler/compiler/circuits/duplicate_name_context.leo.out index e477b4a944..ab25d96b9a 100644 --- a/tests/expectations/compiler/compiler/circuits/duplicate_name_context.leo.out +++ b/tests/expectations/compiler/compiler/circuits/duplicate_name_context.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: e96236da6f97f8472930c05f30db95afa0c914060fe3ee908af57dbc1644f6b8 - canonicalized_ast: e96236da6f97f8472930c05f30db95afa0c914060fe3ee908af57dbc1644f6b8 - type_inferenced_ast: 933e32a944dbeba01b9c1600ccdec94370927087a3a2b5511bdf4767b5fecd7b + initial_ast: 46d600c5f3b64378fbdcff7b4097d54e3855eded01d642f5af25fa3aef44eede + canonicalized_ast: 46d600c5f3b64378fbdcff7b4097d54e3855eded01d642f5af25fa3aef44eede + type_inferenced_ast: e5cdf935d34157bdbc2eb228c94e2222887c91fc3bc1c9f24bc6e84fddde9730 diff --git a/tests/expectations/compiler/compiler/circuits/inline.leo.out b/tests/expectations/compiler/compiler/circuits/inline.leo.out index 859d29d610..f5649f0b60 100644 --- a/tests/expectations/compiler/compiler/circuits/inline.leo.out +++ b/tests/expectations/compiler/compiler/circuits/inline.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: u32 value: "100" - initial_ast: 7a6b3abb44b3770f98b45c1f961539ae538e1b5fb2b62ae7bffeaf2209739bc3 - canonicalized_ast: 7a6b3abb44b3770f98b45c1f961539ae538e1b5fb2b62ae7bffeaf2209739bc3 - type_inferenced_ast: 88703ec6b9780a1e7629b14afd0e3da35ff4d68f968db2926242f745d6f61b4d + initial_ast: ba821e922e3b934581e39a58e2ef08d14b6cb0355500ed79f017dc0ecd39651c + canonicalized_ast: ba821e922e3b934581e39a58e2ef08d14b6cb0355500ed79f017dc0ecd39651c + type_inferenced_ast: 03fadaa1772f83ffa18a67a2279a65bad0715a6077f7219ff8955b45707c0437 diff --git a/tests/expectations/compiler/compiler/circuits/inline_fail.leo.out b/tests/expectations/compiler/compiler/circuits/inline_fail.leo.out index f64e632faa..6854a2bc6f 100644 --- a/tests/expectations/compiler/compiler/circuits/inline_fail.leo.out +++ b/tests/expectations/compiler/compiler/circuits/inline_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:9:15\n |\n 9 | const a = Foo { y: 0u32 };\n | ^^^^^^^^^^^^^^^\n |\n = missing circuit member 'x' for initialization of circuit 'Foo'" + - "Error [EASG0373003]: missing circuit member 'x' for initialization of circuit 'Foo'\n --> compiler-test:9:15\n |\n 9 | const a = Foo { y: 0u32 };\n | ^^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/circuits/inline_member_fail.leo.out b/tests/expectations/compiler/compiler/circuits/inline_member_fail.leo.out index c87d98a1e2..a6b6460e54 100644 --- a/tests/expectations/compiler/compiler/circuits/inline_member_fail.leo.out +++ b/tests/expectations/compiler/compiler/circuits/inline_member_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:9:15\n |\n 9 | const a = Foo { y };\n | ^^^^^^^^^\n |\n = missing circuit member 'x' for initialization of circuit 'Foo'" + - "Error [EASG0373003]: missing circuit member 'x' for initialization of circuit 'Foo'\n --> compiler-test:9:15\n |\n 9 | const a = Foo { y };\n | ^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/circuits/inline_member_pass.leo.out b/tests/expectations/compiler/compiler/circuits/inline_member_pass.leo.out index 86e9316902..024e4f07b1 100644 --- a/tests/expectations/compiler/compiler/circuits/inline_member_pass.leo.out +++ b/tests/expectations/compiler/compiler/circuits/inline_member_pass.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 489c3e8ccafc04e118846f4009d93dfbf018902fbdcd1dde6798cc853bcd8903 - canonicalized_ast: 4b8614afcbaf258d87202daa83f1340762d9a90f4edd7723b8a83df74acbbeb1 - type_inferenced_ast: 3e23d0db328e40ffa2a1ced543295650aa724a8b2dc795bbca54a40ca726b59a + initial_ast: 58d028cbd020f04ef3b1025a07dabbc8bc4f5a2adf7e2ca4bb67cc229d4f64cd + canonicalized_ast: 5e72d67df40e8ecd2ae9999419888ade6ebf1c054f1f80f91a274360e294d361 + type_inferenced_ast: 177f3be4bed2ca8e1a9543b8bb71a75a751d6835dcac15910bc4bd5fa9e25897 diff --git a/tests/expectations/compiler/compiler/circuits/inline_undefined.leo.out b/tests/expectations/compiler/compiler/circuits/inline_undefined.leo.out index 0a3ab75cf6..690ccca5b5 100644 --- a/tests/expectations/compiler/compiler/circuits/inline_undefined.leo.out +++ b/tests/expectations/compiler/compiler/circuits/inline_undefined.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:15\n |\n 4 | const a = Foo { };\n | ^^^\n |\n = failed to resolve circuit: 'Foo'" + - "Error [EASG0373000]: failed to resolve circuit: 'Foo'\n --> compiler-test:4:15\n |\n 4 | const a = Foo { };\n | ^^^" diff --git a/tests/expectations/compiler/compiler/circuits/member_function.leo.out b/tests/expectations/compiler/compiler/circuits/member_function.leo.out index 206329dc34..0f4bb0e507 100644 --- a/tests/expectations/compiler/compiler/circuits/member_function.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_function.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 8eacc56577069bef188ac3bbabbceaca5fb8955af1e8ea74ef52f01ce7bd4516 - canonicalized_ast: 8eacc56577069bef188ac3bbabbceaca5fb8955af1e8ea74ef52f01ce7bd4516 - type_inferenced_ast: d5947d1cd599d713fdaafe3cc1084784639c768d5069151dfe7dd0cb02e28ae2 + initial_ast: 681bcdc031155971ce0dab8c8ee659df3f09b97b4e6b4525d47f4a045765a57c + canonicalized_ast: 681bcdc031155971ce0dab8c8ee659df3f09b97b4e6b4525d47f4a045765a57c + type_inferenced_ast: 40920da878d0316ea8fd4d1963e53843b1d8933441fd568adba5f11e4ded7246 diff --git a/tests/expectations/compiler/compiler/circuits/member_function_fail.leo.out b/tests/expectations/compiler/compiler/circuits/member_function_fail.leo.out index 48e4365950..5c34a23b9d 100644 --- a/tests/expectations/compiler/compiler/circuits/member_function_fail.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_function_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:11:17\n |\n 11 | const err = a.echoed(1u32);\n | ^^^^^^^^\n |\n = illegal reference to non-existant member 'echoed' of circuit 'Foo'" + - "Error [EASG0373002]: illegal reference to non-existant member 'echoed' of circuit 'Foo'\n --> compiler-test:11:17\n |\n 11 | const err = a.echoed(1u32);\n | ^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/circuits/member_function_invalid.leo.out b/tests/expectations/compiler/compiler/circuits/member_function_invalid.leo.out index acf65fe3b4..50f8f5a0b5 100644 --- a/tests/expectations/compiler/compiler/circuits/member_function_invalid.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_function_invalid.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:11:17\n |\n 11 | const err = a.echo(1u32); // echo is a static function and must be accessed using `::`\n | ^^^^^^\n |\n = cannot call static function 'echo' of circuit 'Foo' from target" + - "Error [EASG0373009]: cannot call static function 'echo' of circuit 'Foo' from target\n --> compiler-test:11:17\n |\n 11 | const err = a.echo(1u32); // echo is a static function and must be accessed using `::`\n | ^^^^^^" diff --git a/tests/expectations/compiler/compiler/circuits/member_function_nested.leo.out b/tests/expectations/compiler/compiler/circuits/member_function_nested.leo.out index c36f829b9a..7869be8c61 100644 --- a/tests/expectations/compiler/compiler/circuits/member_function_nested.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_function_nested.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: f4796f1f9215d0c6d42478aae63b1495dfad36eaaec4a981dddac9def85ffef0 - canonicalized_ast: f4796f1f9215d0c6d42478aae63b1495dfad36eaaec4a981dddac9def85ffef0 - type_inferenced_ast: f808f56c8af9d6677bf54e7f777b3023f82144462df704dc4f3e39830be4c109 + initial_ast: 05ea77fc193abe91954fc2fcd338d3ebfaff6bb7939339e9dcc78e514802dd42 + canonicalized_ast: 05ea77fc193abe91954fc2fcd338d3ebfaff6bb7939339e9dcc78e514802dd42 + type_inferenced_ast: 9827f4b622a95714f55620295e8ce9d9cf6fc85603a869b178825c818d64d768 diff --git a/tests/expectations/compiler/compiler/circuits/member_static_function.leo.out b/tests/expectations/compiler/compiler/circuits/member_static_function.leo.out index 6630cd07bc..997cb9340a 100644 --- a/tests/expectations/compiler/compiler/circuits/member_static_function.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_static_function.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 75577795f48b9c4f50fed7051e3d76e4b76e3d3b6896ead606d3ebe925e43d2f - canonicalized_ast: 75577795f48b9c4f50fed7051e3d76e4b76e3d3b6896ead606d3ebe925e43d2f - type_inferenced_ast: 60a0557cf60a23b458e3a7ef25299f3fef8cae5c473446b54bb7e98ed91b70f0 + initial_ast: da39dd8a0b9ddb1304cfe1fd1dd555c01c43750524db4021d27e1425ec175322 + canonicalized_ast: da39dd8a0b9ddb1304cfe1fd1dd555c01c43750524db4021d27e1425ec175322 + type_inferenced_ast: 6cdc6a128cc2fb9220293b7c34ba4066cc63911f5ffbe00959142992f358e488 diff --git a/tests/expectations/compiler/compiler/circuits/member_static_function_invalid.leo.out b/tests/expectations/compiler/compiler/circuits/member_static_function_invalid.leo.out index b41d2c24b2..0fedea2143 100644 --- a/tests/expectations/compiler/compiler/circuits/member_static_function_invalid.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_static_function_invalid.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:10:17\n |\n 10 | const err = Foo.echo(1u32); // Invalid, echo is a static function and must be accessed using `::`\n | ^^^\n |\n = failed to resolve variable reference 'Foo'" + - "Error [EASG0373028]: failed to resolve variable reference 'Foo'\n --> compiler-test:10:17\n |\n 10 | const err = Foo.echo(1u32); // Invalid, echo is a static function and must be accessed using `::`\n | ^^^" diff --git a/tests/expectations/compiler/compiler/circuits/member_static_function_nested.leo.out b/tests/expectations/compiler/compiler/circuits/member_static_function_nested.leo.out index 14f7a27016..65a10e56bf 100644 --- a/tests/expectations/compiler/compiler/circuits/member_static_function_nested.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_static_function_nested.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 4c74b65863cddde8ce523495358ab619ec48645dcb8409658a3fb3d7a3821d6d - canonicalized_ast: 45dc35a683e14503f8a1fc40280f05e7d096b49896f115ffa649e76b9cd80941 - type_inferenced_ast: 11af72cfc90adc12c3412e3067ad285a2279de0f4f12af5081dbe27c58b5a3bf + initial_ast: 380f44a5f5d7c1ef76c593da32936d480e79240bb7cd17fce0122b18c9e7f722 + canonicalized_ast: 82f1edfa14a6e28b57828bf5f4be2aaaf21fb5468c0388088a56a4e44adb31fe + type_inferenced_ast: ab690a29d11e08699223ec4009174acdec23c3667d523af63556187d7396e66b diff --git a/tests/expectations/compiler/compiler/circuits/member_static_function_undefined.leo.out b/tests/expectations/compiler/compiler/circuits/member_static_function_undefined.leo.out index 2291504352..66b5cccfc3 100644 --- a/tests/expectations/compiler/compiler/circuits/member_static_function_undefined.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_static_function_undefined.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:10:17\n |\n 10 | const err = Foo::echoed(1u32);\n | ^^^^^^^^^^^\n |\n = illegal reference to non-existant member 'echoed' of circuit 'Foo'" + - "Error [EASG0373002]: illegal reference to non-existant member 'echoed' of circuit 'Foo'\n --> compiler-test:10:17\n |\n 10 | const err = Foo::echoed(1u32);\n | ^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/circuits/member_variable.leo.out b/tests/expectations/compiler/compiler/circuits/member_variable.leo.out index 3d5447716c..ff6d455507 100644 --- a/tests/expectations/compiler/compiler/circuits/member_variable.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_variable.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 701fc149d818f5cfc5c0a2465c46ca76c42d6d558ec0077960a37ae179f401b0 - canonicalized_ast: 701fc149d818f5cfc5c0a2465c46ca76c42d6d558ec0077960a37ae179f401b0 - type_inferenced_ast: 6a3729bb8e9948a84a0fd5a825510420f57ec7979695dc816795a83258a415e8 + initial_ast: 0723285d6c4dac924f6c86e0a6fd57eb78947cfcecd45f2520b7b0f0029f3279 + canonicalized_ast: 0723285d6c4dac924f6c86e0a6fd57eb78947cfcecd45f2520b7b0f0029f3279 + type_inferenced_ast: c42738de8987ca76cacc30dbf86688ff11d5dbf7dccba67947cc78eb452460fd diff --git a/tests/expectations/compiler/compiler/circuits/member_variable_and_function.leo.out b/tests/expectations/compiler/compiler/circuits/member_variable_and_function.leo.out index 7ede51f889..402638f498 100644 --- a/tests/expectations/compiler/compiler/circuits/member_variable_and_function.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_variable_and_function.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 033ac2bd59dacfd0e1f551feee772337e15a3c9eca8fa64075b1f6c411b2f235 - canonicalized_ast: 033ac2bd59dacfd0e1f551feee772337e15a3c9eca8fa64075b1f6c411b2f235 - type_inferenced_ast: a90d633d8db0a339186dc314f4de35ed970aec22cfccd423f49824ade7dcf70b + initial_ast: bbad7fd765dee42c9ebaca7e07201d61befefa5e7d5af700130954ac29cdd27c + canonicalized_ast: bbad7fd765dee42c9ebaca7e07201d61befefa5e7d5af700130954ac29cdd27c + type_inferenced_ast: cb8745ad419c19ad007a9d9d905f01c0d85d2e78cb82be0b82342c44015c322e diff --git a/tests/expectations/compiler/compiler/circuits/member_variable_fail.leo.out b/tests/expectations/compiler/compiler/circuits/member_variable_fail.leo.out index d2d815b44f..f80585c1ea 100644 --- a/tests/expectations/compiler/compiler/circuits/member_variable_fail.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_variable_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:9:17\n |\n 9 | const err = a.y;\n | ^^^\n |\n = illegal reference to non-existant member 'y' of circuit 'Foo'" + - "Error [EASG0373002]: illegal reference to non-existant member 'y' of circuit 'Foo'\n --> compiler-test:9:17\n |\n 9 | const err = a.y;\n | ^^^" diff --git a/tests/expectations/compiler/compiler/circuits/mut_function_fail.leo.out b/tests/expectations/compiler/compiler/circuits/mut_function_fail.leo.out index bf07411499..550752bee7 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_function_fail.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_function_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:12:5\n |\n 12 | f.bar = 1u8;\n | ^^^^^^^^^^^\n |\n = attempt to assign to function 'bar'" + - "Error [EASG0373007]: attempt to assign to function 'bar'\n --> compiler-test:12:5\n |\n 12 | f.bar = 1u8;\n | ^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/circuits/mut_self_function_fail.leo.out b/tests/expectations/compiler/compiler/circuits/mut_self_function_fail.leo.out index 3ccde3f13b..e1958638b2 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_self_function_fail.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_self_function_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:9:9\n |\n 9 | self.bar = new;\n | ^^^^^^^^^^^^^^\n |\n = attempt to assign to function 'bar'" + - "Error [EASG0373007]: attempt to assign to function 'bar'\n --> compiler-test:9:9\n |\n 9 | self.bar = new;\n | ^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/circuits/mut_self_static_function_fail.leo.out b/tests/expectations/compiler/compiler/circuits/mut_self_static_function_fail.leo.out index 3ccde3f13b..e1958638b2 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_self_static_function_fail.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_self_static_function_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:9:9\n |\n 9 | self.bar = new;\n | ^^^^^^^^^^^^^^\n |\n = attempt to assign to function 'bar'" + - "Error [EASG0373007]: attempt to assign to function 'bar'\n --> compiler-test:9:9\n |\n 9 | self.bar = new;\n | ^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/circuits/mut_self_variable.leo.out b/tests/expectations/compiler/compiler/circuits/mut_self_variable.leo.out index a7c760ec44..4dbac2b20a 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_self_variable.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_self_variable.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 35c17de2e9d8a63b29cbeaeeb7eebfa886ff4ae536938e571e953ee206ba8a59 - canonicalized_ast: 8f09ad7c9a20220bf8d9fe7e5c84a7c1e99b840fbeb682fb5646df9a05efbd8b - type_inferenced_ast: b1e1e8b1c22a2c98f82d26a1a339952dbe085366b5dc3bb36d71cf4c842739b9 + initial_ast: d2d5680f0e011b93b2e55aebb62f51b4e78cf68289ffd84a80f852d2a82a6723 + canonicalized_ast: 57c2e52b3f73e7052fdc92d0c668b598b282321cd390ed836f20b92bc528b6e0 + type_inferenced_ast: 4f8c32d94398d49ffb9b1eab3639076e77d77159411c1891d814b4946751e554 diff --git a/tests/expectations/compiler/compiler/circuits/mut_self_variable_branch.leo.out b/tests/expectations/compiler/compiler/circuits/mut_self_variable_branch.leo.out index 90c520afac..301d38f9ac 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_self_variable_branch.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_self_variable_branch.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 5654f2be64d7879bfa2cb49029bd6c3b757c0eb28dd32744de41a28effae5891 - canonicalized_ast: 42710d4ec40860cbd1a88da9738960c5a07a6a9937436ec474b3f1bbc805aac4 - type_inferenced_ast: d7f138829083963f935922d492a94a693b963d3acee6fadb325be8d99f0e4d19 + initial_ast: 15da2283babf7f4a490bd7bdc0331522107f7ce4c88949863178ba4a00419ead + canonicalized_ast: 96a167f8b897e9973bb7b9d13faa81da0b635a6611ef09124a5d12f817b35254 + type_inferenced_ast: 82c54a8e54820fc234a7029cb4c6018df99e7a3d4b47f418efc8835889b1c6cc diff --git a/tests/expectations/compiler/compiler/circuits/mut_self_variable_conditional.leo.out b/tests/expectations/compiler/compiler/circuits/mut_self_variable_conditional.leo.out index d50ce4095d..b9b10201cb 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_self_variable_conditional.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_self_variable_conditional.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 46fccf2a1d04ff7bbfb9a88eeceb6cfd39adcf7ce2e2323d4fb83f4ae3dba273 - canonicalized_ast: 222568f9f7b61876690514fdd2dd12419b2e889269a2b7aabd7223d291167da5 - type_inferenced_ast: f1a5656978bd48409401788332b1a1d90c969178e65af06b54d5b4445be84375 + initial_ast: 6fd3b11431e3e71f2b628bc9c64cb51d04c77df08d7584503b76b3dff7bc90cc + canonicalized_ast: a7a942a8a40f7cf8bfd79fdea0ed81fb6b56cfd9009b01b3d0225b427ef583cd + type_inferenced_ast: d3cc0e19adac957e11d520bf727133bfcc85eef5f306373cb5057b840b1a41f6 diff --git a/tests/expectations/compiler/compiler/circuits/mut_self_variable_fail.leo.out b/tests/expectations/compiler/compiler/circuits/mut_self_variable_fail.leo.out index 8a8dcf0be6..d3d1a707f1 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_self_variable_fail.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_self_variable_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:7:9\n |\n 7 | self.a = new;\n | ^^^^^^^^^^^^\n |\n = illegal assignment to immutable variable 'self'" + - "Error [EASG0373033]: illegal assignment to immutable variable 'self'\n --> compiler-test:7:9\n |\n 7 | self.a = new;\n | ^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/circuits/mut_static_function_fail.leo.out b/tests/expectations/compiler/compiler/circuits/mut_static_function_fail.leo.out index 7bb9b25530..db91c8aeef 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_static_function_fail.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_static_function_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:8:19\n |\n 8 | let f = Foo { a: 0u8 };\n | ^\n |\n = extra circuit member 'a' for initialization of circuit 'Foo' is not allowed" + - "Error [EASG0373006]: extra circuit member 'a' for initialization of circuit 'Foo' is not allowed\n --> compiler-test:8:19\n |\n 8 | let f = Foo { a: 0u8 };\n | ^" diff --git a/tests/expectations/compiler/compiler/circuits/mut_variable.leo.out b/tests/expectations/compiler/compiler/circuits/mut_variable.leo.out index bff2c8dada..8afebb1042 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_variable.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_variable.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 684a9fc0a433525dfbe52d8037588845ad55782b2c1b046bd91049c3b9d9ea4c - canonicalized_ast: 684a9fc0a433525dfbe52d8037588845ad55782b2c1b046bd91049c3b9d9ea4c - type_inferenced_ast: 1fce4132eea4711a6b42fab47478d3608d16df3930554350ed46d865162f7043 + initial_ast: 48713617e0f06ade7b443ec779e646b0ff82e025f040c8a28bf2ea7eb37f3399 + canonicalized_ast: 48713617e0f06ade7b443ec779e646b0ff82e025f040c8a28bf2ea7eb37f3399 + type_inferenced_ast: 68e4f8baf01d452f42d0765f2819783adb55000238d5d57304a314fb5cff3c22 diff --git a/tests/expectations/compiler/compiler/circuits/mut_variable_fail.leo.out b/tests/expectations/compiler/compiler/circuits/mut_variable_fail.leo.out index e2080bf108..d56bfa412b 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_variable_fail.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_variable_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:10:5\n |\n 10 | f.a = 1u8;\n | ^^^^^^^^^\n |\n = illegal assignment to immutable variable 'f'" + - "Error [EASG0373033]: illegal assignment to immutable variable 'f'\n --> compiler-test:10:5\n |\n 10 | f.a = 1u8;\n | ^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/circuits/mutable_call_immutable_context.leo.out b/tests/expectations/compiler/compiler/circuits/mutable_call_immutable_context.leo.out index 5ea932e6db..5f12f27e1c 100644 --- a/tests/expectations/compiler/compiler/circuits/mutable_call_immutable_context.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mutable_call_immutable_context.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: bd8793749cfd151b89162febc55b6bb6de1be867a0009da6a8470106953db630 - canonicalized_ast: 9ecf61f153db9d0912cae6891258e0ebdaecd0da6eef7bbc92c3a6476c7adf6d - type_inferenced_ast: 6908fc70e763ff518a9942a3b930aac64b70075be1b734c2ac93175ca1f16f97 + initial_ast: 2f6262df5e4a39a662b85cff0985d297fa2628d56fc3c036b5beb31d683a8574 + canonicalized_ast: 4bb2ac425c192058af2f97684019d74959bc40abc0f886a741894a89cc8e8d4f + type_inferenced_ast: 6c3c3d16ba595ab33902ece671d2460c3a25347e1e33e35ec82ff8622926afd2 diff --git a/tests/expectations/compiler/compiler/circuits/pedersen_mock.leo.out b/tests/expectations/compiler/compiler/circuits/pedersen_mock.leo.out index bec7e9cfc6..d77bccc2b7 100644 --- a/tests/expectations/compiler/compiler/circuits/pedersen_mock.leo.out +++ b/tests/expectations/compiler/compiler/circuits/pedersen_mock.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: c983e5e79b4325ac133ac1a5ff0b1655c646111389991286322b8c16c5833837 - canonicalized_ast: 8dcb714238ef7e9fd3c66a7a12ec4621bb4e9ac5994f1c692215a9f93463ce9e - type_inferenced_ast: ebd34799bd1c6936ca5032812d2466bade58df616cc06e3c6e57151a06b78601 + initial_ast: 591aa0cc25f8c009c7df6425697003904e97e74c55f887c5ed3b27984fda4176 + canonicalized_ast: 7232353691a314166deb747de9046b05e507b581d35132479b01c6db41e72df6 + type_inferenced_ast: ae5cb090082e845a9a058a15de6345a672864bf2ad2061930922475cc2c3f8e1 diff --git a/tests/expectations/compiler/compiler/circuits/return_self_type_array.leo.out b/tests/expectations/compiler/compiler/circuits/return_self_type_array.leo.out new file mode 100644 index 0000000000..43b372e66e --- /dev/null +++ b/tests/expectations/compiler/compiler/circuits/return_self_type_array.leo.out @@ -0,0 +1,21 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - circuit: + num_public_variables: 0 + num_private_variables: 1 + num_constraints: 1 + at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f + bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c + ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + output: + - input_file: input/dummy.in + output: + registers: + r0: + type: bool + value: "true" + initial_ast: f7e0f5bba37e3a25b8fdf655d2588054659ff212cade431c17bb548757a7781d + canonicalized_ast: 8425ce431117fc5d543a83ddde9e0cf946e0435146ede09096906a0f1fe9eff2 + type_inferenced_ast: da1985f44598222e3940c14fefed9ce269e43d474aaf15b622292cd63f3efe87 diff --git a/tests/expectations/compiler/compiler/circuits/return_self_type_tuple.leo.out b/tests/expectations/compiler/compiler/circuits/return_self_type_tuple.leo.out new file mode 100644 index 0000000000..41f11b772c --- /dev/null +++ b/tests/expectations/compiler/compiler/circuits/return_self_type_tuple.leo.out @@ -0,0 +1,21 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - circuit: + num_public_variables: 0 + num_private_variables: 1 + num_constraints: 1 + at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f + bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c + ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + output: + - input_file: input/dummy.in + output: + registers: + r0: + type: bool + value: "true" + initial_ast: ab5c9ec7a0930713141b84e303355a1ddf69340f5222699c2192868e0e0dc8c4 + canonicalized_ast: 3442d75d2ced2e10abfde09306d9bf91046cecd295a5e48e66a1823abff28ffc + type_inferenced_ast: ace67f309b2535d71ec2b277b42569fa3f89e6bcb817e8b911f7a773c9c4186e diff --git a/tests/expectations/compiler/compiler/circuits/self_circuit.leo.out b/tests/expectations/compiler/compiler/circuits/self_circuit.leo.out index 646f2b94dc..d12165d6a1 100644 --- a/tests/expectations/compiler/compiler/circuits/self_circuit.leo.out +++ b/tests/expectations/compiler/compiler/circuits/self_circuit.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:5:5\n |\n 5 | static function new() -> Self {\n | ^^^^^^\n |\n = expected 'ident', got 'static'" + - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'static'\n --> compiler-test:5:5\n |\n 5 | static function new() -> Self {\n | ^^^^^^" diff --git a/tests/expectations/compiler/compiler/circuits/self_fail.leo.out b/tests/expectations/compiler/compiler/circuits/self_fail.leo.out index b6d62471c5..25126ce204 100644 --- a/tests/expectations/compiler/compiler/circuits/self_fail.leo.out +++ b/tests/expectations/compiler/compiler/circuits/self_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:5\n |\n 4 | Self::main();\n | ^^^^\n |\n = failed to resolve circuit: 'Self'" + - "Error [EASG0373000]: failed to resolve circuit: 'Self'\n --> compiler-test:4:5\n |\n 4 | Self::main();\n | ^^^^" diff --git a/tests/expectations/compiler/compiler/circuits/self_member.leo.out b/tests/expectations/compiler/compiler/circuits/self_member.leo.out index 5311554177..d51b0bc9b9 100644 --- a/tests/expectations/compiler/compiler/circuits/self_member.leo.out +++ b/tests/expectations/compiler/compiler/circuits/self_member.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: ef90c67bd868ad3d1362b37acad99a97316700c60c9667a4d67b8ad392b2922c - canonicalized_ast: ef90c67bd868ad3d1362b37acad99a97316700c60c9667a4d67b8ad392b2922c - type_inferenced_ast: 636fbf53660cedd9c05b6c361fae19ae5adaae85adc98e888308072ef843f8fa + initial_ast: 6b54a642c55d3a7991a063c5346797a4d7facf21533c8ec7b2e22eb9394caba0 + canonicalized_ast: 6b54a642c55d3a7991a063c5346797a4d7facf21533c8ec7b2e22eb9394caba0 + type_inferenced_ast: 5b4b8ea9431aca05e19fcf8987c4f4c824c065e2ed6fc7198cd769b8829ee4f1 diff --git a/tests/expectations/compiler/compiler/circuits/self_member_invalid.leo.out b/tests/expectations/compiler/compiler/circuits/self_member_invalid.leo.out index f18b421ed4..8056d661ae 100644 --- a/tests/expectations/compiler/compiler/circuits/self_member_invalid.leo.out +++ b/tests/expectations/compiler/compiler/circuits/self_member_invalid.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:13:17\n |\n 13 | const err = foo.bar();\n | ^^^^^^^\n |\n = cannot call static function 'bar' of circuit 'Foo' from target" + - "Error [EASG0373009]: cannot call static function 'bar' of circuit 'Foo' from target\n --> compiler-test:13:17\n |\n 13 | const err = foo.bar();\n | ^^^^^^^" diff --git a/tests/expectations/compiler/compiler/circuits/self_member_undefined.leo.out b/tests/expectations/compiler/compiler/circuits/self_member_undefined.leo.out index 45370e3df4..357c5dcc1e 100644 --- a/tests/expectations/compiler/compiler/circuits/self_member_undefined.leo.out +++ b/tests/expectations/compiler/compiler/circuits/self_member_undefined.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:11:17\n |\n 11 | const err = foo.bar();\n | ^^^^^^^\n |\n = cannot call static function 'bar' of circuit 'Foo' from target" + - "Error [EASG0373009]: cannot call static function 'bar' of circuit 'Foo' from target\n --> compiler-test:11:17\n |\n 11 | const err = foo.bar();\n | ^^^^^^^" diff --git a/tests/expectations/compiler/compiler/console/assert.leo.out b/tests/expectations/compiler/compiler/console/assert.leo.out index c4c2771a9b..6d42c7f054 100644 --- a/tests/expectations/compiler/compiler/console/assert.leo.out +++ b/tests/expectations/compiler/compiler/console/assert.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 70bf9e6efa84336b4d023dd5484ad15897678c9d4851b5d7cfdb8cb6b79facaa - canonicalized_ast: 70bf9e6efa84336b4d023dd5484ad15897678c9d4851b5d7cfdb8cb6b79facaa - type_inferenced_ast: b410b94ea2070cbfe393229700288a461896a65bb84feed3c0a006aae04566f8 + initial_ast: 8a1b1671e3685c54d7974b31fbc758210d2cafd8443c33ed8a3b14ad3a1b9fc4 + canonicalized_ast: 8a1b1671e3685c54d7974b31fbc758210d2cafd8443c33ed8a3b14ad3a1b9fc4 + type_inferenced_ast: e60210b668a87ade79886bffd2ebc8ded95f47d12d5c8b67adfd896ea3a1009e diff --git a/tests/expectations/compiler/compiler/console/conditional_assert.leo.out b/tests/expectations/compiler/compiler/console/conditional_assert.leo.out index c05f689b08..df7e07e181 100644 --- a/tests/expectations/compiler/compiler/console/conditional_assert.leo.out +++ b/tests/expectations/compiler/compiler/console/conditional_assert.leo.out @@ -16,6 +16,6 @@ outputs: - input_file: cond_2.in output: registers: {} - initial_ast: d6aad3c859ad1b7f4d3d258c9489cd5a4c26b3a36b10b40dd823c976fb3e1000 - canonicalized_ast: 0291e08f42b60c0ef76f666e610bc7ef850f22e3cb849088f516e2feb312cf6e - type_inferenced_ast: f414dd49f054e54d564501fa52bb266dd152d8c32a84dd54b61f782380d02dbe + initial_ast: 4bafaebf2c6733478fdff48ba2aca4892da0874d88a8cde9a9ea7299939cfa92 + canonicalized_ast: 036d49891c7d9eb0c713eb9eaf7a66321fdd32ff225fa1428f9a7184ebf3679e + type_inferenced_ast: 3d13c527af96ec05f92678c2009047200736e8799fd29875ba371fd34d95ce5a diff --git a/tests/expectations/compiler/compiler/console/error.leo.out b/tests/expectations/compiler/compiler/console/error.leo.out index a8be560200..d198e0551d 100644 --- a/tests/expectations/compiler/compiler/console/error.leo.out +++ b/tests/expectations/compiler/compiler/console/error.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 637b1f2fc3317138b7352122cab1754c30833e87208d443d9657aa178d7e5a31 - canonicalized_ast: 637b1f2fc3317138b7352122cab1754c30833e87208d443d9657aa178d7e5a31 - type_inferenced_ast: b003fc86b328eb76ffb5f13e4cc8b1d19da3c64c9b34ee9f116c46b998121cd3 + initial_ast: d9518f1fbefe56299388ca536aa8d0cc8070eb4ddebf824472d369111578f4ec + canonicalized_ast: d9518f1fbefe56299388ca536aa8d0cc8070eb4ddebf824472d369111578f4ec + type_inferenced_ast: f45369f6227b5fed3322d1d28718bc84382c1312214b6fa0b315b3e02c66f48b diff --git a/tests/expectations/compiler/compiler/console/log.leo.out b/tests/expectations/compiler/compiler/console/log.leo.out index de703bffbf..a03f02f37b 100644 --- a/tests/expectations/compiler/compiler/console/log.leo.out +++ b/tests/expectations/compiler/compiler/console/log.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 7f5540a6b26be4fbf33c59d72ed8ba4697bbfffde5a674bacc5846ea6254194d - canonicalized_ast: 7f5540a6b26be4fbf33c59d72ed8ba4697bbfffde5a674bacc5846ea6254194d - type_inferenced_ast: 0a7837344c544abc21e4be2946292baac4553ad6b29c77e8a08a4032b592b206 + initial_ast: aecf83a2f4aa6587964d65a38e106eb9547d25267fde72fcf078d2498944818b + canonicalized_ast: aecf83a2f4aa6587964d65a38e106eb9547d25267fde72fcf078d2498944818b + type_inferenced_ast: a5345a4bf0f979eef1166902ee0e70ba3635125f1793b0b0742162cc98f46681 diff --git a/tests/expectations/compiler/compiler/console/log_conditional.leo.out b/tests/expectations/compiler/compiler/console/log_conditional.leo.out index 37cfe37ac7..d11c386ccd 100644 --- a/tests/expectations/compiler/compiler/console/log_conditional.leo.out +++ b/tests/expectations/compiler/compiler/console/log_conditional.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 686cf650236e7d5578b163101eb4104f0dbdb0fe9ed72ebf109f518b2ab18568 - canonicalized_ast: 686cf650236e7d5578b163101eb4104f0dbdb0fe9ed72ebf109f518b2ab18568 - type_inferenced_ast: dddd466784e0095ccd9004c9b3fe011290e36cc0b0a0ceb20ed4052f99aa9b35 + initial_ast: f8e35dfef4049fcb03445300a6c86627b4b2b3934e948d4e15849f0464ad318b + canonicalized_ast: f8e35dfef4049fcb03445300a6c86627b4b2b3934e948d4e15849f0464ad318b + type_inferenced_ast: 684c132f914cd9b2bbe55cc7fa868d9f4818a5951cefba287989d787c13c40d3 diff --git a/tests/expectations/compiler/compiler/console/log_fail.leo.out b/tests/expectations/compiler/compiler/console/log_fail.leo.out index f601bdcdd7..3d62711430 100644 --- a/tests/expectations/compiler/compiler/console/log_fail.leo.out +++ b/tests/expectations/compiler/compiler/console/log_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:18\n |\n 4 | console.log( hello );\n | ^^^^^\n |\n = expected 'formatted string', got 'hello'" + - "Error [EPAR0370009]: unexpected string: expected 'formatted string', got 'hello'\n --> compiler-test:4:18\n |\n 4 | console.log( hello );\n | ^^^^^" diff --git a/tests/expectations/compiler/compiler/console/log_input.leo.out b/tests/expectations/compiler/compiler/console/log_input.leo.out index ef23f2153c..bf67ccd495 100644 --- a/tests/expectations/compiler/compiler/console/log_input.leo.out +++ b/tests/expectations/compiler/compiler/console/log_input.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 0e62d5ba7775423a274c6871ed7aa23143051a1030fa2375b3ac52b4624bed29 - canonicalized_ast: 0e62d5ba7775423a274c6871ed7aa23143051a1030fa2375b3ac52b4624bed29 - type_inferenced_ast: 816f0e99603f81c6fd2e771095de519200e954ce238a76a535cd3f2b5c403c23 + initial_ast: 92825fee401d5b953f2fbb155a1069148ba9ceb7dc61efadd5b29bc2ac483ac7 + canonicalized_ast: 92825fee401d5b953f2fbb155a1069148ba9ceb7dc61efadd5b29bc2ac483ac7 + type_inferenced_ast: 0b2d12419a1f32d70683f171ddaad7c5d683fe7975e2315cb6167dbcd16f382d diff --git a/tests/expectations/compiler/compiler/console/log_parameter.leo.out b/tests/expectations/compiler/compiler/console/log_parameter.leo.out index 11a643fae8..cea1bf46f7 100644 --- a/tests/expectations/compiler/compiler/console/log_parameter.leo.out +++ b/tests/expectations/compiler/compiler/console/log_parameter.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 4c513c484e711bef8b4da2bd54e71f3e6bbea22d002155b598c7573ba5b1c747 - canonicalized_ast: 4c513c484e711bef8b4da2bd54e71f3e6bbea22d002155b598c7573ba5b1c747 - type_inferenced_ast: a33edf5d144205f5f5f820c8a95476b677dfcae5a4997c28cd707dcd637cf12a + initial_ast: ab38ae5a77b338e05dcf4554f9510f78d48277964a5f10fb58506967d9e4be8a + canonicalized_ast: ab38ae5a77b338e05dcf4554f9510f78d48277964a5f10fb58506967d9e4be8a + type_inferenced_ast: 0af520b7cbdb4f67914880e62a5ba7ead23ee6c3f173d4573b0d306532f4bf03 diff --git a/tests/expectations/compiler/compiler/console/log_parameter_fail_empty.leo.out b/tests/expectations/compiler/compiler/console/log_parameter_fail_empty.leo.out index 6ebd98b417..a29353bd2f 100644 --- a/tests/expectations/compiler/compiler/console/log_parameter_fail_empty.leo.out +++ b/tests/expectations/compiler/compiler/console/log_parameter_fail_empty.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:17\n |\n 4 | console.log(\"{}\");\n | ^^^^\n |\n = Formatter given 1 containers and found 0 parameters" + - "Error [ECMP0376006]: Formatter given 1 containers and found 0 parameters\n --> compiler-test:4:17\n |\n 4 | console.log(\"{}\");\n | ^^^^" diff --git a/tests/expectations/compiler/compiler/console/log_parameter_fail_none.leo.out b/tests/expectations/compiler/compiler/console/log_parameter_fail_none.leo.out index f7007ccf5f..7af538b8d5 100644 --- a/tests/expectations/compiler/compiler/console/log_parameter_fail_none.leo.out +++ b/tests/expectations/compiler/compiler/console/log_parameter_fail_none.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:17\n |\n 4 | console.log(\"\", 1u32);\n | ^^^^^^^^\n |\n = Formatter given 0 containers and found 1 parameters" + - "Error [ECMP0376006]: Formatter given 0 containers and found 1 parameters\n --> compiler-test:4:17\n |\n 4 | console.log(\"\", 1u32);\n | ^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/console/log_parameter_fail_unknown.leo.out b/tests/expectations/compiler/compiler/console/log_parameter_fail_unknown.leo.out index f61ef70fb7..0693d53502 100644 --- a/tests/expectations/compiler/compiler/console/log_parameter_fail_unknown.leo.out +++ b/tests/expectations/compiler/compiler/console/log_parameter_fail_unknown.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:23\n |\n 4 | console.log(\"{}\", a);\n | ^\n |\n = failed to resolve variable reference 'a'" + - "Error [EASG0373028]: failed to resolve variable reference 'a'\n --> compiler-test:4:23\n |\n 4 | console.log(\"{}\", a);\n | ^" diff --git a/tests/expectations/compiler/compiler/console/log_parameter_many.leo.out b/tests/expectations/compiler/compiler/console/log_parameter_many.leo.out index 78b90b9a8c..c8452bd882 100644 --- a/tests/expectations/compiler/compiler/console/log_parameter_many.leo.out +++ b/tests/expectations/compiler/compiler/console/log_parameter_many.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 11e5803a91f359a4d9e41f70173072984d8a430ea2e19169c239f9fdd0b81726 - canonicalized_ast: 11e5803a91f359a4d9e41f70173072984d8a430ea2e19169c239f9fdd0b81726 - type_inferenced_ast: 6833ca94c2ee3e7ceecec151709c145ac12b3fc258b6f720bc203d89056852cf + initial_ast: 746e67c3c32b565a747779078d83f41197856a657b59eeb9cc9ea4e60677dac0 + canonicalized_ast: 746e67c3c32b565a747779078d83f41197856a657b59eeb9cc9ea4e60677dac0 + type_inferenced_ast: a586b22d1a595440d7a0262c959ae1b668be2980d131c056ebc6536827606454 diff --git a/tests/expectations/compiler/compiler/core/core_circuit_invalid.leo.out b/tests/expectations/compiler/compiler/core/core_circuit_invalid.leo.out index 07c482845a..0fe84aeec0 100644 --- a/tests/expectations/compiler/compiler/core/core_circuit_invalid.leo.out +++ b/tests/expectations/compiler/compiler/core/core_circuit_invalid.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:30\n |\n 3 | import core.unstable.blake2s.BadCircuit; // `BadCircuit` is not included in the blake2s package\n | ^^^^^^^^^^\n |\n = failed to resolve import: 'core.unstable.blake2s.BadCircuit'" + - "Error [EASG0373001]: failed to resolve import: 'core.unstable.blake2s.BadCircuit'\n --> compiler-test:3:30\n |\n 3 | import core.unstable.blake2s.BadCircuit; // `BadCircuit` is not included in the blake2s package\n | ^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/core/core_circuit_star_fail.leo.out b/tests/expectations/compiler/compiler/core/core_circuit_star_fail.leo.out index 9bb7631c2d..b3770394c0 100644 --- a/tests/expectations/compiler/compiler/core/core_circuit_star_fail.leo.out +++ b/tests/expectations/compiler/compiler/core/core_circuit_star_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> :0:0\n |\n |\n = failed to resolve import: 'core'" + - "Error [EASG0373001]: failed to resolve import: 'core'\n --> :0:0\n |\n |" diff --git a/tests/expectations/compiler/compiler/core/core_package_invalid.leo.out b/tests/expectations/compiler/compiler/core/core_package_invalid.leo.out index 9bb7631c2d..b3770394c0 100644 --- a/tests/expectations/compiler/compiler/core/core_package_invalid.leo.out +++ b/tests/expectations/compiler/compiler/core/core_package_invalid.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> :0:0\n |\n |\n = failed to resolve import: 'core'" + - "Error [EASG0373001]: failed to resolve import: 'core'\n --> :0:0\n |\n |" diff --git a/tests/expectations/compiler/compiler/core/core_unstable_package_invalid.leo.out b/tests/expectations/compiler/compiler/core/core_unstable_package_invalid.leo.out index 2493893de3..e118826f9b 100644 --- a/tests/expectations/compiler/compiler/core/core_unstable_package_invalid.leo.out +++ b/tests/expectations/compiler/compiler/core/core_unstable_package_invalid.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> :0:0\n |\n |\n = failed to resolve import: 'core.unstable'" + - "Error [EASG0373001]: failed to resolve import: 'core.unstable'\n --> :0:0\n |\n |" diff --git a/tests/expectations/compiler/compiler/definition/out_of_order.leo.out b/tests/expectations/compiler/compiler/definition/out_of_order.leo.out index 8ff57b550a..e11f80b6f7 100644 --- a/tests/expectations/compiler/compiler/definition/out_of_order.leo.out +++ b/tests/expectations/compiler/compiler/definition/out_of_order.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: a60a2c808f9c8b475e8d4917307e483db1742b5baade6e826e56d848520f24a4 - canonicalized_ast: 9845ae56693cf58d9c1283d2bf2d1d5e8f2be7c2d018cbb689a6fb09ba952451 - type_inferenced_ast: aae7a9954e18cf849f41af233cedd6a472cdd59c6dfdfe25a2433f0a6eaf43c8 + initial_ast: 61087d13f528efabd02f9993e0e5ff23051fa0de9e93a96ef8835f3a0457d87c + canonicalized_ast: 36bde977c62949baf95dd50d0cfaadd1a4a926a2a4d7f55388b21beaefd5e43c + type_inferenced_ast: ab6c6ed97331a676348142fb242cf0f589468f893f97c3e4832f60d4736fc0ca diff --git a/tests/expectations/compiler/compiler/definition/out_of_order_with_import.leo.out b/tests/expectations/compiler/compiler/definition/out_of_order_with_import.leo.out index 9ca08a8e76..6ce8d6fb90 100644 --- a/tests/expectations/compiler/compiler/definition/out_of_order_with_import.leo.out +++ b/tests/expectations/compiler/compiler/definition/out_of_order_with_import.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: a62620cae9946643df9ed0991a0f5134e786fac8d561fb15a33d710cf546799c - canonicalized_ast: 1dc02f76c11beb5dfadc9b3d1f5423ad2bce40502600a42de066a88f97188ed4 - type_inferenced_ast: 41e32609589c1bcb33e9dcaea9864e8868b5d2028b65924a3145b3aae7c6166a + initial_ast: e1792bcb7fe5be2fdb8ca2abd21feb63c9aadbc367d2cba1750fff1b34b8d1b2 + canonicalized_ast: 9badf16677c761fbcb56ea79f0e67b46f8e12c3dc83a9c3fc35559cbc509ff88 + type_inferenced_ast: 571f7723bd45c3e54c04038aa20707640282efe293ba23dfff65b1b318a3a173 diff --git a/tests/expectations/compiler/compiler/field/add.leo.out b/tests/expectations/compiler/compiler/field/add.leo.out index 66010c18fb..7f7f43887e 100644 --- a/tests/expectations/compiler/compiler/field/add.leo.out +++ b/tests/expectations/compiler/compiler/field/add.leo.out @@ -16,6 +16,6 @@ outputs: r: type: bool value: "true" - initial_ast: 59a25bf44613617124a4aa8ea169751c096fb50c5e3797bfe33705febc4fe10d - canonicalized_ast: 59a25bf44613617124a4aa8ea169751c096fb50c5e3797bfe33705febc4fe10d - type_inferenced_ast: f8e5c1c95937d6f7bd04e009d65f2345281dd68e1669b2ecf740f4b071b106f6 + initial_ast: ade887261346e7629dcda78e09b43be2bf742af8cf7aa5e8d3f22d1d9c2c2f24 + canonicalized_ast: ade887261346e7629dcda78e09b43be2bf742af8cf7aa5e8d3f22d1d9c2c2f24 + type_inferenced_ast: af10005d855a2c6277340bd98a1a8893dbc90827eda252f9956e25b131a4dc6c diff --git a/tests/expectations/compiler/compiler/field/div.leo.out b/tests/expectations/compiler/compiler/field/div.leo.out index 7556ffbffc..7d881df6d0 100644 --- a/tests/expectations/compiler/compiler/field/div.leo.out +++ b/tests/expectations/compiler/compiler/field/div.leo.out @@ -16,6 +16,6 @@ outputs: r: type: bool value: "true" - initial_ast: 6fe0af537868b537a8e6b410439b669012cd211fdb988d8457ce6d893d579bfe - canonicalized_ast: 6fe0af537868b537a8e6b410439b669012cd211fdb988d8457ce6d893d579bfe - type_inferenced_ast: 8020277aecd403a5edbd722c320f25cdbd5ba5f930ea4e427929ab7373db8894 + initial_ast: 150c20bc77cda0c046ef9c2f77fe3db7887722125912ee4bc45e61aca3b3275a + canonicalized_ast: 150c20bc77cda0c046ef9c2f77fe3db7887722125912ee4bc45e61aca3b3275a + type_inferenced_ast: 3c72b501b373df6d34d8c9a20c7d73e1e1e6f61cbaa3713b3324c157036f866e diff --git a/tests/expectations/compiler/compiler/field/eq.leo.out b/tests/expectations/compiler/compiler/field/eq.leo.out index 1e99b7fe17..804084d676 100644 --- a/tests/expectations/compiler/compiler/field/eq.leo.out +++ b/tests/expectations/compiler/compiler/field/eq.leo.out @@ -16,6 +16,6 @@ outputs: r: type: bool value: "true" - initial_ast: ed504c4658bfd6d096a4f17fb16bdc8a587b6c91fc669ade95179d8792b1f4ea - canonicalized_ast: ed504c4658bfd6d096a4f17fb16bdc8a587b6c91fc669ade95179d8792b1f4ea - type_inferenced_ast: 920bb42e0ece95f8cd9f343296389f13255b1c3de14f5e13dfd17ff6d82b7137 + initial_ast: 00df32b9a2a3cc1c3b8ec2e4b7f1a15e38d4539992e4a805764814062fd3614e + canonicalized_ast: 00df32b9a2a3cc1c3b8ec2e4b7f1a15e38d4539992e4a805764814062fd3614e + type_inferenced_ast: 786b1a7c74542185e90e6690d6034487b19b1ba7047e3985cc9b85824c98b26f diff --git a/tests/expectations/compiler/compiler/field/field.leo.out b/tests/expectations/compiler/compiler/field/field.leo.out index 30ac9a815a..ebfa1d2868 100644 --- a/tests/expectations/compiler/compiler/field/field.leo.out +++ b/tests/expectations/compiler/compiler/field/field.leo.out @@ -16,6 +16,6 @@ outputs: r: type: bool value: "true" - initial_ast: 54be6c6fb3a49c107d7933f6d0db4e7f54f7db4afc0a77d1bc052cc1b542c96a - canonicalized_ast: 54be6c6fb3a49c107d7933f6d0db4e7f54f7db4afc0a77d1bc052cc1b542c96a - type_inferenced_ast: 849caf4c6446fd4a2360d48bcaf00af8ae24844e9e1aca30c34e77c0e5470d19 + initial_ast: 2fcfda40a52babd238ce5125a6a0b2b829ade39f94d2ce0b216387939c59431e + canonicalized_ast: 2fcfda40a52babd238ce5125a6a0b2b829ade39f94d2ce0b216387939c59431e + type_inferenced_ast: b63f0f712a535d3f14f8c1a443568c3af9f140440e6b115de23e463a1728debf diff --git a/tests/expectations/compiler/compiler/field/mul.leo.out b/tests/expectations/compiler/compiler/field/mul.leo.out index c5073f9fe0..0218d43581 100644 --- a/tests/expectations/compiler/compiler/field/mul.leo.out +++ b/tests/expectations/compiler/compiler/field/mul.leo.out @@ -16,6 +16,6 @@ outputs: r: type: bool value: "false" - initial_ast: d17e4bd13c8e5f3f01cdf41bddde1d8aec876f28b1756b74a78b525d0e97ea09 - canonicalized_ast: d17e4bd13c8e5f3f01cdf41bddde1d8aec876f28b1756b74a78b525d0e97ea09 - type_inferenced_ast: d8db1d4d4fb8b6de4e25a458bfe2cc29d100cf959b294a76086d4cbcb209e4c6 + initial_ast: 2635739c604a7ae3a3555480bb442b819af18179044e24bf19faf5ba546c307a + canonicalized_ast: 2635739c604a7ae3a3555480bb442b819af18179044e24bf19faf5ba546c307a + type_inferenced_ast: 813b8fb791cf91468b34722fb4cb8b2a0005cddb135eee6e1688675104794ab5 diff --git a/tests/expectations/compiler/compiler/field/negate.leo.out b/tests/expectations/compiler/compiler/field/negate.leo.out index e2f7234663..e5ea188c6a 100644 --- a/tests/expectations/compiler/compiler/field/negate.leo.out +++ b/tests/expectations/compiler/compiler/field/negate.leo.out @@ -16,6 +16,6 @@ outputs: r: type: bool value: "true" - initial_ast: 25f48855e80d5d6e0a6fe71d388d7eafd0559bd9b4c320ccb6a2c8af874352fa - canonicalized_ast: 25f48855e80d5d6e0a6fe71d388d7eafd0559bd9b4c320ccb6a2c8af874352fa - type_inferenced_ast: c43f0ac3e0fcb4580dac447b16530ac89d166c95a7a9497a274020c6d4ec75fb + initial_ast: 3584ba6c06f32660612d44e78a7d8a83075046a49ff4cd47a6165d603ebf85c3 + canonicalized_ast: 3584ba6c06f32660612d44e78a7d8a83075046a49ff4cd47a6165d603ebf85c3 + type_inferenced_ast: 336ecb6f4ead5395c4c5ad52fa5eb29993aa7db2ab65749acdb39c068961e64b diff --git a/tests/expectations/compiler/compiler/field/no_space_between_literal.leo.out b/tests/expectations/compiler/compiler/field/no_space_between_literal.leo.out index ad72f642e2..bcdd357d41 100644 --- a/tests/expectations/compiler/compiler/field/no_space_between_literal.leo.out +++ b/tests/expectations/compiler/compiler/field/no_space_between_literal.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:13\n |\n 4 | const f = 1 field;\n | ^\n |\n = Unexpected white space between terms 1 and field" + - "Error [EPAR0370004]: Unexpected white space between terms 1 and field\n --> compiler-test:4:13\n |\n 4 | const f = 1 field;\n | ^" diff --git a/tests/expectations/compiler/compiler/function/array_input.leo.out b/tests/expectations/compiler/compiler/function/array_input.leo.out index 8204e381f2..ede2412315 100644 --- a/tests/expectations/compiler/compiler/function/array_input.leo.out +++ b/tests/expectations/compiler/compiler/function/array_input.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: cbf1d3fe0106bda529af2912783d2ea0505b9d3780f5ca6954c1caaf3381543a - canonicalized_ast: 711c249e5b0c1ac7f8e9dd96e13bdf1c7449f2f0afa994b9c6430f91b40072a9 - type_inferenced_ast: a96aab38c2fa75d08da2a17ed91efd8128067f9f8ad96e151d0c27a2a55355c3 + initial_ast: f57c7199a6f40d6f898133390fc69cc7ac17c6522adc2653eba92635eddad340 + canonicalized_ast: 6402aa395f7030e58a146ed91755220ee495693e59b9b544f7db59e190b3ef17 + type_inferenced_ast: 94a3c2e3632d3ab5fd7af3ea51b9f8bedb82f00762686a10764d103b35787261 diff --git a/tests/expectations/compiler/compiler/function/array_params_direct_call.leo.out b/tests/expectations/compiler/compiler/function/array_params_direct_call.leo.out index db9a7a59a9..27d44cf87f 100644 --- a/tests/expectations/compiler/compiler/function/array_params_direct_call.leo.out +++ b/tests/expectations/compiler/compiler/function/array_params_direct_call.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 16b635b136d26f8f9b71d9637bd85aa8449d6a93a558669bb44235f969703cba - canonicalized_ast: f46853ed6440686de4f7ed91623575fe2a040e0672580aa06dd2d6fd54dd51b1 - type_inferenced_ast: b36955c7ea4a3894d5857df754e20b6ee2767d84adab7509d50a645cb78af437 + initial_ast: 8e231f37db8feb5d0490f9ee8ad1b4844327cc213238b849b9250dcd416c578c + canonicalized_ast: 63c46bc9757274e52cecf05bdab4b2adaa2177ccc3ced0a8e6a6e0d3ec73038d + type_inferenced_ast: 958cf68742c142d071df29899bb8b81f66e9c5d325325b71d94543762c804001 diff --git a/tests/expectations/compiler/compiler/function/conditional_return.leo.out b/tests/expectations/compiler/compiler/function/conditional_return.leo.out index 34b427b34b..decebbaae1 100644 --- a/tests/expectations/compiler/compiler/function/conditional_return.leo.out +++ b/tests/expectations/compiler/compiler/function/conditional_return.leo.out @@ -16,6 +16,6 @@ outputs: a: type: u32 value: "4" - initial_ast: 0f75f5cb48d7ef68bc14fad54adc07e94d3ffbe2f3ea9e4c7b3a0720bf51dec6 - canonicalized_ast: 0f75f5cb48d7ef68bc14fad54adc07e94d3ffbe2f3ea9e4c7b3a0720bf51dec6 - type_inferenced_ast: 09c9b20ba2ff94cfca66a5e2e9eda0ce0e5970ca6ebbd111968445f028294cb7 + initial_ast: 606414e516d1f59459d71c58f650c63cea9e3213ab59ebbcc617001677d9eea3 + canonicalized_ast: 606414e516d1f59459d71c58f650c63cea9e3213ab59ebbcc617001677d9eea3 + type_inferenced_ast: 74c63a94510e5e000a5b6fb213f34c89bc1d35c69a549eea3b5aad627dd7c43a diff --git a/tests/expectations/compiler/compiler/function/duplicate_definition_fail.leo.out b/tests/expectations/compiler/compiler/function/duplicate_definition_fail.leo.out index f76592d7fd..c8c2dd729f 100644 --- a/tests/expectations/compiler/compiler/function/duplicate_definition_fail.leo.out +++ b/tests/expectations/compiler/compiler/function/duplicate_definition_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:8:1\n |\n 8 | function main() {\n|\n 9 | ...\n|\n 10 | }\n | ^\n |\n = a function named \"main\" already exists in this scope" + - "Error [EASG0373016]: a function named \"main\" already exists in this scope\n --> compiler-test:8:1\n |\n 8 | function main() {\n 9 | ...\n 10 | }\n | ^" diff --git a/tests/expectations/compiler/compiler/function/empty.leo.out b/tests/expectations/compiler/compiler/function/empty.leo.out index 844180d720..40c161337f 100644 --- a/tests/expectations/compiler/compiler/function/empty.leo.out +++ b/tests/expectations/compiler/compiler/function/empty.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 2e31236a963bb214beb942fbb0269ec2c08ddf704fd47ce5d0864b1f1fbb2a7a - canonicalized_ast: 186d0d826a29f428034b8782b79d8e3a0cf810f9dde88b5f1062508322c5d7d5 - type_inferenced_ast: 740b33fa80b8d50c88523daf299d79846430a291dd8b034dd5a01a106270610b + initial_ast: 2dd3bd6fa202a0356e48f757a1e745888aafab1c89721e272eb65534f658a8ef + canonicalized_ast: 689cc7ed7957d488050014971ea55b69970e43a8863fe36176f95224fa601323 + type_inferenced_ast: c8b358ff7af51a9f0e11db6ceb465ff36142bbc14159a7aaeefba55ce9c18a69 diff --git a/tests/expectations/compiler/compiler/function/iteration.leo.out b/tests/expectations/compiler/compiler/function/iteration.leo.out index 16dc886ac5..b2a2865bb1 100644 --- a/tests/expectations/compiler/compiler/function/iteration.leo.out +++ b/tests/expectations/compiler/compiler/function/iteration.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 96155896f4993bd97a8e15281e92c4e9352ed02343bccddb9c3cd0f8ca55b408 - canonicalized_ast: ae4a2dfa82f00621192f117bea664e58768d57376b68a90ce0e15c5bc9535e22 - type_inferenced_ast: 2452ad985e23efbc07a94f2945d406a959aca68ec37e9c349a30edcc12839c04 + initial_ast: bce6dc51b76cc0f285be76d5c35f28dc1121a2b814e60e0094c858d58e83272e + canonicalized_ast: ac7e9987e1a6c30c0ee21665fa824e201b58e186b2d662b6f3817eab3ac3dfa9 + type_inferenced_ast: bd8524c62243e04203ac7b1f1ce7f22c7969c8511463eef2d63ae55ea5d21b69 diff --git a/tests/expectations/compiler/compiler/function/iteration_repeated.leo.out b/tests/expectations/compiler/compiler/function/iteration_repeated.leo.out index 8056fc7df4..94c85ceefe 100644 --- a/tests/expectations/compiler/compiler/function/iteration_repeated.leo.out +++ b/tests/expectations/compiler/compiler/function/iteration_repeated.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 55bf6a745bd0da1684239dd5f624a5ead1d5644c15f25e3099ff40c71ce23317 - canonicalized_ast: 929e1e876d7dd5d04ae39dd8d4b0b3fa3f0e8783e39056941115fff337a0ef84 - type_inferenced_ast: bc6903d0764db54fd4938835120ab6fa02575b1b896828876153bb30da28a19a + initial_ast: e00d6916d7234d7ed9f405c02e281301bc5482800ca70c5b6d3f72e84ea22f58 + canonicalized_ast: bfba19b1a25966ba895c0b318845f4e0e2bf32eb98cba02c1a332fb6f211c532 + type_inferenced_ast: f6c7f08d785a0dc516a4ffd1165e63b54b7e04c6e9d4b22c12ffd3c282562d0b diff --git a/tests/expectations/compiler/compiler/function/multiple_returns.leo.out b/tests/expectations/compiler/compiler/function/multiple_returns.leo.out index 1a0e723993..800cc96588 100644 --- a/tests/expectations/compiler/compiler/function/multiple_returns.leo.out +++ b/tests/expectations/compiler/compiler/function/multiple_returns.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 4c1138877fd90e6a2728592a085a567f3ba63d4225abedaf517251b8ddce7a6a - canonicalized_ast: 4c1138877fd90e6a2728592a085a567f3ba63d4225abedaf517251b8ddce7a6a - type_inferenced_ast: 7cf351cd0c0dbe9bb2a87397c2273f09482994ca60be8f8044a4e2d074fc7dd4 + initial_ast: 8bbbd1ddbb1a616fb3b6cc813734f6dec1989f305dcf2b1580c66c91e023e3db + canonicalized_ast: 8bbbd1ddbb1a616fb3b6cc813734f6dec1989f305dcf2b1580c66c91e023e3db + type_inferenced_ast: 88fbd7fea3a02a091f2f00347f1e862710a621898f80d8acc91d4041e3adc9f2 diff --git a/tests/expectations/compiler/compiler/function/multiple_returns_fail.leo.out b/tests/expectations/compiler/compiler/function/multiple_returns_fail.leo.out index 6738b2788e..68c53fc358 100644 --- a/tests/expectations/compiler/compiler/function/multiple_returns_fail.leo.out +++ b/tests/expectations/compiler/compiler/function/multiple_returns_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:5\n |\n 4 | if true {\n|\n 5 | ...\n|\n 6 | }\n | ^\n |\n = function 'main' failed to validate return path: 'cannot have asymmetrical return in if statement'" + - "Error [EASG0373035]: function 'main' failed to validate return path: 'cannot have asymmetrical return in if statement'\n --> compiler-test:4:5\n |\n 4 | if true {\n 5 | ...\n 6 | }\n | ^" diff --git a/tests/expectations/compiler/compiler/function/multiple_returns_fail_conditional.leo.out b/tests/expectations/compiler/compiler/function/multiple_returns_fail_conditional.leo.out index ee103c4030..a8b0dfd0c9 100644 --- a/tests/expectations/compiler/compiler/function/multiple_returns_fail_conditional.leo.out +++ b/tests/expectations/compiler/compiler/function/multiple_returns_fail_conditional.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:1\n |\n 3 | function main() -> bool {\n|\n 4 | ...\n|\n 5 | }\n|\n 6 | \n|\n 7 | \n|\n 8 | \n|\n 9 | \n|\n 10 | \n | ^\n |\n = function 'main' missing return for all paths" + - "Error [EASG0373034]: function 'main' missing return for all paths\n --> compiler-test:3:1\n |\n 3 | function main() -> bool {\n 4 | ...\n 5 | ...\n 6 | ...\n 7 | ...\n 8 | ...\n 9 | ...\n 10 | ...\n 11 | }\n | ^" diff --git a/tests/expectations/compiler/compiler/function/multiple_returns_main.leo.out b/tests/expectations/compiler/compiler/function/multiple_returns_main.leo.out index da27b1ea91..208288b578 100644 --- a/tests/expectations/compiler/compiler/function/multiple_returns_main.leo.out +++ b/tests/expectations/compiler/compiler/function/multiple_returns_main.leo.out @@ -19,6 +19,6 @@ outputs: r1: type: bool value: "true" - initial_ast: 5a3189a6167d84e140e6e8d2dbfcbb35de5b02927733de0c1143ede46f2fbcf2 - canonicalized_ast: 5a3189a6167d84e140e6e8d2dbfcbb35de5b02927733de0c1143ede46f2fbcf2 - type_inferenced_ast: 7bc19e1d45f6cd7d88edb80aa02c5d92021d0cfc6473d9404f513bda95b30b6b + initial_ast: f982480cc10a58594b1ed75be2d2dcd29ed874fa666497f2c14b58c338a4443f + canonicalized_ast: f982480cc10a58594b1ed75be2d2dcd29ed874fa666497f2c14b58c338a4443f + type_inferenced_ast: f70e1d694f99f56777ac863e764615c6bc496ebb4f476c2faf8356e9246f4d24 diff --git a/tests/expectations/compiler/compiler/function/newlines.leo.out b/tests/expectations/compiler/compiler/function/newlines.leo.out index 1a391adae5..7dfc3aefb5 100644 --- a/tests/expectations/compiler/compiler/function/newlines.leo.out +++ b/tests/expectations/compiler/compiler/function/newlines.leo.out @@ -19,6 +19,6 @@ outputs: b: type: u32 value: "0" - initial_ast: 1e4cdf32e452509a2da4d4ef7a49fd51ba4773eb9582693e47f4838a506aa404 - canonicalized_ast: 1e4cdf32e452509a2da4d4ef7a49fd51ba4773eb9582693e47f4838a506aa404 - type_inferenced_ast: 8a61717cc7c59824571deaeb55dfcc499d26ef21617c9e8ef4814752374518eb + initial_ast: 15f65ebeef2a1394bad8e787b7f85b4ce097c92d4f83723d2f04fc94a2f704fe + canonicalized_ast: 15f65ebeef2a1394bad8e787b7f85b4ce097c92d4f83723d2f04fc94a2f704fe + type_inferenced_ast: 80d4650ca4846bc858164dc5d39d8e9333046ed58a655a0c739a5fb2b3018b90 diff --git a/tests/expectations/compiler/compiler/function/repeated.leo.out b/tests/expectations/compiler/compiler/function/repeated.leo.out index b535091b49..871d97f0fb 100644 --- a/tests/expectations/compiler/compiler/function/repeated.leo.out +++ b/tests/expectations/compiler/compiler/function/repeated.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 63569735bf4eb8ad55d90df67cf6fefec39579db3326888926142af2cfb26d6f - canonicalized_ast: 63569735bf4eb8ad55d90df67cf6fefec39579db3326888926142af2cfb26d6f - type_inferenced_ast: 542715a7e5c18db26fdadf63bd41e6cb71df4f96bb867eb18ad65c80a965decc + initial_ast: 500b33c3ca695738a761854a5c97d7d46ef4689e80fcf0c2dc4694ab09499b7f + canonicalized_ast: 500b33c3ca695738a761854a5c97d7d46ef4689e80fcf0c2dc4694ab09499b7f + type_inferenced_ast: 1383b0311db00a303f411f023eb3d87c8c29b95776bcf09d8b9622ab3af789f6 diff --git a/tests/expectations/compiler/compiler/function/return.leo.out b/tests/expectations/compiler/compiler/function/return.leo.out index 35f3cb6c2a..8561fede33 100644 --- a/tests/expectations/compiler/compiler/function/return.leo.out +++ b/tests/expectations/compiler/compiler/function/return.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 7195af24acaba1dbba4c8d8848177e7a82e71320a9381e48a2c176e9886699c5 - canonicalized_ast: 7195af24acaba1dbba4c8d8848177e7a82e71320a9381e48a2c176e9886699c5 - type_inferenced_ast: 92e7397b037f436aee2ccd1fb04e95014ed5f1335681c8357592f6a6076cc76c + initial_ast: bb569604b5c03343d63deca1fb42fbfb2a275a78d22009e24c58dfc3ac0156ab + canonicalized_ast: bb569604b5c03343d63deca1fb42fbfb2a275a78d22009e24c58dfc3ac0156ab + type_inferenced_ast: fb793f59586351711471dd75136a8c380c154690feccf9cf7174cef82591e6f7 diff --git a/tests/expectations/compiler/compiler/function/return_array_nested_fail.leo.out b/tests/expectations/compiler/compiler/function/return_array_nested_fail.leo.out index cb86704670..ec70067b21 100644 --- a/tests/expectations/compiler/compiler/function/return_array_nested_fail.leo.out +++ b/tests/expectations/compiler/compiler/function/return_array_nested_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:12\n |\n 4 | return [0u8; (2, 3)]; // The correct 3x2 array tuple is `[0u8; (3, 2)]`\n | ^^^^^^^^^^^^^\n |\n = unexpected type, expected: 'array of length 3', received: 'array of length 2'" + - "Error [EASG0373026]: unexpected type, expected: 'array of length 3', received: 'array of length 2'\n --> compiler-test:4:12\n |\n 4 | return [0u8; (2, 3)]; // The correct 3x2 array tuple is `[0u8; (3, 2)]`\n | ^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/function/return_array_nested_pass.leo.out b/tests/expectations/compiler/compiler/function/return_array_nested_pass.leo.out index fcca1da90c..a26c9321b3 100644 --- a/tests/expectations/compiler/compiler/function/return_array_nested_pass.leo.out +++ b/tests/expectations/compiler/compiler/function/return_array_nested_pass.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: b310827701505fb4e4457a1c55557f1754437cd4a49a02a421f15e9fca038ccb - canonicalized_ast: a33daa0e9d07ce990b2c3ea8b71c7f6a700415012b8d6fe04f9245f8d3308b59 - type_inferenced_ast: 896b72d52b23f48531c18035033b48d7b96539592de086d8ada0cd18a6a56eb4 + initial_ast: 0d5b759de15703ed61e503ca8d70f2f8423e29dc817d2612ca384fb29d204f15 + canonicalized_ast: 9698b926f7b85ac3fbb6183a37a08b4681eeea8ccae65aeaa66e691f62487d0b + type_inferenced_ast: 3bf56872a33b1c61d71dd0141acb87050cef59915ea7dbf6559f15345c9d6736 diff --git a/tests/expectations/compiler/compiler/function/return_array_tuple_fail.leo.out b/tests/expectations/compiler/compiler/function/return_array_tuple_fail.leo.out index d3eb890c94..e2256628cb 100644 --- a/tests/expectations/compiler/compiler/function/return_array_tuple_fail.leo.out +++ b/tests/expectations/compiler/compiler/function/return_array_tuple_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:12\n |\n 4 | return [[0u8; 3]; 2]; // The correct 3x2 nested array is `[0u8; 2]; 3]`\n | ^^^^^^^^^^^^^\n |\n = unexpected type, expected: 'array of length 3', received: 'array of length 2'" + - "Error [EASG0373026]: unexpected type, expected: 'array of length 3', received: 'array of length 2'\n --> compiler-test:4:12\n |\n 4 | return [[0u8; 3]; 2]; // The correct 3x2 nested array is `[0u8; 2]; 3]`\n | ^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/function/return_array_tuple_pass.leo.out b/tests/expectations/compiler/compiler/function/return_array_tuple_pass.leo.out index bf5b7f3d89..8123254983 100644 --- a/tests/expectations/compiler/compiler/function/return_array_tuple_pass.leo.out +++ b/tests/expectations/compiler/compiler/function/return_array_tuple_pass.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: b9f2f146319a861d734a70b88cafd0c7a5ea8fde1e9e22687b70400c7457c52a - canonicalized_ast: 1453df7ea8e2245ac6103ac84ac47d2d2dd77a64c74503a1e6b91d5434937c2d - type_inferenced_ast: 08f9c08fcac9ef9da68d227a04f49b9be38b6ce72ffc11ea82acea2cf8fe6b5e + initial_ast: 3c4dacd555f9a91ffe40ddc302bb764ef757462cfad20f6461707b8bf6005196 + canonicalized_ast: 5913a06c38457b98f8aac60740450faf1ebc25760ccb8d6cb86edefd0c217cc6 + type_inferenced_ast: 697c8ad6d1d6ecff77818d3ee92733cd9210c2d151ec8b15093e54ef21cd3b64 diff --git a/tests/expectations/compiler/compiler/function/return_tuple.leo.out b/tests/expectations/compiler/compiler/function/return_tuple.leo.out index 25caceeb64..984cb65bbc 100644 --- a/tests/expectations/compiler/compiler/function/return_tuple.leo.out +++ b/tests/expectations/compiler/compiler/function/return_tuple.leo.out @@ -19,6 +19,6 @@ outputs: r1: type: u32 value: "103" - initial_ast: d4b008869f1527290e9cd0862e3df4204b32683a96d909dbb6c91fc9489ad0e2 - canonicalized_ast: d4b008869f1527290e9cd0862e3df4204b32683a96d909dbb6c91fc9489ad0e2 - type_inferenced_ast: b8ac5ab2d9383543da885cb474f1e9a237c883a8e9facf60692161d439788f90 + initial_ast: 05733c81aa57b7c0c2f89d6ab74b31df49d78414ad354a707ae3474e54fd7951 + canonicalized_ast: 05733c81aa57b7c0c2f89d6ab74b31df49d78414ad354a707ae3474e54fd7951 + type_inferenced_ast: 81ba2fb5f7c788306b516c750361f7984a1a04ef35d72a47ed8ea0c3acf3cb7f diff --git a/tests/expectations/compiler/compiler/function/return_tuple_conditional.leo.out b/tests/expectations/compiler/compiler/function/return_tuple_conditional.leo.out index 758598b22f..30f2a3f58a 100644 --- a/tests/expectations/compiler/compiler/function/return_tuple_conditional.leo.out +++ b/tests/expectations/compiler/compiler/function/return_tuple_conditional.leo.out @@ -19,6 +19,6 @@ outputs: b: type: u32 value: "1" - initial_ast: c429458b4d201fa548eea62e4a2ff8d581f788b7401a03b5f189ae210c3fe132 - canonicalized_ast: c429458b4d201fa548eea62e4a2ff8d581f788b7401a03b5f189ae210c3fe132 - type_inferenced_ast: 1453a4e5252dc0989544abafe9ff5477021ef0f3e8874276e4a989ad23ffaa5a + initial_ast: 91fd89c2d91693622b5305b302c762d139bca3ff839dc5352be5ab694300ad8b + canonicalized_ast: 91fd89c2d91693622b5305b302c762d139bca3ff839dc5352be5ab694300ad8b + type_inferenced_ast: bfefba5d47f28d8939c2f296d1a52559fbcefc88d75cedde390233f4d4db1e98 diff --git a/tests/expectations/compiler/compiler/function/scope_fail.leo.out b/tests/expectations/compiler/compiler/function/scope_fail.leo.out index db3439c953..1d2cfacf9e 100644 --- a/tests/expectations/compiler/compiler/function/scope_fail.leo.out +++ b/tests/expectations/compiler/compiler/function/scope_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:5:12\n |\n 5 | return myGlobal;\n | ^^^^^^^^\n |\n = failed to resolve variable reference 'myGlobal'" + - "Error [EASG0373028]: failed to resolve variable reference 'myGlobal'\n --> compiler-test:5:12\n |\n 5 | return myGlobal;\n | ^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/function/undefined.leo.out b/tests/expectations/compiler/compiler/function/undefined.leo.out index df282cd43c..d21aace1cd 100644 --- a/tests/expectations/compiler/compiler/function/undefined.leo.out +++ b/tests/expectations/compiler/compiler/function/undefined.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:5:5\n |\n 5 | my_function();\n | ^^^^^^^^^^^\n |\n = failed to resolve function: 'my_function'" + - "Error [EASG0373024]: failed to resolve function: 'my_function'\n --> compiler-test:5:5\n |\n 5 | my_function();\n | ^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/function/value_unchanged.leo.out b/tests/expectations/compiler/compiler/function/value_unchanged.leo.out index a4e5ddae32..ca20b3c22e 100644 --- a/tests/expectations/compiler/compiler/function/value_unchanged.leo.out +++ b/tests/expectations/compiler/compiler/function/value_unchanged.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 089803f7197594aeca82cba9bc2eb70b6fdbbf42c007a0949da4c5b1b4f63508 - canonicalized_ast: 415cdab7ff832a06dc7b01e3134b81d36f0efc0efb3ae092c062419c38f57450 - type_inferenced_ast: 91fb5695f3a2c856d2cde8936aaef4cbb94773a2a71b56c00661c72c8fdee50b + initial_ast: d3d54367b0fcc1b5a01185aec3cfe669941bd0a1b6f4218a73a1928f9dea5dbc + canonicalized_ast: eb82bb09e23368391dca2472a6838bb7f9d704a9bb1ca53169550fafb79b6eed + type_inferenced_ast: eeae07f387addad134aca399c105f020006f79fa64e4d1395abd2e27d42e0ae8 diff --git a/tests/expectations/compiler/compiler/global_consts/global_const_types.leo.out b/tests/expectations/compiler/compiler/global_consts/global_const_types.leo.out index 3f2ac74f18..bfc4883877 100644 --- a/tests/expectations/compiler/compiler/global_consts/global_const_types.leo.out +++ b/tests/expectations/compiler/compiler/global_consts/global_const_types.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "false" - initial_ast: 8b9ad0b83a216048ab6179c6e223f68290059bab1deb72771f72a672ea7a0bf9 - canonicalized_ast: acdf383c635404bccf9612be9c14c96e400496fb231cf3062bce9aa269331c0f - type_inferenced_ast: ab3b8dc3ddfba1affaacf2bc344c658d5b82419544da136e42c810a3f99f3832 + initial_ast: 97024a9c26e890afe8f4dc64b727a72e837f46b27ff56cddc1231c29671dc2b4 + canonicalized_ast: 8674af05f953dfda5eb360e367447912e9d0ec5abf513eaba14444bd66bd9cae + type_inferenced_ast: 33017f3824095dcb4431f73db16a3fe1e845d30d7a6366182b247a23445eb26d diff --git a/tests/expectations/compiler/compiler/global_consts/modify_global_const.leo.out b/tests/expectations/compiler/compiler/global_consts/modify_global_const.leo.out index dd80c5e6bc..1f854bf2fd 100644 --- a/tests/expectations/compiler/compiler/global_consts/modify_global_const.leo.out +++ b/tests/expectations/compiler/compiler/global_consts/modify_global_const.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:7:5\n |\n 7 | basic = 2u32;\n | ^^^^^^^^^^^^\n |\n = illegal assignment to immutable variable 'basic'" + - "Error [EASG0373033]: illegal assignment to immutable variable 'basic'\n --> compiler-test:7:5\n |\n 7 | basic = 2u32;\n | ^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/import_dependency/tests/import_dependency_folder.leo.out b/tests/expectations/compiler/compiler/import_dependency/tests/import_dependency_folder.leo.out index 1eeff43f07..afd08250f6 100644 --- a/tests/expectations/compiler/compiler/import_dependency/tests/import_dependency_folder.leo.out +++ b/tests/expectations/compiler/compiler/import_dependency/tests/import_dependency_folder.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: d6273a716c2546b210eeefb640b5c34830fb2b2a4195ae0b636843e855fcbc1e - canonicalized_ast: 41a3c4ffe7c243ffc76bc7d3c147f77f71119d64e632581a20eb1cd576752ac3 - type_inferenced_ast: 196e5191c3d8c8cc552b419422b3e1411fa576336f63ae9d5c340bf2a7d62942 + initial_ast: 3f1b8c03ff4676240e6a1deaf46094a95f87b0c5375b7af09b9fd796ee9d7639 + canonicalized_ast: d677dff4951f6b48675b4b38c3725b21914619c5af9494510f0ea9fdb50bec74 + type_inferenced_ast: e053cf66b0a4b1ed0208c18d45566d8cd6277bbcb56f3547a28ef095deb25153 diff --git a/tests/expectations/compiler/compiler/import_local/import_all.leo.out b/tests/expectations/compiler/compiler/import_local/import_all.leo.out index af0f7a88be..3b261da032 100644 --- a/tests/expectations/compiler/compiler/import_local/import_all.leo.out +++ b/tests/expectations/compiler/compiler/import_local/import_all.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 1a78fdc95fad861e53d1b0463228701df726fa0bf5092bd94d1d35f57c8c2a94 - canonicalized_ast: 1a78fdc95fad861e53d1b0463228701df726fa0bf5092bd94d1d35f57c8c2a94 - type_inferenced_ast: be1c8166ce3ae7f805d8600441996328ce8f45ada3c16c4284f07d07af52ef75 + initial_ast: b01c46ace6ae994f48ca0042be1a1ec06bf844211f5a29a30594f74fdd6ccb90 + canonicalized_ast: b01c46ace6ae994f48ca0042be1a1ec06bf844211f5a29a30594f74fdd6ccb90 + type_inferenced_ast: 0b46b4b8fe6e9a397d8e9a64761f0f7c84f50a4be2f4ac3f08770183f27b6565 diff --git a/tests/expectations/compiler/compiler/import_local/import_as.leo.out b/tests/expectations/compiler/compiler/import_local/import_as.leo.out index bc897c1c3f..66be5fc42c 100644 --- a/tests/expectations/compiler/compiler/import_local/import_as.leo.out +++ b/tests/expectations/compiler/compiler/import_local/import_as.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 47ef8cd0b57a42612bc9138c6da6e05fbca27c47464acf5af569c2fe0c91dd31 - canonicalized_ast: 39c0b27ba63cc34eed735900912e154031ca1f291aade9d9964ce49e77eeb19e - type_inferenced_ast: 19bfc761f899b48a3e0c4142bac6cbdaceac8230e92422cf9f6a99d9f7eddc6f + initial_ast: 09ae5023ca083bbf3e4cd4634d83b4cb5d5b4ad44b51c6f849273540b74c05bf + canonicalized_ast: d12f6315280c12a7052e08f635d41e8d81d89c98ae6f760fbc3885da42224c4a + type_inferenced_ast: cd79fce9b7c1325a1d992159466c1dfba53a123f383aefa34940ceb2593fa483 diff --git a/tests/expectations/compiler/compiler/import_local/import_dir.leo.out b/tests/expectations/compiler/compiler/import_local/import_dir.leo.out index ebbd5184aa..9b6756ecd2 100644 --- a/tests/expectations/compiler/compiler/import_local/import_dir.leo.out +++ b/tests/expectations/compiler/compiler/import_local/import_dir.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 7e0ba7b09b3840a5d4fc9f0d413163ba2de8f207c3818f604f9a71297aac30f3 - canonicalized_ast: 3f7efb61847fd75fed58b70526da8ceffb573a0806521fb30443f341c3d14a45 - type_inferenced_ast: a1baf614c8ab13c1ff978faf8022f90eef4c482261928cb3256ab4d63e20096c + initial_ast: 326263da73e6edfe8788d5d6db70ee879999bf0339690fdbb3d3c27508966125 + canonicalized_ast: b81f83d7d31ec610e10e52f89a21e268664cf95cc6fb08bf2153403dc9c2f37f + type_inferenced_ast: 69402330a4fb2015c1ba2990104d3c8c43e05bc5d701c79587066092d3aabfa1 diff --git a/tests/expectations/compiler/compiler/import_local/import_files.leo.out b/tests/expectations/compiler/compiler/import_local/import_files.leo.out index aaaee96823..6859d46ba1 100644 --- a/tests/expectations/compiler/compiler/import_local/import_files.leo.out +++ b/tests/expectations/compiler/compiler/import_local/import_files.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 042e056c86e545ce256459a0de20d44c0bae24ff406becba4330e3208c48e180 - canonicalized_ast: 6cab1ab863f40c96d5d6921e2ced0dd00ebe5e9e334d84508af708be19ae8f59 - type_inferenced_ast: 17ff3e62f1c48edfbfb1c35ed4ac542260b59153d85afeca2e707dde217dc675 + initial_ast: 1e48fe05ca987660d68c6166f45097631ac3a900da03ed1ff66a9f5410f7b817 + canonicalized_ast: 567ae9a9f0641d4805d14ce57cbe7beb3fc33115e11187b1087d34c14f86b270 + type_inferenced_ast: 3a934ed3696b799ce020a7d51db12af1039ea94608bf909804664521828348e3 diff --git a/tests/expectations/compiler/compiler/import_local/import_many.leo.out b/tests/expectations/compiler/compiler/import_local/import_many.leo.out index b379ba5f2e..3ca9429193 100644 --- a/tests/expectations/compiler/compiler/import_local/import_many.leo.out +++ b/tests/expectations/compiler/compiler/import_local/import_many.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: ad1dd786c43b4d3de69b6e162bed3f01a0a53f0643e6fd2d95f12c98dfa16855 - canonicalized_ast: ad1dd786c43b4d3de69b6e162bed3f01a0a53f0643e6fd2d95f12c98dfa16855 - type_inferenced_ast: 1c983cf518cfafbe158ee3e42aed5cb190863b09aedfc4dd34e0268160ee79e2 + initial_ast: 64f447a80a88cb665651c9d4a8d6c195d4f9529c0157d6c2f3c6557062b9361b + canonicalized_ast: 64f447a80a88cb665651c9d4a8d6c195d4f9529c0157d6c2f3c6557062b9361b + type_inferenced_ast: a31ce23735af584c7c21b27ba0b3e27cea01dbdb50efb87f690fdd5e0fa94547 diff --git a/tests/expectations/compiler/compiler/import_local/import_weird_names.leo.out b/tests/expectations/compiler/compiler/import_local/import_weird_names.leo.out index 22e000786a..ac8ce750b5 100644 --- a/tests/expectations/compiler/compiler/import_local/import_weird_names.leo.out +++ b/tests/expectations/compiler/compiler/import_local/import_weird_names.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 6a099d784f82bb8065c8efdd2b4018089d968a7f57cbab3406df3ec5d0612410 - canonicalized_ast: 6a099d784f82bb8065c8efdd2b4018089d968a7f57cbab3406df3ec5d0612410 - type_inferenced_ast: 58541200a815edfee41333b9b2b048add269d0924ca17457ecf9fbcbb5032ccf + initial_ast: e58bc13bf652921c07e471122832498fa2b5fc317976fab07e34e9bb62e6ddca + canonicalized_ast: e58bc13bf652921c07e471122832498fa2b5fc317976fab07e34e9bb62e6ddca + type_inferenced_ast: 4e807d6d0dc3435ca3d6a1ab34b7d9f819664837cf32b5b26a81b027bbc05d71 diff --git a/tests/expectations/compiler/compiler/import_local/import_weird_names_nested.leo.out b/tests/expectations/compiler/compiler/import_local/import_weird_names_nested.leo.out index e34d9e527a..6598931551 100644 --- a/tests/expectations/compiler/compiler/import_local/import_weird_names_nested.leo.out +++ b/tests/expectations/compiler/compiler/import_local/import_weird_names_nested.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 98debe360fb6fbede5a9db625cbc2e4e4dfddcb23f40e3914e909157334e1d70 - canonicalized_ast: 98debe360fb6fbede5a9db625cbc2e4e4dfddcb23f40e3914e909157334e1d70 - type_inferenced_ast: 50c06c3666a830c7f1fd533c412a4e8054fdb494845f4f5d85414b08f1c1a8dd + initial_ast: e1b0fc42c16ba92201081238a603e1a1c9a464882a274613cc8f99465d80334e + canonicalized_ast: e1b0fc42c16ba92201081238a603e1a1c9a464882a274613cc8f99465d80334e + type_inferenced_ast: 0f876207fdc179cc01db6d4b65350454dc0be5e20f6de2356eb53e0ff0e8ee97 diff --git a/tests/expectations/compiler/compiler/input_files/program_input/const_input_non_const.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/const_input_non_const.leo.out index 4859c4e575..a93d0799e0 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/const_input_non_const.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/const_input_non_const.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:15\n |\n 3 | function main(a: u32) {\n | ^\n |\n = Expected input variable `a` to be non-constant. Move input variable `a` to [main] section of input file" + - "Error [ECMP0376029]: Expected input variable `a` to be non-constant. Move input variable `a` to [main] section of input file\n --> compiler-test:3:15\n |\n 3 | function main(a: u32) {\n | ^" diff --git a/tests/expectations/compiler/compiler/input_files/program_input/const_var_in_both_sections_fail.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/const_var_in_both_sections_fail.leo.out index bb3c808a15..fff9ee336c 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/const_var_in_both_sections_fail.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/const_var_in_both_sections_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:21\n |\n 3 | function main(const a: u32) {\n | ^\n |\n = Input variable a declared twice" + - "Error [ECMP0376035]: Input variable a declared twice\n --> compiler-test:3:21\n |\n 3 | function main(const a: u32) {\n | ^" diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main.leo.out index adb443fba9..3bc9bbd98a 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: c9a0358dec57807c9afbce3bb523f3677a19873b713b16e15b31be9b58e7e938 - canonicalized_ast: c9a0358dec57807c9afbce3bb523f3677a19873b713b16e15b31be9b58e7e938 - type_inferenced_ast: 33c49e9288050147b62513345adee7c22e7326ccef9bcf9b4e6782376a89de8f + initial_ast: fd5d65f5f25616d2b3ebb6ee863f8f5099544e19448534131299fca6dc090387 + canonicalized_ast: fd5d65f5f25616d2b3ebb6ee863f8f5099544e19448534131299fca6dc090387 + type_inferenced_ast: 20cc52c351fcacc3321fd3b56a79d81824e475e2c4bf9c63451e39d2545b7c05 diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_array.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main_array.leo.out index 55dafb3426..a3522c3118 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_array.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_array.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 49288b2a38f96d3b0d7dfafd780a028815c4f3dc033e9083daa9226ac630e9d2 - canonicalized_ast: 49288b2a38f96d3b0d7dfafd780a028815c4f3dc033e9083daa9226ac630e9d2 - type_inferenced_ast: 1324a840dafe289197021fddf594be6becdf99b195f37596af43ce300f84b023 + initial_ast: 75de104d23e3eda322cf8335ea2b72ca32c26fe79b9c7b8946f1b957a5a58b5d + canonicalized_ast: 75de104d23e3eda322cf8335ea2b72ca32c26fe79b9c7b8946f1b957a5a58b5d + type_inferenced_ast: 86e9c692a93d08c3d6ff7ffb82d885e6df78fb6c477c1efc6627881b5db02402 diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_array_fail.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main_array_fail.leo.out index 8f284636c0..97ab65d88b 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_array_fail.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_array_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:15\n |\n 3 | function main(x: [i16; 2]) {\n | ^\n |\n = Input array dimensions mismatch expected 1, found array dimensions 2" + - "Error [ECMP0376031]: Input array dimensions mismatch expected 1, found array dimensions 2\n --> compiler-test:3:15\n |\n 3 | function main(x: [i16; 2]) {\n | ^" diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_char.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main_char.leo.out index 36a622c2d8..5e72920d14 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_char.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_char.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 812d646edd6b14d9e27244a9da95ce1dc805fcaac8b654f9e3e962837e776f84 - canonicalized_ast: 812d646edd6b14d9e27244a9da95ce1dc805fcaac8b654f9e3e962837e776f84 - type_inferenced_ast: 249bacf5d583e861e2e8168fdbb3d3a0219d5a00f5b2ba3ca4dcd94f62ef575d + initial_ast: 79d9c8c5681e8eda47e4cc625e555cdc25de8b46f359db004ec2b5408d740f84 + canonicalized_ast: 79d9c8c5681e8eda47e4cc625e555cdc25de8b46f359db004ec2b5408d740f84 + type_inferenced_ast: 6a25166a63b0ef30ed2beb723ce9bca0b848da95ab633889409fd797f18a8fef diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_field.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main_field.leo.out index 1ec1f4e7af..82f0893667 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_field.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_field.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "false" - initial_ast: f3bac684fe095a005d0d4811a3878d9c1ae67df0ad3a6229ac3f098ad413afb2 - canonicalized_ast: f3bac684fe095a005d0d4811a3878d9c1ae67df0ad3a6229ac3f098ad413afb2 - type_inferenced_ast: 0ece5b45cc7f746d06d626cce250e212fbd48eeecc61e972394609494937f7bc + initial_ast: f1c4e2b8a27e2575293486977b41988a4fdc9195c40ac70b703cd6b34c52e526 + canonicalized_ast: f1c4e2b8a27e2575293486977b41988a4fdc9195c40ac70b703cd6b34c52e526 + type_inferenced_ast: 38bf188ec70371f03856ec64b1df460cd3217a1565040f143aff30f1c3740c70 diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_group.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main_group.leo.out index e1afb82eb9..942216f150 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_group.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_group.leo.out @@ -13,6 +13,6 @@ outputs: - input_file: input/main_group.in output: registers: {} - initial_ast: 80d005d0d277205d4e42029b1257aea9f67301ac8193dd8e595051ebb12ee50e - canonicalized_ast: 89eca89eb1633f9346fed9f868d11326c6d8721b846f49b23cf5c54bc426273a - type_inferenced_ast: 4e592b434fbceb1a1b942a65d8f6e1a2ca21754fd8215584512c0ecf89c03fa7 + initial_ast: 734254f32edba7e044d3d9f73dd222a0dd967707d51f4a6fdc3c89af9bc79f6c + canonicalized_ast: 8e37317e62d5c398c84aa4470c96a2bef33e63b5bb1a0e469a4cf1a49c565a74 + type_inferenced_ast: 6f5a6a68f766ee45ea2f4b3e16a6f85ac13fe60fbe3a27cea90e5da7bd7982c4 diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_multi_dimension_array.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main_multi_dimension_array.leo.out index 26317ab6f0..32b62ddcee 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_multi_dimension_array.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_multi_dimension_array.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 5f2fe4c4fae5c53b40a0011389aaba92ed6f61487c4be3938f450d658cae4639 - canonicalized_ast: bada9b141c8740dc1af11c395ac97152ed9ef8796e92ceade5fdcb43354a997d - type_inferenced_ast: 905b29996916de37e498809f39b26520b618d4d6a952156d8406513dda9d4e8a + initial_ast: da5236e9a81e2048dacfd3004db8a370a342ca2fb966b3d8ba6535ba4d3fae17 + canonicalized_ast: f65c8486c62ea1df95bb7ef70577388da94d200ceba32ce15620e5498ce245e9 + type_inferenced_ast: dca62cb02813f4047d5f69c1b70d945902dc99044c980f74e7789611dc6968b1 diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_multiple.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main_multiple.leo.out index f865f6645c..6d17836eeb 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_multiple.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_multiple.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: aa57c32deb2ca3f69aac1c8d6ab1c9ca787d7539d15dd6ae1d132c4bdf1628f0 - canonicalized_ast: aa57c32deb2ca3f69aac1c8d6ab1c9ca787d7539d15dd6ae1d132c4bdf1628f0 - type_inferenced_ast: 730367497b7b56381f29321e18eade74d70107a6d8c657b47022215015f53801 + initial_ast: aae17ba5bd2ce376b5c440df42be442b0731feb499fa37b133b89f364a8790bf + canonicalized_ast: aae17ba5bd2ce376b5c440df42be442b0731feb499fa37b133b89f364a8790bf + type_inferenced_ast: 5b110c3aa3e0d65942f7a7fdbdccfc745aa810ea7d71137358f220d2bfecb0b7 diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_string.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main_string.leo.out index 12267c22b1..9f50a60077 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_string.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_string.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 4d78c30ded08f7db4f66f8fb7a2afe70aeb6aa8e6deb904c559497c776147446 - canonicalized_ast: a946a3abb84533a9d3b0ea014355920a058aa37b3fd7025946f35a317e0693e9 - type_inferenced_ast: 0dad4ae7f3f49065239efb989eff41070ad109ae66331c15ae455718ef915563 + initial_ast: febb53aab48ab8b14c5254dbabd4962986633cd1d8e835cb2cd37273eb679f19 + canonicalized_ast: 87a760c60ea690797600988e8bb9e3f767aea097d226e1c4975f96103c2de8b6 + type_inferenced_ast: 43c510a75ca27431f2f85be85e1cc7a92cd4c6da43cd38e74bb3d3fd1fa525b5 diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_tuple.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main_tuple.leo.out index 5110685fdf..1a5835c8e8 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_tuple.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_tuple.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 0f65ed036cf7ac2bf2d9b1e73406b7f8ea669c3392b24c171697f924a99025b9 - canonicalized_ast: 0f65ed036cf7ac2bf2d9b1e73406b7f8ea669c3392b24c171697f924a99025b9 - type_inferenced_ast: 685758ab99acb9f79da0c0665097d1dc34d821d02502011dee82c5564e5f885a + initial_ast: f7d08c7f104e732a04c7a71522a04d8a781afd3b67b28db8978a41d34c7ae472 + canonicalized_ast: f7d08c7f104e732a04c7a71522a04d8a781afd3b67b28db8978a41d34c7ae472 + type_inferenced_ast: 358265a83714b484456d92d5ccc15e4259e94bdd28072914628c5ac9773adfd8 diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_tuple_fail.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main_tuple_fail.leo.out index 20d32da413..2699fc0238 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_tuple_fail.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_tuple_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:15\n |\n 3 | function main(x: (u8, bool, u8)) {\n | ^\n |\n = Input tuple size mismatch expected 3, found tuple with length 2" + - "Error [ECMP0376032]: Input tuple size mismatch expected 3, found tuple with length 2\n --> compiler-test:3:15\n |\n 3 | function main(x: (u8, bool, u8)) {\n | ^" diff --git a/tests/expectations/compiler/compiler/input_files/program_input/non_const_input_const.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/non_const_input_const.leo.out index 26e1da8cfe..7c208e40ac 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/non_const_input_const.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/non_const_input_const.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:17\n |\n 4 | let b = a * 2;\n | ^\n |\n = failed to resolve type for variable definition 'unknown'" + - "Error [EASG0373025]: failed to resolve type for variable definition 'unknown'\n --> compiler-test:4:17\n |\n 4 | let b = a * 2;\n | ^" diff --git a/tests/expectations/compiler/compiler/input_files/program_input/var_in_both_sections_fail.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/var_in_both_sections_fail.leo.out index 3bfbdf310e..29564d375c 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/var_in_both_sections_fail.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/var_in_both_sections_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:15\n |\n 3 | function main(a: u32) {\n | ^\n |\n = Input variable a declared twice" + - "Error [ECMP0376035]: Input variable a declared twice\n --> compiler-test:3:15\n |\n 3 | function main(a: u32) {\n | ^" diff --git a/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/basic.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/basic.leo.out index 31fec7b550..1b01d3a1c3 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/basic.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/basic.leo.out @@ -16,6 +16,6 @@ outputs: b: type: bool value: "true" - initial_ast: 1c5370b54401931103a9aee59aadbc05dd747e758a20dcf9665ba181777d76d5 - canonicalized_ast: 1c5370b54401931103a9aee59aadbc05dd747e758a20dcf9665ba181777d76d5 - type_inferenced_ast: 04a1f100613ccf2f49733ecc76c83058d78c14c03fc4817df117eaa9a8296c66 + initial_ast: 2cfed669110dc972ec11a67149117c6dd2f4d09d7791d7d3cdfe334c32bfc3eb + canonicalized_ast: 2cfed669110dc972ec11a67149117c6dd2f4d09d7791d7d3cdfe334c32bfc3eb + type_inferenced_ast: 4df0dad517cafd4f8f4e9a9717e0b4d3decd2c07091338cd65fe97fdcc5e8778 diff --git a/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/token_withdraw.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/token_withdraw.leo.out index 9996d2ff80..f3559fa361 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/token_withdraw.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/token_withdraw.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 1ef884c7c1e9e5a806bc5dce27cd68f33b3cddf5c1ebf930a292fd6adb5762ce - canonicalized_ast: 1ef884c7c1e9e5a806bc5dce27cd68f33b3cddf5c1ebf930a292fd6adb5762ce - type_inferenced_ast: aeedb43de348c034bee08c8df80d0fb2e8f9e7f11989e57cfa4fb8bbf876eb83 + initial_ast: 2a87c1d20941f840d6e6535b0145568e8aea7f87466c5e313329e3844efeef82 + canonicalized_ast: 2a87c1d20941f840d6e6535b0145568e8aea7f87466c5e313329e3844efeef82 + type_inferenced_ast: 34a0270bb47f0ba1b72f8789a1223084b6719933dd937f6703759502ace7a346 diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main.leo.out index 23d8f056da..d7047044c2 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: cd8b1f60505fc1f2269a587982e3c9cfd08b9f183ede8eadc8a1f00d63360f5c - canonicalized_ast: cd8b1f60505fc1f2269a587982e3c9cfd08b9f183ede8eadc8a1f00d63360f5c - type_inferenced_ast: a1640fb069335b80d27567c56759f0b6610c9ba31cac966a742fa775c3fd0373 + initial_ast: e007051c65717fe114d8886204b8c097d81c38144ab4afc1ab1bc382e5773dd8 + canonicalized_ast: e007051c65717fe114d8886204b8c097d81c38144ab4afc1ab1bc382e5773dd8 + type_inferenced_ast: a22c5c90adcd19441b5fef47a637f1dc1b1f849a31a1c8adcbe377897dc292ca diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_array.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_array.leo.out index 8fc0faca83..33588fcfe7 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_array.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_array.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 5cf9f340177e4a476a81c0cbb645ab443dd93551b5e247332e193273b5a42288 - canonicalized_ast: 5cf9f340177e4a476a81c0cbb645ab443dd93551b5e247332e193273b5a42288 - type_inferenced_ast: 9b10865266ad6fa0f46d35a94fe2c052ff0fb46ffca1dbdc2b2294ca9e52217e + initial_ast: 9957e99bb4cb4b2b9b4c8a49435f05773cdae1bdaf20ea6b98aa1e77b804d94c + canonicalized_ast: 9957e99bb4cb4b2b9b4c8a49435f05773cdae1bdaf20ea6b98aa1e77b804d94c + type_inferenced_ast: 3a1dcb5ea333c1dfc1b1ceb5516c59a449cd882d22a7439833c1d3a0a3eca3f3 diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_array_fail.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_array_fail.leo.out index eeb175895f..2b6757d01d 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_array_fail.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_array_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:21\n |\n 3 | function main(const x: [i16; 2]) {\n | ^\n |\n = Input array dimensions mismatch expected 2, found array dimensions 1" + - "Error [ECMP0376031]: Input array dimensions mismatch expected 2, found array dimensions 1\n --> compiler-test:3:21\n |\n 3 | function main(const x: [i16; 2]) {\n | ^" diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_char.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_char.leo.out index 3ec43c8646..b6a5b28c2e 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_char.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_char.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 0fd985182a4a32bc7b983c13e4f7b188902b6ef37ea1fbaa22da867b388990e8 - canonicalized_ast: 0fd985182a4a32bc7b983c13e4f7b188902b6ef37ea1fbaa22da867b388990e8 - type_inferenced_ast: 08864c66bc6890ed6d83cbb214318f7423735533f0146a856a9bdf5b8d48e816 + initial_ast: a1518e5bbc6ee7140232bb483f4dd6ec53455aff8aa8c517c5e27921ebeab3af + canonicalized_ast: a1518e5bbc6ee7140232bb483f4dd6ec53455aff8aa8c517c5e27921ebeab3af + type_inferenced_ast: 0940493f8d297c71d9286c980ce74405a10115412a16c6a5247c03280747e76f diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.leo.out index bbdae9fa2c..f3dfc7b125 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "false" - initial_ast: da17f98e5cf8d90b4d73d797493d752c9d519c61cf900509c866a0649c034cad - canonicalized_ast: da17f98e5cf8d90b4d73d797493d752c9d519c61cf900509c866a0649c034cad - type_inferenced_ast: 5842a5364abf56e9a51e69b2ded9fdce009c8851d86beba39ba8ab373394ef66 + initial_ast: 8c41518bf856943776335f7134085d5ec579fcd3f074c684bf15a088d5706cc5 + canonicalized_ast: 8c41518bf856943776335f7134085d5ec579fcd3f074c684bf15a088d5706cc5 + type_inferenced_ast: 0e64948c43c40dc90e3256093e0d5ee21d03593c38331febf90d6ef3ac381b7a diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_group.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_group.leo.out index 78e7a115fd..033fa39be3 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_group.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_group.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 854be098a724cec3bb03249c8fc03aba5d53c2628bad6d45188872d2f67a7f15 - canonicalized_ast: 854be098a724cec3bb03249c8fc03aba5d53c2628bad6d45188872d2f67a7f15 - type_inferenced_ast: 37a8d6e71f2f6e2ffc61ffd29beb07ff04189647a367e21e7d70245bb3d0b280 + initial_ast: d23e3cc53865b5079111a5f568576fcc760b7ab3d97261b7d8c6c26a1dbc3da3 + canonicalized_ast: d23e3cc53865b5079111a5f568576fcc760b7ab3d97261b7d8c6c26a1dbc3da3 + type_inferenced_ast: dbfabbf984c9ff0741ed1d00ff5ef3a2e3408ccc16270ec835a5781f206edc7b diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multi_dimension_array.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multi_dimension_array.leo.out index 9dbacb0ff1..3fb727c90a 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multi_dimension_array.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multi_dimension_array.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: a42e650c64317b4ee6145da788ff7348dbe61543e87016c7491854edc7104e3b - canonicalized_ast: ebda82101177805ec323d0cce8325ea29090a7942d6784f074444fdf370c3e2e - type_inferenced_ast: c034b0dec8b1c4b3aa735137d2294514a7014a223565811054fbf7d69b67c9da + initial_ast: fc34aa149a013b9dc5b89b37e19a9ab4b8c721bfb0194332b18491354005c757 + canonicalized_ast: 70e54f09c930683fdf01d942fbf818de72f73fe17de4bc06c428bb3166fca7b6 + type_inferenced_ast: 8eb214fdbd3319530abbbbf834c99fd5339513d6be7aed84490fae01b5e9ca47 diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multiple.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multiple.leo.out index a7762a959e..3d3e03bbdb 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multiple.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multiple.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 5cf468e17290553c60a2cdedcb92c16d8269b07403cffefbe16701bf7e4e3efd - canonicalized_ast: 5cf468e17290553c60a2cdedcb92c16d8269b07403cffefbe16701bf7e4e3efd - type_inferenced_ast: 63f2f49324e5dc7b8aa9c5be7b524c21fb86528c6ca5e9446d0accd2f3c14470 + initial_ast: 6ca86b141b3b3ca7236fa991bf26c91e9451208080803c05878229721adece7e + canonicalized_ast: 6ca86b141b3b3ca7236fa991bf26c91e9451208080803c05878229721adece7e + type_inferenced_ast: 466038c7c7bc66b05eb0e58ffff56a491e754aa315b4b75779012236ff1f1c1c diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_string.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_string.leo.out index 0953a7ca5b..a442df980a 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_string.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_string.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 54f05a3b9e065ed4a4c9060278ebbfba8c871fc0952928b3247495e3420e6a8f - canonicalized_ast: 5239f39807679614fa177f6da454d51e73348714e680cc51c4587630525a3d1f - type_inferenced_ast: 34dc40266a9c59e43ecbb094edbefbe654d89032e57f75fdcd42f5cd6125896a + initial_ast: 613d2bc2c09f5bc83f69f1a412e95d0131111bc74b60b9ed7d1fa8bb2006120c + canonicalized_ast: a6601205f9b1deb01c7029664cc1074a5c4497be5e4702fa66886f7791b20d94 + type_inferenced_ast: bc5f71c3a2a6918c75cb361514d4bdaecbb54f294ba20ec16ccecd20b582fbd5 diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_tuple.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_tuple.leo.out index 673d8e7b70..424015348d 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_tuple.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_tuple.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: a5fdbc9ea34c5171ba153bfd9b5078d84d4be9e08c2eb97410082299143ae902 - canonicalized_ast: a5fdbc9ea34c5171ba153bfd9b5078d84d4be9e08c2eb97410082299143ae902 - type_inferenced_ast: 2caf7e798653f694eb868a03899e8316d25f4d35df081a287ca1c764d9f45a33 + initial_ast: fae106810af4f4f1778934609b37de40b91e8f813b66b745c50343e3ff862dde + canonicalized_ast: fae106810af4f4f1778934609b37de40b91e8f813b66b745c50343e3ff862dde + type_inferenced_ast: 8ec29af283c7f3e23ee77643cc0fd7b7e8fe07639870b87ecd952ca187e4fc20 diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_tuple_fail.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_tuple_fail.leo.out index f4642c5005..6ab90fa4b5 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_tuple_fail.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_tuple_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:21\n |\n 3 | function main(const x: (u8, bool, u8)) {\n | ^\n |\n = Input tuple size mismatch expected 3, found tuple with length 2" + - "Error [ECMP0376032]: Input tuple size mismatch expected 3, found tuple with length 2\n --> compiler-test:3:21\n |\n 3 | function main(const x: (u8, bool, u8)) {\n | ^" diff --git a/tests/expectations/compiler/compiler/input_files/program_registers/registers_array.leo.out b/tests/expectations/compiler/compiler/input_files/program_registers/registers_array.leo.out index 108b936235..56cb3f6df3 100644 --- a/tests/expectations/compiler/compiler/input_files/program_registers/registers_array.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_registers/registers_array.leo.out @@ -16,6 +16,6 @@ outputs: r2: type: "[[u8; 4]; 2]" value: "\"[0, 0, 0, 0][0, 0, 0, 0]\"" - initial_ast: fb540ccd0618e433c2181c6dc9b73080e0a23c3f5b5ebe9f1106276aae38d8ef - canonicalized_ast: fb540ccd0618e433c2181c6dc9b73080e0a23c3f5b5ebe9f1106276aae38d8ef - type_inferenced_ast: f6ed6b87a3fb35bf53ef4ba86a9a3e0d2271914a45d773dd7931c6a5d1b83151 + initial_ast: fc0375f232a4a8d600789df4c17c872438ae3e918c7a617364085c62b9873c8e + canonicalized_ast: fc0375f232a4a8d600789df4c17c872438ae3e918c7a617364085c62b9873c8e + type_inferenced_ast: 8566dcec6a7bb0a0105c25331486c7a69d03bf12734f62b9136b3179d7f22432 diff --git a/tests/expectations/compiler/compiler/input_files/program_registers/registers_fail.leo.out b/tests/expectations/compiler/compiler/input_files/program_registers/registers_fail.leo.out index 6609ce03a3..3fd558ebfb 100644 --- a/tests/expectations/compiler/compiler/input_files/program_registers/registers_fail.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_registers/registers_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:1\n |\n 3 | function main() -> bool {\n|\n 4 | ...\n|\n 5 | }\n | ^\n |\n = Mismatched types. Expected register output type `u8`, found type `bool`." + - "Error [ECMP0376037]: Mismatched types. Expected register output type `u8`, found type `bool`.\n --> compiler-test:3:1\n |\n 3 | function main() -> bool {\n 4 | ...\n 5 | }\n | ^" diff --git a/tests/expectations/compiler/compiler/input_files/program_registers/registers_pass.leo.out b/tests/expectations/compiler/compiler/input_files/program_registers/registers_pass.leo.out index 513d80da5e..f6ec6ba7c5 100644 --- a/tests/expectations/compiler/compiler/input_files/program_registers/registers_pass.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_registers/registers_pass.leo.out @@ -16,6 +16,6 @@ outputs: r: type: u8 value: "101" - initial_ast: 430d76675273bb92e7af55000e710e2f5d1621db50550a5366325779633577bf - canonicalized_ast: 430d76675273bb92e7af55000e710e2f5d1621db50550a5366325779633577bf - type_inferenced_ast: bcde9c109d65d236fb2079bc26490658438c422bc17b09bd0beebe0298feaf03 + initial_ast: cf6a76290b73851a3ed589650d1a25ffbb75e663f510dfe3274b66600678bc64 + canonicalized_ast: cf6a76290b73851a3ed589650d1a25ffbb75e663f510dfe3274b66600678bc64 + type_inferenced_ast: ce87463df0f9dee5d06d1d872340e8f40ca5cab1bc5a9dbb4e422165714798d4 diff --git a/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out b/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out index b77180760f..e53c68cb4a 100644 --- a/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 6f08333f0f602b1ef25d548da7f5f5a611a4409281e3412fe380c367a76bac24 - canonicalized_ast: 6f08333f0f602b1ef25d548da7f5f5a611a4409281e3412fe380c367a76bac24 - type_inferenced_ast: 3a05ae6705cfc5a344631563ed43c3caf73c1762bef0b4a4165ae73e1466e27f + initial_ast: 6fd4f46e0a795fd0edef840925c6a152c8b69685f30b42b1dc5aeaf2e0f1296a + canonicalized_ast: 6fd4f46e0a795fd0edef840925c6a152c8b69685f30b42b1dc5aeaf2e0f1296a + type_inferenced_ast: ad948d43d662198b33e752ac1c20807b5d79525c4cc61f15d41155f31ade71c4 diff --git a/tests/expectations/compiler/compiler/input_files/program_state/access_state.leo.out b/tests/expectations/compiler/compiler/input_files/program_state/access_state.leo.out index b8140088f6..e5a5c707d0 100644 --- a/tests/expectations/compiler/compiler/input_files/program_state/access_state.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_state/access_state.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 0eabec3e7bd9d1b1ca1666329f7bd3ad9d3095d209c94f83a19b60e78857375f - canonicalized_ast: 0eabec3e7bd9d1b1ca1666329f7bd3ad9d3095d209c94f83a19b60e78857375f - type_inferenced_ast: c6fb6168c1089361909edf6d76a9d3cba97a2f907821eb7f71198f1fb6bb1310 + initial_ast: 14d707805bc7e51b4b01dc9272ce7e7f1018c52a885a14177acb4e7ca34174f5 + canonicalized_ast: 14d707805bc7e51b4b01dc9272ce7e7f1018c52a885a14177acb4e7ca34174f5 + type_inferenced_ast: b399e663877ab10bb59844997e4a6a94e53c67cec20112a125906087a91f3a32 diff --git a/tests/expectations/compiler/compiler/input_files/program_state/basic.leo.out b/tests/expectations/compiler/compiler/input_files/program_state/basic.leo.out index 8859157fd8..2cef53b2e9 100644 --- a/tests/expectations/compiler/compiler/input_files/program_state/basic.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_state/basic.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: e94f4826afb8405a883b3c3df074507dbd38db45e8fa5e8d984ed5974f521c6a - canonicalized_ast: e94f4826afb8405a883b3c3df074507dbd38db45e8fa5e8d984ed5974f521c6a - type_inferenced_ast: 26596f4778c179462d3365caa87addc607d88bb8f700b6132565b56ff3396dd2 + initial_ast: 4f9380a273ae5ba7862fd6b8f8be1a46cf6595c6f89d7538760239e7b99dc3d0 + canonicalized_ast: 4f9380a273ae5ba7862fd6b8f8be1a46cf6595c6f89d7538760239e7b99dc3d0 + type_inferenced_ast: 92e14566897c6c2d06f9044837878814b75995beed268edf3f36b4691819bc7c diff --git a/tests/expectations/compiler/compiler/integers/i128/add.leo.out b/tests/expectations/compiler/compiler/integers/i128/add.leo.out index b35d16874e..c1d7276af8 100644 --- a/tests/expectations/compiler/compiler/integers/i128/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/add.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 278b92038c32110995dae24885b81e15d897c16ca4500633b8550557758d76a1 - canonicalized_ast: 278b92038c32110995dae24885b81e15d897c16ca4500633b8550557758d76a1 - type_inferenced_ast: 58f145ea9284607029135a8afd9bb00e05c3ae31836c735aeb2cc0c7628f9e98 + initial_ast: c473f0dfff63bc3a34b3da6eba52325b9eb84899d5adabfddab819f13f3d5c12 + canonicalized_ast: c473f0dfff63bc3a34b3da6eba52325b9eb84899d5adabfddab819f13f3d5c12 + type_inferenced_ast: 9aacff57a9dc5e20202d0caf861d3b221291e9b24b55dae3d6af7cae0d462523 diff --git a/tests/expectations/compiler/compiler/integers/i128/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/i128/console_assert.leo.out index 93536c2ff2..f003bd352f 100644 --- a/tests/expectations/compiler/compiler/integers/i128/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/console_assert.leo.out @@ -13,6 +13,6 @@ outputs: - input_file: i128.in output: registers: {} - initial_ast: 069a5439632b91a257c447f7db4278b6ea59ec794ab3ec3e5805757615d9f3a4 - canonicalized_ast: 43ea108e255608c03dea9e4cd6e4ac1ab4dc84a3c974372b9902139c83e4434e - type_inferenced_ast: 3314b8988acb6fa813557f5e87f81b95370a3f15e336b78a1f0575208034d55b + initial_ast: 9179994f97bb644f2398fb05b40a3a953f07131cde0835661ddf13c02b9a79ff + canonicalized_ast: 84d32c3262b3ae07914ddfc44ff21be8e1ba8750e8a36dca109d615db2393f85 + type_inferenced_ast: e0a51a2a919c8fbd7225bac172d55a1f03592b4355b7f7894a3b7ad2816f36bf diff --git a/tests/expectations/compiler/compiler/integers/i128/div.leo.out b/tests/expectations/compiler/compiler/integers/i128/div.leo.out index 78542083c6..ae5b136f59 100644 --- a/tests/expectations/compiler/compiler/integers/i128/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/div.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 4a1bed67b569a4ca5d986533ae623e685c6cb4b5fcab951ce35e6c6833c75f9e - canonicalized_ast: 4a1bed67b569a4ca5d986533ae623e685c6cb4b5fcab951ce35e6c6833c75f9e - type_inferenced_ast: 5327f9c10201daf1c2089780c8d6b03d25ff62ee07c739070c7a50823de4da64 + initial_ast: ccff1bd7ccdd4deb2856d537f9662b07c2b095f5ee46f7161c2b6a51b9ebb85b + canonicalized_ast: ccff1bd7ccdd4deb2856d537f9662b07c2b095f5ee46f7161c2b6a51b9ebb85b + type_inferenced_ast: 9e2e24001539561dbe1dbecfa55b0c7b8d92f8c85de213a144d0c5fcd505204a diff --git a/tests/expectations/compiler/compiler/integers/i128/eq.leo.out b/tests/expectations/compiler/compiler/integers/i128/eq.leo.out index 48a1ad3170..392d47b56f 100644 --- a/tests/expectations/compiler/compiler/integers/i128/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/eq.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 3b8180fa769e086232eef3bf8462a75275750b60729e2e642d2b4ca96aab9222 - canonicalized_ast: 3b8180fa769e086232eef3bf8462a75275750b60729e2e642d2b4ca96aab9222 - type_inferenced_ast: 96f2ff3c817d3df9ea92e9f5e5100ce8baa8eee1e35b0bfbeb832d4eb2a36c67 + initial_ast: 193c20aaf2312cc8408d2c9e38af8db7cfc77765a2c0f550f75fe36bf893ddb6 + canonicalized_ast: 193c20aaf2312cc8408d2c9e38af8db7cfc77765a2c0f550f75fe36bf893ddb6 + type_inferenced_ast: 4a6b35a5d378b03e2c4f342d8fee17b06ae117a8c2c67e3e694da0ca82fceefe diff --git a/tests/expectations/compiler/compiler/integers/i128/ge.leo.out b/tests/expectations/compiler/compiler/integers/i128/ge.leo.out index f63a5e8909..8dd73b9917 100644 --- a/tests/expectations/compiler/compiler/integers/i128/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/ge.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: bcde5f6ea48309da013de3c4cd2e759f809e8cce72c115f8b5bd2b1272e1c088 - canonicalized_ast: bcde5f6ea48309da013de3c4cd2e759f809e8cce72c115f8b5bd2b1272e1c088 - type_inferenced_ast: 0aa48e18e8b7b7857f9ca9808d0eac7ded70cd617e65e527fdb93fa07ff5336b + initial_ast: 41a3c24f3843caa402b24c4efadfbdd439613a0dadacc2c4c4fbb14eecdd3012 + canonicalized_ast: 41a3c24f3843caa402b24c4efadfbdd439613a0dadacc2c4c4fbb14eecdd3012 + type_inferenced_ast: 080a3cda9504d930a392811175a4d3960667e2eb6c3a1ed0ba0ef784adbe74ca diff --git a/tests/expectations/compiler/compiler/integers/i128/gt.leo.out b/tests/expectations/compiler/compiler/integers/i128/gt.leo.out index 57fb36b2d9..671fb45330 100644 --- a/tests/expectations/compiler/compiler/integers/i128/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/gt.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 59236105dd9e8340d9348c60d9b7cd51e615dd4ec6a645b09573a22678e74470 - canonicalized_ast: 59236105dd9e8340d9348c60d9b7cd51e615dd4ec6a645b09573a22678e74470 - type_inferenced_ast: 4b84f0d2fd2d0bebcffce6bdb30919e230a5e7f6f0b31f2772efedf4f6fd3c94 + initial_ast: 8fde7a555355f0cb3109c38e6708590f0cf23440c95f498d9ff1b63ef8ac7fbb + canonicalized_ast: 8fde7a555355f0cb3109c38e6708590f0cf23440c95f498d9ff1b63ef8ac7fbb + type_inferenced_ast: 4ed1fc29250d7175f812cfd956ea7641676f9216e8d66ba22f2fe2b8fceaafaa diff --git a/tests/expectations/compiler/compiler/integers/i128/le.leo.out b/tests/expectations/compiler/compiler/integers/i128/le.leo.out index a5e1d57415..cf0cf15ae4 100644 --- a/tests/expectations/compiler/compiler/integers/i128/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/le.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 3f8f56d5c17a96d015b50f804dababd4e15d1d2ebf54bd239fe362befc49f98c - canonicalized_ast: 3f8f56d5c17a96d015b50f804dababd4e15d1d2ebf54bd239fe362befc49f98c - type_inferenced_ast: 74e997c5107955a418b7e658b649f10bac760ab497a69925642db4e372f8fff7 + initial_ast: 78d701153a1bd0e37caffd3623672bbc15eef30013f0d6945622e3c773b0e40b + canonicalized_ast: 78d701153a1bd0e37caffd3623672bbc15eef30013f0d6945622e3c773b0e40b + type_inferenced_ast: bcc72ba644e3e085e4fb7ec5ad81cad31c8a3e52ca695c508a5a974084557fa5 diff --git a/tests/expectations/compiler/compiler/integers/i128/lt.leo.out b/tests/expectations/compiler/compiler/integers/i128/lt.leo.out index ffd95309fd..c7e449d401 100644 --- a/tests/expectations/compiler/compiler/integers/i128/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/lt.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: d6025ab5243349142231d66100fe3e6001606095303d39aaf28663c6f0984369 - canonicalized_ast: d6025ab5243349142231d66100fe3e6001606095303d39aaf28663c6f0984369 - type_inferenced_ast: 06ff7de0309de0c4e88adc23d837363f0951bf96859c1dc18076d2deff17474f + initial_ast: a525dab584b9e4cf919db4362ae18124ecb4b75870aa1f221764a8a16f0eed77 + canonicalized_ast: a525dab584b9e4cf919db4362ae18124ecb4b75870aa1f221764a8a16f0eed77 + type_inferenced_ast: 462717ffba89b46c65e2452dadc959f14fcebb49b78c60172f223c1c4bb0ebe8 diff --git a/tests/expectations/compiler/compiler/integers/i128/max.leo.out b/tests/expectations/compiler/compiler/integers/i128/max.leo.out index 666913438d..cdd1782c75 100644 --- a/tests/expectations/compiler/compiler/integers/i128/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/max.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: fbe3d891245219b62b7444a1a2d145e6aa77ef5a5bb768b0fb058f1b243dd894 - canonicalized_ast: fbe3d891245219b62b7444a1a2d145e6aa77ef5a5bb768b0fb058f1b243dd894 - type_inferenced_ast: 926fdd740dd000b2155e292ac0fb4c51ea2c6ca6a1a8dc88addf83b35b07ca94 + initial_ast: 8b2ac26a6a27f74b2f7a9f7523972083a5caad1fd95597cfb15ac21d58bc32e9 + canonicalized_ast: 8b2ac26a6a27f74b2f7a9f7523972083a5caad1fd95597cfb15ac21d58bc32e9 + type_inferenced_ast: 7f01c95106c222834c49509fdc88b7cf3b9d74cf2ff4923f0000968535859fa1 diff --git a/tests/expectations/compiler/compiler/integers/i128/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/i128/max_fail.leo.out index 5c2d445743..d3bcb58a4e 100644 --- a/tests/expectations/compiler/compiler/integers/i128/max_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/max_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:21\n |\n 4 | const a: i128 = 170141183460469231731687303715884105728;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = failed to parse int value '170141183460469231731687303715884105728'" + - "Error [EASG0373031]: failed to parse int value '170141183460469231731687303715884105728'\n --> compiler-test:4:21\n |\n 4 | const a: i128 = 170141183460469231731687303715884105728;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/integers/i128/min.leo.out b/tests/expectations/compiler/compiler/integers/i128/min.leo.out index a762f4c140..007e2a219d 100644 --- a/tests/expectations/compiler/compiler/integers/i128/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/min.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 12baf68b32dd0cc27e6c695e4373c68e789a0b7da1e30392ca84dd237602df20 - canonicalized_ast: 12baf68b32dd0cc27e6c695e4373c68e789a0b7da1e30392ca84dd237602df20 - type_inferenced_ast: 7b3cd17b290d7c46f014ae424adc4f526e770925fa8ff678c35f0f4283c591d7 + initial_ast: ca4b9ce444b0d445a84d26e4711d25c9f8670b8cae8ce0c456680b9ddd49663a + canonicalized_ast: ca4b9ce444b0d445a84d26e4711d25c9f8670b8cae8ce0c456680b9ddd49663a + type_inferenced_ast: 122e02aff2e30b825b64251f34dd01ef81429e5cf7807e18b5f33adc9709e67e diff --git a/tests/expectations/compiler/compiler/integers/i128/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/i128/min_fail.leo.out index 13921defb2..55f057ca89 100644 --- a/tests/expectations/compiler/compiler/integers/i128/min_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/min_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:21\n |\n 4 | const a: i128 = -170141183460469231731687303715884105729;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = failed to parse int value '-170141183460469231731687303715884105729'" + - "Error [EASG0373031]: failed to parse int value '-170141183460469231731687303715884105729'\n --> compiler-test:4:21\n |\n 4 | const a: i128 = -170141183460469231731687303715884105729;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/integers/i128/mul.leo.out b/tests/expectations/compiler/compiler/integers/i128/mul.leo.out index 1659834146..ed9d73e5d7 100644 --- a/tests/expectations/compiler/compiler/integers/i128/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/mul.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 749f276238221a67ee7cc724f2925f47ee72e2de8ce28135f0090ddc70843896 - canonicalized_ast: 749f276238221a67ee7cc724f2925f47ee72e2de8ce28135f0090ddc70843896 - type_inferenced_ast: 2e262184d0acfd77343ea357565d5c460b002637df8c1e1d30832373cd4bb348 + initial_ast: 228b473e19bbba4b71e7d157b704e89d6ef8aa446663844077719db104d1569b + canonicalized_ast: 228b473e19bbba4b71e7d157b704e89d6ef8aa446663844077719db104d1569b + type_inferenced_ast: 06a3d13f280995c019cb81a4e5de4457815a45c6f507d27911bda75ffd2e0f98 diff --git a/tests/expectations/compiler/compiler/integers/i128/ne.leo.out b/tests/expectations/compiler/compiler/integers/i128/ne.leo.out index 7c5e698cf6..2dbbe9130f 100644 --- a/tests/expectations/compiler/compiler/integers/i128/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/ne.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 6abbf856d68ddf5dab6e0e28efd4edcf0b8c77a73ec3cc71b342672737487925 - canonicalized_ast: 6abbf856d68ddf5dab6e0e28efd4edcf0b8c77a73ec3cc71b342672737487925 - type_inferenced_ast: 2be2d42dd129f782b0393284108e22368823857f66a338406159b30c2953c486 + initial_ast: 0c0a73b6892c05a8e28baeb86e1d18d28af3b602f7e6de4adba4ae28335ca509 + canonicalized_ast: 0c0a73b6892c05a8e28baeb86e1d18d28af3b602f7e6de4adba4ae28335ca509 + type_inferenced_ast: b2a1e5f4428e37b0c5ae52cc63ed3f4c0908885c6732d4f353825b816fa6136c diff --git a/tests/expectations/compiler/compiler/integers/i128/negate.leo.out b/tests/expectations/compiler/compiler/integers/i128/negate.leo.out index 7e4374c184..6d4fa039ec 100644 --- a/tests/expectations/compiler/compiler/integers/i128/negate.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/negate.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 77b18a83d019f104049c3d1c6bf7b3a159e56024184304d42508d1be58a12e4a - canonicalized_ast: 77b18a83d019f104049c3d1c6bf7b3a159e56024184304d42508d1be58a12e4a - type_inferenced_ast: e08006c78ca1dfede635303eeab1b764d86c25d1e64c9f1584e67b2903cbbcc6 + initial_ast: d059629756c072e44c3ca938339712f85b2b69fb0649051bf76d1908e4b2eade + canonicalized_ast: d059629756c072e44c3ca938339712f85b2b69fb0649051bf76d1908e4b2eade + type_inferenced_ast: 9b3f2561a65416b13d6409492bfc989bae6bc67976faba9825fb02f1451a4c17 diff --git a/tests/expectations/compiler/compiler/integers/i128/negate_min.leo.out b/tests/expectations/compiler/compiler/integers/i128/negate_min.leo.out index 33b2e3eef5..ab4f777fed 100644 --- a/tests/expectations/compiler/compiler/integers/i128/negate_min.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/negate_min.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 7caf7d58784d0fde99b9041c2de7013c5171d8b77d12fadedc1a7f254736d5db - canonicalized_ast: 7caf7d58784d0fde99b9041c2de7013c5171d8b77d12fadedc1a7f254736d5db - type_inferenced_ast: 7b7e03ea46695e6190bc4731e5091f6f7524c21b6b2659cd100d872f6c8dbc51 + initial_ast: a0009b59b8ff05ebb3309395250a94e675663417730aceed483ce2338880d8fd + canonicalized_ast: a0009b59b8ff05ebb3309395250a94e675663417730aceed483ce2338880d8fd + type_inferenced_ast: 5140944155158eba88db7a3c6614dac1b50ba37a30d906b10d6c86729dc1c923 diff --git a/tests/expectations/compiler/compiler/integers/i128/negate_zero.leo.out b/tests/expectations/compiler/compiler/integers/i128/negate_zero.leo.out index 8be89f4fee..26d7c1642a 100644 --- a/tests/expectations/compiler/compiler/integers/i128/negate_zero.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/negate_zero.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 8938763585750f00e3af22fbe607925515c738649e25ef536926d4c26bc4987e - canonicalized_ast: 8938763585750f00e3af22fbe607925515c738649e25ef536926d4c26bc4987e - type_inferenced_ast: 7e5da98c82d7a3c8fd7ebc80e54289ae1c5bd7f7febd7943a2a376e65f925df6 + initial_ast: c9e977ef13cd2c8e6b6c3e50ce14888865d51e858e6fa8660076015986692978 + canonicalized_ast: c9e977ef13cd2c8e6b6c3e50ce14888865d51e858e6fa8660076015986692978 + type_inferenced_ast: b59d18c7f15c7b4cdadd36feb0c4da91ff5d72d362be4e8c69039bbcd6d262d0 diff --git a/tests/expectations/compiler/compiler/integers/i128/no_space_between_literal.leo.out b/tests/expectations/compiler/compiler/integers/i128/no_space_between_literal.leo.out index 972dbae802..58e069fbb0 100644 --- a/tests/expectations/compiler/compiler/integers/i128/no_space_between_literal.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/no_space_between_literal.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:15\n |\n 4 | const i = 1 i128;\n | ^\n |\n = Unexpected white space between terms 1 and i128" + - "Error [EPAR0370004]: Unexpected white space between terms 1 and i128\n --> compiler-test:4:15\n |\n 4 | const i = 1 i128;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i128/sub.leo.out b/tests/expectations/compiler/compiler/integers/i128/sub.leo.out index 3191d89ca4..f95190326a 100644 --- a/tests/expectations/compiler/compiler/integers/i128/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/sub.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: cbc3426682d111bcc624772a9e331194e91afe090c7fad60b6a26f7bbfc80c52 - canonicalized_ast: cbc3426682d111bcc624772a9e331194e91afe090c7fad60b6a26f7bbfc80c52 - type_inferenced_ast: 6590ef64c4fea22ae40610713fd9ab9c8099db62dfa03dbb4b52544745add887 + initial_ast: 94fc493ab84b819b8c12f68a7c4d01e9adfd7eaa1cc533bafcbcce10b547cddb + canonicalized_ast: 94fc493ab84b819b8c12f68a7c4d01e9adfd7eaa1cc533bafcbcce10b547cddb + type_inferenced_ast: 6238710e4e6696f1020a31763f3edaa17be46f9ba4fd55bd72497e5c4bfe1cd7 diff --git a/tests/expectations/compiler/compiler/integers/i128/ternary.leo.out b/tests/expectations/compiler/compiler/integers/i128/ternary.leo.out index b147f39f98..76111474a5 100644 --- a/tests/expectations/compiler/compiler/integers/i128/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/ternary.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: ba1d5d680a9efb9ec10633ea657d4671b3e68bf496ae75a9f6a21c39572ab928 - canonicalized_ast: ba1d5d680a9efb9ec10633ea657d4671b3e68bf496ae75a9f6a21c39572ab928 - type_inferenced_ast: 24933918f7ad7589c86ee29dcb310034c6061ac0f30447cd90e1909812388494 + initial_ast: eee17d124eb8d460f62417c1af0bbbe424cc14a6751250c6f606df1b28d191d3 + canonicalized_ast: eee17d124eb8d460f62417c1af0bbbe424cc14a6751250c6f606df1b28d191d3 + type_inferenced_ast: c37cd2aa068f66eb9debcda671ad096b852639b3d074f11deced4d2e93dba370 diff --git a/tests/expectations/compiler/compiler/integers/i16/add.leo.out b/tests/expectations/compiler/compiler/integers/i16/add.leo.out index 9d7f2683fc..6f0ee352a9 100644 --- a/tests/expectations/compiler/compiler/integers/i16/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/add.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: c6e60e90f02eedaf8209c76aaf12e2fe10ae13dc6061c36f5e49b72bf6b0a65a - canonicalized_ast: c6e60e90f02eedaf8209c76aaf12e2fe10ae13dc6061c36f5e49b72bf6b0a65a - type_inferenced_ast: cbd5e50cfc56419e9406f490d626035c8337a1bdaf35bc62a4600fcf76c391b9 + initial_ast: 4fd0a999f8398beef7f71c3315355df0bd1124f66a6fda726db6830442a9069f + canonicalized_ast: 4fd0a999f8398beef7f71c3315355df0bd1124f66a6fda726db6830442a9069f + type_inferenced_ast: d7a93d56836cb99a113174804450f53e19096901e14b4ec31acbfab389df7eed diff --git a/tests/expectations/compiler/compiler/integers/i16/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/i16/console_assert.leo.out index fe1d0245f0..95d01494f5 100644 --- a/tests/expectations/compiler/compiler/integers/i16/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/console_assert.leo.out @@ -13,6 +13,6 @@ outputs: - input_file: i16.in output: registers: {} - initial_ast: dc4639a138bd4abe35fdb62f4276a1dd7d9fff035da9e307f3522ebcd0d85242 - canonicalized_ast: 11c7e7171c6ae7c1cbb12c7e27dee4786d5689c83d4e60c1c1860f78372e9ae7 - type_inferenced_ast: 8d5f15f30bfa9b61498011cd4c66e7980a6a30d43112fb54f80247764f5ccaca + initial_ast: b2877669171aea3b2c3f020ba997de1fe6c5a64328f041620a502fad992f820f + canonicalized_ast: 33d960627a5a40386fcf1fc1edd259379bca4517a77155440f5417919e69c6b3 + type_inferenced_ast: e03a6ef7557c36c6c2a57306d1d4ff1d6f7c5d1955d938af2a64ed5a37cc257d diff --git a/tests/expectations/compiler/compiler/integers/i16/div.leo.out b/tests/expectations/compiler/compiler/integers/i16/div.leo.out index d645fdebfc..388f0f87f1 100644 --- a/tests/expectations/compiler/compiler/integers/i16/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/div.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 9ba56478095b7f7ed43019d532d9b21817ecb729458843de0ee84f64ccbeaad5 - canonicalized_ast: 9ba56478095b7f7ed43019d532d9b21817ecb729458843de0ee84f64ccbeaad5 - type_inferenced_ast: 0313c0eb6ab4ee2bf5c8a0b2e5936a6ee62e73897fb2da20f4278f0627f1c9db + initial_ast: d50e609d7e88ef14c86c8a72cdff0c92106ed4580a06faf3705c789141181782 + canonicalized_ast: d50e609d7e88ef14c86c8a72cdff0c92106ed4580a06faf3705c789141181782 + type_inferenced_ast: 78f3ab4058104f17d002e8baedea424719e8ef6f99666e68042b89326cbb4916 diff --git a/tests/expectations/compiler/compiler/integers/i16/eq.leo.out b/tests/expectations/compiler/compiler/integers/i16/eq.leo.out index 364d88b526..29e49a0c30 100644 --- a/tests/expectations/compiler/compiler/integers/i16/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/eq.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 9b7aa4b35a464c120a2fbbcc5f64e94224bd5a83a4178f41f522b8c3f4103eed - canonicalized_ast: 9b7aa4b35a464c120a2fbbcc5f64e94224bd5a83a4178f41f522b8c3f4103eed - type_inferenced_ast: fa332a69d255172b4ab1f07fcab1b6cd4ba2b29ef86f488b006a6d728a53c21d + initial_ast: 9a4e11bacd644fd08dd1bce9b88fde724b357dfc1ec5f8d123f8c0479de36e71 + canonicalized_ast: 9a4e11bacd644fd08dd1bce9b88fde724b357dfc1ec5f8d123f8c0479de36e71 + type_inferenced_ast: 56798e8bcbbda12ea8540466cf8e25051000cb66c8bb15bae72c106ec8a8e0e5 diff --git a/tests/expectations/compiler/compiler/integers/i16/ge.leo.out b/tests/expectations/compiler/compiler/integers/i16/ge.leo.out index 306ebd0fcf..36c60c60ac 100644 --- a/tests/expectations/compiler/compiler/integers/i16/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/ge.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: acbe69247b7e93d134e08bb50b235fb0fdcedc5aaf0d064dd32d1955eb7530f1 - canonicalized_ast: acbe69247b7e93d134e08bb50b235fb0fdcedc5aaf0d064dd32d1955eb7530f1 - type_inferenced_ast: 8c762e804e44a6ec7aee1106bc0742266f34f7136a35878675ac239ffb4e2f9c + initial_ast: 57a7f4ea91f1b8168f64c44bbc972451f1b928f0b24a3fe2ae54d140db200e11 + canonicalized_ast: 57a7f4ea91f1b8168f64c44bbc972451f1b928f0b24a3fe2ae54d140db200e11 + type_inferenced_ast: c36a49da5d76dfd83be7fae709163ca9055a7561f1e4c0dd0ea45cacb50ff5fc diff --git a/tests/expectations/compiler/compiler/integers/i16/gt.leo.out b/tests/expectations/compiler/compiler/integers/i16/gt.leo.out index abaf5d0480..7b4e62e28c 100644 --- a/tests/expectations/compiler/compiler/integers/i16/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/gt.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 79c5123b8d5fdde1e774ce298e69fec5a6ac561d42f2cff1620ee90868a1a788 - canonicalized_ast: 79c5123b8d5fdde1e774ce298e69fec5a6ac561d42f2cff1620ee90868a1a788 - type_inferenced_ast: 2f5c103f24367e1b7d38073a41b039c94fd2d4138ed6ededd1f1a526ed741653 + initial_ast: d04f1a60245b6bbb02ed550a9f1a7d39d6ed52a8b096fa19196992f79f1118f8 + canonicalized_ast: d04f1a60245b6bbb02ed550a9f1a7d39d6ed52a8b096fa19196992f79f1118f8 + type_inferenced_ast: c1e6bf995eebfaf0c4615af2657876836001e793d5eee5701dac65374a98a452 diff --git a/tests/expectations/compiler/compiler/integers/i16/le.leo.out b/tests/expectations/compiler/compiler/integers/i16/le.leo.out index a1d3093d45..7ab8abb8d1 100644 --- a/tests/expectations/compiler/compiler/integers/i16/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/le.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 0ec2096fbd8fdfa796b104aef9e28458e18a25951bb610f61f4ea4fbaae9757f - canonicalized_ast: 0ec2096fbd8fdfa796b104aef9e28458e18a25951bb610f61f4ea4fbaae9757f - type_inferenced_ast: 7ddd6341403c131f721540b6cb1a7e3daaff0ec9615f8c35e4c07f32591f9eaf + initial_ast: 1791b30d366c1380e67e6526ce5c33a532937d2315b9c73c18066200dfe9f3d2 + canonicalized_ast: 1791b30d366c1380e67e6526ce5c33a532937d2315b9c73c18066200dfe9f3d2 + type_inferenced_ast: 52fbb77cfe63d3736526f72032c784fc9d854e6b7ab20e3951ea9a7171dd3265 diff --git a/tests/expectations/compiler/compiler/integers/i16/lt.leo.out b/tests/expectations/compiler/compiler/integers/i16/lt.leo.out index ef870cb29a..d3dc3fdd7c 100644 --- a/tests/expectations/compiler/compiler/integers/i16/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/lt.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 4fd8570e10354fb6f8fe19d8d822ed3d8d9149f464c0bbdcc5967d903875234e - canonicalized_ast: 4fd8570e10354fb6f8fe19d8d822ed3d8d9149f464c0bbdcc5967d903875234e - type_inferenced_ast: 0cd72ea5eaf563bfc2a2ba82ad6e2e9d65df60730c8cf87aa9d09848448cbdca + initial_ast: ddb410ad0b9d0a078744b5ff1f8bdb7991f46f2dde53e754b69b163e4ab60d27 + canonicalized_ast: ddb410ad0b9d0a078744b5ff1f8bdb7991f46f2dde53e754b69b163e4ab60d27 + type_inferenced_ast: b560aa7679b75616a300f942a2d863e58715227703b6d7c17bbd11ab02840944 diff --git a/tests/expectations/compiler/compiler/integers/i16/max.leo.out b/tests/expectations/compiler/compiler/integers/i16/max.leo.out index 5d469b4f44..529dfe111e 100644 --- a/tests/expectations/compiler/compiler/integers/i16/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/max.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 8cc319fae5a195cc91c1b906a4945d60fe8f4a2649ecae5910523f20ab29a80e - canonicalized_ast: 8cc319fae5a195cc91c1b906a4945d60fe8f4a2649ecae5910523f20ab29a80e - type_inferenced_ast: 79c7c35ea8546567ff0faef52f0a90e945a3cd835859b96f5e25d457eac51212 + initial_ast: f156257ed496945bb2c1c3453c6abadb8cf83ee3db1943932fd381eb63d7172d + canonicalized_ast: f156257ed496945bb2c1c3453c6abadb8cf83ee3db1943932fd381eb63d7172d + type_inferenced_ast: b398428451e40f14d765e57cefd7b500df7eb14b84589545ef772b4d08bca9cc diff --git a/tests/expectations/compiler/compiler/integers/i16/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/i16/max_fail.leo.out index bec67bdb3e..243ee127a8 100644 --- a/tests/expectations/compiler/compiler/integers/i16/max_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/max_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:20\n |\n 4 | const a: i16 = 32768;\n | ^^^^^\n |\n = failed to parse int value '32768'" + - "Error [EASG0373031]: failed to parse int value '32768'\n --> compiler-test:4:20\n |\n 4 | const a: i16 = 32768;\n | ^^^^^" diff --git a/tests/expectations/compiler/compiler/integers/i16/min.leo.out b/tests/expectations/compiler/compiler/integers/i16/min.leo.out index 2cf8d929d0..b5baabb2c8 100644 --- a/tests/expectations/compiler/compiler/integers/i16/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/min.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 01194f1d3e40d631c4b4f2d57d7c6d9906a2dd53299f0246fe259d49a81aaf1e - canonicalized_ast: 01194f1d3e40d631c4b4f2d57d7c6d9906a2dd53299f0246fe259d49a81aaf1e - type_inferenced_ast: 384165664aac2ff844fb06836db88f9e92de2aff6bf9745a56c6924e1f5ed63a + initial_ast: b5cd4df2823d12fa01257069c35fb1385cba00c646822bc0fd9fa660d1edc085 + canonicalized_ast: b5cd4df2823d12fa01257069c35fb1385cba00c646822bc0fd9fa660d1edc085 + type_inferenced_ast: 6d3fcd70910f98e8980782b2d87ac394debd331dc54167df5cc8f58ea1f4477d diff --git a/tests/expectations/compiler/compiler/integers/i16/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/i16/min_fail.leo.out index 7422740b9a..00fcc69d5c 100644 --- a/tests/expectations/compiler/compiler/integers/i16/min_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/min_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:20\n |\n 4 | const a: i16 = -32769;\n | ^^^^^^\n |\n = failed to parse int value '-32769'" + - "Error [EASG0373031]: failed to parse int value '-32769'\n --> compiler-test:4:20\n |\n 4 | const a: i16 = -32769;\n | ^^^^^^" diff --git a/tests/expectations/compiler/compiler/integers/i16/mul.leo.out b/tests/expectations/compiler/compiler/integers/i16/mul.leo.out index e69cf863fe..213c7903ac 100644 --- a/tests/expectations/compiler/compiler/integers/i16/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/mul.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: e4d59a5cf7736b6fe993c348eb71c77e19339f9f48c71288858ee57f8afea1a2 - canonicalized_ast: e4d59a5cf7736b6fe993c348eb71c77e19339f9f48c71288858ee57f8afea1a2 - type_inferenced_ast: fdbdf403033c6317a5767b06b27454c40055dfb3f58893021e6abd7325b0eba7 + initial_ast: 8ada3ff469df0290e1dbb7f3fa12d094710cd68249fb6083c27eaea7f95a1cbb + canonicalized_ast: 8ada3ff469df0290e1dbb7f3fa12d094710cd68249fb6083c27eaea7f95a1cbb + type_inferenced_ast: 83c7e2a44566f7829e05668d44f940c045e3174db2729508d711b7eb8f848753 diff --git a/tests/expectations/compiler/compiler/integers/i16/ne.leo.out b/tests/expectations/compiler/compiler/integers/i16/ne.leo.out index 5d0dda3d2d..86e717f877 100644 --- a/tests/expectations/compiler/compiler/integers/i16/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/ne.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 7aa0502683430c1eb3b692497b4d0a58eb463229a4e2dc112fe9065478bfb614 - canonicalized_ast: 7aa0502683430c1eb3b692497b4d0a58eb463229a4e2dc112fe9065478bfb614 - type_inferenced_ast: ce82a4fd386bbb70d200402189572063eeb71308be4ab30988e95952144be3b8 + initial_ast: 6fdf2386103f6bf3d5f551149b5f565f60ceb5181caca425668127be3e945884 + canonicalized_ast: 6fdf2386103f6bf3d5f551149b5f565f60ceb5181caca425668127be3e945884 + type_inferenced_ast: 4c373148bcec4f7d483cc9c560eb079746765c00a5e51c303449a9181696fae0 diff --git a/tests/expectations/compiler/compiler/integers/i16/negate.leo.out b/tests/expectations/compiler/compiler/integers/i16/negate.leo.out index 2ec74aaf6c..4129d6126a 100644 --- a/tests/expectations/compiler/compiler/integers/i16/negate.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/negate.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 3d30aa34b4b8c3dc2e1e63c4e82f829562c037e9ce1025e157e84fbc445e5b8d - canonicalized_ast: 3d30aa34b4b8c3dc2e1e63c4e82f829562c037e9ce1025e157e84fbc445e5b8d - type_inferenced_ast: 0f85cf3686a22da3196600a5f511095ad54a892716001eb3970ab128eed84908 + initial_ast: 78b70e6ae55381a259898d0ffbc671c24841583e81b57e2f354bc1de69060818 + canonicalized_ast: 78b70e6ae55381a259898d0ffbc671c24841583e81b57e2f354bc1de69060818 + type_inferenced_ast: d38e16eaab8936e730c5aed27b7bcdee553374dc14879e2007137e529aea1a71 diff --git a/tests/expectations/compiler/compiler/integers/i16/negate_min.leo.out b/tests/expectations/compiler/compiler/integers/i16/negate_min.leo.out index 6ec1b1e5ef..67eb91d545 100644 --- a/tests/expectations/compiler/compiler/integers/i16/negate_min.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/negate_min.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 064db7790a5fe7507c1f56c3d4bfac3b184da1f4e9de9792950d016cc331b2d7 - canonicalized_ast: 064db7790a5fe7507c1f56c3d4bfac3b184da1f4e9de9792950d016cc331b2d7 - type_inferenced_ast: 6e8dae083b61d225f4982fa6f9b0530ecc63b365af0782e00384077e176303ab + initial_ast: 4a65eba57cd4644e8470ab20438d6777573f513b1f5d922cd99d4114eac64c8c + canonicalized_ast: 4a65eba57cd4644e8470ab20438d6777573f513b1f5d922cd99d4114eac64c8c + type_inferenced_ast: bc8a7a7ea6867eadfdc5fe662239f591b6d2d2dfc46af9021376338294eeccea diff --git a/tests/expectations/compiler/compiler/integers/i16/negate_zero.leo.out b/tests/expectations/compiler/compiler/integers/i16/negate_zero.leo.out index 480c5a8fdb..9b9a95d776 100644 --- a/tests/expectations/compiler/compiler/integers/i16/negate_zero.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/negate_zero.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 1d284ab53df47bd68057717ea9ea338f4c77cd7fa9d2d8850d47cb34cea62f6b - canonicalized_ast: 1d284ab53df47bd68057717ea9ea338f4c77cd7fa9d2d8850d47cb34cea62f6b - type_inferenced_ast: 46256ea5632485212fda4dd534ddc0c8b6fe7439ca65ca1ff4d843ad47f92fbc + initial_ast: 59f05a78cd18913660f463f5ee7bc407f5a3893fb36049fabf385b7ad0b826d3 + canonicalized_ast: 59f05a78cd18913660f463f5ee7bc407f5a3893fb36049fabf385b7ad0b826d3 + type_inferenced_ast: 0d90246cadbc95713dc45b0d09330d532cc9e6fd206b4c9426876f8ba25f2bd2 diff --git a/tests/expectations/compiler/compiler/integers/i16/no_space_between_literal.leo.out b/tests/expectations/compiler/compiler/integers/i16/no_space_between_literal.leo.out index 47680bf6ac..8484337bd0 100644 --- a/tests/expectations/compiler/compiler/integers/i16/no_space_between_literal.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/no_space_between_literal.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:15\n |\n 4 | const i = 1 i16;\n | ^\n |\n = Unexpected white space between terms 1 and i16" + - "Error [EPAR0370004]: Unexpected white space between terms 1 and i16\n --> compiler-test:4:15\n |\n 4 | const i = 1 i16;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i16/sub.leo.out b/tests/expectations/compiler/compiler/integers/i16/sub.leo.out index 82752349cc..51a8b60107 100644 --- a/tests/expectations/compiler/compiler/integers/i16/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/sub.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 0ed8af4e184becf59423bef3f18a8282e14797fa65605cde3ec662b3495c17b6 - canonicalized_ast: 0ed8af4e184becf59423bef3f18a8282e14797fa65605cde3ec662b3495c17b6 - type_inferenced_ast: 692c5aa63291373cd59ace973c18581c08e1713a80a07d4e49a94384e00f5b4d + initial_ast: 385d1b0ffca199ec557e28fc9b51b40414c458b01ab549f67772f45064da727f + canonicalized_ast: 385d1b0ffca199ec557e28fc9b51b40414c458b01ab549f67772f45064da727f + type_inferenced_ast: af05a924222674c6d50fec716217083cd675424c6e04840ece1d1c2f39fd5345 diff --git a/tests/expectations/compiler/compiler/integers/i16/ternary.leo.out b/tests/expectations/compiler/compiler/integers/i16/ternary.leo.out index 742b78acff..d943b090db 100644 --- a/tests/expectations/compiler/compiler/integers/i16/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/ternary.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 9bcb3368b7c5c54401805a92c0a38a5e2790ce1404928ce53c5f11fc91facda6 - canonicalized_ast: 9bcb3368b7c5c54401805a92c0a38a5e2790ce1404928ce53c5f11fc91facda6 - type_inferenced_ast: 24a9f154beda36f615d7b8eb20d82d2302f5a98e530ec5d6f7178248c54fc485 + initial_ast: b77183d532a218611aff8db0203b9a043a2e8f5acacf5e03b79a27c75d566d26 + canonicalized_ast: b77183d532a218611aff8db0203b9a043a2e8f5acacf5e03b79a27c75d566d26 + type_inferenced_ast: 88c4cd08d33755f4990b5dacd9884730499781a128ebc01b616e3b93897476c4 diff --git a/tests/expectations/compiler/compiler/integers/i32/add.leo.out b/tests/expectations/compiler/compiler/integers/i32/add.leo.out index 54ba1d7251..ebaa4dc882 100644 --- a/tests/expectations/compiler/compiler/integers/i32/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/add.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: f42260573fe4d4c93a3ef5d4ce6178361696d80a6d59c29bbc45c2f91372524d - canonicalized_ast: f42260573fe4d4c93a3ef5d4ce6178361696d80a6d59c29bbc45c2f91372524d - type_inferenced_ast: 53a55ce50552159c54febcc31f2f02f3b2b60264dfc53fece8b6cb12c80774f6 + initial_ast: e867242ead014273d3c7f6829e55851b9e2b01883b55499dfdce94b45c9ebb7d + canonicalized_ast: e867242ead014273d3c7f6829e55851b9e2b01883b55499dfdce94b45c9ebb7d + type_inferenced_ast: 3575a9b8ffa5f5ec96c86dab2230e3333d6525b38789b0b1b8cbc44df3d9c190 diff --git a/tests/expectations/compiler/compiler/integers/i32/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/i32/console_assert.leo.out index 800a1bd630..095005acde 100644 --- a/tests/expectations/compiler/compiler/integers/i32/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/console_assert.leo.out @@ -13,6 +13,6 @@ outputs: - input_file: i32.in output: registers: {} - initial_ast: 0827f6332d1efc21bf2d0875dbe60a00ca0af5b8fac88831402c1289d5cb561a - canonicalized_ast: 2744510f89a25b5b0cac8cdd335cfaad65f6df030b01b3bbf543d1766c7392b4 - type_inferenced_ast: 03dfb3c4eabf1f32ffc24ef5cd2f682346a9b9aa03a081dae718954070ac4460 + initial_ast: c2a72c4ab80cce9d171a487cfaf2a930a4ee9191298786335af894d483e58857 + canonicalized_ast: 4cea550893a8ccb47451f8c54a8f568c2ca29c8a73a4d4a6e6c3fe69ea081e20 + type_inferenced_ast: c7c946c493772f30c641a53a56a410c9a17af557b24fa6411af7162b8cf49394 diff --git a/tests/expectations/compiler/compiler/integers/i32/div.leo.out b/tests/expectations/compiler/compiler/integers/i32/div.leo.out index 994bd4d0bb..c1bad5b24c 100644 --- a/tests/expectations/compiler/compiler/integers/i32/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/div.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: a86f5aafe6577bb0be490afcc9e0837c068aab15ad2d130d47c1eda9dd754515 - canonicalized_ast: a86f5aafe6577bb0be490afcc9e0837c068aab15ad2d130d47c1eda9dd754515 - type_inferenced_ast: f25c7ba9ed10a4ad8e102f0af326a396b94169721251986531ba68313af8a40a + initial_ast: aeb8257825486463ebfd0b8f24c68960cbe1d214841e28233f9971c61fa869cb + canonicalized_ast: aeb8257825486463ebfd0b8f24c68960cbe1d214841e28233f9971c61fa869cb + type_inferenced_ast: 68e6a4be72ecc4d11831756e72591474765077951f919f7bc511fa37fd40ac24 diff --git a/tests/expectations/compiler/compiler/integers/i32/eq.leo.out b/tests/expectations/compiler/compiler/integers/i32/eq.leo.out index 77c3598529..abbda763bb 100644 --- a/tests/expectations/compiler/compiler/integers/i32/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/eq.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: c698e127258e1e60652ddb897be0a4638bc263a6c50b7dece797c60b30fe1373 - canonicalized_ast: c698e127258e1e60652ddb897be0a4638bc263a6c50b7dece797c60b30fe1373 - type_inferenced_ast: 45a9d197ff995eb43cad8f5dd0cdb906d5e0d0bef0b4f3459acc07cb5541edaf + initial_ast: 2398622edbbd3f627a9d39f056c359fb00ca8d4ff393ac784ab809ebbe2dbc87 + canonicalized_ast: 2398622edbbd3f627a9d39f056c359fb00ca8d4ff393ac784ab809ebbe2dbc87 + type_inferenced_ast: 6492773ea5bdcbcdfb0b846a8e5446cefe7a1417033a07c0207308c7870c5753 diff --git a/tests/expectations/compiler/compiler/integers/i32/ge.leo.out b/tests/expectations/compiler/compiler/integers/i32/ge.leo.out index df84e1b17f..759df606c9 100644 --- a/tests/expectations/compiler/compiler/integers/i32/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/ge.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: cf1aa79b2597a82e8347b093417a2281829e3c07fd74973b42bf7cc2018c7cb1 - canonicalized_ast: cf1aa79b2597a82e8347b093417a2281829e3c07fd74973b42bf7cc2018c7cb1 - type_inferenced_ast: 0810a1676362bcd258b306296590dc9ffa325dd3150b7e241a0c755979fa0b48 + initial_ast: d48fecdcedb16ee73c9206b370c525c1e76fed03e8465eb3a139deef81d74c1e + canonicalized_ast: d48fecdcedb16ee73c9206b370c525c1e76fed03e8465eb3a139deef81d74c1e + type_inferenced_ast: 0542e9c4cae0e395a5b0bfc0b190064a4f8cbf1ea1d87be62943a8b8f4ef1503 diff --git a/tests/expectations/compiler/compiler/integers/i32/gt.leo.out b/tests/expectations/compiler/compiler/integers/i32/gt.leo.out index da1462579f..618d4d6b96 100644 --- a/tests/expectations/compiler/compiler/integers/i32/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/gt.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: aa75c9b492684e06ea45996ac25a23ee47617312b986e9ce6756ff76f22be3b0 - canonicalized_ast: aa75c9b492684e06ea45996ac25a23ee47617312b986e9ce6756ff76f22be3b0 - type_inferenced_ast: b84a67583559c2d8794b0c4bee5038864b54649134deb088a4a72309b664e0a5 + initial_ast: 2400dfd1d48a4543a52a23ddb2f8da736d42dbfbd6a7d9831b7751e4cb278125 + canonicalized_ast: 2400dfd1d48a4543a52a23ddb2f8da736d42dbfbd6a7d9831b7751e4cb278125 + type_inferenced_ast: 5e5227aff1ba94756a53585d4f6f0749216ae54e2e33fa30f268fe774025933d diff --git a/tests/expectations/compiler/compiler/integers/i32/le.leo.out b/tests/expectations/compiler/compiler/integers/i32/le.leo.out index 3f06095739..42b1744479 100644 --- a/tests/expectations/compiler/compiler/integers/i32/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/le.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 496c0f9332973aeac3f7f10a663d7449dfb5ee3bb800dde47eda82f1e61beea3 - canonicalized_ast: 496c0f9332973aeac3f7f10a663d7449dfb5ee3bb800dde47eda82f1e61beea3 - type_inferenced_ast: 9e9611c48ffd078fdb36febf75b0294f2adad7e43e044f0fa80791a2a49f1b35 + initial_ast: 79661a6c772991cbf0784607b942ddb356b8af566e3faa5cf1f8865edaeed36e + canonicalized_ast: 79661a6c772991cbf0784607b942ddb356b8af566e3faa5cf1f8865edaeed36e + type_inferenced_ast: c4c7a350f77be14beb28f65218146d4cb9dc1e93b43d14cbd5c2b177b21ed4d6 diff --git a/tests/expectations/compiler/compiler/integers/i32/lt.leo.out b/tests/expectations/compiler/compiler/integers/i32/lt.leo.out index 7621bd18aa..880956d247 100644 --- a/tests/expectations/compiler/compiler/integers/i32/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/lt.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: aba1dbe634cb3a7ff87cfff3af689a49807d98b7068c6a8500f305d8cdc7d9a5 - canonicalized_ast: aba1dbe634cb3a7ff87cfff3af689a49807d98b7068c6a8500f305d8cdc7d9a5 - type_inferenced_ast: c0d77512c6581e6998277754ce5abf3acf4864a5f6d7440de3525e207b67e401 + initial_ast: 6b82c3a9c3cea936a71ba9e75aac084cbfebe9ebb69483dd40e4ed8996705699 + canonicalized_ast: 6b82c3a9c3cea936a71ba9e75aac084cbfebe9ebb69483dd40e4ed8996705699 + type_inferenced_ast: e27449f028c9e2fd55193bc63ed828fbb4b570847d4c3abf6332d80150963474 diff --git a/tests/expectations/compiler/compiler/integers/i32/max.leo.out b/tests/expectations/compiler/compiler/integers/i32/max.leo.out index 5bb9d85e93..357397ce29 100644 --- a/tests/expectations/compiler/compiler/integers/i32/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/max.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: bc6011a5b62f3a74a2279d10e8cc2a80309b7a72717fc6a3f21f3ef3dcdfd561 - canonicalized_ast: bc6011a5b62f3a74a2279d10e8cc2a80309b7a72717fc6a3f21f3ef3dcdfd561 - type_inferenced_ast: 000c069c25da11a48ed3d7e4a0a806a7cc482e62830e52bdc36f21843c855b8b + initial_ast: 7781647f89d8ee15673130bce176dc295ae269680f6b8283dc40e188233a6522 + canonicalized_ast: 7781647f89d8ee15673130bce176dc295ae269680f6b8283dc40e188233a6522 + type_inferenced_ast: 3b4c83cf724723beece52d8beca13295a41b94b07c9fe6ded1b1ce06ee58d525 diff --git a/tests/expectations/compiler/compiler/integers/i32/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/i32/max_fail.leo.out index f0de883d3d..3781b7b1a9 100644 --- a/tests/expectations/compiler/compiler/integers/i32/max_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/max_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:20\n |\n 4 | const a: i32 = 2147483648;\n | ^^^^^^^^^^\n |\n = failed to parse int value '2147483648'" + - "Error [EASG0373031]: failed to parse int value '2147483648'\n --> compiler-test:4:20\n |\n 4 | const a: i32 = 2147483648;\n | ^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/integers/i32/min.leo.out b/tests/expectations/compiler/compiler/integers/i32/min.leo.out index 5418513b1f..1907b6427e 100644 --- a/tests/expectations/compiler/compiler/integers/i32/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/min.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: fca7ee4eba546b4b481f1686b3db4c82c863b7aa122c3d38ff435672271dd609 - canonicalized_ast: fca7ee4eba546b4b481f1686b3db4c82c863b7aa122c3d38ff435672271dd609 - type_inferenced_ast: dab4b2cd49c1a69873fa82bb37f61013cdaf8d04e65023cd670514ca93ff9081 + initial_ast: 7a10c1da523c0929e30db9ffda38a23978a8ec6114db4c5745f6acd766c8b861 + canonicalized_ast: 7a10c1da523c0929e30db9ffda38a23978a8ec6114db4c5745f6acd766c8b861 + type_inferenced_ast: 33d60b91125897d8efb05c8df8df7f2eb6f10f9f74a69f7b954933916f3e2937 diff --git a/tests/expectations/compiler/compiler/integers/i32/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/i32/min_fail.leo.out index 211afb26eb..45d45fc6e5 100644 --- a/tests/expectations/compiler/compiler/integers/i32/min_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/min_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:20\n |\n 4 | const a: i32 = -2147483649;\n | ^^^^^^^^^^^\n |\n = failed to parse int value '-2147483649'" + - "Error [EASG0373031]: failed to parse int value '-2147483649'\n --> compiler-test:4:20\n |\n 4 | const a: i32 = -2147483649;\n | ^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/integers/i32/mul.leo.out b/tests/expectations/compiler/compiler/integers/i32/mul.leo.out index 9ae88132ce..f592780112 100644 --- a/tests/expectations/compiler/compiler/integers/i32/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/mul.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 2db6f04149f1e4f57186156a57f6a03acba8c67d1fba6a1b1014e1f1b7a13aa8 - canonicalized_ast: 2db6f04149f1e4f57186156a57f6a03acba8c67d1fba6a1b1014e1f1b7a13aa8 - type_inferenced_ast: 3813b4f84021ed964cb335c399de9d5baacb695f0c881d6c15fdb557c3cb0ba4 + initial_ast: 685076ff4cb6847b0c44552796371d14bc6a0edc1d1cb78c98c84134345bb7ac + canonicalized_ast: 685076ff4cb6847b0c44552796371d14bc6a0edc1d1cb78c98c84134345bb7ac + type_inferenced_ast: e064f9845933cccaccc411d9837ffa1e36d158cac25dc9529ab940532211add3 diff --git a/tests/expectations/compiler/compiler/integers/i32/ne.leo.out b/tests/expectations/compiler/compiler/integers/i32/ne.leo.out index 4281dcda96..e6a4a8d212 100644 --- a/tests/expectations/compiler/compiler/integers/i32/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/ne.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 2d4a443c29c71a57919c04ef3fd46b2905a369029d8d9c9f550ddfba7d9f4412 - canonicalized_ast: 2d4a443c29c71a57919c04ef3fd46b2905a369029d8d9c9f550ddfba7d9f4412 - type_inferenced_ast: 57567697c6a41eecc0ae2cd4f48e451b6f04da28aff5d9017dadce44fafddfb9 + initial_ast: b01fb5830de1334b20c40a846a0f5097059e1f23f7e03a93344b01a85daf45c0 + canonicalized_ast: b01fb5830de1334b20c40a846a0f5097059e1f23f7e03a93344b01a85daf45c0 + type_inferenced_ast: 9dee212732866b561e7543608592425fd8a70ae2d7e286cb56037bff66eb2714 diff --git a/tests/expectations/compiler/compiler/integers/i32/negate.leo.out b/tests/expectations/compiler/compiler/integers/i32/negate.leo.out index ff6e862e5b..52194d22a7 100644 --- a/tests/expectations/compiler/compiler/integers/i32/negate.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/negate.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 2ae478eb637f8e59b53f6750c726e728aa6bcdc702a9434f290a15ce091c2fd8 - canonicalized_ast: 2ae478eb637f8e59b53f6750c726e728aa6bcdc702a9434f290a15ce091c2fd8 - type_inferenced_ast: 0fe0731c61c040d0221066408c5bb64204db82b9521fb8bc6ebd0e9d7fb8e46c + initial_ast: 6d1ee39de9724740815e6ae902cc6d554c68b25d52c46e8a083891edd44d5115 + canonicalized_ast: 6d1ee39de9724740815e6ae902cc6d554c68b25d52c46e8a083891edd44d5115 + type_inferenced_ast: d79fcaaf02bff685eab7de7678089cbcf5a2094cc2e93572f666439aeaad48ab diff --git a/tests/expectations/compiler/compiler/integers/i32/negate_min.leo.out b/tests/expectations/compiler/compiler/integers/i32/negate_min.leo.out index f154160065..a5095f76da 100644 --- a/tests/expectations/compiler/compiler/integers/i32/negate_min.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/negate_min.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 055a3effe6dab326bc05efb4e705b975b8b5b9a476fcc51c1031cc0ad7bb579f - canonicalized_ast: 055a3effe6dab326bc05efb4e705b975b8b5b9a476fcc51c1031cc0ad7bb579f - type_inferenced_ast: de723bb30e595a20606a520588af8ba6042ab5206a02c13f184b7a72cd21ce00 + initial_ast: 405c4feb62723fd057a5c48607083f5f4b1759d00ff8cdc5f98c94d32fa9e85e + canonicalized_ast: 405c4feb62723fd057a5c48607083f5f4b1759d00ff8cdc5f98c94d32fa9e85e + type_inferenced_ast: 6afa590ff464ad10a01dfb115a6975cafde1ee3a69c03a97e1226512bf8679ed diff --git a/tests/expectations/compiler/compiler/integers/i32/negate_zero.leo.out b/tests/expectations/compiler/compiler/integers/i32/negate_zero.leo.out index c355e353ba..393e6d292d 100644 --- a/tests/expectations/compiler/compiler/integers/i32/negate_zero.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/negate_zero.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: a136febecbdc7a15151f62688ed248422281c2555bebae831c815be512377356 - canonicalized_ast: a136febecbdc7a15151f62688ed248422281c2555bebae831c815be512377356 - type_inferenced_ast: bea5396c3c0a772fcbf20c39d2700a62663f48eaeb84c67e5f202a14812a6cc8 + initial_ast: 3c96a559318d5e876326f4ceef8db9b0f90330206b0be63cc1fcd33963b8db3a + canonicalized_ast: 3c96a559318d5e876326f4ceef8db9b0f90330206b0be63cc1fcd33963b8db3a + type_inferenced_ast: e33caf2a6323f9e4926a29ebe4f566a1a4959afc48eaf50d80be3be8c3e18373 diff --git a/tests/expectations/compiler/compiler/integers/i32/no_space_between_literal.leo.out b/tests/expectations/compiler/compiler/integers/i32/no_space_between_literal.leo.out index 6a9d5f0913..8bf423a222 100644 --- a/tests/expectations/compiler/compiler/integers/i32/no_space_between_literal.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/no_space_between_literal.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:15\n |\n 4 | const i = 1 i32;\n | ^\n |\n = Unexpected white space between terms 1 and i32" + - "Error [EPAR0370004]: Unexpected white space between terms 1 and i32\n --> compiler-test:4:15\n |\n 4 | const i = 1 i32;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i32/sub.leo.out b/tests/expectations/compiler/compiler/integers/i32/sub.leo.out index 87b0c99def..439b852dab 100644 --- a/tests/expectations/compiler/compiler/integers/i32/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/sub.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: ccb65cb15b43a9dc74925cca1128198439de34c4208a8ca6674cc11d775f4a6c - canonicalized_ast: ccb65cb15b43a9dc74925cca1128198439de34c4208a8ca6674cc11d775f4a6c - type_inferenced_ast: 53f17f158869f377d8feb3d63b4f8885d0a1e826d0e4d4faaa770a47fb2bea4d + initial_ast: b8bc1c1d83f538c7f2627dda8c7a274586cab99dcc8c819fca0f1985a39c9a0e + canonicalized_ast: b8bc1c1d83f538c7f2627dda8c7a274586cab99dcc8c819fca0f1985a39c9a0e + type_inferenced_ast: 0462f78b7aedf61b4f79b2cd3b8c61bc58782d79496188f4ad00bcb5026a6eaf diff --git a/tests/expectations/compiler/compiler/integers/i32/ternary.leo.out b/tests/expectations/compiler/compiler/integers/i32/ternary.leo.out index 2adbd0b653..483edb8ccf 100644 --- a/tests/expectations/compiler/compiler/integers/i32/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/ternary.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: d9f544c8d3c1f2b5f75e43aaa6ad136262668bb8f52961b0890d6e417f1b7cd4 - canonicalized_ast: d9f544c8d3c1f2b5f75e43aaa6ad136262668bb8f52961b0890d6e417f1b7cd4 - type_inferenced_ast: 7f557bec0085efc8317c8061c4bb8b1d31d898e5d0d75e07b0ebc3bb958de770 + initial_ast: a3f58f20e2b332bf45444ee4b14b9c5e3680bb64301595bd9da7cc615aea117b + canonicalized_ast: a3f58f20e2b332bf45444ee4b14b9c5e3680bb64301595bd9da7cc615aea117b + type_inferenced_ast: b60128ddfb24ca1130e67082e31ffab0802b4b9ffd164cacc730390349237ee1 diff --git a/tests/expectations/compiler/compiler/integers/i64/add.leo.out b/tests/expectations/compiler/compiler/integers/i64/add.leo.out index 4289fbc21e..1c6882b2ad 100644 --- a/tests/expectations/compiler/compiler/integers/i64/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/add.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 95021c02880a3b85d58be6a8f0ddba2732ba35322af9c767c232a47c9a9e66a8 - canonicalized_ast: 95021c02880a3b85d58be6a8f0ddba2732ba35322af9c767c232a47c9a9e66a8 - type_inferenced_ast: f6befcf4a7ebde46dd5434464cb0ead1900294e5704000350667d1763d614c72 + initial_ast: 043a24e3e8b53b5f647e12862256dc3bd2219d02cc51d746e4c9e85a57d152d7 + canonicalized_ast: 043a24e3e8b53b5f647e12862256dc3bd2219d02cc51d746e4c9e85a57d152d7 + type_inferenced_ast: b8e4f7de1c4065b327f08317bb9adef204cd09e9fe2cf0ee0875fa9f80e0334a diff --git a/tests/expectations/compiler/compiler/integers/i64/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/i64/console_assert.leo.out index 60bdae93b5..f63fef5b87 100644 --- a/tests/expectations/compiler/compiler/integers/i64/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/console_assert.leo.out @@ -13,6 +13,6 @@ outputs: - input_file: i64.in output: registers: {} - initial_ast: e602573b4419a65c310de826337dc34bfc1dc2e215546d27c84be8f958f2fbe7 - canonicalized_ast: 66e33af7b62390b864dc4d488ecffaa3fbc1673788394ea87a94e650b6a4fcd2 - type_inferenced_ast: 1d22b0a31160d820841f5c8b5b85a683e878d35c237f45d0e5cf0f98151a7577 + initial_ast: 28b6e3766452fc6f1ee10ae35662ede0a0f5c4d1b9ac2c619a17a6bc649f963a + canonicalized_ast: be257d374b10905b8737b8910364057fed4c9ec7e1bb80430b8e09b484d2089f + type_inferenced_ast: 2cbe65a1aa234a9157553e9bc2838c6115f080108cdd4b30a3a467d183e0f5ef diff --git a/tests/expectations/compiler/compiler/integers/i64/div.leo.out b/tests/expectations/compiler/compiler/integers/i64/div.leo.out index 1e38674d57..2e038dbea8 100644 --- a/tests/expectations/compiler/compiler/integers/i64/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/div.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 9cbb95349371703905da55fff0b264d4ef85d754ac942d4e3f6e8079bb903c28 - canonicalized_ast: 9cbb95349371703905da55fff0b264d4ef85d754ac942d4e3f6e8079bb903c28 - type_inferenced_ast: 00e413b039c152dff6d27afb5c8ac135debc9774f9cb4bb3c58c56de3368552b + initial_ast: b90fd305c5208bf3eaebfda1df40384bbcdc840104f9b235caa01529deb7c05c + canonicalized_ast: b90fd305c5208bf3eaebfda1df40384bbcdc840104f9b235caa01529deb7c05c + type_inferenced_ast: f4061210d2c0607e84ff49b75e28cb3181dda81da611701d0ad9879860d973b6 diff --git a/tests/expectations/compiler/compiler/integers/i64/eq.leo.out b/tests/expectations/compiler/compiler/integers/i64/eq.leo.out index 5ffc4620ba..bf5e107e7c 100644 --- a/tests/expectations/compiler/compiler/integers/i64/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/eq.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: c8bbd0ab8eafe688d3abd30ae78ed816ac3f4664274171871b26905af03f10df - canonicalized_ast: c8bbd0ab8eafe688d3abd30ae78ed816ac3f4664274171871b26905af03f10df - type_inferenced_ast: 75a421a5808194cd352e6166b4785dad5f9e70d02f5025594f2cc230f0456277 + initial_ast: 00666c43ec1897cd0758ef4c5fc5ac25dce6330abdd10da33c5546a9c05de888 + canonicalized_ast: 00666c43ec1897cd0758ef4c5fc5ac25dce6330abdd10da33c5546a9c05de888 + type_inferenced_ast: 58ebc8997dec1f429496dcf539b93ce08b4ddbd85b83f741153bd0bd6631db2c diff --git a/tests/expectations/compiler/compiler/integers/i64/ge.leo.out b/tests/expectations/compiler/compiler/integers/i64/ge.leo.out index afc6bc7604..99893272b7 100644 --- a/tests/expectations/compiler/compiler/integers/i64/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/ge.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 2bcccde7177cfd914485ebdaee98cdedccad44284d9bdcea03f17d6d20c57270 - canonicalized_ast: 2bcccde7177cfd914485ebdaee98cdedccad44284d9bdcea03f17d6d20c57270 - type_inferenced_ast: a6d083260a3b5596c2dc24424f95a5ccaf6e46998e3cea8d998416888e0b95b6 + initial_ast: f0ce8ad04c21417acd9b86eadabee54c3e63e1d902607883596e849aeffa51f9 + canonicalized_ast: f0ce8ad04c21417acd9b86eadabee54c3e63e1d902607883596e849aeffa51f9 + type_inferenced_ast: e38e74a0510712dda0b0e50b205a5ab31132dcb0e8622d215d1b3a1f7370844b diff --git a/tests/expectations/compiler/compiler/integers/i64/gt.leo.out b/tests/expectations/compiler/compiler/integers/i64/gt.leo.out index c05baefc04..fb0e09f293 100644 --- a/tests/expectations/compiler/compiler/integers/i64/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/gt.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 55fd60c9cf7fef6cafa09678da081f9eedf33af39a7d04ec6ba9da4bbf4d3dd7 - canonicalized_ast: 55fd60c9cf7fef6cafa09678da081f9eedf33af39a7d04ec6ba9da4bbf4d3dd7 - type_inferenced_ast: 816b7aa988cbfc5fa868facbce6533c4a721ff7e8a6123c83329a1effd65f1c3 + initial_ast: 8bb288b0ec5e1330ccf9fef1a26a872295a79bf128fd566e3c14cdc4dbfc0bc4 + canonicalized_ast: 8bb288b0ec5e1330ccf9fef1a26a872295a79bf128fd566e3c14cdc4dbfc0bc4 + type_inferenced_ast: 96fdeedf1a1af69369792208228d4df5f3f2bfa98e33a026d658278470071bc9 diff --git a/tests/expectations/compiler/compiler/integers/i64/le.leo.out b/tests/expectations/compiler/compiler/integers/i64/le.leo.out index c271ce463d..9b6cef7e16 100644 --- a/tests/expectations/compiler/compiler/integers/i64/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/le.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 109dd9e920a3e1bd6cddad99ead2f7061810a22e1f5d0dc624c23a4f73058788 - canonicalized_ast: 109dd9e920a3e1bd6cddad99ead2f7061810a22e1f5d0dc624c23a4f73058788 - type_inferenced_ast: 242bb938c88a667b0591a25633163be323767851bbbc2867340742d5314d9a1e + initial_ast: 1f2b2def4134a9c6b6e4c1d2763c75ec517926fe8842e500b337da8e91e8d118 + canonicalized_ast: 1f2b2def4134a9c6b6e4c1d2763c75ec517926fe8842e500b337da8e91e8d118 + type_inferenced_ast: 26bf92382ad5c5dfbe5ad3b80fd3223398727da3cb1c46e5651fb09ce28370bf diff --git a/tests/expectations/compiler/compiler/integers/i64/lt.leo.out b/tests/expectations/compiler/compiler/integers/i64/lt.leo.out index 79ec4271b8..db0628ead8 100644 --- a/tests/expectations/compiler/compiler/integers/i64/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/lt.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 027c84f3937e34053a8f35500c77fb58f751b974b73d1fa569aa935be1b25968 - canonicalized_ast: 027c84f3937e34053a8f35500c77fb58f751b974b73d1fa569aa935be1b25968 - type_inferenced_ast: 38992b9114c318fe9740fa924107c6aa52b8ca956815a4aaaf6d47e151414434 + initial_ast: 7a72ead766ad1d8c40478170a0fb368b02a2f717030340d34c52a9ab078d106b + canonicalized_ast: 7a72ead766ad1d8c40478170a0fb368b02a2f717030340d34c52a9ab078d106b + type_inferenced_ast: 4e277d241e9083c6d49f07a0f7b923eeda50b3868953dbecd2d5e9ecccf873fb diff --git a/tests/expectations/compiler/compiler/integers/i64/max.leo.out b/tests/expectations/compiler/compiler/integers/i64/max.leo.out index d29514b8f6..3df49b0549 100644 --- a/tests/expectations/compiler/compiler/integers/i64/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/max.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 698a82d44fbb01e2c3c65df9190bac740af75cd5425cdff9e4bbf34b1eb928c7 - canonicalized_ast: 698a82d44fbb01e2c3c65df9190bac740af75cd5425cdff9e4bbf34b1eb928c7 - type_inferenced_ast: af2a509e627e3ee3ab2f4d3a47c4c97162c510a27e4aa30bbe0ff2461f9942af + initial_ast: d9658434c1b68f4d19bb9e68696f2f8abd4669f5f199a526161dff7d01f3603d + canonicalized_ast: d9658434c1b68f4d19bb9e68696f2f8abd4669f5f199a526161dff7d01f3603d + type_inferenced_ast: 3be7d4fac8f7d61e044038ae0b93599b6293bb108f39244c3a60ea25426b0014 diff --git a/tests/expectations/compiler/compiler/integers/i64/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/i64/max_fail.leo.out index 7e8eb2c7de..70acb90ad2 100644 --- a/tests/expectations/compiler/compiler/integers/i64/max_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/max_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:20\n |\n 4 | const a: i64 = 9223372036854775808;\n | ^^^^^^^^^^^^^^^^^^^\n |\n = failed to parse int value '9223372036854775808'" + - "Error [EASG0373031]: failed to parse int value '9223372036854775808'\n --> compiler-test:4:20\n |\n 4 | const a: i64 = 9223372036854775808;\n | ^^^^^^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/integers/i64/min.leo.out b/tests/expectations/compiler/compiler/integers/i64/min.leo.out index bf3f3fcc4c..0ee662b3c0 100644 --- a/tests/expectations/compiler/compiler/integers/i64/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/min.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 662b9ccc5756661ad9a5433665c235452e5602af433d5174a9a7d35575d58e50 - canonicalized_ast: 662b9ccc5756661ad9a5433665c235452e5602af433d5174a9a7d35575d58e50 - type_inferenced_ast: 1cca602cda64194082da2aeda13e806abfd1dec6f2f6e33b8f59e684a7f8a9f6 + initial_ast: 95db7e46acbe1f4ef5a0050a2920f642b8ca12b5583126c0d41ad70dd527eab7 + canonicalized_ast: 95db7e46acbe1f4ef5a0050a2920f642b8ca12b5583126c0d41ad70dd527eab7 + type_inferenced_ast: 0a8aa38462d6c8388a5f90de48118bf4639276aaee62982befff0fc2c315a6e5 diff --git a/tests/expectations/compiler/compiler/integers/i64/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/i64/min_fail.leo.out index 0e07cabdcc..d40e357854 100644 --- a/tests/expectations/compiler/compiler/integers/i64/min_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/min_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:20\n |\n 4 | const a: i64 = -9223372036854775809;\n | ^^^^^^^^^^^^^^^^^^^^\n |\n = failed to parse int value '-9223372036854775809'" + - "Error [EASG0373031]: failed to parse int value '-9223372036854775809'\n --> compiler-test:4:20\n |\n 4 | const a: i64 = -9223372036854775809;\n | ^^^^^^^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/integers/i64/mul.leo.out b/tests/expectations/compiler/compiler/integers/i64/mul.leo.out index 15a2dcf5e2..93d2f34237 100644 --- a/tests/expectations/compiler/compiler/integers/i64/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/mul.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 56e7098f4df6632cd2182397b87055079912107712b141e5752c733fd205ea5d - canonicalized_ast: 56e7098f4df6632cd2182397b87055079912107712b141e5752c733fd205ea5d - type_inferenced_ast: 46df0d390bd68d1309e24be5d7a442884a6d7b1f001649d0ebc529c31d4850b6 + initial_ast: 08ed84d4fdd3cc1e18811bfd7e4ebd6470b77db0320156190fcc1633ea75d185 + canonicalized_ast: 08ed84d4fdd3cc1e18811bfd7e4ebd6470b77db0320156190fcc1633ea75d185 + type_inferenced_ast: 3745fc6450f24bd989409077819614e9188f9a0f7af9e8cdd0d6eed11bebca9f diff --git a/tests/expectations/compiler/compiler/integers/i64/ne.leo.out b/tests/expectations/compiler/compiler/integers/i64/ne.leo.out index 005bee81b4..d5b477955a 100644 --- a/tests/expectations/compiler/compiler/integers/i64/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/ne.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 2779d7555674b1de843b11ac9833276fb3e0de2bae1f8274b4a99a0266c19503 - canonicalized_ast: 2779d7555674b1de843b11ac9833276fb3e0de2bae1f8274b4a99a0266c19503 - type_inferenced_ast: c3ea20c697a684a34398cba8339ea16083aac06fbf780864301053e4f9b4b6ae + initial_ast: c1e15e7bf0b3a581f1740c3bc13a7f3b65018efee79a0fd2df8a9083ffe3fd8b + canonicalized_ast: c1e15e7bf0b3a581f1740c3bc13a7f3b65018efee79a0fd2df8a9083ffe3fd8b + type_inferenced_ast: 004a04b4a76998b0dbb3746af430587608229db3d7c6caec82f705abfdbf8d7f diff --git a/tests/expectations/compiler/compiler/integers/i64/negate.leo.out b/tests/expectations/compiler/compiler/integers/i64/negate.leo.out index 7be1dbf0cb..9ddbf30cfa 100644 --- a/tests/expectations/compiler/compiler/integers/i64/negate.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/negate.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 928bb21b0da55474b51aa036c31fabe00ba68f3ff051159871a99493503edcb8 - canonicalized_ast: 928bb21b0da55474b51aa036c31fabe00ba68f3ff051159871a99493503edcb8 - type_inferenced_ast: 5e9aea6325f193622ecd68c7c7c7c05864d05b37b0b122432119243939153f49 + initial_ast: 4c2f1403554f27f5e437477dc86db86bc7888d0faa60983ce66a451ec08c5c6f + canonicalized_ast: 4c2f1403554f27f5e437477dc86db86bc7888d0faa60983ce66a451ec08c5c6f + type_inferenced_ast: a043ffc8fb3f8505916b04e51fbdb753ede14f012e838b267fa3f35c70b61fc4 diff --git a/tests/expectations/compiler/compiler/integers/i64/negate_min.leo.out b/tests/expectations/compiler/compiler/integers/i64/negate_min.leo.out index 0668d81c84..a17009a849 100644 --- a/tests/expectations/compiler/compiler/integers/i64/negate_min.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/negate_min.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: ee7f236b8d5e51c8c5556c877e94997c90a7ba0f0a0924a6786392b6a22973b6 - canonicalized_ast: ee7f236b8d5e51c8c5556c877e94997c90a7ba0f0a0924a6786392b6a22973b6 - type_inferenced_ast: 0bc182c9db0fbccb9c54bf5ec2a6c3f423337ea005d34473fb86b66cd99e468e + initial_ast: 49b9ce4d8db36da75cc9d1c219de09544211bb798ed732cf4e7ab3c3020bef46 + canonicalized_ast: 49b9ce4d8db36da75cc9d1c219de09544211bb798ed732cf4e7ab3c3020bef46 + type_inferenced_ast: 9b99d299dc2cf83b1f7d42b65f1c608cf2d8b643998519f86279c52ce753c9aa diff --git a/tests/expectations/compiler/compiler/integers/i64/negate_zero.leo.out b/tests/expectations/compiler/compiler/integers/i64/negate_zero.leo.out index bb918efa64..ccf10ad146 100644 --- a/tests/expectations/compiler/compiler/integers/i64/negate_zero.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/negate_zero.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 6f0d090c229a40a04a66af7d209216fd828b723e1ffc030e213a3e15e8994833 - canonicalized_ast: 6f0d090c229a40a04a66af7d209216fd828b723e1ffc030e213a3e15e8994833 - type_inferenced_ast: 1b3b58589e816ac7a563f0c1b64cd890f2074440fb82a15240c1dac4a4f1ebfc + initial_ast: 080706861414ec2965a7d5cb3a9d09e8870fdf18ab9521f31b6f50f868b18d71 + canonicalized_ast: 080706861414ec2965a7d5cb3a9d09e8870fdf18ab9521f31b6f50f868b18d71 + type_inferenced_ast: 0fbe33071492a89813a64102acb80b8e55c2f5cc6710fe9a7b43fd514429d7cc diff --git a/tests/expectations/compiler/compiler/integers/i64/no_space_between_literal.leo.out b/tests/expectations/compiler/compiler/integers/i64/no_space_between_literal.leo.out index 8ad4c3a497..c5d6f40e8c 100644 --- a/tests/expectations/compiler/compiler/integers/i64/no_space_between_literal.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/no_space_between_literal.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:15\n |\n 4 | const i = 1 i64;\n | ^\n |\n = Unexpected white space between terms 1 and i64" + - "Error [EPAR0370004]: Unexpected white space between terms 1 and i64\n --> compiler-test:4:15\n |\n 4 | const i = 1 i64;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i64/sub.leo.out b/tests/expectations/compiler/compiler/integers/i64/sub.leo.out index 154c393b2e..a2d9a8de4c 100644 --- a/tests/expectations/compiler/compiler/integers/i64/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/sub.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 5912057d08a97f306a50eee0b5fc41b703ac08625a2a52948f2efe1fd88e9e22 - canonicalized_ast: 5912057d08a97f306a50eee0b5fc41b703ac08625a2a52948f2efe1fd88e9e22 - type_inferenced_ast: a8402fdcd9a7806c0abb5a5f251d843cbdaa78a9c8b3a4732caff52e91ebb405 + initial_ast: 5570bb473f58cc6a5ddb788adf577cae71d57672bf185873faf1f1609472e4a2 + canonicalized_ast: 5570bb473f58cc6a5ddb788adf577cae71d57672bf185873faf1f1609472e4a2 + type_inferenced_ast: cb4a8e39015b686e3784c3e52ae2720168888b4d099136efb3459a0cbb49ebf1 diff --git a/tests/expectations/compiler/compiler/integers/i64/ternary.leo.out b/tests/expectations/compiler/compiler/integers/i64/ternary.leo.out index 9161f1403d..1e0c828501 100644 --- a/tests/expectations/compiler/compiler/integers/i64/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/ternary.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 855c17c617a81e8c5b10eba1f7eecd695209bf976a80eea338263afa18916800 - canonicalized_ast: 855c17c617a81e8c5b10eba1f7eecd695209bf976a80eea338263afa18916800 - type_inferenced_ast: 4fa3ab3a8fc73e4d758fa6cfbe3417a71135b5073328d1227bcd8695d61880a3 + initial_ast: ccb0e39c6789d3484f5511d3dfa2797deb2bc06d72d741f6782c8926a1de9c85 + canonicalized_ast: ccb0e39c6789d3484f5511d3dfa2797deb2bc06d72d741f6782c8926a1de9c85 + type_inferenced_ast: 80dae2513fecac5b28781bb03dea1f5e84325d8b7e09d89eb6415a2c55ef0544 diff --git a/tests/expectations/compiler/compiler/integers/i8/add.leo.out b/tests/expectations/compiler/compiler/integers/i8/add.leo.out index 54f2b7ab59..294e8ba6d7 100644 --- a/tests/expectations/compiler/compiler/integers/i8/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/add.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 24eace7d2b0f99fb7a1a0d1d5089047c0805945d98d55e27fe2794cf68b46a9a - canonicalized_ast: 24eace7d2b0f99fb7a1a0d1d5089047c0805945d98d55e27fe2794cf68b46a9a - type_inferenced_ast: f3aa44fe027d17b02b2751d91483ed27a14039fdf523952236b89c345d2359fa + initial_ast: 0345f356aa7f85a3f9ed679c405d7821e3f8e33cc0c2e384f6f363249d9ed1a7 + canonicalized_ast: 0345f356aa7f85a3f9ed679c405d7821e3f8e33cc0c2e384f6f363249d9ed1a7 + type_inferenced_ast: a26548a04ecbf21ebec0bbc0e82b6f4c90ed64fe8dd77f93262a92a9117d4308 diff --git a/tests/expectations/compiler/compiler/integers/i8/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/i8/console_assert.leo.out index ce2b929fbd..01a72303c7 100644 --- a/tests/expectations/compiler/compiler/integers/i8/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/console_assert.leo.out @@ -13,6 +13,6 @@ outputs: - input_file: i8.in output: registers: {} - initial_ast: a579aa5a1bc5185d4dc4e8d463edc176d1fbf8d2761f64f276c2bc89ea57a8e7 - canonicalized_ast: 852adf503c72cc27c6555b37f6742c195f9c5b9dc837734954caec31b519a85d - type_inferenced_ast: 9a3ebea7ab65abf6dc23811657dbdae791bf72cc5b28ccbc7dc4e89515d97463 + initial_ast: 4d01f64027709ac40a2582307fdd9420e8b20bfd2cdb26d134b740e00e1f2d1a + canonicalized_ast: f01b1c5294c1f84e31961e0a55595f8bc3fcb213b979c47ff714d4999d157d47 + type_inferenced_ast: 220a44664b251324980f86daba0146c3cb9bd42d315447a9348e3b7c25a2ee92 diff --git a/tests/expectations/compiler/compiler/integers/i8/div.leo.out b/tests/expectations/compiler/compiler/integers/i8/div.leo.out index 30061983a5..45817a7d12 100644 --- a/tests/expectations/compiler/compiler/integers/i8/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/div.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 2ad50f87d6336c8436def71a47ed317220eadf07ef90717be8ef2567c60913f9 - canonicalized_ast: 2ad50f87d6336c8436def71a47ed317220eadf07ef90717be8ef2567c60913f9 - type_inferenced_ast: a818fdc8b79bc6b68364a686a6b17b6167fcbdd5d4a80123419cabfa526f46aa + initial_ast: f045abe3e527251101929855c56f8e0ecac819cd98761f001f6361717518734d + canonicalized_ast: f045abe3e527251101929855c56f8e0ecac819cd98761f001f6361717518734d + type_inferenced_ast: 1d2512703b9c82f65115ef34db4272f744007eee3a45412267de55b88b8843ad diff --git a/tests/expectations/compiler/compiler/integers/i8/eq.leo.out b/tests/expectations/compiler/compiler/integers/i8/eq.leo.out index 06cc6873e4..02704bad5e 100644 --- a/tests/expectations/compiler/compiler/integers/i8/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/eq.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 0bbca11747587a18929d2c86d2539ae9d8d8abf7763fec5588e86c36e0108cec - canonicalized_ast: 0bbca11747587a18929d2c86d2539ae9d8d8abf7763fec5588e86c36e0108cec - type_inferenced_ast: 970b354c05d483629a9127d4499eebcec400b1dd6eced44eb07fceabcb51a42a + initial_ast: ff86399699f200f582d18157f4be094385b35b074b4e0a53db3a42903aa14865 + canonicalized_ast: ff86399699f200f582d18157f4be094385b35b074b4e0a53db3a42903aa14865 + type_inferenced_ast: 44a3ca635d4bee4bb390aaf0cd557bc7877df42eba9d2250a7a68b938ff30a7d diff --git a/tests/expectations/compiler/compiler/integers/i8/ge.leo.out b/tests/expectations/compiler/compiler/integers/i8/ge.leo.out index 80468ae674..96123ae89c 100644 --- a/tests/expectations/compiler/compiler/integers/i8/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/ge.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: be98a456d3f1a866fbb1793db4a6da15b6c23e5bcfe1ea820808c50df523d269 - canonicalized_ast: be98a456d3f1a866fbb1793db4a6da15b6c23e5bcfe1ea820808c50df523d269 - type_inferenced_ast: 6291f19c100f11c11cee46c98a7ed78de16f2bd8527bdb2926cc7c0e7212b084 + initial_ast: 22a0abfda74c125e32189496642194c191e2cd635324e218eb1d7a35266fef73 + canonicalized_ast: 22a0abfda74c125e32189496642194c191e2cd635324e218eb1d7a35266fef73 + type_inferenced_ast: 520d467a0676f3e7853c564f20c75493320d87f0858cc91ffa2ac432bb2cfa59 diff --git a/tests/expectations/compiler/compiler/integers/i8/gt.leo.out b/tests/expectations/compiler/compiler/integers/i8/gt.leo.out index 7622e185fb..8da60e8cbe 100644 --- a/tests/expectations/compiler/compiler/integers/i8/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/gt.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 7f40bef3810a98a6069ee9f27d91902b8c21779e27790fd44d80e6b798e26214 - canonicalized_ast: 7f40bef3810a98a6069ee9f27d91902b8c21779e27790fd44d80e6b798e26214 - type_inferenced_ast: c83944355f670629d6cefc4e35dc52b86d5f42a6b6f4b20e0e6b712b661d5261 + initial_ast: 13935de7dc4809be1f09d9c2cc29b7f7123a90314d57f65be88eb606048d1dfa + canonicalized_ast: 13935de7dc4809be1f09d9c2cc29b7f7123a90314d57f65be88eb606048d1dfa + type_inferenced_ast: 45861e982dcab54a21b4d6042593a6d1b59f4307bc5214e3449d25ce573a0698 diff --git a/tests/expectations/compiler/compiler/integers/i8/le.leo.out b/tests/expectations/compiler/compiler/integers/i8/le.leo.out index 6a040c562f..5acd05f876 100644 --- a/tests/expectations/compiler/compiler/integers/i8/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/le.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 57bdf9ca35c48812e16a9d4cb6531c96a625ed9995804ed4b8b31edc1837c124 - canonicalized_ast: 57bdf9ca35c48812e16a9d4cb6531c96a625ed9995804ed4b8b31edc1837c124 - type_inferenced_ast: 6fe044c68d21ad1379c1a74967a420cf0ffa182785d294bdabe75b624b9dad6d + initial_ast: 9e0661c28ed13a8f8d98c47be3ac659c42a9a1051e137bf47cf9ba5d454a553d + canonicalized_ast: 9e0661c28ed13a8f8d98c47be3ac659c42a9a1051e137bf47cf9ba5d454a553d + type_inferenced_ast: 4c9a74a84f87ccf73f441b5a8e369037b4656e6951fe27866ec7a10d486571e4 diff --git a/tests/expectations/compiler/compiler/integers/i8/lt.leo.out b/tests/expectations/compiler/compiler/integers/i8/lt.leo.out index 03bab656d2..cd08676f9b 100644 --- a/tests/expectations/compiler/compiler/integers/i8/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/lt.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: bb0cf928abcdf4b3492dd75699a6726f11600b55021bc56b4fd45f6fd3df4b54 - canonicalized_ast: bb0cf928abcdf4b3492dd75699a6726f11600b55021bc56b4fd45f6fd3df4b54 - type_inferenced_ast: 5b41154e37f1f4976f75493b49cef9b8d0b2b2ca1a7f42b586e1390c0767bb5e + initial_ast: 0436a1435096db772c51a2914abe88d5134df442371a113ecee51027fa6a8041 + canonicalized_ast: 0436a1435096db772c51a2914abe88d5134df442371a113ecee51027fa6a8041 + type_inferenced_ast: c609d452b7b36ac987ad8dd5893d3a82f75c74f4f8e72b3d5c03c343057150df diff --git a/tests/expectations/compiler/compiler/integers/i8/max.leo.out b/tests/expectations/compiler/compiler/integers/i8/max.leo.out index 83bb3b0bf9..b3ad88b9a8 100644 --- a/tests/expectations/compiler/compiler/integers/i8/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/max.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 5b36c3f9e174c3e003993e13992f35b1b2b381bb600999205fcb6099b56b521e - canonicalized_ast: 5b36c3f9e174c3e003993e13992f35b1b2b381bb600999205fcb6099b56b521e - type_inferenced_ast: 8175e64b383fb53a548b58cc463e2edd55a87d133fa60246b794dde5b9119ef6 + initial_ast: 2540c69850521a04ce3f38303681df3331c89bc47322658d68d3605ff0c19253 + canonicalized_ast: 2540c69850521a04ce3f38303681df3331c89bc47322658d68d3605ff0c19253 + type_inferenced_ast: 1bf81474ffebc0bbc04a09366353dc6120baf4b68bfafa2c9c56ba9a3091801a diff --git a/tests/expectations/compiler/compiler/integers/i8/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/i8/max_fail.leo.out index beec6ea364..59e58793b3 100644 --- a/tests/expectations/compiler/compiler/integers/i8/max_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/max_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:19\n |\n 4 | const a: i8 = 128;\n | ^^^\n |\n = failed to parse int value '128'" + - "Error [EASG0373031]: failed to parse int value '128'\n --> compiler-test:4:19\n |\n 4 | const a: i8 = 128;\n | ^^^" diff --git a/tests/expectations/compiler/compiler/integers/i8/min.leo.out b/tests/expectations/compiler/compiler/integers/i8/min.leo.out index ac027570ba..d489352194 100644 --- a/tests/expectations/compiler/compiler/integers/i8/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/min.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 09df9882f6b902d6148316917e8ed9e62408e85c2248e111f87cbb505f7705fd - canonicalized_ast: 09df9882f6b902d6148316917e8ed9e62408e85c2248e111f87cbb505f7705fd - type_inferenced_ast: dbe09fecd41cbf9d4027140464ce6e87e57f4ee32f60dd1272a5cec82d088a1c + initial_ast: 848bcd581f4f7b58b7eeccd1b9df9a8c37f66afe79681cdd7945c6b22603e1b9 + canonicalized_ast: 848bcd581f4f7b58b7eeccd1b9df9a8c37f66afe79681cdd7945c6b22603e1b9 + type_inferenced_ast: 1b18368ab78736280c3778888c21f08eee137611fb104ab5baee58a2843f7c35 diff --git a/tests/expectations/compiler/compiler/integers/i8/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/i8/min_fail.leo.out index b56ece00d3..849c2b97bc 100644 --- a/tests/expectations/compiler/compiler/integers/i8/min_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/min_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:19\n |\n 4 | const a: i8 = -129;\n | ^^^^\n |\n = failed to parse int value '-129'" + - "Error [EASG0373031]: failed to parse int value '-129'\n --> compiler-test:4:19\n |\n 4 | const a: i8 = -129;\n | ^^^^" diff --git a/tests/expectations/compiler/compiler/integers/i8/mul.leo.out b/tests/expectations/compiler/compiler/integers/i8/mul.leo.out index 920fc6a184..010598c77d 100644 --- a/tests/expectations/compiler/compiler/integers/i8/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/mul.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: ad9b97cdc654da8d5c850e7d79b38f26dae3fcb90711c18a0c3b34df60349c7e - canonicalized_ast: ad9b97cdc654da8d5c850e7d79b38f26dae3fcb90711c18a0c3b34df60349c7e - type_inferenced_ast: de1670f9a5fc69c24fdd5607d6789af9d5a59e6f87f170857d8c29f3414013e5 + initial_ast: f3888a0d49212fcfa415eed868ffd2a1101a406739ac71dab681be85c695ea86 + canonicalized_ast: f3888a0d49212fcfa415eed868ffd2a1101a406739ac71dab681be85c695ea86 + type_inferenced_ast: 00f94b33b1d62bf8519729caaea90f61b6c6ba5f3d0cbb8af4502fc52b334dc1 diff --git a/tests/expectations/compiler/compiler/integers/i8/ne.leo.out b/tests/expectations/compiler/compiler/integers/i8/ne.leo.out index 0ebf7ad3d3..ee78c1ce50 100644 --- a/tests/expectations/compiler/compiler/integers/i8/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/ne.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 3c2884711728384eb34c61e005682c6480d1b3b67454e4e02f0619c48b7917cf - canonicalized_ast: 3c2884711728384eb34c61e005682c6480d1b3b67454e4e02f0619c48b7917cf - type_inferenced_ast: 87d9a9b58227a323ea9a5989da2432756fc77766e1515896bea03fe7a504f54d + initial_ast: 67a54d8e773b571783cd1f1a7adf30c1eb91cf371435e0c3ee8c1d036da7ff00 + canonicalized_ast: 67a54d8e773b571783cd1f1a7adf30c1eb91cf371435e0c3ee8c1d036da7ff00 + type_inferenced_ast: 93c7565072976d98e8084210cedd004dedc66dfc405eb2836ce9c014d851a232 diff --git a/tests/expectations/compiler/compiler/integers/i8/negate.leo.out b/tests/expectations/compiler/compiler/integers/i8/negate.leo.out index 2da8a458dd..7205e418ae 100644 --- a/tests/expectations/compiler/compiler/integers/i8/negate.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/negate.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 2698a8d7153a02a13dfb9450652465cae7b807f53ed1b1429eaecfb888300334 - canonicalized_ast: 2698a8d7153a02a13dfb9450652465cae7b807f53ed1b1429eaecfb888300334 - type_inferenced_ast: fe061e3467bfcabc7a36ea290be2f04aff27efa6dae8e1164bd03ce1af8664c1 + initial_ast: 8c288dff00a92efd14f4da90c3f49acb793ba083a4d2c209f00bb66237cfae86 + canonicalized_ast: 8c288dff00a92efd14f4da90c3f49acb793ba083a4d2c209f00bb66237cfae86 + type_inferenced_ast: 52153c3e1725d62fc6392a640ecbc35e37f977c17685ee556b3b5a26c0435b8a diff --git a/tests/expectations/compiler/compiler/integers/i8/negate_min.leo.out b/tests/expectations/compiler/compiler/integers/i8/negate_min.leo.out index 1e357b60db..cc8f46e1c2 100644 --- a/tests/expectations/compiler/compiler/integers/i8/negate_min.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/negate_min.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:5:15\n |\n 5 | const b = -a;\n | ^^\n |\n = integer operation failed due to the signed integer error `Overflow`" + - "Error [ECMP0376083]: integer operation failed due to the signed integer error `Integer overflow`\n --> compiler-test:5:15\n |\n 5 | const b = -a;\n | ^^" diff --git a/tests/expectations/compiler/compiler/integers/i8/negate_zero.leo.out b/tests/expectations/compiler/compiler/integers/i8/negate_zero.leo.out index d531809f95..7e7a3b3695 100644 --- a/tests/expectations/compiler/compiler/integers/i8/negate_zero.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/negate_zero.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: da89fb90b63ff44da71f20bd1a95b5a14385f254e267463b9ecb17ccc5d8e643 - canonicalized_ast: da89fb90b63ff44da71f20bd1a95b5a14385f254e267463b9ecb17ccc5d8e643 - type_inferenced_ast: 077f62f984727186f23fdcbb13bc800ba6e6aaf667ebb578e014c2971b1f0389 + initial_ast: f8995a120800a95ddaf61dfe7e4f31d5140b655d4a5b9e6a616c83b65092fe61 + canonicalized_ast: f8995a120800a95ddaf61dfe7e4f31d5140b655d4a5b9e6a616c83b65092fe61 + type_inferenced_ast: bc9ba5ac09deede1a1960236a1f20c0954c0fb4e06c2b54905d9b5f2cf877adf diff --git a/tests/expectations/compiler/compiler/integers/i8/no_space_between_literal.leo.out b/tests/expectations/compiler/compiler/integers/i8/no_space_between_literal.leo.out index cd1c85e431..5a8f095af1 100644 --- a/tests/expectations/compiler/compiler/integers/i8/no_space_between_literal.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/no_space_between_literal.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:15\n |\n 4 | const i = 1 i8;\n | ^\n |\n = Unexpected white space between terms 1 and i8" + - "Error [EPAR0370004]: Unexpected white space between terms 1 and i8\n --> compiler-test:4:15\n |\n 4 | const i = 1 i8;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i8/sub.leo.out b/tests/expectations/compiler/compiler/integers/i8/sub.leo.out index d34883de25..d79a4f0422 100644 --- a/tests/expectations/compiler/compiler/integers/i8/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/sub.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 59c47c65fa77729fdb64f325d9498a52b13e57f92e57f64c0b65f32a81b5d0b5 - canonicalized_ast: 59c47c65fa77729fdb64f325d9498a52b13e57f92e57f64c0b65f32a81b5d0b5 - type_inferenced_ast: 46fbeb4b3b044958e67d0ae0b89a149729a982b9c02fc9e0892bc907c93b3b5b + initial_ast: 6ff82e799e64834c43399e51589e5b110a8ab179a1a7cf3a4210ae780515df54 + canonicalized_ast: 6ff82e799e64834c43399e51589e5b110a8ab179a1a7cf3a4210ae780515df54 + type_inferenced_ast: ec57c434abe046a57b5ae80b94f7118ee25ed52ce54e61f5210dba094591c17e diff --git a/tests/expectations/compiler/compiler/integers/i8/ternary.leo.out b/tests/expectations/compiler/compiler/integers/i8/ternary.leo.out index d8f0274229..3915ad46e9 100644 --- a/tests/expectations/compiler/compiler/integers/i8/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/ternary.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 807f6d204c511da0de8677fec27d64b461d505be3f756a5cf2430c4e5fe16d6d - canonicalized_ast: 807f6d204c511da0de8677fec27d64b461d505be3f756a5cf2430c4e5fe16d6d - type_inferenced_ast: 90970cdd4a45182dac1861ed3cd4ce397f3d0117c596b8ed388b98a28e4718ca + initial_ast: 256d3ed102c8a18d29515bbaea00dd9d1deb16d12474c5d75aa76f64cf7d691d + canonicalized_ast: 256d3ed102c8a18d29515bbaea00dd9d1deb16d12474c5d75aa76f64cf7d691d + type_inferenced_ast: fb3d90dac9be745eeb2ac5eb29f9ea91994cc074d3720d54cbc4f6d9bea8a26e diff --git a/tests/expectations/compiler/compiler/integers/u128/add.leo.out b/tests/expectations/compiler/compiler/integers/u128/add.leo.out index 661fd1b9a7..a2dbfa3408 100644 --- a/tests/expectations/compiler/compiler/integers/u128/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/add.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: d45e6866a79c28636a5333b057f577ddb9af3528c72cfb0292d6cb30e9a84c34 - canonicalized_ast: d45e6866a79c28636a5333b057f577ddb9af3528c72cfb0292d6cb30e9a84c34 - type_inferenced_ast: d5500f11415075486f76f4f88a98f48f89ba30b9c7829527481004f05563be56 + initial_ast: bc7eadb66a46463e9516afcdad00914bd3f17efe7bd100f839839c54e52d13a4 + canonicalized_ast: bc7eadb66a46463e9516afcdad00914bd3f17efe7bd100f839839c54e52d13a4 + type_inferenced_ast: b6f70ec62b9f4048cf7ca2990eb893dc940c6d3917718c13fb1a3df0eaf3543d diff --git a/tests/expectations/compiler/compiler/integers/u128/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/u128/console_assert.leo.out index ffdc4b659c..d5cd5e0a3d 100644 --- a/tests/expectations/compiler/compiler/integers/u128/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/console_assert.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: a50e90edf35c1c2d69c6ab04a5024c951caf54e37677cba8aed3e5f653ffcf5e - canonicalized_ast: a50e90edf35c1c2d69c6ab04a5024c951caf54e37677cba8aed3e5f653ffcf5e - type_inferenced_ast: 62efd6e15269c60fd45fbd873fc2a120ea98ba0a9bf96d774eb85847c36d482e + initial_ast: 8e4d20b04881c26b369dc2a68ed15ed06d1b54d5459543cdb689f806bd1aa1d9 + canonicalized_ast: 8e4d20b04881c26b369dc2a68ed15ed06d1b54d5459543cdb689f806bd1aa1d9 + type_inferenced_ast: 9531660b5018c2f43a3d1ba0a40e029df6a50898ea3c74e469b1ab5634313df8 diff --git a/tests/expectations/compiler/compiler/integers/u128/div.leo.out b/tests/expectations/compiler/compiler/integers/u128/div.leo.out index 28ed9ea4e8..3014858d27 100644 --- a/tests/expectations/compiler/compiler/integers/u128/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/div.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: f50f65ba74e0e2c2cf146d66f83beb18023692e90b664e0217a19486b9b5fd67 - canonicalized_ast: f50f65ba74e0e2c2cf146d66f83beb18023692e90b664e0217a19486b9b5fd67 - type_inferenced_ast: d851da0f7cf5b7dacc0186f963b33564fde73427d10b84d13635923d12998963 + initial_ast: 2e06804b600a35de30eaaf59f33a28872576b91a5f09f1203893f02f1277b08a + canonicalized_ast: 2e06804b600a35de30eaaf59f33a28872576b91a5f09f1203893f02f1277b08a + type_inferenced_ast: 695abf8d7f279e561b4a89ca764c94ee730bdf8f653414664d7d664eb59fe830 diff --git a/tests/expectations/compiler/compiler/integers/u128/eq.leo.out b/tests/expectations/compiler/compiler/integers/u128/eq.leo.out index 6cf593d4e7..bd0f5a7899 100644 --- a/tests/expectations/compiler/compiler/integers/u128/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/eq.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 36db0f375d215a56d167d6c59144fd514489118b82f59b7811a2afcea361443d - canonicalized_ast: 36db0f375d215a56d167d6c59144fd514489118b82f59b7811a2afcea361443d - type_inferenced_ast: 56e5d5ba650e0c0f4faad326e60c727b6af636ca72d15f949df28cd1966b1a6e + initial_ast: c7b25869dfb1c128c5ff8f0f484e3b6de1a7dc5381b2f8807c943d0c92603669 + canonicalized_ast: c7b25869dfb1c128c5ff8f0f484e3b6de1a7dc5381b2f8807c943d0c92603669 + type_inferenced_ast: f6bafa99d7e108411b4e71edb2a981e0f9e730707a9ac2e2fce87100fb35ebf8 diff --git a/tests/expectations/compiler/compiler/integers/u128/ge.leo.out b/tests/expectations/compiler/compiler/integers/u128/ge.leo.out index 852abf0857..7c3a463282 100644 --- a/tests/expectations/compiler/compiler/integers/u128/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/ge.leo.out @@ -28,6 +28,6 @@ outputs: r0: type: bool value: "true" - initial_ast: c398a4f1f04fc9ebe97c65cb33c26ac5faf161417493db8bd8c50f0c0da7fad6 - canonicalized_ast: c398a4f1f04fc9ebe97c65cb33c26ac5faf161417493db8bd8c50f0c0da7fad6 - type_inferenced_ast: f5052bd40c74aee7da886eb480ccbb24136ee7d2fed1c70d5e8d38e819a9a697 + initial_ast: bec3606816632c3ec6b912dedb2d10149380b68d6159792c603b866698175b2a + canonicalized_ast: bec3606816632c3ec6b912dedb2d10149380b68d6159792c603b866698175b2a + type_inferenced_ast: 440e113b6ebcf6ecbe2db5caa41e8f8b23538db7e0e7112ecc86629c0e9c7eab diff --git a/tests/expectations/compiler/compiler/integers/u128/gt.leo.out b/tests/expectations/compiler/compiler/integers/u128/gt.leo.out index 2d45d8a801..6afc52a0ea 100644 --- a/tests/expectations/compiler/compiler/integers/u128/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/gt.leo.out @@ -16,6 +16,6 @@ outputs: - input_file: u128_f.in output: registers: {} - initial_ast: 8c2309bdacd6b025d2462e08376db93e25406d164abc8955e039a338a0a58c00 - canonicalized_ast: 7bec6018459ad543c408f4f911200b81dc05f855ef680a3b12c6b8f58558f216 - type_inferenced_ast: d495e9868687b702dc07201da22b59dfd91212f2d6632e67f0a967b0fc748995 + initial_ast: 61af6f965b2525b4ce424fdea87e53ca1e8e1b037bf5b50fc63d5d3ddf1ed877 + canonicalized_ast: 5d9465b3594defa551a4573815c23600809c968ead6289253fd6e7de88f4f532 + type_inferenced_ast: 57bd5776b3700331bee92e3bfafbe17fccf3a3acb13b943e2dda42a0600cd817 diff --git a/tests/expectations/compiler/compiler/integers/u128/input.leo.out b/tests/expectations/compiler/compiler/integers/u128/input.leo.out index fa5c449606..e903add2ae 100644 --- a/tests/expectations/compiler/compiler/integers/u128/input.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/input.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 564026493df81fbcbea34b98737e3aade0b3a0a410f19534c61b8132b2796a58 - canonicalized_ast: 564026493df81fbcbea34b98737e3aade0b3a0a410f19534c61b8132b2796a58 - type_inferenced_ast: c64ae9e0e4aefcc4897de172b9107ab0a824b49dbd1e678d88ae15a33c85ce41 + initial_ast: 9b6300874e2e40af3eeb288a3b0e2c96d77ed7b7819ebe4bdea4cf536d6e0f37 + canonicalized_ast: 9b6300874e2e40af3eeb288a3b0e2c96d77ed7b7819ebe4bdea4cf536d6e0f37 + type_inferenced_ast: 98799a27c60065022928365b4cf62115242d8071f5cc6a5ba2535c6edbae2c3a diff --git a/tests/expectations/compiler/compiler/integers/u128/le.leo.out b/tests/expectations/compiler/compiler/integers/u128/le.leo.out index 173211016b..e5b917c83c 100644 --- a/tests/expectations/compiler/compiler/integers/u128/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/le.leo.out @@ -28,6 +28,6 @@ outputs: r0: type: bool value: "false" - initial_ast: 07514fbeb1b81b4c2c99555ab2b7402b71997838ab48cf8a00c859441a93bfaa - canonicalized_ast: 07514fbeb1b81b4c2c99555ab2b7402b71997838ab48cf8a00c859441a93bfaa - type_inferenced_ast: b3aad22da78779bbc4982cc8ee42b1d68ffc77cdea0000d31f8ec23710f088b5 + initial_ast: e71204309379c09b99849308c8fe2bcd4aca2b6d8795e6af2be608c6744ad8bb + canonicalized_ast: e71204309379c09b99849308c8fe2bcd4aca2b6d8795e6af2be608c6744ad8bb + type_inferenced_ast: 30318da869e64a0db90a17fd031d553fc5534922202f9c118989e9b3ebd53a60 diff --git a/tests/expectations/compiler/compiler/integers/u128/lt.leo.out b/tests/expectations/compiler/compiler/integers/u128/lt.leo.out index d5da5718d7..f1997649e0 100644 --- a/tests/expectations/compiler/compiler/integers/u128/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/lt.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "false" - initial_ast: 6cc9a99c85b53360a020faa95b45beda98089442160343df3c0b5705430a8d0d - canonicalized_ast: 6cc9a99c85b53360a020faa95b45beda98089442160343df3c0b5705430a8d0d - type_inferenced_ast: 63fcd7cf6ba3b36bbeed4bd7a234502a427b93289f0253693226692fe7dd457b + initial_ast: 7db17e7a9cebbd8b889a36531da1af576816e9f679c23cedece8b0209c79001b + canonicalized_ast: 7db17e7a9cebbd8b889a36531da1af576816e9f679c23cedece8b0209c79001b + type_inferenced_ast: 291efe204cc4fedaf6b15248be5b9c621eb8f62e8b2033e206c0af3894c9c488 diff --git a/tests/expectations/compiler/compiler/integers/u128/max.leo.out b/tests/expectations/compiler/compiler/integers/u128/max.leo.out index a7a86662e4..5293a8d37b 100644 --- a/tests/expectations/compiler/compiler/integers/u128/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/max.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 22e031b9484b25549efe77735034b7868fe15cb482fb2b9866c4eb6a97d66a9b - canonicalized_ast: 22e031b9484b25549efe77735034b7868fe15cb482fb2b9866c4eb6a97d66a9b - type_inferenced_ast: 1a18559f37943d7863243f97f204a7967bd5ca421cf614db3a454eb62570fa55 + initial_ast: 01d2d7a3271585174c439fd0b9e23be0f81139f44853fcae1c894f575a4d6d15 + canonicalized_ast: 01d2d7a3271585174c439fd0b9e23be0f81139f44853fcae1c894f575a4d6d15 + type_inferenced_ast: fc8cdcdf563aa94a281b4430dae898510666cc7dd39b60faba6d29039b971522 diff --git a/tests/expectations/compiler/compiler/integers/u128/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/u128/max_fail.leo.out index 99e37f107e..0e63762f44 100644 --- a/tests/expectations/compiler/compiler/integers/u128/max_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/max_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:21\n |\n 4 | const a: u128 = 340282366920938463463374607431768211456;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = failed to parse int value '340282366920938463463374607431768211456'" + - "Error [EASG0373031]: failed to parse int value '340282366920938463463374607431768211456'\n --> compiler-test:4:21\n |\n 4 | const a: u128 = 340282366920938463463374607431768211456;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/integers/u128/min.leo.out b/tests/expectations/compiler/compiler/integers/u128/min.leo.out index 954a505ee5..2c78c8f42c 100644 --- a/tests/expectations/compiler/compiler/integers/u128/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/min.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 2e69e9af36727a547e5494e3c77f80a55c18daf0d13398df6c2101a76264d695 - canonicalized_ast: 2e69e9af36727a547e5494e3c77f80a55c18daf0d13398df6c2101a76264d695 - type_inferenced_ast: 4586f887e2d6d10833c6f556c1e6a0a3c53d3da89f1e0659967e6da60692106f + initial_ast: da001a51242f61b13d47e7ffc39908bf62ad3f7a48aebe2d0988d36c55216b00 + canonicalized_ast: da001a51242f61b13d47e7ffc39908bf62ad3f7a48aebe2d0988d36c55216b00 + type_inferenced_ast: cd24eeefb2a9af2bd3b320ed579b4c24e5b98a7fcef5ccf50b6a5406202676a7 diff --git a/tests/expectations/compiler/compiler/integers/u128/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/u128/min_fail.leo.out index 3ec7269953..db0cdb2474 100644 --- a/tests/expectations/compiler/compiler/integers/u128/min_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/min_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:21\n |\n 4 | const a: u128 = -1;\n | ^^\n |\n = failed to parse int value '-1'" + - "Error [EASG0373031]: failed to parse int value '-1'\n --> compiler-test:4:21\n |\n 4 | const a: u128 = -1;\n | ^^" diff --git a/tests/expectations/compiler/compiler/integers/u128/mul.leo.out b/tests/expectations/compiler/compiler/integers/u128/mul.leo.out index a081b7d925..abeb69d5eb 100644 --- a/tests/expectations/compiler/compiler/integers/u128/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/mul.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "false" - initial_ast: 21a49e719d3cf8ef9c34775b584b8ef46213f5c4df384f0780d8233eb9f8c09c - canonicalized_ast: 21a49e719d3cf8ef9c34775b584b8ef46213f5c4df384f0780d8233eb9f8c09c - type_inferenced_ast: af6b3537bf7508bd97b7049bb76df13456dac4d4bdb526cba43aba952f9da9ae + initial_ast: 1687f3a384ae14199fe9e97c2be6601457bb6a343cd35f8830ce0930a574f185 + canonicalized_ast: 1687f3a384ae14199fe9e97c2be6601457bb6a343cd35f8830ce0930a574f185 + type_inferenced_ast: bb06537b55adf805c601edaecc8d28e564fb366bb0e7274ba4c7b8198cd7d35e diff --git a/tests/expectations/compiler/compiler/integers/u128/ne.leo.out b/tests/expectations/compiler/compiler/integers/u128/ne.leo.out index 8cefcf3a09..ccde2780fe 100644 --- a/tests/expectations/compiler/compiler/integers/u128/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/ne.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: a4b0739663c4139b5c69cb65fa2ee4128018162fa2cdb6e3c32e1a72077a0bfb - canonicalized_ast: a4b0739663c4139b5c69cb65fa2ee4128018162fa2cdb6e3c32e1a72077a0bfb - type_inferenced_ast: a71ceabdc2095ad95f9ad70d5272e2d3909774b7f72c1cef5f5ad15013f0763d + initial_ast: ad54acce2fc40331a9b47e756375a8b56ba391c5f9ad6d46c5931d532bfba5a8 + canonicalized_ast: ad54acce2fc40331a9b47e756375a8b56ba391c5f9ad6d46c5931d532bfba5a8 + type_inferenced_ast: 136a6ca5ef187b479084e29e2a081146865f03b39a1e9c01cbf90644e20a0c8c diff --git a/tests/expectations/compiler/compiler/integers/u128/negative_input_fail.leo.out b/tests/expectations/compiler/compiler/integers/u128/negative_input_fail.leo.out index a8c26c2513..e5b8fb94a9 100644 --- a/tests/expectations/compiler/compiler/integers/u128/negative_input_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/negative_input_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:15\n |\n 3 | function main(a: u128) {}\n | ^\n |\n = failed to parse `-2` as expected integer type" + - "Error [ECMP0376089]: failed to parse `-2` as expected integer type\n --> compiler-test:3:15\n |\n 3 | function main(a: u128) {}\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u128/no_space_between_literal.leo.out b/tests/expectations/compiler/compiler/integers/u128/no_space_between_literal.leo.out index 3283c7d907..b53dbf17a5 100644 --- a/tests/expectations/compiler/compiler/integers/u128/no_space_between_literal.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/no_space_between_literal.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:15\n |\n 4 | const i = 1 u128;\n | ^\n |\n = Unexpected white space between terms 1 and u128" + - "Error [EPAR0370004]: Unexpected white space between terms 1 and u128\n --> compiler-test:4:15\n |\n 4 | const i = 1 u128;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u128/sub.leo.out b/tests/expectations/compiler/compiler/integers/u128/sub.leo.out index 9d816dc7ad..4dfc46516a 100644 --- a/tests/expectations/compiler/compiler/integers/u128/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/sub.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: ab2437dbf56e0d28c7b0d370e95fa38d326cdcff9f8cc1f016c8b5ad317d38ce - canonicalized_ast: ab2437dbf56e0d28c7b0d370e95fa38d326cdcff9f8cc1f016c8b5ad317d38ce - type_inferenced_ast: 46fab75c453ebe6ce6ba360a8b5d82e1d6d89799b4a280a27772d66a450bde9f + initial_ast: e76614a31a739252199317d02de4090bf38d89406e145239076c13f65af3d3bd + canonicalized_ast: e76614a31a739252199317d02de4090bf38d89406e145239076c13f65af3d3bd + type_inferenced_ast: 3ed54255089ab10b26df5429b5109d90b27fa6306b84e26018eca7659efe35c4 diff --git a/tests/expectations/compiler/compiler/integers/u128/ternary.leo.out b/tests/expectations/compiler/compiler/integers/u128/ternary.leo.out index 87ec61f49e..2e3d53d6ba 100644 --- a/tests/expectations/compiler/compiler/integers/u128/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/ternary.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 35127d5f289d7f1dd3e1c79c919ceafaff778ea857b4035d6d90d0abc6804533 - canonicalized_ast: 35127d5f289d7f1dd3e1c79c919ceafaff778ea857b4035d6d90d0abc6804533 - type_inferenced_ast: 257c366629f72e71847216b24d14bb81d6125b75c7ade6b0335c82370c3e8550 + initial_ast: 8e008c8133e8646f2fb89938541e8af8709de4e692c44cf7f8bea367f6225733 + canonicalized_ast: 8e008c8133e8646f2fb89938541e8af8709de4e692c44cf7f8bea367f6225733 + type_inferenced_ast: 124baed45ba7d5e053acf041a444d70348f15c01f4a374fa6bb42290d0bd1012 diff --git a/tests/expectations/compiler/compiler/integers/u16/add.leo.out b/tests/expectations/compiler/compiler/integers/u16/add.leo.out index a13f6ef6bc..c8cb53965c 100644 --- a/tests/expectations/compiler/compiler/integers/u16/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/add.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 41be1c43cd89daed5f9d28b5a5a9788989f2618cb157259329be41ae06b89e7c - canonicalized_ast: 41be1c43cd89daed5f9d28b5a5a9788989f2618cb157259329be41ae06b89e7c - type_inferenced_ast: 9a775f976c931eca2318f74c0dde3e4b207d10ed1e8398e64533b7870d73e98a + initial_ast: e8e48cba56241044305c14a0d8e871b1be2495d271ba2a0f7ea3435dd75ad7b0 + canonicalized_ast: e8e48cba56241044305c14a0d8e871b1be2495d271ba2a0f7ea3435dd75ad7b0 + type_inferenced_ast: b004dc4f07683a68734b50e5a3ffb9ddb286be4f568cf78ac8d4fba71a910b48 diff --git a/tests/expectations/compiler/compiler/integers/u16/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/u16/console_assert.leo.out index 7a8e41ab92..f188189f86 100644 --- a/tests/expectations/compiler/compiler/integers/u16/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/console_assert.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: c19ce080448a618611bb810bc73339a31e6f4be3afd3ed782ef848d448105ff4 - canonicalized_ast: c19ce080448a618611bb810bc73339a31e6f4be3afd3ed782ef848d448105ff4 - type_inferenced_ast: 5cedb974c91a3131d6c74d6ad59df8c02c365a0f3bc2717f19020125507354ea + initial_ast: a2bb9e2530828f0a8eb3e85b167e5041bdafe32da9b96e2b1eab20eb40b241bb + canonicalized_ast: a2bb9e2530828f0a8eb3e85b167e5041bdafe32da9b96e2b1eab20eb40b241bb + type_inferenced_ast: 075f11e9cbf0068748b01f5d0bfc405810af20119dbbd9093a1b2bd22203bd6d diff --git a/tests/expectations/compiler/compiler/integers/u16/div.leo.out b/tests/expectations/compiler/compiler/integers/u16/div.leo.out index 9cc0f249f8..9484be103c 100644 --- a/tests/expectations/compiler/compiler/integers/u16/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/div.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 9951c318a725992029658c3a45ba687e51b9025bd7e209471e1dac83fda7ae00 - canonicalized_ast: 9951c318a725992029658c3a45ba687e51b9025bd7e209471e1dac83fda7ae00 - type_inferenced_ast: e85bde99e42c696418bb61214dfdc22d0481f413e81ac5890ef63bf4c29a3f6e + initial_ast: fba1d259e91ced687201093a13bdb2a64a8619de11181dae8e678bafb266ab26 + canonicalized_ast: fba1d259e91ced687201093a13bdb2a64a8619de11181dae8e678bafb266ab26 + type_inferenced_ast: 6040d336454b607e2cb7d74b7acf7dec241b6cad880f8380f521d8f8528fa898 diff --git a/tests/expectations/compiler/compiler/integers/u16/eq.leo.out b/tests/expectations/compiler/compiler/integers/u16/eq.leo.out index 7e8be96bd9..8dc08afd48 100644 --- a/tests/expectations/compiler/compiler/integers/u16/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/eq.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: ee65643024461631489070d2e450bbacdd33b94bf3b3c4a465c3aa2c621d1cfc - canonicalized_ast: ee65643024461631489070d2e450bbacdd33b94bf3b3c4a465c3aa2c621d1cfc - type_inferenced_ast: 0d88202e763c4b1dbaa47150aed77abc511ebe2cd1352ccc0926e7e2ac5a874d + initial_ast: 7211ca407cddb5609fa674f2f1fb9b46c271f4ba84313a0e9b36cc577d8177f8 + canonicalized_ast: 7211ca407cddb5609fa674f2f1fb9b46c271f4ba84313a0e9b36cc577d8177f8 + type_inferenced_ast: 7a147bb829943a07cc27567a68da910bb308aae325566a2325e0c2705ff99f4f diff --git a/tests/expectations/compiler/compiler/integers/u16/ge.leo.out b/tests/expectations/compiler/compiler/integers/u16/ge.leo.out index 9e2988d080..bbdf8c36c5 100644 --- a/tests/expectations/compiler/compiler/integers/u16/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/ge.leo.out @@ -28,6 +28,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 55b790c06884aa8e3b3c90d14020080ef8f80e87ecb56bc0b3cf98d522906e91 - canonicalized_ast: 55b790c06884aa8e3b3c90d14020080ef8f80e87ecb56bc0b3cf98d522906e91 - type_inferenced_ast: fcfdcd073d22c15e7018e171c82efc6dc8aa2a77df8557f51991b2265ec39fea + initial_ast: 4277f9a10e6d860833a3a8913496647e8dae5c4c9a7f245aa90751c87eb86005 + canonicalized_ast: 4277f9a10e6d860833a3a8913496647e8dae5c4c9a7f245aa90751c87eb86005 + type_inferenced_ast: 4b164a7ae7660d5faffaabc481a6f15534971f72bed26ef32e180d4c2b5751c1 diff --git a/tests/expectations/compiler/compiler/integers/u16/gt.leo.out b/tests/expectations/compiler/compiler/integers/u16/gt.leo.out index 81ff5179cd..c64d0300c3 100644 --- a/tests/expectations/compiler/compiler/integers/u16/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/gt.leo.out @@ -16,6 +16,6 @@ outputs: - input_file: u16_f.in output: registers: {} - initial_ast: 475f4077b47b7cb63c07bab29c7acc6781e7c5693484c36c982951c0e1850ac7 - canonicalized_ast: 0808701df629a9df6b534097d0e87536c93c8ccd693747085d1f5254214212a4 - type_inferenced_ast: 810d18f1fdbd7769db52937df22f1f27ea1be7923e74fbe2cd2a645cb4d27f1e + initial_ast: 715529d38ecc6658e030e3cc9e4d102ab5639ba4fcd04d5d89f71d2fdce0c0bd + canonicalized_ast: 9ba94d2edcb9a646caf0c03096a519dda36756a621e1248a564c79e6643e50ef + type_inferenced_ast: a5ad7e6424b4e8e936757d419b7cefdae68a6fa0dcff9133bf74cfe65133142d diff --git a/tests/expectations/compiler/compiler/integers/u16/input.leo.out b/tests/expectations/compiler/compiler/integers/u16/input.leo.out index 2856ff4a5b..98333bc834 100644 --- a/tests/expectations/compiler/compiler/integers/u16/input.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/input.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: d3aaf23c5b1383351acd6c0696e70e14c84e9cae56019730a35818fd142b9204 - canonicalized_ast: d3aaf23c5b1383351acd6c0696e70e14c84e9cae56019730a35818fd142b9204 - type_inferenced_ast: 62f1318f2117ce10ca73d902572e8af6d3f97d37fce108403877f50f277e9963 + initial_ast: 03ec5058648376b68253f8e1a2b62d5d00af93669195be90da09193f7cf249b8 + canonicalized_ast: 03ec5058648376b68253f8e1a2b62d5d00af93669195be90da09193f7cf249b8 + type_inferenced_ast: ca7657b4ec4e3df526a37c3168d74a76e043530e56f56491ff73a95590d6e608 diff --git a/tests/expectations/compiler/compiler/integers/u16/le.leo.out b/tests/expectations/compiler/compiler/integers/u16/le.leo.out index 692df5267f..4c0864f655 100644 --- a/tests/expectations/compiler/compiler/integers/u16/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/le.leo.out @@ -28,6 +28,6 @@ outputs: r0: type: bool value: "false" - initial_ast: 34fc9cb86dd1d3ace79e57d9ba989cc2f995d3b61c18f55c2aae502b0fb51ea4 - canonicalized_ast: 34fc9cb86dd1d3ace79e57d9ba989cc2f995d3b61c18f55c2aae502b0fb51ea4 - type_inferenced_ast: 089d93f92c53431f63aabc1d113c1f6dcd6562228d1c2dd3761c937aa91d88ee + initial_ast: 718c99fee53e9add1aafaf1692140151e05f6bbda2c91f28dff583591c25f885 + canonicalized_ast: 718c99fee53e9add1aafaf1692140151e05f6bbda2c91f28dff583591c25f885 + type_inferenced_ast: 9139f4ac9593bdc96d477f02270ca3e57949ce1503fe1db9113b45103c81fa5f diff --git a/tests/expectations/compiler/compiler/integers/u16/lt.leo.out b/tests/expectations/compiler/compiler/integers/u16/lt.leo.out index 232b0e0a61..7a6db1753f 100644 --- a/tests/expectations/compiler/compiler/integers/u16/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/lt.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "false" - initial_ast: dccf5d8cd58b2dbf1680f04107dfe9ab1644ecced22a6256f0d6f1d5ff2d2270 - canonicalized_ast: dccf5d8cd58b2dbf1680f04107dfe9ab1644ecced22a6256f0d6f1d5ff2d2270 - type_inferenced_ast: 66b374f00e25551d6b8f613c65c3cdfca98819252c7b76677837cadb0159eda0 + initial_ast: 3f4455e62c862742538a8ea67eb3cdc88492aa7616a1691cad42e670fca20fc3 + canonicalized_ast: 3f4455e62c862742538a8ea67eb3cdc88492aa7616a1691cad42e670fca20fc3 + type_inferenced_ast: 3efe28c45a9fc97592c7d4ec7c36a6ca0cbb54be2dccc923e68021fbfbeedb1e diff --git a/tests/expectations/compiler/compiler/integers/u16/max.leo.out b/tests/expectations/compiler/compiler/integers/u16/max.leo.out index bb67ba07be..6a24e327b0 100644 --- a/tests/expectations/compiler/compiler/integers/u16/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/max.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: baa6d3c3d700d25eba38c74347a712dc94d47fd44283437649601e60173c0d74 - canonicalized_ast: baa6d3c3d700d25eba38c74347a712dc94d47fd44283437649601e60173c0d74 - type_inferenced_ast: ae44c093359df948b236fd0db5bbfb38c8a793af7bb4ad0491d9ed71f9cd5f5b + initial_ast: 48357892c03a4ed6bfc71fbee106bef0c57939aa3f90d0b902e26133373d90d0 + canonicalized_ast: 48357892c03a4ed6bfc71fbee106bef0c57939aa3f90d0b902e26133373d90d0 + type_inferenced_ast: 6d33448fcb77a5789544c32ef26bdf9cb5dc357dea9e99c6444e137644e837ff diff --git a/tests/expectations/compiler/compiler/integers/u16/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/u16/max_fail.leo.out index 4d3de310ca..b249cb3754 100644 --- a/tests/expectations/compiler/compiler/integers/u16/max_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/max_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:20\n |\n 4 | const a: u16 = 65536;\n | ^^^^^\n |\n = failed to parse int value '65536'" + - "Error [EASG0373031]: failed to parse int value '65536'\n --> compiler-test:4:20\n |\n 4 | const a: u16 = 65536;\n | ^^^^^" diff --git a/tests/expectations/compiler/compiler/integers/u16/min.leo.out b/tests/expectations/compiler/compiler/integers/u16/min.leo.out index ec6c1482a7..988ad9e314 100644 --- a/tests/expectations/compiler/compiler/integers/u16/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/min.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: cde26bef80f68049390ccde167fa99e92595c4f28049540922710fcd5c848c03 - canonicalized_ast: cde26bef80f68049390ccde167fa99e92595c4f28049540922710fcd5c848c03 - type_inferenced_ast: 22350cdbf4a782784b7d68022fda1db95e089d3f548517a34fbce0beb7189682 + initial_ast: 7400309603e4020cc0652a55937fd70bdf280ba8f7ae1fb9150b0da6c5024040 + canonicalized_ast: 7400309603e4020cc0652a55937fd70bdf280ba8f7ae1fb9150b0da6c5024040 + type_inferenced_ast: 6c842e1f5b09f2d65ebddc1ff0a32656184920b9e408cda403f801b43dceec1a diff --git a/tests/expectations/compiler/compiler/integers/u16/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/u16/min_fail.leo.out index d227adfb91..7f1c33ece7 100644 --- a/tests/expectations/compiler/compiler/integers/u16/min_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/min_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:20\n |\n 4 | const a: u16 = -1;\n | ^^\n |\n = failed to parse int value '-1'" + - "Error [EASG0373031]: failed to parse int value '-1'\n --> compiler-test:4:20\n |\n 4 | const a: u16 = -1;\n | ^^" diff --git a/tests/expectations/compiler/compiler/integers/u16/mul.leo.out b/tests/expectations/compiler/compiler/integers/u16/mul.leo.out index 1239a88cee..a95b30f04e 100644 --- a/tests/expectations/compiler/compiler/integers/u16/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/mul.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "false" - initial_ast: 2eefc41f982ec20bc145b7a5dd34d87aad66e0852abf44a9415ee4e0401aca04 - canonicalized_ast: 2eefc41f982ec20bc145b7a5dd34d87aad66e0852abf44a9415ee4e0401aca04 - type_inferenced_ast: e8898c8abc5eea0b22fc9f8eb61b6b37f79351f1fed4c490a83256da66a84b58 + initial_ast: c2e0b9bb222645fdaea216b5238168b32a41f7a84cf5ab438b566fb8a5de8a07 + canonicalized_ast: c2e0b9bb222645fdaea216b5238168b32a41f7a84cf5ab438b566fb8a5de8a07 + type_inferenced_ast: ed2bfbd8422254e12d01329641853001fef94e8de97bd71dba95d0f7c05763c8 diff --git a/tests/expectations/compiler/compiler/integers/u16/ne.leo.out b/tests/expectations/compiler/compiler/integers/u16/ne.leo.out index 6956cac42f..78866a8993 100644 --- a/tests/expectations/compiler/compiler/integers/u16/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/ne.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: ac5862d330de9916c7c9f7ed0110adaad26a887d3cd82d8c1b736d595e6445ae - canonicalized_ast: ac5862d330de9916c7c9f7ed0110adaad26a887d3cd82d8c1b736d595e6445ae - type_inferenced_ast: a9618c9c126d8391bcf375f87c3a6a2aa100af711603779fdfb0dad4768d3276 + initial_ast: ce9bcbfa9b4a9445b5df9fd95765c97572fc9c0c8ec07619711bceb84685e972 + canonicalized_ast: ce9bcbfa9b4a9445b5df9fd95765c97572fc9c0c8ec07619711bceb84685e972 + type_inferenced_ast: 1bf0be499a5225eed5505672c01840fada9784d29430a9cbebbb2beb931cdf90 diff --git a/tests/expectations/compiler/compiler/integers/u16/negative_input_fail.leo.out b/tests/expectations/compiler/compiler/integers/u16/negative_input_fail.leo.out index 26835ff1a3..55d679debc 100644 --- a/tests/expectations/compiler/compiler/integers/u16/negative_input_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/negative_input_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:15\n |\n 3 | function main(a: u16) {}\n | ^\n |\n = failed to parse `-2` as expected integer type" + - "Error [ECMP0376089]: failed to parse `-2` as expected integer type\n --> compiler-test:3:15\n |\n 3 | function main(a: u16) {}\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u16/no_space_between_literal.leo.out b/tests/expectations/compiler/compiler/integers/u16/no_space_between_literal.leo.out index 1a5abecdc0..852084492c 100644 --- a/tests/expectations/compiler/compiler/integers/u16/no_space_between_literal.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/no_space_between_literal.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:15\n |\n 4 | const i = 1 u16;\n | ^\n |\n = Unexpected white space between terms 1 and u16" + - "Error [EPAR0370004]: Unexpected white space between terms 1 and u16\n --> compiler-test:4:15\n |\n 4 | const i = 1 u16;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u16/sub.leo.out b/tests/expectations/compiler/compiler/integers/u16/sub.leo.out index 5a34c65a38..a0137217f5 100644 --- a/tests/expectations/compiler/compiler/integers/u16/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/sub.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 7f4ed5b88303c057d83ac580c857cca2fa3a38ab7e8d381bc0efc1fb280edc85 - canonicalized_ast: 7f4ed5b88303c057d83ac580c857cca2fa3a38ab7e8d381bc0efc1fb280edc85 - type_inferenced_ast: 8afc96f5b6a18bb7677735c62e478e49cf801ca9832311ebe95c89f6df422f88 + initial_ast: b67a2e773d463a9a22023e35db7533c2eb7d3114d945389869ab9652858ef86b + canonicalized_ast: b67a2e773d463a9a22023e35db7533c2eb7d3114d945389869ab9652858ef86b + type_inferenced_ast: 3b23e1f8b696bc24776da8bc0255aa12ea92d30853ab4fd65cd1ef6a9b2a4eae diff --git a/tests/expectations/compiler/compiler/integers/u16/ternary.leo.out b/tests/expectations/compiler/compiler/integers/u16/ternary.leo.out index 45a5ddd8f7..7541604642 100644 --- a/tests/expectations/compiler/compiler/integers/u16/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/ternary.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: f927dbe131a6f1be4cfc941aebdd4670591edd75215d54e2dc98a86f8dcfc3de - canonicalized_ast: f927dbe131a6f1be4cfc941aebdd4670591edd75215d54e2dc98a86f8dcfc3de - type_inferenced_ast: e4ca23e9cbea206e5c32d057ec7a93f5ef36d5745314f44f9467fa173fb7bf6f + initial_ast: e441bec546c1972253e0ebf895c44a50f708139e5dbf89416cc05dabf4f4a6c4 + canonicalized_ast: e441bec546c1972253e0ebf895c44a50f708139e5dbf89416cc05dabf4f4a6c4 + type_inferenced_ast: ba45b5d07a22a70e60b431c4b1f592c4e363a1b6dab1e1c08729781eeafc6f17 diff --git a/tests/expectations/compiler/compiler/integers/u32/add.leo.out b/tests/expectations/compiler/compiler/integers/u32/add.leo.out index d327d27a52..a070a8fb31 100644 --- a/tests/expectations/compiler/compiler/integers/u32/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/add.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 3cdca25e10098f45cf439da379aed56b4fe78e35632cb1bac655c8478f51d9cd - canonicalized_ast: 3cdca25e10098f45cf439da379aed56b4fe78e35632cb1bac655c8478f51d9cd - type_inferenced_ast: 84e885f56b08587f875e94a570bf977844b511fb85f7689df660e6ce69b2706e + initial_ast: f10819ad044f53a8a3b671d0591b6e3a8f555080687525e06adc95188a80f71e + canonicalized_ast: f10819ad044f53a8a3b671d0591b6e3a8f555080687525e06adc95188a80f71e + type_inferenced_ast: 9cec0b625c5a8c2de17452989238aa20db015ae707d4a3042974b50381360224 diff --git a/tests/expectations/compiler/compiler/integers/u32/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/u32/console_assert.leo.out index 0bf7ff83ec..42e33e1842 100644 --- a/tests/expectations/compiler/compiler/integers/u32/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/console_assert.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 76b7c73c53d4e59406ba165352d155bf05d5c3615c89ef53ddc2b8ae931bfb85 - canonicalized_ast: 76b7c73c53d4e59406ba165352d155bf05d5c3615c89ef53ddc2b8ae931bfb85 - type_inferenced_ast: ea4d79e6a2877efdc838d54fb7112dfef314b8e82369e91ebf102db9b393ab76 + initial_ast: 3d1a9a1636ee03ed67340d77be57cbfe6f90937af1a244eaf060d102ddab7e51 + canonicalized_ast: 3d1a9a1636ee03ed67340d77be57cbfe6f90937af1a244eaf060d102ddab7e51 + type_inferenced_ast: 484e7e0cff2392a2d43275369e22167a6d2cf5a0370961001cf99316c7873907 diff --git a/tests/expectations/compiler/compiler/integers/u32/div.leo.out b/tests/expectations/compiler/compiler/integers/u32/div.leo.out index 4ec97fc037..88e64d268b 100644 --- a/tests/expectations/compiler/compiler/integers/u32/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/div.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 0023392b04189309efb4fc89df4887595d3824e51cb2bf33c3159a88bcd3f7b5 - canonicalized_ast: 0023392b04189309efb4fc89df4887595d3824e51cb2bf33c3159a88bcd3f7b5 - type_inferenced_ast: 50641a3a2bd7b33c4ff6698b185066cd3ecfcf52497ea39151c3d7d34ce12510 + initial_ast: 798cc70fe6a9278982e9a909162a64607c18320d67f2b69c986f12013c747015 + canonicalized_ast: 798cc70fe6a9278982e9a909162a64607c18320d67f2b69c986f12013c747015 + type_inferenced_ast: 39db1d36fd3893d40b5ab07a9e9cfa68a7cfe740d125ea86761f315cd49af950 diff --git a/tests/expectations/compiler/compiler/integers/u32/eq.leo.out b/tests/expectations/compiler/compiler/integers/u32/eq.leo.out index b2c643d155..557e311e1b 100644 --- a/tests/expectations/compiler/compiler/integers/u32/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/eq.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 371541762c95ceedd6735521918ca19a2c1ff9b5ac7fc03ca932a18576977f50 - canonicalized_ast: 371541762c95ceedd6735521918ca19a2c1ff9b5ac7fc03ca932a18576977f50 - type_inferenced_ast: 265d8fd8db8983f9398efe61fd36176ee4449ee632ea9219b7e1ee6a1b1edda5 + initial_ast: ecd942a96ad98756ca2fa708167e33843806613ba636818e23d0991c165fb131 + canonicalized_ast: ecd942a96ad98756ca2fa708167e33843806613ba636818e23d0991c165fb131 + type_inferenced_ast: d654592bf733d63af723b43c0a08e5b93d8cd6e73ad25f1ec4ba1d44ce79e8c6 diff --git a/tests/expectations/compiler/compiler/integers/u32/ge.leo.out b/tests/expectations/compiler/compiler/integers/u32/ge.leo.out index 03ede53117..2dae0372fb 100644 --- a/tests/expectations/compiler/compiler/integers/u32/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/ge.leo.out @@ -28,6 +28,6 @@ outputs: r0: type: bool value: "true" - initial_ast: d53d5822cea427e9892561559b8a7fe3a3a4ee92f5dfc07e52dd554bec2e0812 - canonicalized_ast: d53d5822cea427e9892561559b8a7fe3a3a4ee92f5dfc07e52dd554bec2e0812 - type_inferenced_ast: 89b7a155fdf0333d66156431437983de4d818b754a18ed00693697e7dc71277a + initial_ast: e6b610505dd516b2b145961540e2426d0e75c8b1f81b837cbda77f99edb4cbc4 + canonicalized_ast: e6b610505dd516b2b145961540e2426d0e75c8b1f81b837cbda77f99edb4cbc4 + type_inferenced_ast: a92ae1efacdcf3737670c23301dcb3fd45ccb65bf07327587f3bcb891544df17 diff --git a/tests/expectations/compiler/compiler/integers/u32/gt.leo.out b/tests/expectations/compiler/compiler/integers/u32/gt.leo.out index 215e301f1a..4debf3e335 100644 --- a/tests/expectations/compiler/compiler/integers/u32/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/gt.leo.out @@ -16,6 +16,6 @@ outputs: - input_file: u32_f.in output: registers: {} - initial_ast: f6b0f84faf3d622d320ea867bf9bd76485633dfae6a41158e0e265880b5fb750 - canonicalized_ast: 5e63641393a51590ce9940712bd01ddb445cf3af3b5c5ffa02d9ca1dddccf03e - type_inferenced_ast: 79dc9917db6925b4d5a1f5aaa15362b55172133be5d088eb73cd7e8029ff710c + initial_ast: 7ff355da2848c6f06892c90a93e1f12095a329dd9fe935ea5c8e1b009b21fa13 + canonicalized_ast: 31547c73b8283e8dc9007834657c9c8de55a0fe50f94d984e93569b9453bc9e7 + type_inferenced_ast: 55d7111ec36845c585d6280723e495df997c058fdf4067c923df944f4903a76a diff --git a/tests/expectations/compiler/compiler/integers/u32/input.leo.out b/tests/expectations/compiler/compiler/integers/u32/input.leo.out index cd14f2e972..053af4bb9f 100644 --- a/tests/expectations/compiler/compiler/integers/u32/input.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/input.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 7f3c18f7e6aa4bf261d1778234a885ff1da3627e74e45498f059c4e616847f5b - canonicalized_ast: 7f3c18f7e6aa4bf261d1778234a885ff1da3627e74e45498f059c4e616847f5b - type_inferenced_ast: 8db8e90395fff2d51dbe280f9aa1825129eeaa45bd84d228017927d2f6bea467 + initial_ast: 090c66945914ad5529e831599c526737da325f6a8a2850ca5b77e2b7e773765e + canonicalized_ast: 090c66945914ad5529e831599c526737da325f6a8a2850ca5b77e2b7e773765e + type_inferenced_ast: 8ce7db653b5ec60f5defef5c12bc6786c6177cef85f847a3420254803d1334ef diff --git a/tests/expectations/compiler/compiler/integers/u32/le.leo.out b/tests/expectations/compiler/compiler/integers/u32/le.leo.out index 75b54b5fb6..48d355f00e 100644 --- a/tests/expectations/compiler/compiler/integers/u32/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/le.leo.out @@ -28,6 +28,6 @@ outputs: r0: type: bool value: "false" - initial_ast: 18af75f75099b7ed0d8337cbc39602d0276d9be538b27f07931e3310e6b674a0 - canonicalized_ast: 18af75f75099b7ed0d8337cbc39602d0276d9be538b27f07931e3310e6b674a0 - type_inferenced_ast: 9da02a49544ec4496d6189199c628b313d4b3d2b792627a71bf11015380cae38 + initial_ast: fa56d415b885a524625c80c4ecb8b5248b7c0e9fc97e635940621bc35edd644c + canonicalized_ast: fa56d415b885a524625c80c4ecb8b5248b7c0e9fc97e635940621bc35edd644c + type_inferenced_ast: d7858764eaf0c79969bed850e695949547e7f728478f24f04cf7a129b8aae23c diff --git a/tests/expectations/compiler/compiler/integers/u32/lt.leo.out b/tests/expectations/compiler/compiler/integers/u32/lt.leo.out index 69996e84f0..bccd5c9570 100644 --- a/tests/expectations/compiler/compiler/integers/u32/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/lt.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "false" - initial_ast: 75eaf809a1c09171ebc028382936ee07c942774f2b20c143590049afe7474c4f - canonicalized_ast: 75eaf809a1c09171ebc028382936ee07c942774f2b20c143590049afe7474c4f - type_inferenced_ast: ac0f96eae8db0d2820c9fa737a9a5571fda10507f3f5f7a50cf989c797d181c3 + initial_ast: ddeff838aaf5674520256362240e9d5429ddf81c3fef3e0fabd649355ee835b4 + canonicalized_ast: ddeff838aaf5674520256362240e9d5429ddf81c3fef3e0fabd649355ee835b4 + type_inferenced_ast: 8c346798879aa2297adb5345d00f7f397e06f9470c9d0bf6ac7400045689adb7 diff --git a/tests/expectations/compiler/compiler/integers/u32/max.leo.out b/tests/expectations/compiler/compiler/integers/u32/max.leo.out index 63325d2dbb..f476068aa3 100644 --- a/tests/expectations/compiler/compiler/integers/u32/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/max.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 86fb7cf305725e7fe097d418ce22135a3e5385bfc6b8d31701aef7d5dad25282 - canonicalized_ast: 86fb7cf305725e7fe097d418ce22135a3e5385bfc6b8d31701aef7d5dad25282 - type_inferenced_ast: b369199bcd968cc175d6f634bc2de4cb8c73b0addc64ac7b457216bfc955e8fa + initial_ast: aeb0761c396b19a2d4067ecfc8a7291e8391935c7573d02fa78cba8950573321 + canonicalized_ast: aeb0761c396b19a2d4067ecfc8a7291e8391935c7573d02fa78cba8950573321 + type_inferenced_ast: 899d5481e2f648e246c22e0118919721aa3289e307558695083e1a1d81178bc1 diff --git a/tests/expectations/compiler/compiler/integers/u32/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/u32/max_fail.leo.out index 137aa789b5..9846c671e1 100644 --- a/tests/expectations/compiler/compiler/integers/u32/max_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/max_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:20\n |\n 4 | const a: u32 = 4294967296;\n | ^^^^^^^^^^\n |\n = failed to parse int value '4294967296'" + - "Error [EASG0373031]: failed to parse int value '4294967296'\n --> compiler-test:4:20\n |\n 4 | const a: u32 = 4294967296;\n | ^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/integers/u32/min.leo.out b/tests/expectations/compiler/compiler/integers/u32/min.leo.out index 78f5fd210e..cafb7cf89e 100644 --- a/tests/expectations/compiler/compiler/integers/u32/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/min.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 0f47e2dde68637ea7d0c54a8fcbd2b0cd767e4c35c646154e5519287d3f015ef - canonicalized_ast: 0f47e2dde68637ea7d0c54a8fcbd2b0cd767e4c35c646154e5519287d3f015ef - type_inferenced_ast: a94c8bd9f0535c2c705cb6124179a9106c9e75d2a29ef5b704096e37e58b0878 + initial_ast: 9c2ffa0ce38d27afc091a6f70b06ac873bd8d8a1ac729581f1e8dded22bbc21e + canonicalized_ast: 9c2ffa0ce38d27afc091a6f70b06ac873bd8d8a1ac729581f1e8dded22bbc21e + type_inferenced_ast: a744410c84202b558cd1047c21fcc9d9a9a264dccc4320ffdd14c0794ac01fb7 diff --git a/tests/expectations/compiler/compiler/integers/u32/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/u32/min_fail.leo.out index 2971bc63a3..28202851e3 100644 --- a/tests/expectations/compiler/compiler/integers/u32/min_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/min_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:20\n |\n 4 | const a: u32 = -1;\n | ^^\n |\n = failed to parse int value '-1'" + - "Error [EASG0373031]: failed to parse int value '-1'\n --> compiler-test:4:20\n |\n 4 | const a: u32 = -1;\n | ^^" diff --git a/tests/expectations/compiler/compiler/integers/u32/mul.leo.out b/tests/expectations/compiler/compiler/integers/u32/mul.leo.out index 4da19d0cd6..a652fb8dac 100644 --- a/tests/expectations/compiler/compiler/integers/u32/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/mul.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "false" - initial_ast: ac19676e4ebd9d5aefb5d5baa0fa477a6b4783efc6b1a599c8128259fa7aa55f - canonicalized_ast: ac19676e4ebd9d5aefb5d5baa0fa477a6b4783efc6b1a599c8128259fa7aa55f - type_inferenced_ast: 34d947a7132f4fd5693babadabb9c05cab523a6d2bce9dbd7da41ad435ac9702 + initial_ast: e30fe6132ab7cc5d0c379a8efa1b5d2cc11804aab0dc1f1e418669177b14a221 + canonicalized_ast: e30fe6132ab7cc5d0c379a8efa1b5d2cc11804aab0dc1f1e418669177b14a221 + type_inferenced_ast: 66befce06d14b7d2177435336a1b1a8cf8188ca87de6179d73d8fa50460a287b diff --git a/tests/expectations/compiler/compiler/integers/u32/ne.leo.out b/tests/expectations/compiler/compiler/integers/u32/ne.leo.out index 7697ba7bd8..43629c277b 100644 --- a/tests/expectations/compiler/compiler/integers/u32/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/ne.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 9ed438102f8938306421dce802d9af7f11366e91d2c6acc840dae1f3f9950e54 - canonicalized_ast: 9ed438102f8938306421dce802d9af7f11366e91d2c6acc840dae1f3f9950e54 - type_inferenced_ast: 3132b80f6e14eb276fed053ce4ad86376599df2568e85b54f53e3dd55ef1ac4b + initial_ast: 44c8fedb883b67bedc8f0d89acd32fd9d89adff22c297e6e916c23f73ba2f658 + canonicalized_ast: 44c8fedb883b67bedc8f0d89acd32fd9d89adff22c297e6e916c23f73ba2f658 + type_inferenced_ast: 79c741c6750d6b62567323c5d03683afc13fe873bed95fbccd0a1afff0e05b77 diff --git a/tests/expectations/compiler/compiler/integers/u32/negative_input_fail.leo.out b/tests/expectations/compiler/compiler/integers/u32/negative_input_fail.leo.out index 571a550017..122639ac74 100644 --- a/tests/expectations/compiler/compiler/integers/u32/negative_input_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/negative_input_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:15\n |\n 3 | function main(a: u32) {}\n | ^\n |\n = failed to parse `-2` as expected integer type" + - "Error [ECMP0376089]: failed to parse `-2` as expected integer type\n --> compiler-test:3:15\n |\n 3 | function main(a: u32) {}\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u32/no_space_between_literal.leo.out b/tests/expectations/compiler/compiler/integers/u32/no_space_between_literal.leo.out index b778c57782..4974811270 100644 --- a/tests/expectations/compiler/compiler/integers/u32/no_space_between_literal.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/no_space_between_literal.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:15\n |\n 4 | const i = 1 u32;\n | ^\n |\n = Unexpected white space between terms 1 and u32" + - "Error [EPAR0370004]: Unexpected white space between terms 1 and u32\n --> compiler-test:4:15\n |\n 4 | const i = 1 u32;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u32/sub.leo.out b/tests/expectations/compiler/compiler/integers/u32/sub.leo.out index 9c227add1c..98c34dec75 100644 --- a/tests/expectations/compiler/compiler/integers/u32/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/sub.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: f55fe0801c2e593e2599fffd34a89073ff85f9aa462cbfbcd20c0e38e42eaa4d - canonicalized_ast: f55fe0801c2e593e2599fffd34a89073ff85f9aa462cbfbcd20c0e38e42eaa4d - type_inferenced_ast: 8640b596fc3d7e4b3999808a51eff9a72422fc02f2ea3b690b62a6ec56e215c0 + initial_ast: 9363bcdbcf89167438f75e5b5ae11f8e5968c4272dacecdb85d67d6627b38577 + canonicalized_ast: 9363bcdbcf89167438f75e5b5ae11f8e5968c4272dacecdb85d67d6627b38577 + type_inferenced_ast: edcb1c406e76f79ebf13bb46ce327e7cb9b0b8e86b1bc3affeaf69d574da9f06 diff --git a/tests/expectations/compiler/compiler/integers/u32/ternary.leo.out b/tests/expectations/compiler/compiler/integers/u32/ternary.leo.out index b3d0e27ea5..5623951925 100644 --- a/tests/expectations/compiler/compiler/integers/u32/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/ternary.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 348ad049a3930eb4f477d98447b8172cca5d163e320e9774111d739d95017c83 - canonicalized_ast: 348ad049a3930eb4f477d98447b8172cca5d163e320e9774111d739d95017c83 - type_inferenced_ast: 7daa91267c1c26560e7e557d7f14d473283c40bf86ffcbff6944d251fb0e1fc5 + initial_ast: f9ef32ac860724ac62be23d9a9059a2b65cd19decda7e133e478951c9b2d220f + canonicalized_ast: f9ef32ac860724ac62be23d9a9059a2b65cd19decda7e133e478951c9b2d220f + type_inferenced_ast: 3ca5c353bf2c9b669e16c01055e96643b3ce99bd9cbb6932d97c2d4560d9f518 diff --git a/tests/expectations/compiler/compiler/integers/u64/add.leo.out b/tests/expectations/compiler/compiler/integers/u64/add.leo.out index 61f673a7f2..226962df02 100644 --- a/tests/expectations/compiler/compiler/integers/u64/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/add.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: d95c70849974223610dd12a4f9f19e2bb8f5c4e1420cae873a6c49043b7cc9ae - canonicalized_ast: d95c70849974223610dd12a4f9f19e2bb8f5c4e1420cae873a6c49043b7cc9ae - type_inferenced_ast: e8eaafd43cafab1cb14addae2196b1d21fc66ce46bedd84580f4654d646bd5de + initial_ast: 8ed9caa46664d975d35eb60f780cc2d3544924d0458b5cd2005262f42cb92120 + canonicalized_ast: 8ed9caa46664d975d35eb60f780cc2d3544924d0458b5cd2005262f42cb92120 + type_inferenced_ast: 1c5761507087bc2a5357df29e0a19f9ed1c5aeb4c72ccd314456d46a02704d3d diff --git a/tests/expectations/compiler/compiler/integers/u64/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/u64/console_assert.leo.out index 52a21b85fb..99fc709a17 100644 --- a/tests/expectations/compiler/compiler/integers/u64/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/console_assert.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 1253b2000d11aaa4395514ee30cefe4027f5cda72bf58cc45a4f873ef4832ea3 - canonicalized_ast: 1253b2000d11aaa4395514ee30cefe4027f5cda72bf58cc45a4f873ef4832ea3 - type_inferenced_ast: 778f30fa8a0cf65b670c1365a71090c4360bad18d4d7f4e65d60d014c9bf6f44 + initial_ast: daf304ae1131ed48f9ca749a7499f095d934bc2ad94cbefe314d0f86fdb4300c + canonicalized_ast: daf304ae1131ed48f9ca749a7499f095d934bc2ad94cbefe314d0f86fdb4300c + type_inferenced_ast: ce627c98acedf9702277dd9bd4d288afe7802a6a4ee5acac4b1f44ee24065800 diff --git a/tests/expectations/compiler/compiler/integers/u64/div.leo.out b/tests/expectations/compiler/compiler/integers/u64/div.leo.out index 2cd3058503..f6f571b6cd 100644 --- a/tests/expectations/compiler/compiler/integers/u64/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/div.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: e303c8ef226f3d7681188a7b97762123b0a4e6bb420a6b26cd4edba8ba068538 - canonicalized_ast: e303c8ef226f3d7681188a7b97762123b0a4e6bb420a6b26cd4edba8ba068538 - type_inferenced_ast: 5f16462ba03f7c86f94bc47e8b0f6996cd72e22a538ac2adc5db52f68162aa40 + initial_ast: eb289b91dade0e281729f77e79d0ab874871c55e6691545fb71d335710564ea3 + canonicalized_ast: eb289b91dade0e281729f77e79d0ab874871c55e6691545fb71d335710564ea3 + type_inferenced_ast: 59b56c3679803203430078cb0b7f8cb43cc687fb10255186493dd94336f93fcd diff --git a/tests/expectations/compiler/compiler/integers/u64/eq.leo.out b/tests/expectations/compiler/compiler/integers/u64/eq.leo.out index c30519eba9..888715eae6 100644 --- a/tests/expectations/compiler/compiler/integers/u64/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/eq.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 222fd1d5b29034866f229ad755a6bdbfc2e7f917208e682ce0ff77d88866008d - canonicalized_ast: 222fd1d5b29034866f229ad755a6bdbfc2e7f917208e682ce0ff77d88866008d - type_inferenced_ast: 794c731afca4579f619aba3379f12bbe71fb4ebc5d256858534ba04b90855e03 + initial_ast: 53edaeebce5575703624feee65798bfd25e4df0797a91d16108dc4843f1be02b + canonicalized_ast: 53edaeebce5575703624feee65798bfd25e4df0797a91d16108dc4843f1be02b + type_inferenced_ast: 79b5ea87295fa54684abace26c0557d87f3966ec08b887cff117bd7c35cb2754 diff --git a/tests/expectations/compiler/compiler/integers/u64/ge.leo.out b/tests/expectations/compiler/compiler/integers/u64/ge.leo.out index 888845a32b..8bbf4fec1f 100644 --- a/tests/expectations/compiler/compiler/integers/u64/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/ge.leo.out @@ -28,6 +28,6 @@ outputs: r0: type: bool value: "true" - initial_ast: c6293b8d2605a06f84a32975756d8a7ae7ad6537fc6ed0dedf01c9046f159331 - canonicalized_ast: c6293b8d2605a06f84a32975756d8a7ae7ad6537fc6ed0dedf01c9046f159331 - type_inferenced_ast: b594f5f48db0a85abdf9fd0b0f76ca69b5405558e1382dfdaa24fce91513c744 + initial_ast: 1754afabf1a32941b5b59c8c3e6fd6299067d6cec13d9a0e9e2a4bebb48113e7 + canonicalized_ast: 1754afabf1a32941b5b59c8c3e6fd6299067d6cec13d9a0e9e2a4bebb48113e7 + type_inferenced_ast: a2c0598451ec27d8297cd1348eb7b459d021e8a0a57111cef5afbb27952995b2 diff --git a/tests/expectations/compiler/compiler/integers/u64/gt.leo.out b/tests/expectations/compiler/compiler/integers/u64/gt.leo.out index 98c227889f..8088a00842 100644 --- a/tests/expectations/compiler/compiler/integers/u64/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/gt.leo.out @@ -16,6 +16,6 @@ outputs: - input_file: u64_f.in output: registers: {} - initial_ast: 524f0311db9ed25bfbd275b2b8432619759d34e1e7d3fcdee179fbb6748a03e1 - canonicalized_ast: cd942d4aa34b649b89e03c308dc28d17e6fbae052382b6e50989b4c6ce600c96 - type_inferenced_ast: f61e2cdef40c057d782467f2b9ad84e7b2163de25af72c6ed2498e5d4b9517cd + initial_ast: 384354a0bccb67829fa7f3fd0e4dc1a1366678284e840d65e0c595828d0544ae + canonicalized_ast: 88e2646b980419e191f5423ee2fe73c863135c460cd36540f152c04a6d5a3a84 + type_inferenced_ast: c1fbef1103029da2f839684e2d8472adafa83b3d666953d37dd24f1a964f05a9 diff --git a/tests/expectations/compiler/compiler/integers/u64/input.leo.out b/tests/expectations/compiler/compiler/integers/u64/input.leo.out index 2c1b6bd0b6..37fafee1b5 100644 --- a/tests/expectations/compiler/compiler/integers/u64/input.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/input.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: f2efb64bbf451e4e1c7c1e9b24ceb40894b72f1769604c62314b729a9fc75a6e - canonicalized_ast: f2efb64bbf451e4e1c7c1e9b24ceb40894b72f1769604c62314b729a9fc75a6e - type_inferenced_ast: bf576998fff80ab652bbcc2aaba9f374650d94c9327d19bc436957360505024b + initial_ast: c99357fe991d4e17756a7efcc2770a693dc53e47a3fcfcdb44c2996b844c8cb2 + canonicalized_ast: c99357fe991d4e17756a7efcc2770a693dc53e47a3fcfcdb44c2996b844c8cb2 + type_inferenced_ast: f5bf4f3724634571b2b4f5f15402c0da5665983bf35d0e0724fb246e48fb8606 diff --git a/tests/expectations/compiler/compiler/integers/u64/le.leo.out b/tests/expectations/compiler/compiler/integers/u64/le.leo.out index 13bd185de7..bdbb9e034c 100644 --- a/tests/expectations/compiler/compiler/integers/u64/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/le.leo.out @@ -28,6 +28,6 @@ outputs: r0: type: bool value: "false" - initial_ast: 3b6aa21f4293ef2b0557303f8ba98a62a72afda56be36f9feff58ede48c87aae - canonicalized_ast: 3b6aa21f4293ef2b0557303f8ba98a62a72afda56be36f9feff58ede48c87aae - type_inferenced_ast: 854beacb056af4a0e44c2f824467105a8ac4334efd0d2b51e7e09b44ff300d79 + initial_ast: c2d16b3c14420d013ff5b1531c0a4e461053fd5e507f0031f428ae1b7ff213f5 + canonicalized_ast: c2d16b3c14420d013ff5b1531c0a4e461053fd5e507f0031f428ae1b7ff213f5 + type_inferenced_ast: 586cb64af9fadad9c01a4ea8b17655a8ef39a8362770a27d7ea280b030c49063 diff --git a/tests/expectations/compiler/compiler/integers/u64/lt.leo.out b/tests/expectations/compiler/compiler/integers/u64/lt.leo.out index cbedd2cda9..716f94923c 100644 --- a/tests/expectations/compiler/compiler/integers/u64/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/lt.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "false" - initial_ast: 1ed483794437131fc09605e7032fecb72d3e3f9534ff26cd4e5b8ac3017609fe - canonicalized_ast: 1ed483794437131fc09605e7032fecb72d3e3f9534ff26cd4e5b8ac3017609fe - type_inferenced_ast: eb1c5645868ccde01d29ac0c07986cbb95e021879228d8e14330851de369090c + initial_ast: d77a1d0ca39da7cd1b08d4f7ee064cd1592edd78fca87fbe633a92e8013c7010 + canonicalized_ast: d77a1d0ca39da7cd1b08d4f7ee064cd1592edd78fca87fbe633a92e8013c7010 + type_inferenced_ast: 5710ebb9c5ef7bf328a4f9a272a311bce64192f423097a707f08e55ae98915bc diff --git a/tests/expectations/compiler/compiler/integers/u64/max.leo.out b/tests/expectations/compiler/compiler/integers/u64/max.leo.out index 7ad47d005d..329bfca76c 100644 --- a/tests/expectations/compiler/compiler/integers/u64/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/max.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: b49c4593620c14da622903ba513c21a1d6111c001fb424b7d96be11b354917eb - canonicalized_ast: b49c4593620c14da622903ba513c21a1d6111c001fb424b7d96be11b354917eb - type_inferenced_ast: 8b3f84f71975ef760fe9d6eeff136fd8512472ad3abc996adf690d3878b74648 + initial_ast: 450969fc4516c60af9708bdee8269cd5c69c28e2e3cc6169a73d13b992ba21bc + canonicalized_ast: 450969fc4516c60af9708bdee8269cd5c69c28e2e3cc6169a73d13b992ba21bc + type_inferenced_ast: 2e352f853185b84705dcc4b42090bee3d7c9a8f4cf637fd0513c7f0091a5cd33 diff --git a/tests/expectations/compiler/compiler/integers/u64/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/u64/max_fail.leo.out index 94fb8ff65e..4636c42cf2 100644 --- a/tests/expectations/compiler/compiler/integers/u64/max_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/max_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:20\n |\n 4 | const a: u64 = 18446744073709551616;\n | ^^^^^^^^^^^^^^^^^^^^\n |\n = failed to parse int value '18446744073709551616'" + - "Error [EASG0373031]: failed to parse int value '18446744073709551616'\n --> compiler-test:4:20\n |\n 4 | const a: u64 = 18446744073709551616;\n | ^^^^^^^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/integers/u64/min.leo.out b/tests/expectations/compiler/compiler/integers/u64/min.leo.out index a3fccfd66c..30843ae5e3 100644 --- a/tests/expectations/compiler/compiler/integers/u64/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/min.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: e47e8d39fbf56125e94cd55a805a9bbe8c9fbc5098703f4996cd98e693fccd1e - canonicalized_ast: e47e8d39fbf56125e94cd55a805a9bbe8c9fbc5098703f4996cd98e693fccd1e - type_inferenced_ast: 6231c1ee6ec45f84e45f21b304beadc0cff11ef5865609e0d495cc6f4bf674df + initial_ast: d7b255884235b2a8e507621b310294d3ebbf875fecc7c5322df3251cab6ded9c + canonicalized_ast: d7b255884235b2a8e507621b310294d3ebbf875fecc7c5322df3251cab6ded9c + type_inferenced_ast: 6933f229d9a8b5d464f20d8efa88354d82fb51e868db11ad37c32f12dc328540 diff --git a/tests/expectations/compiler/compiler/integers/u64/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/u64/min_fail.leo.out index 297cf5e8df..a33bae4611 100644 --- a/tests/expectations/compiler/compiler/integers/u64/min_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/min_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:20\n |\n 4 | const a: u64 = -1;\n | ^^\n |\n = failed to parse int value '-1'" + - "Error [EASG0373031]: failed to parse int value '-1'\n --> compiler-test:4:20\n |\n 4 | const a: u64 = -1;\n | ^^" diff --git a/tests/expectations/compiler/compiler/integers/u64/mul.leo.out b/tests/expectations/compiler/compiler/integers/u64/mul.leo.out index 95b772863a..79538fd5ac 100644 --- a/tests/expectations/compiler/compiler/integers/u64/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/mul.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "false" - initial_ast: 065d2d9b6131ac01f764c77939c52ee25cd43f3d770d99662bb02c534ecb4bab - canonicalized_ast: 065d2d9b6131ac01f764c77939c52ee25cd43f3d770d99662bb02c534ecb4bab - type_inferenced_ast: aad04434079abde88be6fa0e2cd2426a66f75c2f3c25d6805bb229ab9f94319e + initial_ast: 036bcdf2738560a69431e37b7635bfcf562ca871a4bd13362b77a4e1e90cc0fd + canonicalized_ast: 036bcdf2738560a69431e37b7635bfcf562ca871a4bd13362b77a4e1e90cc0fd + type_inferenced_ast: 59d590d7091eb0c740a60de9895b98b9d70bd775f2fd00d9fe25beb3f39b0a8f diff --git a/tests/expectations/compiler/compiler/integers/u64/ne.leo.out b/tests/expectations/compiler/compiler/integers/u64/ne.leo.out index a66f8aeb34..8799e20d99 100644 --- a/tests/expectations/compiler/compiler/integers/u64/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/ne.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 21675ef772779316b4a0cba63284251d69eabf581d65d7780b77988fecd500c8 - canonicalized_ast: 21675ef772779316b4a0cba63284251d69eabf581d65d7780b77988fecd500c8 - type_inferenced_ast: 8d8f881dfd748d28eb47082e945d7e28147a79afd4c346dc718b07f5068f3064 + initial_ast: 434048732d4e8ecf3ef871e262ab4349bca9184130868fc6f81bdb2f9f279eff + canonicalized_ast: 434048732d4e8ecf3ef871e262ab4349bca9184130868fc6f81bdb2f9f279eff + type_inferenced_ast: 0891a175cee05291ce0160ea7bd4d9a89e05bc8ad11aeb6854d5686ddc68b8c0 diff --git a/tests/expectations/compiler/compiler/integers/u64/negative_input_fail.leo.out b/tests/expectations/compiler/compiler/integers/u64/negative_input_fail.leo.out index 28cac501d3..b160ff699c 100644 --- a/tests/expectations/compiler/compiler/integers/u64/negative_input_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/negative_input_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:15\n |\n 3 | function main(a: u64) {}\n | ^\n |\n = failed to parse `-2` as expected integer type" + - "Error [ECMP0376089]: failed to parse `-2` as expected integer type\n --> compiler-test:3:15\n |\n 3 | function main(a: u64) {}\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u64/no_space_between_literal.leo.out b/tests/expectations/compiler/compiler/integers/u64/no_space_between_literal.leo.out index ab434da400..69aa25a324 100644 --- a/tests/expectations/compiler/compiler/integers/u64/no_space_between_literal.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/no_space_between_literal.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:15\n |\n 4 | const i = 1 u64;\n | ^\n |\n = Unexpected white space between terms 1 and u64" + - "Error [EPAR0370004]: Unexpected white space between terms 1 and u64\n --> compiler-test:4:15\n |\n 4 | const i = 1 u64;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u64/sub.leo.out b/tests/expectations/compiler/compiler/integers/u64/sub.leo.out index 7153642a30..697bec4ddc 100644 --- a/tests/expectations/compiler/compiler/integers/u64/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/sub.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 51ea52d83e589316bb16309f9422ad9949832077bd036c61ac1f3de873bb2b62 - canonicalized_ast: 51ea52d83e589316bb16309f9422ad9949832077bd036c61ac1f3de873bb2b62 - type_inferenced_ast: 3409439c9ba061104e4aa8df5d70283bc7f87fa92076f8a0459660dc8f7f1aed + initial_ast: e3d9d7e0777882927c0d62f969a00971eac702cc120a7228d495770b0508c8e2 + canonicalized_ast: e3d9d7e0777882927c0d62f969a00971eac702cc120a7228d495770b0508c8e2 + type_inferenced_ast: 1e073af4c2e020522743b359f27e62b2cdfef990ef3efde2e45eca72d1458694 diff --git a/tests/expectations/compiler/compiler/integers/u64/ternary.leo.out b/tests/expectations/compiler/compiler/integers/u64/ternary.leo.out index f092d03536..8e564366c0 100644 --- a/tests/expectations/compiler/compiler/integers/u64/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/ternary.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 9522a94841df58a5171753bc8ca01db576432511995dc5841107314293af41e1 - canonicalized_ast: 9522a94841df58a5171753bc8ca01db576432511995dc5841107314293af41e1 - type_inferenced_ast: 8759d4926622054977f1171605a87ff6a1b42fd9ff04c4154f01251bb928834e + initial_ast: 0f1eb365e0b6533a4f9e6ebd6915a66945409beeab6b534e9aa4ebfd7429bf98 + canonicalized_ast: 0f1eb365e0b6533a4f9e6ebd6915a66945409beeab6b534e9aa4ebfd7429bf98 + type_inferenced_ast: 0726efa0b131dc2baa5662ced11c1a1da0424496b853cb7a44f8f30682a9b9b8 diff --git a/tests/expectations/compiler/compiler/integers/u8/add.leo.out b/tests/expectations/compiler/compiler/integers/u8/add.leo.out index e28e85c6b3..5bb2bdc182 100644 --- a/tests/expectations/compiler/compiler/integers/u8/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/add.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 46143561de12f971f373f582a5d89ab12cbf3b2e4f05c1f748f9b42a004cd783 - canonicalized_ast: 46143561de12f971f373f582a5d89ab12cbf3b2e4f05c1f748f9b42a004cd783 - type_inferenced_ast: e18f8efbb8b287363a35743db48e443093c3e8528da6bdb59769d93272bce295 + initial_ast: ac6f907e0bde03b050a6a400ec75c9ba36c8ef71e7229b74f6584ca8d2b91947 + canonicalized_ast: ac6f907e0bde03b050a6a400ec75c9ba36c8ef71e7229b74f6584ca8d2b91947 + type_inferenced_ast: dbbc25669e47bc45b3de20bbfb30b2b0a08558a0cfd738a5cadc8ac7b439a822 diff --git a/tests/expectations/compiler/compiler/integers/u8/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/u8/console_assert.leo.out index 190629c870..63e75d5d83 100644 --- a/tests/expectations/compiler/compiler/integers/u8/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/console_assert.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 0fd5c6b2d0a72defe0e73199cc66c2602cecb5bab6432afb11a5cff0da574fac - canonicalized_ast: 0fd5c6b2d0a72defe0e73199cc66c2602cecb5bab6432afb11a5cff0da574fac - type_inferenced_ast: 35cd62b7d5e5848a87a7702ca3574b1e525ec44b57a203042ebf2371f6577eb5 + initial_ast: 0d844d1f940b60507bf4756f3ec5d3ee7927c1b35f8625e6973da1c1cb7fc599 + canonicalized_ast: 0d844d1f940b60507bf4756f3ec5d3ee7927c1b35f8625e6973da1c1cb7fc599 + type_inferenced_ast: 6f643a6f222e06eb2f588ccecff5fe1dd4b037a9ac5ff340056dfd33093ae7a7 diff --git a/tests/expectations/compiler/compiler/integers/u8/div.leo.out b/tests/expectations/compiler/compiler/integers/u8/div.leo.out index bdbb6b2fde..7b8f66a81b 100644 --- a/tests/expectations/compiler/compiler/integers/u8/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/div.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 14e39ff28ecd780e1cac8d6f6b4d1225837f014233130ad709550fc7771a3191 - canonicalized_ast: 14e39ff28ecd780e1cac8d6f6b4d1225837f014233130ad709550fc7771a3191 - type_inferenced_ast: 9773336c82e254fc8bb0df35b41d06ce3cc112dc625bb1f913a2ab712d50336c + initial_ast: b89d99a49767212fe042121c854f22669329d9c73b08894fe49e54b1d5364d20 + canonicalized_ast: b89d99a49767212fe042121c854f22669329d9c73b08894fe49e54b1d5364d20 + type_inferenced_ast: 51638eb70f7dddd16f8b12b97cd047b1c01161111e001aac2b578b697e15e375 diff --git a/tests/expectations/compiler/compiler/integers/u8/eq.leo.out b/tests/expectations/compiler/compiler/integers/u8/eq.leo.out index 46de525dd4..727b23fe74 100644 --- a/tests/expectations/compiler/compiler/integers/u8/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/eq.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: aa2459e6aec917b685a32cd008c7809684f9e08e446a9acb28835d03ee5909d0 - canonicalized_ast: aa2459e6aec917b685a32cd008c7809684f9e08e446a9acb28835d03ee5909d0 - type_inferenced_ast: bb373474343191ea738914a4f15373373ee3b387bd14a2e7ccbeb3b78e83edb6 + initial_ast: e5f1208c5eeddea9529cb7d94abd8402deea7fb99403d30b993d20455c486005 + canonicalized_ast: e5f1208c5eeddea9529cb7d94abd8402deea7fb99403d30b993d20455c486005 + type_inferenced_ast: 4262889173a452f869821a1c5156b16df25938323a1029b9ac16b2d851f590ab diff --git a/tests/expectations/compiler/compiler/integers/u8/ge.leo.out b/tests/expectations/compiler/compiler/integers/u8/ge.leo.out index 5d0cf91b89..f788e88307 100644 --- a/tests/expectations/compiler/compiler/integers/u8/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/ge.leo.out @@ -28,6 +28,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 2fbb4f0e49def7c8576b9201a8b0880cdbc7a84cb101ad717b69b49d0cdd69a9 - canonicalized_ast: 2fbb4f0e49def7c8576b9201a8b0880cdbc7a84cb101ad717b69b49d0cdd69a9 - type_inferenced_ast: 820a374b48ec40e6c7b27321007465fc235c679dc49c01e383acecb1b64d2574 + initial_ast: e112fdcf1e2d652ade77b4a66808e252bf380f9e0db3d4766828ea062fc4653f + canonicalized_ast: e112fdcf1e2d652ade77b4a66808e252bf380f9e0db3d4766828ea062fc4653f + type_inferenced_ast: 96f3e51cdf1f213854d70c733044bb1157391380fa4614e3ad604ce588ee2cfc diff --git a/tests/expectations/compiler/compiler/integers/u8/gt.leo.out b/tests/expectations/compiler/compiler/integers/u8/gt.leo.out index 1cd2419f25..2d889a0bb7 100644 --- a/tests/expectations/compiler/compiler/integers/u8/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/gt.leo.out @@ -16,6 +16,6 @@ outputs: - input_file: u8_f.in output: registers: {} - initial_ast: c5690d672e1ed1d36f698ee7f2cdd39d3dbb190c899435de7b4a71eb2f3d125c - canonicalized_ast: 6eb02fba96f74190b7aacdea8da5eb00964cb25d93e89aff4b0f047d7239a704 - type_inferenced_ast: 446a1de27bf2d3927b4bfcfcd65817cecf8a95c9e09b17901fb283e05ce9a82f + initial_ast: 367bd7c0e5be94e791a9d837ffd38b75346a717b6819180ac3f9de72252d27d5 + canonicalized_ast: 6d52d5232ccd2c88404b6fa137aecb9d40b02c6330995f1060e5f27f5b8ca224 + type_inferenced_ast: bdf5ecebb6a1522b6f2b94a2aab91550473604de2db6dc8d32ec19c2ab6ca590 diff --git a/tests/expectations/compiler/compiler/integers/u8/input.leo.out b/tests/expectations/compiler/compiler/integers/u8/input.leo.out index 5d774835b4..a11b91c799 100644 --- a/tests/expectations/compiler/compiler/integers/u8/input.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/input.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 41cd9d639298b0dd1c84b8fdcb624a12b6fabade022c97738d19e8cdd4796956 - canonicalized_ast: 41cd9d639298b0dd1c84b8fdcb624a12b6fabade022c97738d19e8cdd4796956 - type_inferenced_ast: ed93dbc932db00cbbf765f2908bc27860780102a3a884c6684c91abc3d1ca4d0 + initial_ast: 531f048a2b98e742368e050951fecd924e86bddc2434861a71727e9f56ef79cd + canonicalized_ast: 531f048a2b98e742368e050951fecd924e86bddc2434861a71727e9f56ef79cd + type_inferenced_ast: 2cd1ea5a7a527232d6b433796b486672bdd1eb9f29bedd492ddd88bc118bfac6 diff --git a/tests/expectations/compiler/compiler/integers/u8/le.leo.out b/tests/expectations/compiler/compiler/integers/u8/le.leo.out index 14ac84b05f..c330c95df0 100644 --- a/tests/expectations/compiler/compiler/integers/u8/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/le.leo.out @@ -28,6 +28,6 @@ outputs: r0: type: bool value: "false" - initial_ast: aeaa0daf3457c8c5425b98f0ee5ce1818062b3e319237a1a2f3060f5f76593d9 - canonicalized_ast: aeaa0daf3457c8c5425b98f0ee5ce1818062b3e319237a1a2f3060f5f76593d9 - type_inferenced_ast: 670d28a03f291083985c74c5f5e6aab6dff9e481443ceae2fce033dc9df03c83 + initial_ast: 90d394dcd275a98675d2dd533d85387205c32197f34dac27bf926eadf260c3a4 + canonicalized_ast: 90d394dcd275a98675d2dd533d85387205c32197f34dac27bf926eadf260c3a4 + type_inferenced_ast: 9ecdb7705455bb31f65809c1eb79f31d2b68f17e6aea5d1c4d6038c730e4f6a2 diff --git a/tests/expectations/compiler/compiler/integers/u8/lt.leo.out b/tests/expectations/compiler/compiler/integers/u8/lt.leo.out index 175ef6b0b4..a3a0faa275 100644 --- a/tests/expectations/compiler/compiler/integers/u8/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/lt.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "false" - initial_ast: 6053db7befe79c361e783fdf841d7955b78b0b5cea6aa82de8ba15de73943927 - canonicalized_ast: 6053db7befe79c361e783fdf841d7955b78b0b5cea6aa82de8ba15de73943927 - type_inferenced_ast: 097e4cc4579f4298a73e5f65283dc92792b75c4c1a542456523d949344cb17f6 + initial_ast: 61afedce9bcf1d0018a083b81bc3355cb161e9a92ed7519e52d027b83c2c0930 + canonicalized_ast: 61afedce9bcf1d0018a083b81bc3355cb161e9a92ed7519e52d027b83c2c0930 + type_inferenced_ast: 5f3d7fa99b36f82a7660a7ba7b6331c8eb2b805b1a46ea04c5b74ff1c32b6b93 diff --git a/tests/expectations/compiler/compiler/integers/u8/max.leo.out b/tests/expectations/compiler/compiler/integers/u8/max.leo.out index 0fe0295311..6149ce792d 100644 --- a/tests/expectations/compiler/compiler/integers/u8/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/max.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: c76876fb75e6a86c9f75dee04598fd43dc6ab73e62c92fd4ae8cb0f58d4eaf35 - canonicalized_ast: c76876fb75e6a86c9f75dee04598fd43dc6ab73e62c92fd4ae8cb0f58d4eaf35 - type_inferenced_ast: 3bd166f8a614dca66a55c11e8a88e45c8ec836746fdb18c2b28cd8c19a98fd6f + initial_ast: 6342b402bd6699b8bc7b7ae840c4d3812f8ee1f8b59913ab66353d54e5972893 + canonicalized_ast: 6342b402bd6699b8bc7b7ae840c4d3812f8ee1f8b59913ab66353d54e5972893 + type_inferenced_ast: e9db0cb3f6a2537b42553b4b998c746fb8eb65f8ad1af2e2dfb0ee60243f1418 diff --git a/tests/expectations/compiler/compiler/integers/u8/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/u8/max_fail.leo.out index eff5422487..1764ec3502 100644 --- a/tests/expectations/compiler/compiler/integers/u8/max_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/max_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:19\n |\n 4 | const a: u8 = 256;\n | ^^^\n |\n = failed to parse int value '256'" + - "Error [EASG0373031]: failed to parse int value '256'\n --> compiler-test:4:19\n |\n 4 | const a: u8 = 256;\n | ^^^" diff --git a/tests/expectations/compiler/compiler/integers/u8/min.leo.out b/tests/expectations/compiler/compiler/integers/u8/min.leo.out index 51d92ce45c..de61365e09 100644 --- a/tests/expectations/compiler/compiler/integers/u8/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/min.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 88343847b6fce997c39196a99ea382fdd560e804a04363efa75fff7aa9632550 - canonicalized_ast: 88343847b6fce997c39196a99ea382fdd560e804a04363efa75fff7aa9632550 - type_inferenced_ast: 2ab03d470fda1fb7747fd1868113bf107f90ad4a5e578763475d08d0127df37f + initial_ast: ab129b038cecc6772d826b2cf0ee5ed5379cff8550d245602e599ac25a894d86 + canonicalized_ast: ab129b038cecc6772d826b2cf0ee5ed5379cff8550d245602e599ac25a894d86 + type_inferenced_ast: b7bc9ee14a8d2e35faa657e8fb739494b6e76f04bffbb91072185049d51d1ecf diff --git a/tests/expectations/compiler/compiler/integers/u8/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/u8/min_fail.leo.out index da94b82b2b..c2e3b45913 100644 --- a/tests/expectations/compiler/compiler/integers/u8/min_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/min_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:19\n |\n 4 | const a: u8 = -1;\n | ^^\n |\n = failed to parse int value '-1'" + - "Error [EASG0373031]: failed to parse int value '-1'\n --> compiler-test:4:19\n |\n 4 | const a: u8 = -1;\n | ^^" diff --git a/tests/expectations/compiler/compiler/integers/u8/mul.leo.out b/tests/expectations/compiler/compiler/integers/u8/mul.leo.out index 4928a6fcd0..acbba34889 100644 --- a/tests/expectations/compiler/compiler/integers/u8/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/mul.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "false" - initial_ast: bd3039edc007709bcb436aa637183ad209cfe911e664630a51164fb816e0457c - canonicalized_ast: bd3039edc007709bcb436aa637183ad209cfe911e664630a51164fb816e0457c - type_inferenced_ast: bd4154abb8f63cc329ca278d8d1d881396439f9fc0e0b1824b453b648a9a95a8 + initial_ast: 4ddfc75bb5e02c95e9a0063a7252f710a762826edbf18a6e66f856a1952225aa + canonicalized_ast: 4ddfc75bb5e02c95e9a0063a7252f710a762826edbf18a6e66f856a1952225aa + type_inferenced_ast: fb7db5e925bdfd5819e60f9e62d550e212956bf9848e5c4396ffda535b73fd48 diff --git a/tests/expectations/compiler/compiler/integers/u8/ne.leo.out b/tests/expectations/compiler/compiler/integers/u8/ne.leo.out index e178ae3184..84570433b9 100644 --- a/tests/expectations/compiler/compiler/integers/u8/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/ne.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 13331b76c5f4087e7a47ac31b43ae9465b4df33ffc3a785ed997a3694921338b - canonicalized_ast: 13331b76c5f4087e7a47ac31b43ae9465b4df33ffc3a785ed997a3694921338b - type_inferenced_ast: 8269c7b9114fa31276f9398a51c8642cadf59c68979fdc680bd900ca3aeea73b + initial_ast: cac942dae68f28bb032dee1b20345d38c4c1b948b1d9c77e02af98f2b17d3296 + canonicalized_ast: cac942dae68f28bb032dee1b20345d38c4c1b948b1d9c77e02af98f2b17d3296 + type_inferenced_ast: 9bd574d7862a1d10bdd1ca1096381d1fc2f1070433f189e48c8bfef3587da83f diff --git a/tests/expectations/compiler/compiler/integers/u8/negative_input_fail.leo.out b/tests/expectations/compiler/compiler/integers/u8/negative_input_fail.leo.out index 1c0677422b..f4d484c12b 100644 --- a/tests/expectations/compiler/compiler/integers/u8/negative_input_fail.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/negative_input_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:3:15\n |\n 3 | function main(a: u8) {}\n | ^\n |\n = failed to parse `-2` as expected integer type" + - "Error [ECMP0376089]: failed to parse `-2` as expected integer type\n --> compiler-test:3:15\n |\n 3 | function main(a: u8) {}\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u8/no_space_between_literal.leo.out b/tests/expectations/compiler/compiler/integers/u8/no_space_between_literal.leo.out index ced5132f3b..4f1333e8cc 100644 --- a/tests/expectations/compiler/compiler/integers/u8/no_space_between_literal.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/no_space_between_literal.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:15\n |\n 4 | const i = 1 u8;\n | ^\n |\n = Unexpected white space between terms 1 and u8" + - "Error [EPAR0370004]: Unexpected white space between terms 1 and u8\n --> compiler-test:4:15\n |\n 4 | const i = 1 u8;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u8/sub.leo.out b/tests/expectations/compiler/compiler/integers/u8/sub.leo.out index e2f9e50e16..50ff8321c7 100644 --- a/tests/expectations/compiler/compiler/integers/u8/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/sub.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 8ff67855790ac3e64c77531a999f06a2546567754204428dfb3d8519f9575678 - canonicalized_ast: 8ff67855790ac3e64c77531a999f06a2546567754204428dfb3d8519f9575678 - type_inferenced_ast: 6ad282b40daaae8a4b96531c8a467f189157270bffb31ed07f7ba786b5543ab9 + initial_ast: 37f312fca99e18c20fc3b915d5e9691183e9c8a26facea674c94d18439f76419 + canonicalized_ast: 37f312fca99e18c20fc3b915d5e9691183e9c8a26facea674c94d18439f76419 + type_inferenced_ast: 184d52c1e60496d84b8ea7c99d47c4d61c54462ec876eb1ad9087d921e4bf4c2 diff --git a/tests/expectations/compiler/compiler/integers/u8/ternary.leo.out b/tests/expectations/compiler/compiler/integers/u8/ternary.leo.out index 7e9a221f24..0556332f0b 100644 --- a/tests/expectations/compiler/compiler/integers/u8/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/ternary.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 3a52d53376039a10517157e2c8f25287b85b50f9c46b59b914e417186e8fb245 - canonicalized_ast: 3a52d53376039a10517157e2c8f25287b85b50f9c46b59b914e417186e8fb245 - type_inferenced_ast: 643e93414412b4d6a5b20cc6490f119d277ce6afaedb948247ce028cf9f9b68b + initial_ast: 12081a6268bceeb4d14340427a7d8786dee79834e8d0639530bda36405519f89 + canonicalized_ast: 12081a6268bceeb4d14340427a7d8786dee79834e8d0639530bda36405519f89 + type_inferenced_ast: 1dc21f41bccb8261f4d52ed0ea64b3dbea0a51b685afddb46692ccb3abd0aaef diff --git a/tests/expectations/compiler/compiler/mutability/array_dyn_mut.leo.out b/tests/expectations/compiler/compiler/mutability/array_dyn_mut.leo.out index 4345fe734b..0b62259bc4 100644 --- a/tests/expectations/compiler/compiler/mutability/array_dyn_mut.leo.out +++ b/tests/expectations/compiler/compiler/mutability/array_dyn_mut.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: "[u32; 3]" value: "\"150\"" - initial_ast: e040115f45af0248976ed3dfbf9c3440d73005c2fa62ee12199298f5e375c14f - canonicalized_ast: 9b095b10f8f9c8538cfa8a371cd23e1abbac7385df1ef3ef9b4d0a13ae122335 - type_inferenced_ast: eb4f4325a50b1c5a5e3ab7b89ec2a19a6dd9e3cab55005540ed61206e439b737 + initial_ast: 1b9dd4d93877ba82b0f45fa9512946bbf07683c6ab239d93c4a9a18530cc1eb7 + canonicalized_ast: 7b38858ddb99fd0e62727f508609aa05e68c7daf27429db5f2e0c59f137543ec + type_inferenced_ast: c492d1e3ec39f64c403105c5da177e6593c97ba93e71d187b040a095b1916f47 diff --git a/tests/expectations/compiler/compiler/mutability/array_dyn_mut_indirect.leo.out b/tests/expectations/compiler/compiler/mutability/array_dyn_mut_indirect.leo.out index abb56b0a4f..e583f33d7e 100644 --- a/tests/expectations/compiler/compiler/mutability/array_dyn_mut_indirect.leo.out +++ b/tests/expectations/compiler/compiler/mutability/array_dyn_mut_indirect.leo.out @@ -22,6 +22,6 @@ outputs: r0: type: "[(u32, u32); 3]" value: "\"(1, 1)(2, 2)(0, 1)\"" - initial_ast: fb18710f2c196b07de8bf83e68dfe03d41241ddf7c407bc10780dd1fa19c4cc2 - canonicalized_ast: fb18710f2c196b07de8bf83e68dfe03d41241ddf7c407bc10780dd1fa19c4cc2 - type_inferenced_ast: 65df378f0e3f7b77b83d197dd2d8bfc78b9091a2f1d92629e6956d0f4e96ef06 + initial_ast: 1c99d10e887a1d5127c01ea8e30b83e1ff063074c995dbfe4be8600af27e46be + canonicalized_ast: 1c99d10e887a1d5127c01ea8e30b83e1ff063074c995dbfe4be8600af27e46be + type_inferenced_ast: f78c73953ee24462f3f623cad8661e2a892901193ffedd93f030c49a7225cfe7 diff --git a/tests/expectations/compiler/compiler/mutability/array_fail.leo.out b/tests/expectations/compiler/compiler/mutability/array_fail.leo.out index 0efd7b76a8..ca06a5b485 100644 --- a/tests/expectations/compiler/compiler/mutability/array_fail.leo.out +++ b/tests/expectations/compiler/compiler/mutability/array_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:5:5\n |\n 5 | a[0] = 0;\n | ^^^^^^^^\n |\n = illegal assignment to immutable variable 'a'" + - "Error [EASG0373033]: illegal assignment to immutable variable 'a'\n --> compiler-test:5:5\n |\n 5 | a[0] = 0;\n | ^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/mutability/array_mut.leo.out b/tests/expectations/compiler/compiler/mutability/array_mut.leo.out index 4c9bc1ac1e..540a93fedf 100644 --- a/tests/expectations/compiler/compiler/mutability/array_mut.leo.out +++ b/tests/expectations/compiler/compiler/mutability/array_mut.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: ceb1057896de34c17443d478a2e8bc0934c5bd9fb536ae210b148578f25f5465 - canonicalized_ast: ceb1057896de34c17443d478a2e8bc0934c5bd9fb536ae210b148578f25f5465 - type_inferenced_ast: 4037c97f4f464afcd6c34fa293f4b6a0c434d0e21193b82ccf4189da280e7721 + initial_ast: d1d84eaa70d3a5bc85b399d5cd16f62d78566638c9840e85c0eaed2c6a7218ac + canonicalized_ast: d1d84eaa70d3a5bc85b399d5cd16f62d78566638c9840e85c0eaed2c6a7218ac + type_inferenced_ast: 0c2bda504db5b7d1d4868ad20a3c70fa0e86dd1ec90c514c7a67161997495970 diff --git a/tests/expectations/compiler/compiler/mutability/array_splice_mut.leo.out b/tests/expectations/compiler/compiler/mutability/array_splice_mut.leo.out index e7799a32f1..b0bf42402a 100644 --- a/tests/expectations/compiler/compiler/mutability/array_splice_mut.leo.out +++ b/tests/expectations/compiler/compiler/mutability/array_splice_mut.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 87d5f27ec3dd5c4f9a338186e40021725b7b55b70447164dcb85452b06e2afdb - canonicalized_ast: 87d5f27ec3dd5c4f9a338186e40021725b7b55b70447164dcb85452b06e2afdb - type_inferenced_ast: 257f0fe5d7f985ed49cbc0e8b7501d71433d4dbc401cf746d30e7fde337771a2 + initial_ast: 319d0e6e9e914b85e84803c5ac0c0bee32e5238e89fdcf2e7ac28c88b3386f3c + canonicalized_ast: 319d0e6e9e914b85e84803c5ac0c0bee32e5238e89fdcf2e7ac28c88b3386f3c + type_inferenced_ast: afce2509e7ecc4c7edb35a0d7536fd425171d9b0477c5f7ad731f7bba716c310 diff --git a/tests/expectations/compiler/compiler/mutability/array_tuple_mut.leo.out b/tests/expectations/compiler/compiler/mutability/array_tuple_mut.leo.out index 9d3bf1ac13..4ad3154498 100644 --- a/tests/expectations/compiler/compiler/mutability/array_tuple_mut.leo.out +++ b/tests/expectations/compiler/compiler/mutability/array_tuple_mut.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: a0bdf5a95e0938c0493418f2280d7d9a6c7f484f8c0a16bb262d06364ecedcf6 - canonicalized_ast: a0bdf5a95e0938c0493418f2280d7d9a6c7f484f8c0a16bb262d06364ecedcf6 - type_inferenced_ast: 463c1646c892aadb9b851fb8d73a749183a404ff74c4c7470718b9a4fb95e1a4 + initial_ast: c34cb6ced1870107558689bad9fcf1a6ec465b0db85c2b6f10ddcecf9d5cae25 + canonicalized_ast: c34cb6ced1870107558689bad9fcf1a6ec465b0db85c2b6f10ddcecf9d5cae25 + type_inferenced_ast: 984811782861d636221d6b3ee89f13e8489d0b4ff8ec2f4a01feb5c940ebb8a7 diff --git a/tests/expectations/compiler/compiler/mutability/circuit_fail.leo.out b/tests/expectations/compiler/compiler/mutability/circuit_fail.leo.out index f00b41889f..0d6020a433 100644 --- a/tests/expectations/compiler/compiler/mutability/circuit_fail.leo.out +++ b/tests/expectations/compiler/compiler/mutability/circuit_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:10:5\n |\n 10 | a.x = 0;\n | ^^^^^^^\n |\n = illegal assignment to immutable variable 'a'" + - "Error [EASG0373033]: illegal assignment to immutable variable 'a'\n --> compiler-test:10:5\n |\n 10 | a.x = 0;\n | ^^^^^^^" diff --git a/tests/expectations/compiler/compiler/mutability/circuit_function_const.leo.out b/tests/expectations/compiler/compiler/mutability/circuit_function_const.leo.out index 461b7c8b18..91f1479abc 100644 --- a/tests/expectations/compiler/compiler/mutability/circuit_function_const.leo.out +++ b/tests/expectations/compiler/compiler/mutability/circuit_function_const.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:15:5\n |\n 15 | a.foo();\n | ^^^^^\n |\n = cannot call mutable member function 'foo' of circuit 'Foo' from immutable context" + - "Error [EASG0373010]: cannot call mutable member function 'foo' of circuit 'Foo' from immutable context\n --> compiler-test:15:5\n |\n 15 | a.foo();\n | ^^^^^" diff --git a/tests/expectations/compiler/compiler/mutability/circuit_function_mut.leo.out b/tests/expectations/compiler/compiler/mutability/circuit_function_mut.leo.out index 154b3ce4df..fe01ab791e 100644 --- a/tests/expectations/compiler/compiler/mutability/circuit_function_mut.leo.out +++ b/tests/expectations/compiler/compiler/mutability/circuit_function_mut.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 8db095ba3755c4c0a5c661f82acea4d5088fcc7a1f21445d8f6a76aa349be14c - canonicalized_ast: db2825ad023eb01f420686f407d0411e99d06be1f13116ffce5b18d7e9ceffd6 - type_inferenced_ast: 2afc66cedc72641dbae33927247993fa9b03402889e3a71005888d0e26f34114 + initial_ast: afde0187f805e33f804917815a52421a2662aa029b182be76c39f4ce5f3f453a + canonicalized_ast: 9dfd8d93fa20899e9d146d65b2564f1275cfb73158d8d96ed09f7157ff327e39 + type_inferenced_ast: e59a2cba730871aba6258b78f469b9df7763f8d78ad6bbda5c6026a989bc3d88 diff --git a/tests/expectations/compiler/compiler/mutability/circuit_static_function_mut_fail.leo.out b/tests/expectations/compiler/compiler/mutability/circuit_static_function_mut_fail.leo.out index 9eb3929726..c173994d24 100644 --- a/tests/expectations/compiler/compiler/mutability/circuit_static_function_mut_fail.leo.out +++ b/tests/expectations/compiler/compiler/mutability/circuit_static_function_mut_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:8:19\n |\n 8 | let a = Foo { x: 1 };\n | ^\n |\n = extra circuit member 'x' for initialization of circuit 'Foo' is not allowed" + - "Error [EASG0373006]: extra circuit member 'x' for initialization of circuit 'Foo' is not allowed\n --> compiler-test:8:19\n |\n 8 | let a = Foo { x: 1 };\n | ^" diff --git a/tests/expectations/compiler/compiler/mutability/circuit_variable_mut.leo.out b/tests/expectations/compiler/compiler/mutability/circuit_variable_mut.leo.out index a780c83f31..2658736d93 100644 --- a/tests/expectations/compiler/compiler/mutability/circuit_variable_mut.leo.out +++ b/tests/expectations/compiler/compiler/mutability/circuit_variable_mut.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 7671936b5d58627c508151bd0a851661e929424791064674180e651e5f9d7f8b - canonicalized_ast: 7671936b5d58627c508151bd0a851661e929424791064674180e651e5f9d7f8b - type_inferenced_ast: 08ccc60dc31ebf449c8a359dca037f99b22cd971fe4c5b5606310fa0fe9cd1a9 + initial_ast: db9400fc979f1cfd8eea30945594b0e8d2f4138bb32021b9086021b492e2e246 + canonicalized_ast: db9400fc979f1cfd8eea30945594b0e8d2f4138bb32021b9086021b492e2e246 + type_inferenced_ast: 24783ef52315a02bb2f2e34f5a4020f09f4573ae6d182cab699bf45235e1c4a3 diff --git a/tests/expectations/compiler/compiler/mutability/cond_mut.leo.out b/tests/expectations/compiler/compiler/mutability/cond_mut.leo.out index 925b0913c2..2c8c19daca 100644 --- a/tests/expectations/compiler/compiler/mutability/cond_mut.leo.out +++ b/tests/expectations/compiler/compiler/mutability/cond_mut.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 06f04842fb542f8864eb122d2f28acf86913b1ad2ea77d9b2a138c65d9186ef0 - canonicalized_ast: 2ed31baa6f3faa866cdde220e7066a652c68dfc40eae0215dc32ea38c34c7ac1 - type_inferenced_ast: be031b12e5045a61467348896d88e71017818365692e50201a64e08c2c5be833 + initial_ast: 1f9ad1f3e19f31a5e7195eb91ec9617e07d5eaf146fd1654eb4a5188f0268cbd + canonicalized_ast: 5ff794b8a47377190bb0a834df5c858bee7b6136204677e71db99b395a158d41 + type_inferenced_ast: 1555a60ba172865b0689ca934416a7840a678950f800a33825cb455fa101627c diff --git a/tests/expectations/compiler/compiler/mutability/const.leo.out b/tests/expectations/compiler/compiler/mutability/const.leo.out index 2b510f9d57..c6ba953ccb 100644 --- a/tests/expectations/compiler/compiler/mutability/const.leo.out +++ b/tests/expectations/compiler/compiler/mutability/const.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:6:5\n |\n 6 | a = 0;\n | ^^^^^\n |\n = illegal assignment to immutable variable 'a'" + - "Error [EASG0373033]: illegal assignment to immutable variable 'a'\n --> compiler-test:6:5\n |\n 6 | a = 0;\n | ^^^^^" diff --git a/tests/expectations/compiler/compiler/mutability/function_input.leo.out b/tests/expectations/compiler/compiler/mutability/function_input.leo.out index 6f64decd33..3c28b515fc 100644 --- a/tests/expectations/compiler/compiler/mutability/function_input.leo.out +++ b/tests/expectations/compiler/compiler/mutability/function_input.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:5:5\n |\n 5 | a = false;\n | ^\n |\n = failed to resolve variable reference 'a'" + - "Error [EASG0373028]: failed to resolve variable reference 'a'\n --> compiler-test:5:5\n |\n 5 | a = false;\n | ^" diff --git a/tests/expectations/compiler/compiler/mutability/function_input_mut.leo.out b/tests/expectations/compiler/compiler/mutability/function_input_mut.leo.out index 3918a78e16..c397be906c 100644 --- a/tests/expectations/compiler/compiler/mutability/function_input_mut.leo.out +++ b/tests/expectations/compiler/compiler/mutability/function_input_mut.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: e56a274a8a6081b07198b7562c14249df37e45aac1ed6c122da737325282b8ff - canonicalized_ast: e56a274a8a6081b07198b7562c14249df37e45aac1ed6c122da737325282b8ff - type_inferenced_ast: 6777bfacec09af0204e90fc2a071172451ff22dfbdadbf0854c593f18adb04f7 + initial_ast: 198667d742dfeb7ff2e5a4aff4effeb9290682574faa7c4aa16ea9ea1f63975a + canonicalized_ast: 198667d742dfeb7ff2e5a4aff4effeb9290682574faa7c4aa16ea9ea1f63975a + type_inferenced_ast: 27b6e28e2f604e34e860b2c380efeed816b5c5009acc4072deb006d3efcd005f diff --git a/tests/expectations/compiler/compiler/mutability/let_fail.leo.out b/tests/expectations/compiler/compiler/mutability/let_fail.leo.out index 2b510f9d57..c6ba953ccb 100644 --- a/tests/expectations/compiler/compiler/mutability/let_fail.leo.out +++ b/tests/expectations/compiler/compiler/mutability/let_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:6:5\n |\n 6 | a = 0;\n | ^^^^^\n |\n = illegal assignment to immutable variable 'a'" + - "Error [EASG0373033]: illegal assignment to immutable variable 'a'\n --> compiler-test:6:5\n |\n 6 | a = 0;\n | ^^^^^" diff --git a/tests/expectations/compiler/compiler/mutability/let_mut.leo.out b/tests/expectations/compiler/compiler/mutability/let_mut.leo.out index 08c94c67cc..8861d55252 100644 --- a/tests/expectations/compiler/compiler/mutability/let_mut.leo.out +++ b/tests/expectations/compiler/compiler/mutability/let_mut.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 32fa7d2711aa772281f70ad9c81a3a8d3eab4d0844438849de4998c65ee12237 - canonicalized_ast: 32fa7d2711aa772281f70ad9c81a3a8d3eab4d0844438849de4998c65ee12237 - type_inferenced_ast: 4bde7f50f7488cbf37c29a95ad7699aa1d8ae5d20fdb773ddab63293bd89d6c5 + initial_ast: fe19b0b255803d40b89cc69970126c016c9978a529472be4bfdb71af6bf74128 + canonicalized_ast: fe19b0b255803d40b89cc69970126c016c9978a529472be4bfdb71af6bf74128 + type_inferenced_ast: fc8cc3c7fbad2d163ad8f78a4c4deeebbc062df3b26a4388fd8550ad51ac0ece diff --git a/tests/expectations/compiler/compiler/mutability/let_mut_nested.leo.out b/tests/expectations/compiler/compiler/mutability/let_mut_nested.leo.out index 63fb0ba5d9..7d3f3d7992 100644 --- a/tests/expectations/compiler/compiler/mutability/let_mut_nested.leo.out +++ b/tests/expectations/compiler/compiler/mutability/let_mut_nested.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 68348f81454aaabba9ad9d6eb16be88eb4692e7600840a97b8ceb8296e30b890 - canonicalized_ast: 68348f81454aaabba9ad9d6eb16be88eb4692e7600840a97b8ceb8296e30b890 - type_inferenced_ast: f10f9a4988d9c815bf4a2bfa0c28d5b2913a99bed96825729b08433fe3178145 + initial_ast: 372f591679b8d314412a010f32be0082aa999c7016e761499da8317c12b13750 + canonicalized_ast: 372f591679b8d314412a010f32be0082aa999c7016e761499da8317c12b13750 + type_inferenced_ast: 8409be43d93bebe4ba303fc14b55ef95f987f8723051ddc963febebaeeb75e79 diff --git a/tests/expectations/compiler/compiler/mutability/swap.leo.out b/tests/expectations/compiler/compiler/mutability/swap.leo.out index 49d15ca400..289ab26c8a 100644 --- a/tests/expectations/compiler/compiler/mutability/swap.leo.out +++ b/tests/expectations/compiler/compiler/mutability/swap.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "false" - initial_ast: 17828ff8ffc7902cfe67b7816477cf3099c248f7fde312a9792dd311814340c6 - canonicalized_ast: 17828ff8ffc7902cfe67b7816477cf3099c248f7fde312a9792dd311814340c6 - type_inferenced_ast: be55144bf090bcfc6d49170844c89b067b224b241fd953b0b683c70b91baaad4 + initial_ast: d242fc681e75003adf2e36aecbca50f8c338f8b40b4cf53342857cc672c753a2 + canonicalized_ast: d242fc681e75003adf2e36aecbca50f8c338f8b40b4cf53342857cc672c753a2 + type_inferenced_ast: 21e2566f3ed62dc1bd39cb3b9a7b37bb84c5a621bbb5ee77c4af08412e321e94 diff --git a/tests/expectations/compiler/compiler/statements/all_loops.leo.out b/tests/expectations/compiler/compiler/statements/all_loops.leo.out index 392b2542c0..b2a11d740c 100644 --- a/tests/expectations/compiler/compiler/statements/all_loops.leo.out +++ b/tests/expectations/compiler/compiler/statements/all_loops.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 280277fb32e4eece0eab1f72338a9b60b6792d7f11124e8c4a5678ef3fc4a04e - canonicalized_ast: 84769d3580d79825fef6fd00dd9ab88dc6eaf16bf2e3f3c46feae654f8f1f746 - type_inferenced_ast: 078070bc5df73c49f8de0ca37ac624c93a67551e0221dc1c65a84588507a2a6f + initial_ast: 16484d1177234086a3e8a1c32d2b82e0f1b8d3d93a659aba714d6cd5479bbe8b + canonicalized_ast: da9bcca9fe3e363b62bec3be7f446dd416f72a18aeb91e83c30d2314d67b1881 + type_inferenced_ast: 6d31a33082f9dd2e9a54dcbb90bca315ac328cd93d7979d48b696ba39f6e6f38 diff --git a/tests/expectations/compiler/compiler/statements/assign_ternary.leo.out b/tests/expectations/compiler/compiler/statements/assign_ternary.leo.out index 6518a49fff..659cb7e8b4 100644 --- a/tests/expectations/compiler/compiler/statements/assign_ternary.leo.out +++ b/tests/expectations/compiler/compiler/statements/assign_ternary.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:4:13\n |\n 4 | let x = true ? x: true;\n | ^^^^^^^^^^^^^^\n |\n = ternary sides had different types: left u32, right bool" + - "Error [EASG0373021]: ternary sides had different types: left u32, right bool\n --> compiler-test:4:13\n |\n 4 | let x = true ? x: true;\n | ^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/statements/block.leo.out b/tests/expectations/compiler/compiler/statements/block.leo.out index 4f83d727c2..3d0900fcc5 100644 --- a/tests/expectations/compiler/compiler/statements/block.leo.out +++ b/tests/expectations/compiler/compiler/statements/block.leo.out @@ -16,6 +16,6 @@ outputs: a: type: bool value: "true" - initial_ast: e5ab0d37ae2e0839f9f513f018e8f05fe6f6141962724fb0d84768abb4f155f2 - canonicalized_ast: 931832fc13e7bbb57ce4a867681cd5c746a5d6bec1eea051e1464b4030f746f4 - type_inferenced_ast: 932fe676b3460ab2a209d0b5e40359f8fd5e1d603bac1de5a2254eb83b2e1b39 + initial_ast: 0126e151faacae24bc508e67a5c8d1d78024fed8da226238ad6436851e5b025e + canonicalized_ast: 34e85a0c78e50ee4718fa07458bbdb433399f71833479af414cdb7e7f6b482c2 + type_inferenced_ast: f92fcf546c8559c31db54cf6b19b17f955e568132a12280f7c3804f57fb339d4 diff --git a/tests/expectations/compiler/compiler/statements/chain.leo.out b/tests/expectations/compiler/compiler/statements/chain.leo.out index 96f9d6fee1..a16e4872ea 100644 --- a/tests/expectations/compiler/compiler/statements/chain.leo.out +++ b/tests/expectations/compiler/compiler/statements/chain.leo.out @@ -28,6 +28,6 @@ outputs: a: type: bool value: "false" - initial_ast: 2f84a632ff69e9e18a46b5b8f82b9b3fa66d63c5ceab6edbf034c9388ea0f787 - canonicalized_ast: 2f84a632ff69e9e18a46b5b8f82b9b3fa66d63c5ceab6edbf034c9388ea0f787 - type_inferenced_ast: feaa875ce4b50aa1d73b92c9bbada7f048bf5db7e0653f46507baacea68a7e30 + initial_ast: 07fb0d55368685050d065a7b7cc7e19e7fa119754bbf10a4aab46580ae74c51a + canonicalized_ast: 07fb0d55368685050d065a7b7cc7e19e7fa119754bbf10a4aab46580ae74c51a + type_inferenced_ast: eaa4797908d50053ba52f7ead813fe071aeacf4a24d1b57ed77188f58c3f5348 diff --git a/tests/expectations/compiler/compiler/statements/compound_assignment.leo.out b/tests/expectations/compiler/compiler/statements/compound_assignment.leo.out index a791a74ca9..c171430d72 100644 --- a/tests/expectations/compiler/compiler/statements/compound_assignment.leo.out +++ b/tests/expectations/compiler/compiler/statements/compound_assignment.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: cac8070caf7819b61e0f1d5fc3557c76957acb69e958b6cdfc793c416f0b9fd0 - canonicalized_ast: e678afe5d42eb07b14965803f080cbda55b8c01f65ddf417367a75949223a27f - type_inferenced_ast: c100f9c558b94b2c89b78da4867e2ed5e6bc4de8ec6f3218d64c26ba9c73b428 + initial_ast: b260517dc70a401c68acfc09bd6434b55b61446e27bd940ad339987eb22ff85e + canonicalized_ast: eb5f37501878e5f97180a6f289f29795e09cb2da6fb031ed7ccb83681b407123 + type_inferenced_ast: 3abe1f8136d17844e2d11db603945fc06365cf91b51b9df0a2f700be94df8766 diff --git a/tests/expectations/compiler/compiler/statements/duplicate_variable.leo.out b/tests/expectations/compiler/compiler/statements/duplicate_variable.leo.out index a313c9602a..349d819abb 100644 --- a/tests/expectations/compiler/compiler/statements/duplicate_variable.leo.out +++ b/tests/expectations/compiler/compiler/statements/duplicate_variable.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:5:3\n |\n 5 | let x = true;\n | ^^^^^^^^^^^^\n |\n = a variable named \"x\" already exists in this scope" + - "Error [EASG0373017]: a variable named \"x\" already exists in this scope\n --> compiler-test:5:3\n |\n 5 | let x = true;\n | ^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/statements/for_loop.leo.out b/tests/expectations/compiler/compiler/statements/for_loop.leo.out index 3f9284533d..55dd2ce7ba 100644 --- a/tests/expectations/compiler/compiler/statements/for_loop.leo.out +++ b/tests/expectations/compiler/compiler/statements/for_loop.leo.out @@ -16,6 +16,6 @@ outputs: a: type: bool value: "true" - initial_ast: cce56dc8d678cd645e8fb3043aeb95bd24f94640e08219f00b7b9db66498ec29 - canonicalized_ast: 914f4ba5fc0c5148f1e105af4f857b8b12d29a609d47a366c73fd3d2f8eda3bf - type_inferenced_ast: 02b16a3b3a7e7c7ca4803292ea1f5410f293f2000f21c0a5245f2e5273561f06 + initial_ast: 15072d280d783640c9810be541201c6f71708687ffe7242503ec03012cf9ab67 + canonicalized_ast: 26d817bfd0168ac3aa31b7f197cf8f9273ca4c94b25b9df5a7112c228047cc7b + type_inferenced_ast: 1f5484f5993b7993ac6f10aaef884fbf502ae0efeabf5c9044c38bc7a4dc3011 diff --git a/tests/expectations/compiler/compiler/statements/iteration_basic.leo.out b/tests/expectations/compiler/compiler/statements/iteration_basic.leo.out index 34b078aed4..8958ce64ff 100644 --- a/tests/expectations/compiler/compiler/statements/iteration_basic.leo.out +++ b/tests/expectations/compiler/compiler/statements/iteration_basic.leo.out @@ -16,6 +16,6 @@ outputs: a: type: bool value: "true" - initial_ast: 1c9abdc059f6649b381be12d435129702a048f941b5766212105d9f20c6479cf - canonicalized_ast: 5a8d9b146b28300345c3f0878f712ccc7a545534dc820d22180ec7bff8b96713 - type_inferenced_ast: 259654bcec24b6110db951fef9ee504455219c9e1860cc96b30d18ecf8fc2ead + initial_ast: 7352861b3e7107ec349b2fd905e95fd78bdc79829ecec90eafa2c3bfa36e0716 + canonicalized_ast: bcb00069768d5ce3902d0ee802aa8b1f23132619ca627b5aadc01200565870c1 + type_inferenced_ast: 35cc981849af0cb83ed968b6dd466efbf7c7733cf9fed2e9a0880e2771640ce1 diff --git a/tests/expectations/compiler/compiler/statements/iteration_variable.leo.out b/tests/expectations/compiler/compiler/statements/iteration_variable.leo.out index 74a9d729cf..811d97f278 100644 --- a/tests/expectations/compiler/compiler/statements/iteration_variable.leo.out +++ b/tests/expectations/compiler/compiler/statements/iteration_variable.leo.out @@ -16,6 +16,6 @@ outputs: a: type: bool value: "true" - initial_ast: 3ac3ba48fb628fff67489c5d1502c3e0aaf9e197bf54d8c544fc79d9c83e3e16 - canonicalized_ast: c081654e7bd5edbfc1653444e73bc2f5e5b4e887f3e99dbb54f26cbfa37d84e1 - type_inferenced_ast: 23cddd23376a87be6e293bb4eae4470c9e450984bace87dc7386a5bf37081af0 + initial_ast: 4c020866d910371924bfa7f24761e022b658ac7f38ff6348fc837fb026b43b22 + canonicalized_ast: dfc10c9e46558ebf7654a49fb87a61bae5fa3d5f8384b4e144761518a762f0d1 + type_inferenced_ast: 3aef844b36c18ec04f9f6cacf679182b752a720ac038b71569791e7e12e5eca5 diff --git a/tests/expectations/compiler/compiler/statements/multiple_returns.leo.out b/tests/expectations/compiler/compiler/statements/multiple_returns.leo.out index 4522880b93..8ed2ee0809 100644 --- a/tests/expectations/compiler/compiler/statements/multiple_returns.leo.out +++ b/tests/expectations/compiler/compiler/statements/multiple_returns.leo.out @@ -22,6 +22,6 @@ outputs: a: type: bool value: "false" - initial_ast: e4b9f8c53d1d5cce1f00b2674448d42cd5bfb229a2544df0f2e996da2847e27e - canonicalized_ast: e4b9f8c53d1d5cce1f00b2674448d42cd5bfb229a2544df0f2e996da2847e27e - type_inferenced_ast: 3d4a4e67e5ad7adcd189537ed085a4d894115cfaa0f0afb0cd764f2d28355f81 + initial_ast: 3e1bc14f1bc7e4b083bde21cfd0e833333142bfbcf247b60e77d0ffb8a159e98 + canonicalized_ast: 3e1bc14f1bc7e4b083bde21cfd0e833333142bfbcf247b60e77d0ffb8a159e98 + type_inferenced_ast: 927f1640868f0a50f30ac3a9604dc99f9ec5e7906884007cfea7a10333bb06d8 diff --git a/tests/expectations/compiler/compiler/statements/mutate.leo.out b/tests/expectations/compiler/compiler/statements/mutate.leo.out index 43c1e52419..030ff12ccd 100644 --- a/tests/expectations/compiler/compiler/statements/mutate.leo.out +++ b/tests/expectations/compiler/compiler/statements/mutate.leo.out @@ -22,6 +22,6 @@ outputs: a: type: bool value: "true" - initial_ast: 5bc9151ccd030d4ae8248850c22ba9abef2d3b0c77c8b4658b595ce63a0e3461 - canonicalized_ast: 5bc9151ccd030d4ae8248850c22ba9abef2d3b0c77c8b4658b595ce63a0e3461 - type_inferenced_ast: 0aedd29433a0d5f90ec29a5b8571bf124d2cf98687e7ef11e0ae2576508540f3 + initial_ast: 2ac096dbb8840a8a71cb14365272088509094ffae32f1bcd44618a5fa9abc35e + canonicalized_ast: 2ac096dbb8840a8a71cb14365272088509094ffae32f1bcd44618a5fa9abc35e + type_inferenced_ast: cb7037b631e1a9994a7dc347bf834804acd1e28e5f4ace536aef36ae41695e20 diff --git a/tests/expectations/compiler/compiler/statements/nested_mutate.leo.out b/tests/expectations/compiler/compiler/statements/nested_mutate.leo.out index 0e56fe14c8..ebb4ab1cce 100644 --- a/tests/expectations/compiler/compiler/statements/nested_mutate.leo.out +++ b/tests/expectations/compiler/compiler/statements/nested_mutate.leo.out @@ -28,6 +28,6 @@ outputs: a: type: bool value: "false" - initial_ast: 72f7d405df7dc1f8a399bac21756cac5bad2bfa74d4cf508f385f6e6427cdc7e - canonicalized_ast: 674f7e3c3389d726c338b9af92d7e9492a69573573a7e890e92a35696d7fd6da - type_inferenced_ast: eb4035f253dd5c6f3d49aa6cf329d65e8cf7cee52bb12d673bae89fbd8e38dfa + initial_ast: 45eb01ab83d086d7e6a07c03e47b01d6e0d07f668e3b76138283a64b1e0c5760 + canonicalized_ast: 6c426c224bd59f40be37e044750db2de10527168924a85aae9c90bb6d8fd7c5f + type_inferenced_ast: 7510f5f6eba668e63befb0b9f4119e28382caac699d0da21587a62fe4746b6c9 diff --git a/tests/expectations/compiler/compiler/statements/reverse_loops.leo.out b/tests/expectations/compiler/compiler/statements/reverse_loops.leo.out index 315612b6fe..fe35d557f9 100644 --- a/tests/expectations/compiler/compiler/statements/reverse_loops.leo.out +++ b/tests/expectations/compiler/compiler/statements/reverse_loops.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 41a0c534538a94dc81b72250c2fc9f4119c6b8d3f3e99e47e239365284bd0084 - canonicalized_ast: 6c3f732c92874e90be8cab55ac665c6f6d4292d76fce147ae89ed9dbdfe685ea - type_inferenced_ast: 2258791abdb7bde2e3f28a12ff8b5d593985c42d78e3750d6b5f44d88d0560ed + initial_ast: 6bbf937830bb2dfbd2f308f47ca8ff50a405aed0cec27aca4de4f83ed1ee8186 + canonicalized_ast: 0ba1c0416d295b92a9747cbf7f9d263c9b45b269bce23a0ab4afd932219b7950 + type_inferenced_ast: f00d268715b94de26102bc7d54b7238fec08fc7c4a01a713e1162b9d52e097e3 diff --git a/tests/expectations/compiler/compiler/statements/reverse_one.leo.out b/tests/expectations/compiler/compiler/statements/reverse_one.leo.out index 2efc997d1c..7517a30218 100644 --- a/tests/expectations/compiler/compiler/statements/reverse_one.leo.out +++ b/tests/expectations/compiler/compiler/statements/reverse_one.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 55d64e1ef9318084a66cee912987308a21c5779cdad1f0103d6b3fb195f74d8a - canonicalized_ast: 467824b3c4be8e0d10d6008a036f40bed2659a18ab7eb2ea2a5c7124146d9b06 - type_inferenced_ast: b0908f46546647877409194ca817072d02f157b720236c7f58b5d3b0b7cfb81f + initial_ast: fef6eef9955869631e3cc48ce5127e519a8f3483a440d243e12ff241f0f24b67 + canonicalized_ast: 88939f0afb3e09a85f48ae2022c97128a260bd4eee667dc26e32f48d8b3253e5 + type_inferenced_ast: c10090137663610771d6e8144806b5899f23a881dd810432559848bf3e48bc82 diff --git a/tests/expectations/compiler/compiler/statements/ternary_non_const_fail.leo.out b/tests/expectations/compiler/compiler/statements/ternary_non_const_fail.leo.out index c32c26b9f2..0deb81474b 100644 --- a/tests/expectations/compiler/compiler/statements/ternary_non_const_fail.leo.out +++ b/tests/expectations/compiler/compiler/statements/ternary_non_const_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - " --> compiler-test:5:5\n |\n 5 | const y = x > 2u8? 1u8 : 2u8;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = failed to create const variable(s) 'y' with non constant values." + - "Error [EASG0373015]: failed to create const variable(s) 'y' with non constant values.\n --> compiler-test:5:5\n |\n 5 | const y = x > 2u8? 1u8 : 2u8;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/string/circuit.leo.out b/tests/expectations/compiler/compiler/string/circuit.leo.out index b607e80f47..00776b17f3 100644 --- a/tests/expectations/compiler/compiler/string/circuit.leo.out +++ b/tests/expectations/compiler/compiler/string/circuit.leo.out @@ -16,6 +16,6 @@ outputs: out: type: "[char; 13]" value: "\"Hello, World!\"" - initial_ast: 69219c995852ced5fe06a4009c4d58a8b59cc23ed7144ab4f08d4e0d4a6c5798 - canonicalized_ast: c099eab8cd118203aa297b200be1fd331f6e20ed1f19ff87efe16d406f5a0ce0 - type_inferenced_ast: acef5428f299c6cdbd9ac4b644123cf17a379efe025656122e359abe06da7eb8 + initial_ast: 3ece39236ca03d9f6e4a89ae1a5f27cdbc8036eb1485913a2043d1e0a44beb3c + canonicalized_ast: b3df972e5b9658b6addba6f82e972043620a591f5981ac009b56fb6965742695 + type_inferenced_ast: 22fdc2ba01f04dbe8140df231d6f8c77ad4b5e62a12dfb45a67686830ebee455 diff --git a/tests/expectations/compiler/compiler/string/equality.leo.out b/tests/expectations/compiler/compiler/string/equality.leo.out index 2795b2d234..75e85e5ed4 100644 --- a/tests/expectations/compiler/compiler/string/equality.leo.out +++ b/tests/expectations/compiler/compiler/string/equality.leo.out @@ -22,6 +22,6 @@ outputs: out: type: bool value: "false" - initial_ast: 62916b502a7017356bd5fbb6527ff51d6a5a57aeb55ed87754157ce8cad41341 - canonicalized_ast: b0299b9f1ec6927a101d4385a49b69ca9ab542699a9ab6c56024e75e5b034277 - type_inferenced_ast: 3643e1338fdf04fa531a63b596b26a0225c7a19f67eb600a787918e9fee30db0 + initial_ast: cb656e2f6fdbf4250957c867db059168afb7240fb085f8a850a0f0d7857a80e9 + canonicalized_ast: 7b67543fdb551982c7da1eb3f89ef5c68a4c85de9c6e01259df61532c763e236 + type_inferenced_ast: 4b4fe877cfe562d1c86b0936025390241a26cf21956d2a00cab1c04e0c5ea73b diff --git a/tests/expectations/compiler/compiler/string/replace.leo.out b/tests/expectations/compiler/compiler/string/replace.leo.out index 4ffc21ed0c..34c380ca0e 100644 --- a/tests/expectations/compiler/compiler/string/replace.leo.out +++ b/tests/expectations/compiler/compiler/string/replace.leo.out @@ -22,6 +22,6 @@ outputs: out: type: bool value: "true" - initial_ast: 6c161515e03a95ab1eba6e94a0de9bdd6f85750a99000f66a2c6c518179c6dc0 - canonicalized_ast: c3d2fe2a37ba42e8423d571232ddc1c745c934f3772e3abf4a317816497c73f2 - type_inferenced_ast: 80cfa7238e4a4ed1f05cc5a5c97a00f5c7db1eee377107d4f92830d41e17233d + initial_ast: c0e04242e6a567cdfb4df87912d8c7ab31a19883c3cf0d953b29a767304adba9 + canonicalized_ast: 98bfa17b9e22ad3a06ff41acd60be67b8f34597d89d38abb3b122b22a38f52d8 + type_inferenced_ast: 6598fc525d9b2fed0db8c741ce90820196d1514d6cc739b957f4f133c46592f4 diff --git a/tests/expectations/compiler/compiler/string/string_transformation.leo.out b/tests/expectations/compiler/compiler/string/string_transformation.leo.out index 2bb9dc0ad1..e504e3b6bb 100644 --- a/tests/expectations/compiler/compiler/string/string_transformation.leo.out +++ b/tests/expectations/compiler/compiler/string/string_transformation.leo.out @@ -16,6 +16,6 @@ outputs: out: type: bool value: "true" - initial_ast: 1dc757170332a649227f9b9af6dbfa0c2ecce9040ea6502fb71ee686c956cea5 - canonicalized_ast: 141842a220878194dd91d273691f940685bd44366a8cedb21dfbd67770eb13c9 - type_inferenced_ast: e8c7b68d6db9eb8dd9884f381fac90fe4da9bcbce255f8159a80028fec0c1297 + initial_ast: 09f60770cc5c2d3765eaaaff677e6b0241693db4fb2355859a8787fc837e3b6d + canonicalized_ast: 38b83b23c154e103c0a8564a1845ff75bf270519a87a2d36db659ba616adea38 + type_inferenced_ast: 8090cc48aa49d2a70270c3d2aa8614830a73be2369a1ad91fe57d83aeb7afbb8 diff --git a/tests/expectations/compiler/compiler/tuples/access.leo.out b/tests/expectations/compiler/compiler/tuples/access.leo.out index e063d68ab0..a8a592cf15 100644 --- a/tests/expectations/compiler/compiler/tuples/access.leo.out +++ b/tests/expectations/compiler/compiler/tuples/access.leo.out @@ -19,6 +19,6 @@ outputs: c: type: bool value: "false" - initial_ast: 8e04cd62dc27e5486f82216b68bb9aa8ff996757da01988b8b23f38b090c1645 - canonicalized_ast: 8e04cd62dc27e5486f82216b68bb9aa8ff996757da01988b8b23f38b090c1645 - type_inferenced_ast: 79754b8b299f9c09d99eed04c343ef68da05b3fdd40f0d6885a48c108177fe72 + initial_ast: 26ccb648c843da2de819fa0451bb2aff8e187d2cda920aaccf43e1d2d7f0e95b + canonicalized_ast: 26ccb648c843da2de819fa0451bb2aff8e187d2cda920aaccf43e1d2d7f0e95b + type_inferenced_ast: 7bba16bcec82e82bce1892a9401b2a7c7529f20d25a32c77d727251e2844869d diff --git a/tests/expectations/compiler/compiler/tuples/basic.leo.out b/tests/expectations/compiler/compiler/tuples/basic.leo.out index 8dd37d0083..e0bad6c1f6 100644 --- a/tests/expectations/compiler/compiler/tuples/basic.leo.out +++ b/tests/expectations/compiler/compiler/tuples/basic.leo.out @@ -19,6 +19,6 @@ outputs: c: type: bool value: "false" - initial_ast: af436e46b9e39a856338f4b88de25b7a1fa350de7dc9278479163dcc08b8323e - canonicalized_ast: af436e46b9e39a856338f4b88de25b7a1fa350de7dc9278479163dcc08b8323e - type_inferenced_ast: 6a2c7905e8e8c79d318dde7e4c803e1b2b5b9755e480f0a9c3152ea9ae9240e6 + initial_ast: b8ecc455d0eb34031adea3dd2f74dc4eaeecd0a47fb3143db786c672015383ca + canonicalized_ast: b8ecc455d0eb34031adea3dd2f74dc4eaeecd0a47fb3143db786c672015383ca + type_inferenced_ast: 77ece65393296b71964354ac6915049d5f40d5a22288c3c47bb3889e17cca692 diff --git a/tests/expectations/compiler/compiler/tuples/dependent.leo.out b/tests/expectations/compiler/compiler/tuples/dependent.leo.out index 0fef685159..2663bf4676 100644 --- a/tests/expectations/compiler/compiler/tuples/dependent.leo.out +++ b/tests/expectations/compiler/compiler/tuples/dependent.leo.out @@ -19,6 +19,6 @@ outputs: c: type: bool value: "false" - initial_ast: 8d3a5cc77cf14db7140dace16fc2f590f6ddc73ed98932021bad4f90b5e99824 - canonicalized_ast: 8d3a5cc77cf14db7140dace16fc2f590f6ddc73ed98932021bad4f90b5e99824 - type_inferenced_ast: 7cd799d02f04c5426c8a316c9654db286bbab879e8ced2505152f6264764ba63 + initial_ast: a2a6a6b41de694d8203c33d3f90fc2c1526b604fb57ee4883b993e446b81e648 + canonicalized_ast: a2a6a6b41de694d8203c33d3f90fc2c1526b604fb57ee4883b993e446b81e648 + type_inferenced_ast: 2a1ef0e8fa141193320610df76dc78e6fb3db99f9db8f4ffa8221a90f90f7f40 diff --git a/tests/expectations/compiler/compiler/tuples/destructured.leo.out b/tests/expectations/compiler/compiler/tuples/destructured.leo.out index 106dd0d95d..1363798751 100644 --- a/tests/expectations/compiler/compiler/tuples/destructured.leo.out +++ b/tests/expectations/compiler/compiler/tuples/destructured.leo.out @@ -19,6 +19,6 @@ outputs: c: type: bool value: "true" - initial_ast: 6d6d745c5cfeeb6963cdc1f91b133b7a1526ed4ab3b979416b26a276146d8409 - canonicalized_ast: 6d6d745c5cfeeb6963cdc1f91b133b7a1526ed4ab3b979416b26a276146d8409 - type_inferenced_ast: d3762f581f0bf814fae646c47016e6a809bf1aab564ecc7f2d34a0c54965972b + initial_ast: 98996bc72276bc5cbf211e7559997e8e73a85fce60afd49aa88aee17d1634973 + canonicalized_ast: 98996bc72276bc5cbf211e7559997e8e73a85fce60afd49aa88aee17d1634973 + type_inferenced_ast: 664df8d84cc5ff6bcd4300df23227871ec938459b991d86384fdd1f15b3a89ca diff --git a/tests/expectations/compiler/compiler/tuples/nested_access.leo.out b/tests/expectations/compiler/compiler/tuples/nested_access.leo.out index f88ab1e6e2..c4af57aaf4 100644 --- a/tests/expectations/compiler/compiler/tuples/nested_access.leo.out +++ b/tests/expectations/compiler/compiler/tuples/nested_access.leo.out @@ -19,6 +19,6 @@ outputs: c: type: bool value: "false" - initial_ast: 972a1898ed642a83e5a49f4fd385d6a65a5021669cd28235dcc47e68cec836f7 - canonicalized_ast: 972a1898ed642a83e5a49f4fd385d6a65a5021669cd28235dcc47e68cec836f7 - type_inferenced_ast: a89fb16b36f7e1389f143ae7d15fe535982cfa1a8eb8e0a1e7a49a81d53d1c9c + initial_ast: ef3718fc909a28703e2487661aafb3fc24a858428d79d2ab7bb3743a162ed6a1 + canonicalized_ast: ef3718fc909a28703e2487661aafb3fc24a858428d79d2ab7bb3743a162ed6a1 + type_inferenced_ast: 14e0a6cf8847f1a292a5b22db1173b6c5181e5d49d8f6046d072620a0e94ff07 diff --git a/tests/expectations/parser/parser/circuits/big_self.leo.out b/tests/expectations/parser/parser/circuits/big_self.leo.out index abdced08ca..7ab99429ca 100644 --- a/tests/expectations/parser/parser/circuits/big_self.leo.out +++ b/tests/expectations/parser/parser/circuits/big_self.leo.out @@ -6,12 +6,12 @@ outputs: expected_input: [] imports: [] circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" + "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": + circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" members: - CircuitFunction: annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function x() -> Self {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x() -> Self {\\\"}\"}" input: [] output: SelfType block: @@ -19,35 +19,35 @@ outputs: - Return: expression: CircuitInit: - name: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" return Self {};\\\"}\"}" + name: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self {};\\\"}\"}" members: [] span: line_start: 5 line_stop: 5 col_start: 16 col_stop: 23 - path: test + path: "" content: " return Self {};" span: line_start: 5 line_stop: 5 col_start: 9 col_stop: 23 - path: test + path: "" content: " return Self {};" span: line_start: 4 line_stop: 6 col_start: 26 col_stop: 6 - path: test - content: " function x() -> Self {\n...\n }" + path: "" + content: " function x() -> Self {\n ...\n }" span: line_start: 4 line_stop: 6 col_start: 5 col_stop: 6 - path: test - content: " function x() -> Self {\n...\n }" + path: "" + content: " function x() -> Self {\n ...\n }" global_consts: {} functions: {} diff --git a/tests/expectations/parser/parser/circuits/empty.leo.out b/tests/expectations/parser/parser/circuits/empty.leo.out index e826c4097d..c49cb7535e 100644 --- a/tests/expectations/parser/parser/circuits/empty.leo.out +++ b/tests/expectations/parser/parser/circuits/empty.leo.out @@ -6,8 +6,8 @@ outputs: expected_input: [] imports: [] circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" + "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": + circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" members: [] global_consts: {} functions: {} diff --git a/tests/expectations/parser/parser/circuits/field_and_functions.leo.out b/tests/expectations/parser/parser/circuits/field_and_functions.leo.out index a13e5be7fb..2001535836 100644 --- a/tests/expectations/parser/parser/circuits/field_and_functions.leo.out +++ b/tests/expectations/parser/parser/circuits/field_and_functions.leo.out @@ -6,18 +6,18 @@ outputs: expected_input: [] imports: [] circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" + "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": + circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" members: - CircuitVariable: - - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" x: u32,\\\"}\"}" + - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x: u32,\\\"}\"}" - IntegerType: U32 - CircuitVariable: - - "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" y: u32\\\"}\"}" + - "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y: u32\\\"}\"}" - IntegerType: U32 - CircuitFunction: annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function x() {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x() {\\\"}\"}" input: [] output: ~ block: @@ -31,32 +31,32 @@ outputs: line_stop: 7 col_start: 16 col_stop: 18 - path: test + path: "" content: " return ();" span: line_start: 7 line_stop: 7 col_start: 9 col_stop: 18 - path: test + path: "" content: " return ();" span: line_start: 6 line_stop: 8 col_start: 18 col_stop: 6 - path: test - content: " function x() {\n...\n }" + path: "" + content: " function x() {\n ...\n }" span: line_start: 6 line_stop: 8 col_start: 5 col_stop: 6 - path: test - content: " function x() {\n...\n }" + path: "" + content: " function x() {\n ...\n }" - CircuitFunction: annotations: [] - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function y() {\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function y() {\\\"}\"}" input: [] output: ~ block: @@ -70,28 +70,28 @@ outputs: line_stop: 10 col_start: 16 col_stop: 18 - path: test + path: "" content: " return ();" span: line_start: 10 line_stop: 10 col_start: 9 col_stop: 18 - path: test + path: "" content: " return ();" span: line_start: 9 line_stop: 11 col_start: 18 col_stop: 6 - path: test - content: " function y() {\n...\n }" + path: "" + content: " function y() {\n ...\n }" span: line_start: 9 line_stop: 11 col_start: 5 col_stop: 6 - path: test - content: " function y() {\n...\n }" + path: "" + content: " function y() {\n ...\n }" global_consts: {} functions: {} diff --git a/tests/expectations/parser/parser/circuits/fields.leo.out b/tests/expectations/parser/parser/circuits/fields.leo.out index 041cc13554..544e12e553 100644 --- a/tests/expectations/parser/parser/circuits/fields.leo.out +++ b/tests/expectations/parser/parser/circuits/fields.leo.out @@ -6,14 +6,14 @@ outputs: expected_input: [] imports: [] circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" + "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": + circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" members: - CircuitVariable: - - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" x: u32;\\\"}\"}" + - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x: u32;\\\"}\"}" - IntegerType: U32 - CircuitVariable: - - "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" y: u32;\\\"}\"}" + - "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y: u32;\\\"}\"}" - IntegerType: U32 global_consts: {} functions: {} diff --git a/tests/expectations/parser/parser/circuits/fields_fail.leo.out b/tests/expectations/parser/parser/circuits/fields_fail.leo.out index 006159e9d5..8c4dbaf736 100644 --- a/tests/expectations/parser/parser/circuits/fields_fail.leo.out +++ b/tests/expectations/parser/parser/circuits/fields_fail.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - " --> test:10:11\n |\n 10 | y: u32;\n | ^\n |\n = Cannot mix use of commas and semi-colons for circuit member variable declarations." + - "Error [EPAR0370006]: Cannot mix use of commas and semi-colons for circuit member variable declarations.\n --> test:10:11\n |\n 10 | y: u32;\n | ^" diff --git a/tests/expectations/parser/parser/circuits/functions.leo.out b/tests/expectations/parser/parser/circuits/functions.leo.out index aebda6c4e5..456134649f 100644 --- a/tests/expectations/parser/parser/circuits/functions.leo.out +++ b/tests/expectations/parser/parser/circuits/functions.leo.out @@ -6,12 +6,12 @@ outputs: expected_input: [] imports: [] circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" + "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": + circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" members: - CircuitFunction: annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function x() {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x() {\\\"}\"}" input: [] output: ~ block: @@ -25,32 +25,32 @@ outputs: line_stop: 5 col_start: 16 col_stop: 18 - path: test + path: "" content: " return ();" span: line_start: 5 line_stop: 5 col_start: 9 col_stop: 18 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 6 col_start: 18 col_stop: 6 - path: test - content: " function x() {\n...\n }" + path: "" + content: " function x() {\n ...\n }" span: line_start: 4 line_stop: 6 col_start: 5 col_stop: 6 - path: test - content: " function x() {\n...\n }" + path: "" + content: " function x() {\n ...\n }" - CircuitFunction: annotations: [] - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function y() {\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function y() {\\\"}\"}" input: [] output: ~ block: @@ -64,28 +64,28 @@ outputs: line_stop: 8 col_start: 16 col_stop: 18 - path: test + path: "" content: " return ();" span: line_start: 8 line_stop: 8 col_start: 9 col_stop: 18 - path: test + path: "" content: " return ();" span: line_start: 7 line_stop: 9 col_start: 18 col_stop: 6 - path: test - content: " function y() {\n...\n }" + path: "" + content: " function y() {\n ...\n }" span: line_start: 7 line_stop: 9 col_start: 5 col_stop: 6 - path: test - content: " function y() {\n...\n }" + path: "" + content: " function y() {\n ...\n }" global_consts: {} functions: {} diff --git a/tests/expectations/parser/parser/circuits/mut_self.leo.out b/tests/expectations/parser/parser/circuits/mut_self.leo.out index 03997801dc..5aac598fe5 100644 --- a/tests/expectations/parser/parser/circuits/mut_self.leo.out +++ b/tests/expectations/parser/parser/circuits/mut_self.leo.out @@ -6,14 +6,14 @@ outputs: expected_input: [] imports: [] circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" + "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": + circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" members: - CircuitFunction: annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function x(mut self) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x(mut self) {\\\"}\"}" input: - - MutSelfKeyword: "{\"name\":\"mut self\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":16,\\\"col_stop\\\":24,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function x(mut self) {\\\"}\"}" + - MutSelfKeyword: "{\"name\":\"mut self\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":16,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x(mut self) {\\\"}\"}" output: ~ block: statements: @@ -26,28 +26,28 @@ outputs: line_stop: 5 col_start: 16 col_stop: 18 - path: test + path: "" content: " return ();" span: line_start: 5 line_stop: 5 col_start: 9 col_stop: 18 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 6 col_start: 26 col_stop: 6 - path: test - content: " function x(mut self) {\n...\n }" + path: "" + content: " function x(mut self) {\n ...\n }" span: line_start: 4 line_stop: 6 col_start: 5 col_stop: 6 - path: test - content: " function x(mut self) {\n...\n }" + path: "" + content: " function x(mut self) {\n ...\n }" global_consts: {} functions: {} diff --git a/tests/expectations/parser/parser/circuits/self.leo.out b/tests/expectations/parser/parser/circuits/self.leo.out index 65785a36b6..728f595922 100644 --- a/tests/expectations/parser/parser/circuits/self.leo.out +++ b/tests/expectations/parser/parser/circuits/self.leo.out @@ -6,14 +6,14 @@ outputs: expected_input: [] imports: [] circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" + "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": + circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" members: - CircuitFunction: annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function x(self) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x(self) {\\\"}\"}" input: - - SelfKeyword: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function x(self) {\\\"}\"}" + - SelfKeyword: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x(self) {\\\"}\"}" output: ~ block: statements: @@ -26,28 +26,28 @@ outputs: line_stop: 5 col_start: 16 col_stop: 18 - path: test + path: "" content: " return ();" span: line_start: 5 line_stop: 5 col_start: 9 col_stop: 18 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 6 col_start: 22 col_stop: 6 - path: test - content: " function x(self) {\n...\n }" + path: "" + content: " function x(self) {\n ...\n }" span: line_start: 4 line_stop: 6 col_start: 5 col_stop: 6 - path: test - content: " function x(self) {\n...\n }" + path: "" + content: " function x(self) {\n ...\n }" global_consts: {} functions: {} diff --git a/tests/expectations/parser/parser/expression/access/array_access.leo.out b/tests/expectations/parser/parser/expression/access/array_access.leo.out index 5c820cc814..b430ed4d75 100644 --- a/tests/expectations/parser/parser/expression/access/array_access.leo.out +++ b/tests/expectations/parser/parser/expression/access/array_access.leo.out @@ -4,7 +4,7 @@ expectation: Pass outputs: - ArrayAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0]\\\"}\"}" index: Value: Implicit: @@ -13,18 +13,18 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: "x[0]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x[0]" - ArrayAccess: array: - Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"X[1]\\\"}\"}" + Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X[1]\\\"}\"}" index: Value: Implicit: @@ -33,18 +33,18 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: "X[1]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "X[1]" - ArrayAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0u8]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0u8]\\\"}\"}" index: Value: Integer: @@ -54,20 +54,20 @@ outputs: line_stop: 1 col_start: 3 col_stop: 6 - path: test + path: "" content: "x[0u8]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "x[0u8]" - ArrayAccess: array: ArrayAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[1u8][2u8]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[1u8][2u8]\\\"}\"}" index: Value: Integer: @@ -77,14 +77,14 @@ outputs: line_stop: 1 col_start: 3 col_stop: 6 - path: test + path: "" content: "x[1u8][2u8]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "x[1u8][2u8]" index: Value: @@ -95,14 +95,14 @@ outputs: line_stop: 1 col_start: 8 col_stop: 11 - path: test + path: "" content: "x[1u8][2u8]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: "x[1u8][2u8]" - ArrayAccess: array: @@ -110,39 +110,39 @@ outputs: array: ArrayAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" index: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x[x][y][z]" index: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "x[x][y][z]" index: - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" + Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: "x[x][y][z]" - Call: function: ArrayAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0]()\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0]()\\\"}\"}" index: Value: Implicit: @@ -151,14 +151,14 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: "x[0]()" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x[0]()" arguments: [] span: @@ -166,20 +166,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "x[0]()" - ArrayAccess: array: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x()[0]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x()[0]\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "x()[0]" index: Value: @@ -189,14 +189,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: "x()[0]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "x()[0]" - Call: function: @@ -204,32 +204,32 @@ outputs: circuit: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(y)::y(x)\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x(y)::y(x)\\\"}\"}" arguments: - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(y)::y(x)\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x(y)::y(x)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x(y)::y(x)" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(y)::y(x)\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x(y)::y(x)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "x(y)::y(x)" arguments: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(y)::y(x)\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x(y)::y(x)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: "x(y)::y(x)" - ArrayAccess: array: @@ -237,15 +237,15 @@ outputs: tuple: ArrayAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x].0[x]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x].0[x]\\\"}\"}" index: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x].0[x]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x].0[x]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x[x].0[x]" index: value: "0" @@ -254,14 +254,14 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "x[x].0[x]" index: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x].0[x]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x].0[x]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "x[x].0[x]" diff --git a/tests/expectations/parser/parser/expression/access/array_range_access.leo.out b/tests/expectations/parser/parser/expression/access/array_range_access.leo.out index 10b02e133d..01765075b3 100644 --- a/tests/expectations/parser/parser/expression/access/array_range_access.leo.out +++ b/tests/expectations/parser/parser/expression/access/array_range_access.leo.out @@ -4,7 +4,7 @@ expectation: Pass outputs: - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..]\\\"}\"}" left: ~ right: ~ span: @@ -12,11 +12,11 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: "x[..]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[1..]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[1..]\\\"}\"}" left: Value: Implicit: @@ -25,7 +25,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: "x[1..]" right: ~ span: @@ -33,11 +33,11 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "x[1..]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..1]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..1]\\\"}\"}" left: ~ right: Value: @@ -47,18 +47,18 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: "x[..1]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "x[..1]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[1..1]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[1..1]\\\"}\"}" left: Value: Implicit: @@ -67,7 +67,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: "x[1..1]" right: Value: @@ -77,18 +77,18 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: "x[1..1]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "x[1..1]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0..100]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0..100]\\\"}\"}" left: Value: Implicit: @@ -97,7 +97,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: "x[0..100]" right: Value: @@ -107,20 +107,20 @@ outputs: line_stop: 1 col_start: 6 col_stop: 9 - path: test + path: "" content: "x[0..100]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "x[0..100]" - ArrayAccess: array: ArrayAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[323452345.2345234523453453][323452345.2345234523453453]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[323452345.2345234523453453][323452345.2345234523453453]\\\"}\"}" index: TupleAccess: tuple: @@ -131,7 +131,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 12 - path: test + path: "" content: "x[323452345.2345234523453453][323452345.2345234523453453]" index: value: "2345234523453453" @@ -140,14 +140,14 @@ outputs: line_stop: 1 col_start: 3 col_stop: 29 - path: test + path: "" content: "x[323452345.2345234523453453][323452345.2345234523453453]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 30 - path: test + path: "" content: "x[323452345.2345234523453453][323452345.2345234523453453]" index: TupleAccess: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 31 col_stop: 40 - path: test + path: "" content: "x[323452345.2345234523453453][323452345.2345234523453453]" index: value: "2345234523453453" @@ -168,18 +168,18 @@ outputs: line_stop: 1 col_start: 31 col_stop: 57 - path: test + path: "" content: "x[323452345.2345234523453453][323452345.2345234523453453]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 58 - path: test + path: "" content: "x[323452345.2345234523453453][323452345.2345234523453453]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0u8..1u8]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0u8..1u8]\\\"}\"}" left: Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 6 - path: test + path: "" content: "x[0u8..1u8]" right: Value: @@ -200,18 +200,18 @@ outputs: line_stop: 1 col_start: 8 col_stop: 11 - path: test + path: "" content: "x[0u8..1u8]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: "x[0u8..1u8]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0u8..]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0u8..]\\\"}\"}" left: Value: Integer: @@ -221,7 +221,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 6 - path: test + path: "" content: "x[0u8..]" right: ~ span: @@ -229,11 +229,11 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "x[0u8..]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..0u8]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..0u8]\\\"}\"}" left: ~ right: Value: @@ -244,18 +244,18 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: test + path: "" content: "x[..0u8]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "x[..0u8]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..]\\\"}\"}" left: ~ right: ~ span: @@ -263,22 +263,22 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: "x[..]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y..]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..]\\\"}\"}" left: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y..]\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y..]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..]\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 3 col_stop: 6 - path: test + path: "" content: "x[x.y..]" right: ~ span: @@ -286,116 +286,116 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "x[x.y..]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..y.x]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..y.x]\\\"}\"}" left: ~ right: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..y.x]\\\"}\"}" - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..y.x]\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..y.x]\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..y.x]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 8 - path: test + path: "" content: "x[..y.x]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "x[..y.x]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" left: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 3 col_stop: 6 - path: test + path: "" content: "x[x.y..y.x]" right: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 11 - path: test + path: "" content: "x[x.y..y.x]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: "x[x.y..y.x]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" left: CircuitMemberAccess: circuit: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 3 col_stop: 6 - path: test + path: "" content: "x[x.y.x..y.x.y]" - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 3 col_stop: 8 - path: test + path: "" content: "x[x.y.x..y.x.y]" right: CircuitMemberAccess: circuit: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 10 col_stop: 13 - path: test + path: "" content: "x[x.y.x..y.x.y]" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 10 col_stop: 15 - path: test + path: "" content: "x[x.y.x..y.x.y]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 16 - path: test + path: "" content: "x[x.y.x..y.x.y]" diff --git a/tests/expectations/parser/parser/expression/access/call.leo.out b/tests/expectations/parser/parser/expression/access/call.leo.out index ed9e9058da..922d67dd47 100644 --- a/tests/expectations/parser/parser/expression/access/call.leo.out +++ b/tests/expectations/parser/parser/expression/access/call.leo.out @@ -4,77 +4,77 @@ expectation: Pass outputs: - Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x()\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x()\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x() - Call: function: - Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"X()\\\"}\"}" + Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X()\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: X() - Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(y)\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x(y)\\\"}\"}" arguments: - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(y)\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x(y)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: x(y) - Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(y, z)\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x(y, z)\\\"}\"}" arguments: - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(y, z)\\\"}\"}" - - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(y, z)\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x(y, z)\\\"}\"}" + - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x(y, z)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "x(y, z)" - Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(x, y, z)\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x(x, y, z)\\\"}\"}" arguments: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(x, y, z)\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(x, y, z)\\\"}\"}" - - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(x, y, z)\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x(x, y, z)\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x(x, y, z)\\\"}\"}" + - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x(x, y, z)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: "x(x, y, z)" - Call: function: CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y()\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y()\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y()\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y()\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x::y()" arguments: [] span: @@ -82,35 +82,35 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "x::y()" - Call: function: CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y(x)\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y(x)\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y(x)\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y(x)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x::y(x)" arguments: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y(x)\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y(x)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "x::y(x)" - Call: function: TupleAccess: tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0(x)\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.0(x)\\\"}\"}" index: value: "0" span: @@ -118,22 +118,22 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x.0(x) arguments: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0(x)\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.0(x)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: x.0(x) - Call: function: ArrayAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0](x)\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0](x)\\\"}\"}" index: Value: Implicit: @@ -142,21 +142,21 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: "x[0](x)" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x[0](x)" arguments: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0](x)\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0](x)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "x[0](x)" diff --git a/tests/expectations/parser/parser/expression/access/circuit.leo.out b/tests/expectations/parser/parser/expression/access/circuit.leo.out index e10176179c..8498601d1e 100644 --- a/tests/expectations/parser/parser/expression/access/circuit.leo.out +++ b/tests/expectations/parser/parser/expression/access/circuit.leo.out @@ -4,59 +4,59 @@ expectation: Pass outputs: - CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.y\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.y\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x.y - CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"X.Y\\\"}\"}" - name: "{\"name\":\"Y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"X.Y\\\"}\"}" + Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X.Y\\\"}\"}" + name: "{\"name\":\"Y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X.Y\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: X.Y - CircuitMemberAccess: circuit: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.y.z\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.y.z\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y.z\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y.z\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x.y.z - name: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.y.z\\\"}\"}" + name: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y.z\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: x.y.z - Call: function: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.y()\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.y()\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y()\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y()\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x.y() arguments: [] span: @@ -64,20 +64,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: x.y() - TupleAccess: tuple: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.y.0\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.y.0\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y.0\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y.0\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x.y.0 index: value: "0" @@ -86,20 +86,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: x.y.0 - ArrayAccess: array: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.y[1]\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.y[1]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y[1]\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y[1]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "x.y[1]" index: Value: @@ -109,12 +109,12 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: "x.y[1]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "x.y[1]" diff --git a/tests/expectations/parser/parser/expression/access/circuit_static.leo.out b/tests/expectations/parser/parser/expression/access/circuit_static.leo.out index eed96329a1..d4bc568323 100644 --- a/tests/expectations/parser/parser/expression/access/circuit_static.leo.out +++ b/tests/expectations/parser/parser/expression/access/circuit_static.leo.out @@ -4,59 +4,59 @@ expectation: Pass outputs: - CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x::y" - CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"X::Y\\\"}\"}" - name: "{\"name\":\"Y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"X::Y\\\"}\"}" + Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X::Y\\\"}\"}" + name: "{\"name\":\"Y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X::Y\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "X::Y" - CircuitStaticFunctionAccess: circuit: CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y::z\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y::z\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y::z\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y::z\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x::y::z" - name: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y::z\\\"}\"}" + name: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y::z\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "x::y::z" - Call: function: CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y()\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y()\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y()\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y()\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x::y()" arguments: [] span: @@ -64,20 +64,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "x::y()" - TupleAccess: tuple: CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y.0\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y.0\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y.0\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y.0\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x::y.0" index: value: "0" @@ -86,20 +86,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "x::y.0" - ArrayAccess: array: CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y[1]\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y[1]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y[1]\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y[1]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x::y[1]" index: Value: @@ -109,12 +109,12 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: "x::y[1]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "x::y[1]" diff --git a/tests/expectations/parser/parser/expression/access/tuple.leo.out b/tests/expectations/parser/parser/expression/access/tuple.leo.out index c4089a4522..5a9b570777 100644 --- a/tests/expectations/parser/parser/expression/access/tuple.leo.out +++ b/tests/expectations/parser/parser/expression/access/tuple.leo.out @@ -4,7 +4,7 @@ expectation: Pass outputs: - TupleAccess: tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.0\\\"}\"}" index: value: "0" span: @@ -12,11 +12,11 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x.0 - TupleAccess: tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.1\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.1\\\"}\"}" index: value: "1" span: @@ -24,11 +24,11 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x.1 - TupleAccess: tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.2\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.2\\\"}\"}" index: value: "2" span: @@ -36,13 +36,13 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x.2 - TupleAccess: tuple: TupleAccess: tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0.0\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.0.0\\\"}\"}" index: value: "0" span: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x.0.0 index: value: "0" @@ -59,13 +59,13 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: x.0.0 - TupleAccess: tuple: TupleAccess: tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.1.1\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.1.1\\\"}\"}" index: value: "1" span: @@ -73,7 +73,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x.1.1 index: value: "1" @@ -82,13 +82,13 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: x.1.1 - TupleAccess: tuple: TupleAccess: tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.2.2\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.2.2\\\"}\"}" index: value: "2" span: @@ -96,7 +96,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x.2.2 index: value: "2" @@ -105,5 +105,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: x.2.2 diff --git a/tests/expectations/parser/parser/expression/array_init.leo.out b/tests/expectations/parser/parser/expression/array_init.leo.out index c8ee3bfb32..a85d5bacea 100644 --- a/tests/expectations/parser/parser/expression/array_init.leo.out +++ b/tests/expectations/parser/parser/expression/array_init.leo.out @@ -12,7 +12,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "[0u8; 1]" dimensions: - value: "1" @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "[0u8; 1]" - ArrayInit: element: @@ -32,7 +32,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 3 - path: test + path: "" content: "[0; 1]" dimensions: - value: "1" @@ -41,7 +41,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "[0; 1]" - ArrayInit: element: @@ -52,7 +52,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 3 - path: test + path: "" content: "[0; (1)]" dimensions: - value: "1" @@ -61,7 +61,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "[0; (1)]" - ArrayInit: element: @@ -72,7 +72,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 3 - path: test + path: "" content: "[0; (1, 2)]" dimensions: - value: "1" @@ -82,7 +82,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: "[0; (1, 2)]" - ArrayInit: element: @@ -93,7 +93,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 3 - path: test + path: "" content: "[0; (1, 2, 3)]" dimensions: - value: "1" @@ -104,7 +104,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: "[0; (1, 2, 3)]" - ArrayInit: element: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 4 col_stop: 5 - path: test + path: "" content: "[[[0; 3]; 2]; 1]" dimensions: - value: "3" @@ -128,7 +128,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 9 - path: test + path: "" content: "[[[0; 3]; 2]; 1]" dimensions: - value: "2" @@ -137,7 +137,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 13 - path: test + path: "" content: "[[[0; 3]; 2]; 1]" dimensions: - value: "1" @@ -146,5 +146,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 17 - path: test + path: "" content: "[[[0; 3]; 2]; 1]" diff --git a/tests/expectations/parser/parser/expression/array_init_fail.leo.out b/tests/expectations/parser/parser/expression/array_init_fail.leo.out index 3e6e920477..0eacb46895 100644 --- a/tests/expectations/parser/parser/expression/array_init_fail.leo.out +++ b/tests/expectations/parser/parser/expression/array_init_fail.leo.out @@ -2,5 +2,5 @@ namespace: ParseExpression expectation: Fail outputs: - - " --> test:1:1\n |\n 1 | [...0u8; 1]\n | ^^^^^^^\n |\n = illegal spread in array initializer" - - " --> test:1:1\n |\n 1 | [...0; 1]\n | ^^^^^\n |\n = illegal spread in array initializer" + - "Error [EPAR0370010]: illegal spread in array initializer\n --> test:1:1\n |\n 1 | [...0u8; 1]\n | ^^^^^^^" + - "Error [EPAR0370010]: illegal spread in array initializer\n --> test:1:1\n |\n 1 | [...0; 1]\n | ^^^^^" diff --git a/tests/expectations/parser/parser/expression/array_inline.leo.out b/tests/expectations/parser/parser/expression/array_inline.leo.out index ae4ccf624f..0d8b1911cf 100644 --- a/tests/expectations/parser/parser/expression/array_inline.leo.out +++ b/tests/expectations/parser/parser/expression/array_inline.leo.out @@ -13,7 +13,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "[0u8, 1, 2, 3]" - Expression: Value: @@ -23,7 +23,7 @@ outputs: line_stop: 1 col_start: 7 col_stop: 8 - path: test + path: "" content: "[0u8, 1, 2, 3]" - Expression: Value: @@ -33,7 +33,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: "[0u8, 1, 2, 3]" - Expression: Value: @@ -43,14 +43,14 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: test + path: "" content: "[0u8, 1, 2, 3]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: "[0u8, 1, 2, 3]" - ArrayInline: elements: @@ -62,14 +62,14 @@ outputs: line_stop: 1 col_start: 2 col_stop: 3 - path: test + path: "" content: "[1]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "[1]" - ArrayInline: elements: @@ -82,14 +82,14 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "[1u8]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: "[1u8]" - ArrayInline: elements: @@ -102,14 +102,14 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "[1u8,]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "[1u8,]" - ArrayInline: elements: @@ -121,7 +121,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 3 - path: test + path: "" content: "[0, 1,]" - Expression: Value: @@ -131,14 +131,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: "[0, 1,]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "[0, 1,]" - ArrayInline: elements: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 3 - path: test + path: "" content: "[0,1,]" - Expression: Value: @@ -160,14 +160,14 @@ outputs: line_stop: 1 col_start: 4 col_stop: 5 - path: test + path: "" content: "[0,1,]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "[0,1,]" - ArrayInline: elements: [] @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 3 - path: test + path: "" content: "[]" - ArrayInline: elements: @@ -191,7 +191,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: "[[1,2,3],[1,2,3]]" - Expression: Value: @@ -201,7 +201,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: "[[1,2,3],[1,2,3]]" - Expression: Value: @@ -211,14 +211,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 8 - path: test + path: "" content: "[[1,2,3],[1,2,3]]" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 9 - path: test + path: "" content: "[[1,2,3],[1,2,3]]" - Expression: ArrayInline: @@ -231,7 +231,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: "[[1,2,3],[1,2,3]]" - Expression: Value: @@ -241,7 +241,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: test + path: "" content: "[[1,2,3],[1,2,3]]" - Expression: Value: @@ -251,21 +251,21 @@ outputs: line_stop: 1 col_start: 15 col_stop: 16 - path: test + path: "" content: "[[1,2,3],[1,2,3]]" span: line_start: 1 line_stop: 1 col_start: 10 col_stop: 17 - path: test + path: "" content: "[[1,2,3],[1,2,3]]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: test + path: "" content: "[[1,2,3],[1,2,3]]" - ArrayInline: elements: @@ -277,14 +277,14 @@ outputs: line_stop: 1 col_start: 2 col_stop: 4 - path: test + path: "" content: "[[]]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "[[]]" - ArrayInline: elements: @@ -296,7 +296,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 4 - path: test + path: "" content: "[[], []]" - Expression: ArrayInline: @@ -306,12 +306,12 @@ outputs: line_stop: 1 col_start: 6 col_stop: 8 - path: test + path: "" content: "[[], []]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "[[], []]" diff --git a/tests/expectations/parser/parser/expression/array_inline_fail.leo.out b/tests/expectations/parser/parser/expression/array_inline_fail.leo.out index 3565e3e59c..dd15703185 100644 --- a/tests/expectations/parser/parser/expression/array_inline_fail.leo.out +++ b/tests/expectations/parser/parser/expression/array_inline_fail.leo.out @@ -2,8 +2,8 @@ namespace: ParseExpression expectation: Fail outputs: - - " --> test:1:2\n |\n 1 | [,]\n | ^\n |\n = expected 'expression', got ','" - - " --> test:1:2\n |\n 1 | [,,]\n | ^\n |\n = expected 'expression', got ','" - - " --> test:1:4\n |\n 1 | [0,,]\n | ^\n |\n = expected 'expression', got ','" - - " --> test:1:2\n |\n 1 | [,0]\n | ^\n |\n = expected 'expression', got ','" - - " --> test:1:2\n |\n 1 | [,0,]\n | ^\n |\n = expected 'expression', got ','" + - "Error [EPAR0370009]: unexpected string: expected 'expression', got ','\n --> test:1:2\n |\n 1 | [,]\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', got ','\n --> test:1:2\n |\n 1 | [,,]\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', got ','\n --> test:1:4\n |\n 1 | [0,,]\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', got ','\n --> test:1:2\n |\n 1 | [,0]\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', got ','\n --> test:1:2\n |\n 1 | [,0,]\n | ^" diff --git a/tests/expectations/parser/parser/expression/binary/add.leo.out b/tests/expectations/parser/parser/expression/binary/add.leo.out index 72d244dd8d..9648060da3 100644 --- a/tests/expectations/parser/parser/expression/binary/add.leo.out +++ b/tests/expectations/parser/parser/expression/binary/add.leo.out @@ -11,7 +11,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 + 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 + 1 op: Add span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 + 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 2+3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: 2+3 op: Add span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: 2+3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 + 2 + 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 + 2 + 3 op: Add span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 + 2 + 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 + 2 + 3 op: Add span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: 1 + 2 + 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 * 2 + 3 * 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 * 2 + 3 * 4 op: Mul span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 * 2 + 3 * 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 * 2 + 3 * 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: test + path: "" content: 1 * 2 + 3 * 4 op: Mul span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: test + path: "" content: 1 * 2 + 3 * 4 op: Add span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 1 * 2 + 3 * 4 - Binary: left: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 + 2 - 3 right: Value: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 + 2 - 3 op: Add span: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 + 2 - 3 right: Value: @@ -217,7 +217,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 + 2 - 3 op: Sub span: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: 1 + 2 - 3 - Binary: left: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 right: Value: @@ -250,7 +250,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 op: Mul span: @@ -258,7 +258,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 right: Binary: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 right: Value: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 op: Mul span: @@ -288,7 +288,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 op: Add span: @@ -296,7 +296,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 right: Binary: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 17 col_stop: 18 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 right: Value: @@ -318,7 +318,7 @@ outputs: line_stop: 1 col_start: 21 col_stop: 22 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 op: Mul span: @@ -326,7 +326,7 @@ outputs: line_stop: 1 col_start: 17 col_stop: 22 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 op: Sub span: @@ -334,5 +334,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 22 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 diff --git a/tests/expectations/parser/parser/expression/binary/and.leo.out b/tests/expectations/parser/parser/expression/binary/and.leo.out index b6f8de5d72..b78bdf05ec 100644 --- a/tests/expectations/parser/parser/expression/binary/and.leo.out +++ b/tests/expectations/parser/parser/expression/binary/and.leo.out @@ -11,7 +11,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: true && false right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: test + path: "" content: true && false op: And span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: true && false - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: false&&true right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 8 col_stop: 12 - path: test + path: "" content: false&&true op: And span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: false&&true - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: true&&false&&true right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 7 col_stop: 12 - path: test + path: "" content: true&&false&&true op: And span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: true&&false&&true right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 18 - path: test + path: "" content: true&&false&&true op: And span: @@ -107,5 +107,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 18 - path: test + path: "" content: true&&false&&true diff --git a/tests/expectations/parser/parser/expression/binary/div.leo.out b/tests/expectations/parser/parser/expression/binary/div.leo.out index 45684cd859..b247975db9 100644 --- a/tests/expectations/parser/parser/expression/binary/div.leo.out +++ b/tests/expectations/parser/parser/expression/binary/div.leo.out @@ -11,7 +11,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 / 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 / 1 op: Div span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 / 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 2/3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: 2/3 op: Div span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: 2/3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 / 2 / 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 / 2 / 3 op: Div span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 / 2 / 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 / 2 / 3 op: Div span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: 1 / 2 / 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 ** 2 / 3 ** 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: 1 ** 2 / 3 ** 4 op: Pow span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 1 ** 2 / 3 ** 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: 1 ** 2 / 3 ** 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 15 col_stop: 16 - path: test + path: "" content: 1 ** 2 / 3 ** 4 op: Pow span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 16 - path: test + path: "" content: 1 ** 2 / 3 ** 4 op: Div span: @@ -176,5 +176,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 16 - path: test + path: "" content: 1 ** 2 / 3 ** 4 diff --git a/tests/expectations/parser/parser/expression/binary/eq.leo.out b/tests/expectations/parser/parser/expression/binary/eq.leo.out index a467a62bae..4d6341f2d8 100644 --- a/tests/expectations/parser/parser/expression/binary/eq.leo.out +++ b/tests/expectations/parser/parser/expression/binary/eq.leo.out @@ -11,7 +11,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 == 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: 1 == 1 op: Eq span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 1 == 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 2==3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 4 col_stop: 5 - path: test + path: "" content: 2==3 op: Eq span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: 2==3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 < 2 == 3 < 4 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 < 2 == 3 < 4 op: Lt span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 < 2 == 3 < 4 right: Binary: @@ -101,7 +101,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: 1 < 2 == 3 < 4 right: Value: @@ -111,7 +111,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: test + path: "" content: 1 < 2 == 3 < 4 op: Lt span: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 15 - path: test + path: "" content: 1 < 2 == 3 < 4 op: Eq span: @@ -127,7 +127,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 1 < 2 == 3 < 4 - Binary: left: @@ -142,7 +142,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 < 2 == 3 < 4 && 3 < 4 == 5 < 6 right: Value: @@ -152,7 +152,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 < 2 == 3 < 4 && 3 < 4 == 5 < 6 op: Lt span: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 < 2 == 3 < 4 && 3 < 4 == 5 < 6 right: Binary: @@ -172,7 +172,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: 1 < 2 == 3 < 4 && 3 < 4 == 5 < 6 right: Value: @@ -182,7 +182,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: test + path: "" content: 1 < 2 == 3 < 4 && 3 < 4 == 5 < 6 op: Lt span: @@ -190,7 +190,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 15 - path: test + path: "" content: 1 < 2 == 3 < 4 && 3 < 4 == 5 < 6 op: Eq span: @@ -198,7 +198,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 1 < 2 == 3 < 4 && 3 < 4 == 5 < 6 right: Binary: @@ -212,7 +212,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 20 - path: test + path: "" content: 1 < 2 == 3 < 4 && 3 < 4 == 5 < 6 right: Value: @@ -222,7 +222,7 @@ outputs: line_stop: 1 col_start: 23 col_stop: 24 - path: test + path: "" content: 1 < 2 == 3 < 4 && 3 < 4 == 5 < 6 op: Lt span: @@ -230,7 +230,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 24 - path: test + path: "" content: 1 < 2 == 3 < 4 && 3 < 4 == 5 < 6 right: Binary: @@ -242,7 +242,7 @@ outputs: line_stop: 1 col_start: 28 col_stop: 29 - path: test + path: "" content: 1 < 2 == 3 < 4 && 3 < 4 == 5 < 6 right: Value: @@ -252,7 +252,7 @@ outputs: line_stop: 1 col_start: 32 col_stop: 33 - path: test + path: "" content: 1 < 2 == 3 < 4 && 3 < 4 == 5 < 6 op: Lt span: @@ -260,7 +260,7 @@ outputs: line_stop: 1 col_start: 28 col_stop: 33 - path: test + path: "" content: 1 < 2 == 3 < 4 && 3 < 4 == 5 < 6 op: Eq span: @@ -268,7 +268,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 33 - path: test + path: "" content: 1 < 2 == 3 < 4 && 3 < 4 == 5 < 6 op: And span: @@ -276,5 +276,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 33 - path: test + path: "" content: 1 < 2 == 3 < 4 && 3 < 4 == 5 < 6 diff --git a/tests/expectations/parser/parser/expression/binary/exp.leo.out b/tests/expectations/parser/parser/expression/binary/exp.leo.out index b0c39a877f..cbac3279a1 100644 --- a/tests/expectations/parser/parser/expression/binary/exp.leo.out +++ b/tests/expectations/parser/parser/expression/binary/exp.leo.out @@ -11,7 +11,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 ** 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: 1 ** 1 op: Pow span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 1 ** 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 2**3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 4 col_stop: 5 - path: test + path: "" content: 2**3 op: Pow span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: 2**3 - Binary: left: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 ** 2 ** 3 right: Binary: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: 1 ** 2 ** 3 right: Value: @@ -91,7 +91,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: 1 ** 2 ** 3 op: Pow span: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 12 - path: test + path: "" content: 1 ** 2 ** 3 op: Pow span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 1 ** 2 ** 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 as i8 ** 3 as i8 target_type: IntegerType: I8 @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: 1 as i8 ** 3 as i8 right: Cast: @@ -141,7 +141,7 @@ outputs: line_stop: 1 col_start: 12 col_stop: 13 - path: test + path: "" content: 1 as i8 ** 3 as i8 target_type: IntegerType: I8 @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 12 col_stop: 19 - path: test + path: "" content: 1 as i8 ** 3 as i8 op: Pow span: @@ -158,7 +158,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 19 - path: test + path: "" content: 1 as i8 ** 3 as i8 - Binary: left: @@ -171,7 +171,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 as i8 ** 3 as i8 ** 5 as i8 target_type: IntegerType: I8 @@ -180,7 +180,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: 1 as i8 ** 3 as i8 ** 5 as i8 right: Binary: @@ -194,7 +194,7 @@ outputs: line_stop: 1 col_start: 12 col_stop: 13 - path: test + path: "" content: 1 as i8 ** 3 as i8 ** 5 as i8 target_type: IntegerType: I8 @@ -203,7 +203,7 @@ outputs: line_stop: 1 col_start: 12 col_stop: 19 - path: test + path: "" content: 1 as i8 ** 3 as i8 ** 5 as i8 right: Cast: @@ -215,7 +215,7 @@ outputs: line_stop: 1 col_start: 23 col_stop: 24 - path: test + path: "" content: 1 as i8 ** 3 as i8 ** 5 as i8 target_type: IntegerType: I8 @@ -224,7 +224,7 @@ outputs: line_stop: 1 col_start: 23 col_stop: 30 - path: test + path: "" content: 1 as i8 ** 3 as i8 ** 5 as i8 op: Pow span: @@ -232,7 +232,7 @@ outputs: line_stop: 1 col_start: 12 col_stop: 30 - path: test + path: "" content: 1 as i8 ** 3 as i8 ** 5 as i8 op: Pow span: @@ -240,5 +240,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 30 - path: test + path: "" content: 1 as i8 ** 3 as i8 ** 5 as i8 diff --git a/tests/expectations/parser/parser/expression/binary/gt.leo.out b/tests/expectations/parser/parser/expression/binary/gt.leo.out index b9d5cfd72d..186db57773 100644 --- a/tests/expectations/parser/parser/expression/binary/gt.leo.out +++ b/tests/expectations/parser/parser/expression/binary/gt.leo.out @@ -11,7 +11,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 > 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 > 1 op: Gt span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 > 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 2>3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: 2>3 op: Gt span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: 2>3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 > 2 > 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 > 2 > 3 op: Gt span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 > 2 > 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 > 2 > 3 op: Gt span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: 1 > 2 > 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 + 2 > 3 + 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 + 2 > 3 + 4 op: Add span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 + 2 > 3 + 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 + 2 > 3 + 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: test + path: "" content: 1 + 2 > 3 + 4 op: Add span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: test + path: "" content: 1 + 2 > 3 + 4 op: Gt span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 1 + 2 > 3 + 4 - Binary: left: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 > 2 > 3 right: Value: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 > 2 > 3 op: Gt span: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 > 2 > 3 right: Value: @@ -217,7 +217,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 > 2 > 3 op: Gt span: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: 1 > 2 > 3 - Binary: left: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 + 2 > 3 + 4 > 5 + 6 right: Value: @@ -250,7 +250,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 + 2 > 3 + 4 > 5 + 6 op: Add span: @@ -258,7 +258,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 + 2 > 3 + 4 > 5 + 6 right: Binary: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 + 2 > 3 + 4 > 5 + 6 right: Value: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: test + path: "" content: 1 + 2 > 3 + 4 > 5 + 6 op: Add span: @@ -288,7 +288,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: test + path: "" content: 1 + 2 > 3 + 4 > 5 + 6 op: Gt span: @@ -296,7 +296,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 1 + 2 > 3 + 4 > 5 + 6 right: Binary: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 17 col_stop: 18 - path: test + path: "" content: 1 + 2 > 3 + 4 > 5 + 6 right: Value: @@ -318,7 +318,7 @@ outputs: line_stop: 1 col_start: 21 col_stop: 22 - path: test + path: "" content: 1 + 2 > 3 + 4 > 5 + 6 op: Add span: @@ -326,7 +326,7 @@ outputs: line_stop: 1 col_start: 17 col_stop: 22 - path: test + path: "" content: 1 + 2 > 3 + 4 > 5 + 6 op: Gt span: @@ -334,5 +334,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 22 - path: test + path: "" content: 1 + 2 > 3 + 4 > 5 + 6 diff --git a/tests/expectations/parser/parser/expression/binary/gte.leo.out b/tests/expectations/parser/parser/expression/binary/gte.leo.out index 9ab526f71c..a7fd2f15c9 100644 --- a/tests/expectations/parser/parser/expression/binary/gte.leo.out +++ b/tests/expectations/parser/parser/expression/binary/gte.leo.out @@ -11,7 +11,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 >= 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: 1 >= 1 op: Ge span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 1 >= 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 2 >= 3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: 2 >= 3 op: Ge span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 2 >= 3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 >= 2 >= 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: 1 >= 2 >= 3 op: Ge span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 1 >= 2 >= 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: 1 >= 2 >= 3 op: Ge span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 1 >= 2 >= 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 + 2 >= 3 + 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 + 2 >= 3 + 4 op: Add span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 + 2 >= 3 + 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: 1 + 2 >= 3 + 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: test + path: "" content: 1 + 2 >= 3 + 4 op: Add span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 15 - path: test + path: "" content: 1 + 2 >= 3 + 4 op: Ge span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 1 + 2 >= 3 + 4 - Binary: left: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 >= 2 >= 3 right: Value: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: 1 >= 2 >= 3 op: Ge span: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 1 >= 2 >= 3 right: Value: @@ -217,7 +217,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: 1 >= 2 >= 3 op: Ge span: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 1 >= 2 >= 3 - Binary: left: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 + 2 >= 3 + 4 >= 5 + 6 right: Value: @@ -250,7 +250,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 + 2 >= 3 + 4 >= 5 + 6 op: Add span: @@ -258,7 +258,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 + 2 >= 3 + 4 >= 5 + 6 right: Binary: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: 1 + 2 >= 3 + 4 >= 5 + 6 right: Value: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: test + path: "" content: 1 + 2 >= 3 + 4 >= 5 + 6 op: Add span: @@ -288,7 +288,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 15 - path: test + path: "" content: 1 + 2 >= 3 + 4 >= 5 + 6 op: Ge span: @@ -296,7 +296,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 1 + 2 >= 3 + 4 >= 5 + 6 right: Binary: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 20 - path: test + path: "" content: 1 + 2 >= 3 + 4 >= 5 + 6 right: Value: @@ -318,7 +318,7 @@ outputs: line_stop: 1 col_start: 23 col_stop: 24 - path: test + path: "" content: 1 + 2 >= 3 + 4 >= 5 + 6 op: Add span: @@ -326,7 +326,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 24 - path: test + path: "" content: 1 + 2 >= 3 + 4 >= 5 + 6 op: Ge span: @@ -334,5 +334,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 24 - path: test + path: "" content: 1 + 2 >= 3 + 4 >= 5 + 6 diff --git a/tests/expectations/parser/parser/expression/binary/lt.leo.out b/tests/expectations/parser/parser/expression/binary/lt.leo.out index 9879afc9d3..d0b27b53c0 100644 --- a/tests/expectations/parser/parser/expression/binary/lt.leo.out +++ b/tests/expectations/parser/parser/expression/binary/lt.leo.out @@ -11,7 +11,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 < 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 < 1 op: Lt span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 < 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 2<3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: 2<3 op: Lt span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: 2<3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 < 2 < 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 < 2 < 3 op: Lt span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 < 2 < 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 < 2 < 3 op: Lt span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: 1 < 2 < 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 + 2 < 3 + 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 + 2 < 3 + 4 op: Add span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 + 2 < 3 + 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 + 2 < 3 + 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: test + path: "" content: 1 + 2 < 3 + 4 op: Add span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: test + path: "" content: 1 + 2 < 3 + 4 op: Lt span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 1 + 2 < 3 + 4 - Binary: left: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 < 2 < 3 right: Value: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 < 2 < 3 op: Lt span: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 < 2 < 3 right: Value: @@ -217,7 +217,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 < 2 < 3 op: Lt span: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: 1 < 2 < 3 - Binary: left: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 + 2 < 3 + 4 < 5 + 6 right: Value: @@ -250,7 +250,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 + 2 < 3 + 4 < 5 + 6 op: Add span: @@ -258,7 +258,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 + 2 < 3 + 4 < 5 + 6 right: Binary: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 + 2 < 3 + 4 < 5 + 6 right: Value: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: test + path: "" content: 1 + 2 < 3 + 4 < 5 + 6 op: Add span: @@ -288,7 +288,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: test + path: "" content: 1 + 2 < 3 + 4 < 5 + 6 op: Lt span: @@ -296,7 +296,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 1 + 2 < 3 + 4 < 5 + 6 right: Binary: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 17 col_stop: 18 - path: test + path: "" content: 1 + 2 < 3 + 4 < 5 + 6 right: Value: @@ -318,7 +318,7 @@ outputs: line_stop: 1 col_start: 21 col_stop: 22 - path: test + path: "" content: 1 + 2 < 3 + 4 < 5 + 6 op: Add span: @@ -326,7 +326,7 @@ outputs: line_stop: 1 col_start: 17 col_stop: 22 - path: test + path: "" content: 1 + 2 < 3 + 4 < 5 + 6 op: Lt span: @@ -334,5 +334,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 22 - path: test + path: "" content: 1 + 2 < 3 + 4 < 5 + 6 diff --git a/tests/expectations/parser/parser/expression/binary/lte.leo.out b/tests/expectations/parser/parser/expression/binary/lte.leo.out index f40df4bddb..334172f47c 100644 --- a/tests/expectations/parser/parser/expression/binary/lte.leo.out +++ b/tests/expectations/parser/parser/expression/binary/lte.leo.out @@ -11,7 +11,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 <= 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: 1 <= 1 op: Le span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 1 <= 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 2 <= 3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: 2 <= 3 op: Le span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 2 <= 3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 <= 2 <= 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: 1 <= 2 <= 3 op: Le span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 1 <= 2 <= 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: 1 <= 2 <= 3 op: Le span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 1 <= 2 <= 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 + 2 <= 3 + 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 + 2 <= 3 + 4 op: Add span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 + 2 <= 3 + 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: 1 + 2 <= 3 + 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: test + path: "" content: 1 + 2 <= 3 + 4 op: Add span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 15 - path: test + path: "" content: 1 + 2 <= 3 + 4 op: Le span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 1 + 2 <= 3 + 4 - Binary: left: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 <= 2 <= 3 right: Value: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: 1 <= 2 <= 3 op: Le span: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 1 <= 2 <= 3 right: Value: @@ -217,7 +217,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: 1 <= 2 <= 3 op: Le span: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 1 <= 2 <= 3 - Binary: left: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 + 2 <= 3 + 4 <= 5 + 6 right: Value: @@ -250,7 +250,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 + 2 <= 3 + 4 <= 5 + 6 op: Add span: @@ -258,7 +258,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 + 2 <= 3 + 4 <= 5 + 6 right: Binary: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: 1 + 2 <= 3 + 4 <= 5 + 6 right: Value: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: test + path: "" content: 1 + 2 <= 3 + 4 <= 5 + 6 op: Add span: @@ -288,7 +288,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 15 - path: test + path: "" content: 1 + 2 <= 3 + 4 <= 5 + 6 op: Le span: @@ -296,7 +296,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 1 + 2 <= 3 + 4 <= 5 + 6 right: Binary: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 20 - path: test + path: "" content: 1 + 2 <= 3 + 4 <= 5 + 6 right: Value: @@ -318,7 +318,7 @@ outputs: line_stop: 1 col_start: 23 col_stop: 24 - path: test + path: "" content: 1 + 2 <= 3 + 4 <= 5 + 6 op: Add span: @@ -326,7 +326,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 24 - path: test + path: "" content: 1 + 2 <= 3 + 4 <= 5 + 6 op: Le span: @@ -334,5 +334,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 24 - path: test + path: "" content: 1 + 2 <= 3 + 4 <= 5 + 6 diff --git a/tests/expectations/parser/parser/expression/binary/mul.leo.out b/tests/expectations/parser/parser/expression/binary/mul.leo.out index c146eeee15..4108b91e3e 100644 --- a/tests/expectations/parser/parser/expression/binary/mul.leo.out +++ b/tests/expectations/parser/parser/expression/binary/mul.leo.out @@ -11,7 +11,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 * 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 * 1 op: Mul span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 * 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 2*3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: 2*3 op: Mul span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: 2*3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 * 2 * 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 * 2 * 3 op: Mul span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 * 2 * 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 * 2 * 3 op: Mul span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: 1 * 2 * 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 ** 2 * 3 ** 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: 1 ** 2 * 3 ** 4 op: Pow span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 1 ** 2 * 3 ** 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: 1 ** 2 * 3 ** 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 15 col_stop: 16 - path: test + path: "" content: 1 ** 2 * 3 ** 4 op: Pow span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 16 - path: test + path: "" content: 1 ** 2 * 3 ** 4 op: Mul span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 16 - path: test + path: "" content: 1 ** 2 * 3 ** 4 - Binary: left: @@ -191,7 +191,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 ** 2 * 3 ** 4 / 5 ** 6 right: Value: @@ -201,7 +201,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: 1 ** 2 * 3 ** 4 / 5 ** 6 op: Pow span: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 1 ** 2 * 3 ** 4 / 5 ** 6 right: Binary: @@ -221,7 +221,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: 1 ** 2 * 3 ** 4 / 5 ** 6 right: Value: @@ -231,7 +231,7 @@ outputs: line_stop: 1 col_start: 15 col_stop: 16 - path: test + path: "" content: 1 ** 2 * 3 ** 4 / 5 ** 6 op: Pow span: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 16 - path: test + path: "" content: 1 ** 2 * 3 ** 4 / 5 ** 6 op: Mul span: @@ -247,7 +247,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 16 - path: test + path: "" content: 1 ** 2 * 3 ** 4 / 5 ** 6 right: Binary: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 20 - path: test + path: "" content: 1 ** 2 * 3 ** 4 / 5 ** 6 right: Value: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 24 col_stop: 25 - path: test + path: "" content: 1 ** 2 * 3 ** 4 / 5 ** 6 op: Pow span: @@ -277,7 +277,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 25 - path: test + path: "" content: 1 ** 2 * 3 ** 4 / 5 ** 6 op: Div span: @@ -285,5 +285,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 25 - path: test + path: "" content: 1 ** 2 * 3 ** 4 / 5 ** 6 diff --git a/tests/expectations/parser/parser/expression/binary/ne.leo.out b/tests/expectations/parser/parser/expression/binary/ne.leo.out index 9e1db5c244..de659ddaf6 100644 --- a/tests/expectations/parser/parser/expression/binary/ne.leo.out +++ b/tests/expectations/parser/parser/expression/binary/ne.leo.out @@ -11,7 +11,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 != 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: 1 != 1 op: Ne span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 1 != 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 2!=3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 4 col_stop: 5 - path: test + path: "" content: 2!=3 op: Ne span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: 2!=3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 < 2 != 3 < 4 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 < 2 != 3 < 4 op: Lt span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 < 2 != 3 < 4 right: Binary: @@ -101,7 +101,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: 1 < 2 != 3 < 4 right: Value: @@ -111,7 +111,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: test + path: "" content: 1 < 2 != 3 < 4 op: Lt span: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 15 - path: test + path: "" content: 1 < 2 != 3 < 4 op: Ne span: @@ -127,7 +127,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 1 < 2 != 3 < 4 - Binary: left: @@ -142,7 +142,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 < 2 != 3 < 4 || 3 < 4 != 5 < 6 right: Value: @@ -152,7 +152,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 < 2 != 3 < 4 || 3 < 4 != 5 < 6 op: Lt span: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 < 2 != 3 < 4 || 3 < 4 != 5 < 6 right: Binary: @@ -172,7 +172,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: 1 < 2 != 3 < 4 || 3 < 4 != 5 < 6 right: Value: @@ -182,7 +182,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: test + path: "" content: 1 < 2 != 3 < 4 || 3 < 4 != 5 < 6 op: Lt span: @@ -190,7 +190,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 15 - path: test + path: "" content: 1 < 2 != 3 < 4 || 3 < 4 != 5 < 6 op: Ne span: @@ -198,7 +198,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 1 < 2 != 3 < 4 || 3 < 4 != 5 < 6 right: Binary: @@ -212,7 +212,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 20 - path: test + path: "" content: 1 < 2 != 3 < 4 || 3 < 4 != 5 < 6 right: Value: @@ -222,7 +222,7 @@ outputs: line_stop: 1 col_start: 23 col_stop: 24 - path: test + path: "" content: 1 < 2 != 3 < 4 || 3 < 4 != 5 < 6 op: Lt span: @@ -230,7 +230,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 24 - path: test + path: "" content: 1 < 2 != 3 < 4 || 3 < 4 != 5 < 6 right: Binary: @@ -242,7 +242,7 @@ outputs: line_stop: 1 col_start: 28 col_stop: 29 - path: test + path: "" content: 1 < 2 != 3 < 4 || 3 < 4 != 5 < 6 right: Value: @@ -252,7 +252,7 @@ outputs: line_stop: 1 col_start: 32 col_stop: 33 - path: test + path: "" content: 1 < 2 != 3 < 4 || 3 < 4 != 5 < 6 op: Lt span: @@ -260,7 +260,7 @@ outputs: line_stop: 1 col_start: 28 col_stop: 33 - path: test + path: "" content: 1 < 2 != 3 < 4 || 3 < 4 != 5 < 6 op: Ne span: @@ -268,7 +268,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 33 - path: test + path: "" content: 1 < 2 != 3 < 4 || 3 < 4 != 5 < 6 op: Or span: @@ -276,5 +276,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 33 - path: test + path: "" content: 1 < 2 != 3 < 4 || 3 < 4 != 5 < 6 diff --git a/tests/expectations/parser/parser/expression/binary/or.leo.out b/tests/expectations/parser/parser/expression/binary/or.leo.out index 72d244dd8d..9648060da3 100644 --- a/tests/expectations/parser/parser/expression/binary/or.leo.out +++ b/tests/expectations/parser/parser/expression/binary/or.leo.out @@ -11,7 +11,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 + 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 + 1 op: Add span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 + 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 2+3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: 2+3 op: Add span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: 2+3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 + 2 + 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 + 2 + 3 op: Add span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 + 2 + 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 + 2 + 3 op: Add span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: 1 + 2 + 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 * 2 + 3 * 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 * 2 + 3 * 4 op: Mul span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 * 2 + 3 * 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 * 2 + 3 * 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: test + path: "" content: 1 * 2 + 3 * 4 op: Mul span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: test + path: "" content: 1 * 2 + 3 * 4 op: Add span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 1 * 2 + 3 * 4 - Binary: left: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 + 2 - 3 right: Value: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 + 2 - 3 op: Add span: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 + 2 - 3 right: Value: @@ -217,7 +217,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 + 2 - 3 op: Sub span: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: 1 + 2 - 3 - Binary: left: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 right: Value: @@ -250,7 +250,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 op: Mul span: @@ -258,7 +258,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 right: Binary: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 right: Value: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 op: Mul span: @@ -288,7 +288,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 op: Add span: @@ -296,7 +296,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 right: Binary: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 17 col_stop: 18 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 right: Value: @@ -318,7 +318,7 @@ outputs: line_stop: 1 col_start: 21 col_stop: 22 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 op: Mul span: @@ -326,7 +326,7 @@ outputs: line_stop: 1 col_start: 17 col_stop: 22 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 op: Sub span: @@ -334,5 +334,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 22 - path: test + path: "" content: 1 * 2 + 3 * 4 - 5 * 6 diff --git a/tests/expectations/parser/parser/expression/binary/sub.leo.out b/tests/expectations/parser/parser/expression/binary/sub.leo.out index 4e39639fe2..85cf6da268 100644 --- a/tests/expectations/parser/parser/expression/binary/sub.leo.out +++ b/tests/expectations/parser/parser/expression/binary/sub.leo.out @@ -11,7 +11,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 - 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 - 1 op: Sub span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 - 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 2-3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: 2-3 op: Sub span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: 2-3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 - 2 - 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 - 2 - 3 op: Sub span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 - 2 - 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 - 2 - 3 op: Sub span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: 1 - 2 - 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: 1 * 2 - 3 * 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: 1 * 2 - 3 * 4 op: Mul span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 1 * 2 - 3 * 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: 1 * 2 - 3 * 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: test + path: "" content: 1 * 2 - 3 * 4 op: Mul span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: test + path: "" content: 1 * 2 - 3 * 4 op: Sub span: @@ -176,5 +176,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 1 * 2 - 3 * 4 diff --git a/tests/expectations/parser/parser/expression/cast.leo.out b/tests/expectations/parser/parser/expression/cast.leo.out index 25ace32c14..b610e43264 100644 --- a/tests/expectations/parser/parser/expression/cast.leo.out +++ b/tests/expectations/parser/parser/expression/cast.leo.out @@ -4,7 +4,7 @@ expectation: Pass outputs: - Cast: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x as u8\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x as u8\\\"}\"}" target_type: IntegerType: U8 span: @@ -12,23 +12,23 @@ outputs: line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: x as u8 - Cast: inner: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"y as id\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"y as id\\\"}\"}" target_type: - Circuit: "{\"name\":\"id\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"y as id\\\"}\"}" + Circuit: "{\"name\":\"id\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"y as id\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: y as id - Cast: inner: - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"z as u32\\\"}\"}" + Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"z as u32\\\"}\"}" target_type: IntegerType: U32 span: @@ -36,11 +36,11 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: z as u32 - Cast: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x as i128\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x as i128\\\"}\"}" target_type: IntegerType: I128 span: @@ -48,13 +48,13 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: x as i128 - Cast: inner: Cast: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x as u8 as u128\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x as u8 as u128\\\"}\"}" target_type: IntegerType: U8 span: @@ -62,7 +62,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: x as u8 as u128 target_type: IntegerType: U128 @@ -71,39 +71,39 @@ outputs: line_stop: 1 col_start: 1 col_stop: 16 - path: test + path: "" content: x as u8 as u128 - Cast: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x as field\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x as field\\\"}\"}" target_type: Field span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: x as field - Cast: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x as group\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x as group\\\"}\"}" target_type: Group span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: x as group - Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ** y as u32 ** z\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ** y as u32 ** z\\\"}\"}" right: Binary: left: Cast: inner: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ** y as u32 ** z\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ** y as u32 ** z\\\"}\"}" target_type: IntegerType: U32 span: @@ -111,17 +111,17 @@ outputs: line_stop: 1 col_start: 6 col_stop: 14 - path: test + path: "" content: x ** y as u32 ** z right: - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ** y as u32 ** z\\\"}\"}" + Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ** y as u32 ** z\\\"}\"}" op: Pow span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 19 - path: test + path: "" content: x ** y as u32 ** z op: Pow span: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 19 - path: test + path: "" content: x ** y as u32 ** z - Value: Implicit: @@ -144,14 +144,14 @@ outputs: inner: Unary: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"!x as u32\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"!x as u32\\\"}\"}" op: Not span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 3 - path: test + path: "" content: "!x as u32" target_type: IntegerType: U32 @@ -160,20 +160,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "!x as u32" - Cast: inner: Unary: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"-x as u32\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"-x as u32\\\"}\"}" op: Negate span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 3 - path: test + path: "" content: "-x as u32" target_type: IntegerType: U32 @@ -182,5 +182,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "-x as u32" diff --git a/tests/expectations/parser/parser/expression/circuit_init.leo.out b/tests/expectations/parser/parser/expression/circuit_init.leo.out index 4295420d95..8290a7825b 100644 --- a/tests/expectations/parser/parser/expression/circuit_init.leo.out +++ b/tests/expectations/parser/parser/expression/circuit_init.leo.out @@ -3,111 +3,111 @@ namespace: ParseExpression expectation: Pass outputs: - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x {}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x {}\\\"}\"}" members: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x {}" - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x {y}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x {y}\\\"}\"}" members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x {y}\\\"}\"}" + - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x {y}\\\"}\"}" expression: ~ span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: "x {y}" - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y}\\\"}\"}" members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y}\\\"}\"}" + - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y}\\\"}\"}" expression: ~ span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x{y}" - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{}\\\"}\"}" members: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "x{}" - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: y}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: y}\\\"}\"}" members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: y}\\\"}\"}" + - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: y}\\\"}\"}" expression: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: y}\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: y}\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "x{y: y}" - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: x}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: x}\\\"}\"}" members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: x}\\\"}\"}" + - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: x}\\\"}\"}" expression: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: x}\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: x}\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "x{y: x}" - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: x,}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: x,}\\\"}\"}" members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: x,}\\\"}\"}" + - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: x,}\\\"}\"}" expression: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: x,}\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: x,}\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "x{y: x,}" - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" + - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" expression: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" - - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" + - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" expression: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: "x{y:x, x:y,}" - CircuitInit: - name: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"Self {}\\\"}\"}" + name: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"Self {}\\\"}\"}" members: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "Self {}" diff --git a/tests/expectations/parser/parser/expression/circuit_init_fail.leo.out b/tests/expectations/parser/parser/expression/circuit_init_fail.leo.out index 3aae92971f..9a08737239 100644 --- a/tests/expectations/parser/parser/expression/circuit_init_fail.leo.out +++ b/tests/expectations/parser/parser/expression/circuit_init_fail.leo.out @@ -2,15 +2,15 @@ namespace: ParseExpression expectation: Fail outputs: - - " --> test:1:3\n |\n 1 | x {\n | ^\n |\n = unexpected EOF" + - "Error [EPAR0370003]: unexpected EOF\n --> test:1:3\n |\n 1 | x {\n | ^" - "did not consume all input: '}' @ 1:3-4\n" - - " --> test:1:4\n |\n 1 | x {,}\n | ^\n |\n = expected 'ident', got ','" - - " --> test:1:5\n |\n 1 | x { , }\n | ^\n |\n = expected 'ident', got ','" - - " --> test:1:4\n |\n 1 | x {,,,}\n | ^\n |\n = expected 'ident', got ','" - - " --> test:1:6\n |\n 1 | x {x,,}\n | ^\n |\n = expected 'ident', got ','" - - " --> test:1:4\n |\n 1 | x {,,x}\n | ^\n |\n = expected 'ident', got ','" - - " --> test:1:4\n |\n 1 | x {,x}\n | ^\n |\n = expected 'ident', got ','" - - " --> test:1:8\n |\n 1 | x {x:y,,}\n | ^\n |\n = expected 'ident', got ','" - - " --> test:1:4\n |\n 1 | x {,,x:y}\n | ^\n |\n = expected 'ident', got ','" - - " --> test:1:4\n |\n 1 | x {,x:y}\n | ^\n |\n = expected 'ident', got ','" - - " --> test:1:6\n |\n 1 | x {x:}\n | ^\n |\n = expected 'expression', got '}'" + - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:4\n |\n 1 | x {,}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:5\n |\n 1 | x { , }\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:4\n |\n 1 | x {,,,}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:6\n |\n 1 | x {x,,}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:4\n |\n 1 | x {,,x}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:4\n |\n 1 | x {,x}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:8\n |\n 1 | x {x:y,,}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:4\n |\n 1 | x {,,x:y}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:4\n |\n 1 | x {,x:y}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', got '}'\n --> test:1:6\n |\n 1 | x {x:}\n | ^" diff --git a/tests/expectations/parser/parser/expression/ident.leo.out b/tests/expectations/parser/parser/expression/ident.leo.out index a92fc0c1c8..329ca97a73 100644 --- a/tests/expectations/parser/parser/expression/ident.leo.out +++ b/tests/expectations/parser/parser/expression/ident.leo.out @@ -2,22 +2,22 @@ namespace: ParseExpression expectation: Pass outputs: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x\\\"}\"}" - - Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"X\\\"}\"}" - - Identifier: "{\"name\":\"xxx\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"xxx\\\"}\"}" - - Identifier: "{\"name\":\"XXX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"XXX\\\"}\"}" - - Identifier: "{\"name\":\"x1\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x1\\\"}\"}" - - Identifier: "{\"name\":\"xu32\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"xu32\\\"}\"}" - - Identifier: "{\"name\":\"testx\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"testx\\\"}\"}" - - Identifier: "{\"name\":\"truex\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"truex\\\"}\"}" - - Identifier: "{\"name\":\"TRUE\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"TRUE\\\"}\"}" - - Identifier: "{\"name\":\"testX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"testX\\\"}\"}" - - Identifier: "{\"name\":\"letX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"letX\\\"}\"}" - - Identifier: "{\"name\":\"constX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"constX\\\"}\"}" - - Identifier: "{\"name\":\"test_test\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"test_test\\\"}\"}" - - Identifier: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"self\\\"}\"}" - - Identifier: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"Self\\\"}\"}" - - Identifier: "{\"name\":\"input\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"input\\\"}\"}" - - Identifier: "{\"name\":\"selfX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"selfX\\\"}\"}" - - Identifier: "{\"name\":\"SelfX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"SelfX\\\"}\"}" - - Identifier: "{\"name\":\"inputX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"inputX\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x\\\"}\"}" + - Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X\\\"}\"}" + - Identifier: "{\"name\":\"xxx\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"xxx\\\"}\"}" + - Identifier: "{\"name\":\"XXX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"XXX\\\"}\"}" + - Identifier: "{\"name\":\"x1\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x1\\\"}\"}" + - Identifier: "{\"name\":\"xu32\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"xu32\\\"}\"}" + - Identifier: "{\"name\":\"testx\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"testx\\\"}\"}" + - Identifier: "{\"name\":\"truex\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"truex\\\"}\"}" + - Identifier: "{\"name\":\"TRUE\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"TRUE\\\"}\"}" + - Identifier: "{\"name\":\"testX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"testX\\\"}\"}" + - Identifier: "{\"name\":\"letX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"letX\\\"}\"}" + - Identifier: "{\"name\":\"constX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"constX\\\"}\"}" + - Identifier: "{\"name\":\"test_test\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"test_test\\\"}\"}" + - Identifier: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"self\\\"}\"}" + - Identifier: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"Self\\\"}\"}" + - Identifier: "{\"name\":\"input\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"input\\\"}\"}" + - Identifier: "{\"name\":\"selfX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"selfX\\\"}\"}" + - Identifier: "{\"name\":\"SelfX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"SelfX\\\"}\"}" + - Identifier: "{\"name\":\"inputX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"inputX\\\"}\"}" diff --git a/tests/expectations/parser/parser/expression/literal/address_fail.leo.out b/tests/expectations/parser/parser/expression/literal/address_fail.leo.out index c0fc912fd4..ecbfa3a8ac 100644 --- a/tests/expectations/parser/parser/expression/literal/address_fail.leo.out +++ b/tests/expectations/parser/parser/expression/literal/address_fail.leo.out @@ -2,12 +2,12 @@ namespace: Token expectation: Fail outputs: - - " --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1'" - - " --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6Z2eu975wnpz2925ntjccd5cfqxtyu8sta57J9\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6Z2eu975wnpz2925ntjccd5cfqxtyu8sta57J9'" - - " --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d'" - - " --> test:1:1\n |\n 1 | aleo1\n | ^^^^^\n |\n = invalid address literal: 'aleo1'" - - " --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8st\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8st'" - - " --> test:1:1\n |\n 1 | aleo1\n | ^^^^^\n |\n = invalid address literal: 'aleo1'" - - " --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1'" - - " --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d11\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d11'" - - " --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1x\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1x'" + - "Error [EPAR0370001]: invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1'\n --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" + - "Error [EPAR0370001]: invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6Z2eu975wnpz2925ntjccd5cfqxtyu8sta57J9'\n --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6Z2eu975wnpz2925ntjccd5cfqxtyu8sta57J9\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" + - "Error [EPAR0370001]: invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d'\n --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" + - "Error [EPAR0370001]: invalid address literal: 'aleo1'\n --> test:1:1\n |\n 1 | aleo1\n | ^^^^^" + - "Error [EPAR0370001]: invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8st'\n --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8st\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" + - "Error [EPAR0370001]: invalid address literal: 'aleo1'\n --> test:1:1\n |\n 1 | aleo1\n | ^^^^^" + - "Error [EPAR0370001]: invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1'\n --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" + - "Error [EPAR0370001]: invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d11'\n --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d11\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" + - "Error [EPAR0370001]: invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1x'\n --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1x\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" diff --git a/tests/expectations/parser/parser/expression/literal/address_parse.leo.out b/tests/expectations/parser/parser/expression/literal/address_parse.leo.out index ce2e019189..61bf7c9359 100644 --- a/tests/expectations/parser/parser/expression/literal/address_parse.leo.out +++ b/tests/expectations/parser/parser/expression/literal/address_parse.leo.out @@ -9,7 +9,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 64 - path: test + path: "" content: aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 - Value: Address: @@ -18,7 +18,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 64 - path: test + path: "" content: aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j9 - Value: Address: @@ -27,7 +27,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 64 - path: test + path: "" content: aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d9 - Value: Address: @@ -36,5 +36,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 64 - path: test + path: "" content: aleo1aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8st diff --git a/tests/expectations/parser/parser/expression/literal/bool_parse.leo.out b/tests/expectations/parser/parser/expression/literal/bool_parse.leo.out index 85b9453e0b..ba8cfcd0bf 100644 --- a/tests/expectations/parser/parser/expression/literal/bool_parse.leo.out +++ b/tests/expectations/parser/parser/expression/literal/bool_parse.leo.out @@ -9,7 +9,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "true" - Value: Boolean: @@ -18,5 +18,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: "false" diff --git a/tests/expectations/parser/parser/expression/literal/char_fail.leo.out b/tests/expectations/parser/parser/expression/literal/char_fail.leo.out index 30bb2b78e6..a5656a5488 100644 --- a/tests/expectations/parser/parser/expression/literal/char_fail.leo.out +++ b/tests/expectations/parser/parser/expression/literal/char_fail.leo.out @@ -2,38 +2,38 @@ namespace: Token expectation: Fail outputs: - - " --> test:1:1\n |\n 1 | '\\'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | 'a\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | ''\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\x9A'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\x7'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\x7g'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\xz'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\x80'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\xc1'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\xc2'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\xDF'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\xC0'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\xe0'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\x9f'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | 'abcdefg'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\t\\t'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\a'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\z'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\A'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\Z'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\1'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\9'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\*'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\x'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\u'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\u{bbbbb}\\u{aaaa}'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\uz'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\u1'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\u123'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\u{2764z'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\u{276g}'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\u00000000'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\u01000000'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '\\u9999999'\n | ^\n |\n = unexpected token: '''" - - " --> test:1:1\n |\n 1 | '😭😂😘'\n | ^\n |\n = unexpected token: '''" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | 'a\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | ''\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\x9A'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\x7'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\x7g'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\xz'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\x80'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\xc1'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\xc2'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\xDF'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\xC0'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\xe0'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\x9f'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | 'abcdefg'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\t\\t'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\a'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\z'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\A'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\Z'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\1'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\9'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\*'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\x'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\u'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\u{bbbbb}\\u{aaaa}'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\uz'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\u1'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\u123'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\u{2764z'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\u{276g}'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\u00000000'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\u01000000'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '\\u9999999'\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: '\n --> test:1:1\n |\n 1 | '😭😂😘'\n | ^\n |\n = HELP TODO" diff --git a/tests/expectations/parser/parser/expression/literal/char_parse.leo.out b/tests/expectations/parser/parser/expression/literal/char_parse.leo.out index f7611f55f5..ce8cfae708 100644 --- a/tests/expectations/parser/parser/expression/literal/char_parse.leo.out +++ b/tests/expectations/parser/parser/expression/literal/char_parse.leo.out @@ -11,7 +11,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "'a'" - Value: Char: @@ -22,7 +22,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "'Z'" - Value: Char: @@ -33,7 +33,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "'\\\"'" - Value: Char: @@ -44,7 +44,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "'\\t'" - Value: Char: @@ -55,7 +55,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "'\\r'" - Value: Char: @@ -66,7 +66,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "'\\0'" - Value: Char: @@ -77,7 +77,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "'\\u{F}'" - Value: Char: @@ -88,7 +88,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: "''" - Value: Char: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "'\\u{E5}'" - Value: Char: @@ -110,7 +110,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "'å'" - Value: Char: @@ -121,7 +121,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "'\\u{4e0}'" - Value: Char: @@ -132,7 +132,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "'Ӡ'" - Value: Char: @@ -143,7 +143,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: "'\\u{2764}'" - Value: Char: @@ -154,7 +154,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: "'❤'" - Value: Char: @@ -165,7 +165,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: "'\\u{1F622}'" - Value: Char: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'😭'" - Value: Char: @@ -187,7 +187,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: "'\\u{10001F}'" - Value: Char: @@ -198,7 +198,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x2A'" - Value: Char: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x7f'" - Value: Char: @@ -220,7 +220,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x00'" - Value: Char: @@ -231,7 +231,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x01'" - Value: Char: @@ -242,7 +242,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x02'" - Value: Char: @@ -253,7 +253,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x03'" - Value: Char: @@ -264,7 +264,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x04'" - Value: Char: @@ -275,7 +275,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x05'" - Value: Char: @@ -286,7 +286,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x06'" - Value: Char: @@ -297,7 +297,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x07'" - Value: Char: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x10'" - Value: Char: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x11'" - Value: Char: @@ -330,7 +330,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x12'" - Value: Char: @@ -341,7 +341,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x13'" - Value: Char: @@ -352,7 +352,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x14'" - Value: Char: @@ -363,7 +363,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x15'" - Value: Char: @@ -374,7 +374,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x16'" - Value: Char: @@ -385,7 +385,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x17'" - Value: Char: @@ -396,7 +396,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x20'" - Value: Char: @@ -407,7 +407,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x21'" - Value: Char: @@ -418,7 +418,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x22'" - Value: Char: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x23'" - Value: Char: @@ -440,7 +440,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x24'" - Value: Char: @@ -451,7 +451,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x25'" - Value: Char: @@ -462,7 +462,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x26'" - Value: Char: @@ -473,7 +473,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x27'" - Value: Char: @@ -484,7 +484,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x30'" - Value: Char: @@ -495,7 +495,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x31'" - Value: Char: @@ -506,7 +506,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x32'" - Value: Char: @@ -517,7 +517,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x33'" - Value: Char: @@ -528,7 +528,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x34'" - Value: Char: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x35'" - Value: Char: @@ -550,7 +550,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x36'" - Value: Char: @@ -561,5 +561,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "'\\x37'" diff --git a/tests/expectations/parser/parser/expression/literal/group.leo.out b/tests/expectations/parser/parser/expression/literal/group.leo.out index 2a4389526e..03113a7eb4 100644 --- a/tests/expectations/parser/parser/expression/literal/group.leo.out +++ b/tests/expectations/parser/parser/expression/literal/group.leo.out @@ -12,7 +12,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 12 - path: test + path: "" content: "(+, _)group" - Value: Group: @@ -24,7 +24,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 12 - path: test + path: "" content: "(_, -)group" - Value: Group: @@ -36,7 +36,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 12 - path: test + path: "" content: "(+, -)group" - Value: Group: @@ -48,7 +48,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 12 - path: test + path: "" content: "(-, +)group" - Value: Group: @@ -60,7 +60,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 12 - path: test + path: "" content: "(+, +)group" - Value: Group: @@ -72,7 +72,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 12 - path: test + path: "" content: "(-, -)group" - Value: Group: @@ -84,7 +84,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 12 - path: test + path: "" content: "(_, _)group" - Value: Group: @@ -96,7 +96,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123,-456)group" y: Number: @@ -105,14 +105,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: test + path: "" content: "(123,-456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: test + path: "" content: "(123,-456)group" - Value: Group: @@ -124,7 +124,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 6 - path: test + path: "" content: "(-123,456)group" y: Number: @@ -133,14 +133,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: test + path: "" content: "(-123,456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: test + path: "" content: "(-123,456)group" - Value: Group: @@ -152,7 +152,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 6 - path: test + path: "" content: "(-123,456)group" y: Number: @@ -161,14 +161,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: test + path: "" content: "(-123,456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: test + path: "" content: "(-123,456)group" - Value: Group: @@ -180,7 +180,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123, _)group" y: Inferred span: @@ -188,7 +188,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 14 - path: test + path: "" content: "(123, _)group" - Value: Group: @@ -200,7 +200,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123, -)group" y: SignLow span: @@ -208,7 +208,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 14 - path: test + path: "" content: "(123, -)group" - Value: Group: @@ -220,7 +220,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123, -)group" y: SignLow span: @@ -228,7 +228,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 14 - path: test + path: "" content: "(123, -)group" - Value: Group: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123, +)group" y: SignHigh span: @@ -248,7 +248,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 14 - path: test + path: "" content: "(123, +)group" - Value: Group: @@ -260,7 +260,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123, +)group" y: SignHigh span: @@ -268,7 +268,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 14 - path: test + path: "" content: "(123, +)group" - Value: Group: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123, -)group" y: SignLow span: @@ -288,7 +288,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 14 - path: test + path: "" content: "(123, -)group" - Value: Group: @@ -300,7 +300,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123, _)group" y: Inferred span: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 14 - path: test + path: "" content: "(123, _)group" - Value: Group: @@ -321,14 +321,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: test + path: "" content: "(+, 345)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 14 - path: test + path: "" content: "(+, 345)group" - Value: Group: @@ -341,14 +341,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: test + path: "" content: "(_, 345)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 14 - path: test + path: "" content: "(_, 345)group" - Value: Group: @@ -361,14 +361,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: test + path: "" content: "(+, 345)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 14 - path: test + path: "" content: "(+, 345)group" - Value: Group: @@ -381,14 +381,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: test + path: "" content: "(-, 345)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 14 - path: test + path: "" content: "(-, 345)group" - Value: Group: @@ -401,14 +401,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: test + path: "" content: "(+, 345)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 14 - path: test + path: "" content: "(+, 345)group" - Value: Group: @@ -421,14 +421,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: test + path: "" content: "(-, 345)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 14 - path: test + path: "" content: "(-, 345)group" - Value: Group: @@ -441,14 +441,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: test + path: "" content: "(_, 345)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 14 - path: test + path: "" content: "(_, 345)group" - Value: Group: @@ -460,7 +460,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123, 456)group" y: Number: @@ -469,14 +469,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: test + path: "" content: "(123, 456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: test + path: "" content: "(123, 456)group" - Value: Group: @@ -488,7 +488,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123, 456)group" y: Number: @@ -497,14 +497,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: test + path: "" content: "(123, 456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: test + path: "" content: "(123, 456)group" - Value: Group: @@ -516,7 +516,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123, 456)group" y: Number: @@ -525,14 +525,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: test + path: "" content: "(123, 456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: test + path: "" content: "(123, 456)group" - Value: Group: @@ -544,7 +544,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123, 456)group" y: Number: @@ -553,14 +553,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: test + path: "" content: "(123, 456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: test + path: "" content: "(123, 456)group" - Value: Group: @@ -572,7 +572,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123, 456)group" y: Number: @@ -581,14 +581,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: test + path: "" content: "(123, 456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: test + path: "" content: "(123, 456)group" - Value: Group: @@ -600,7 +600,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123, 456)group" y: Number: @@ -609,14 +609,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: test + path: "" content: "(123, 456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: test + path: "" content: "(123, 456)group" - Value: Group: @@ -628,7 +628,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123, 456)group" y: Number: @@ -637,12 +637,12 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: test + path: "" content: "(123, 456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: test + path: "" content: "(123, 456)group" diff --git a/tests/expectations/parser/parser/expression/literal/group_fail.leo.out b/tests/expectations/parser/parser/expression/literal/group_fail.leo.out index da65de24fa..8816fb7773 100644 --- a/tests/expectations/parser/parser/expression/literal/group_fail.leo.out +++ b/tests/expectations/parser/parser/expression/literal/group_fail.leo.out @@ -2,12 +2,12 @@ namespace: ParseExpression expectation: Fail outputs: - - " --> test:1:1\n |\n 1 | group\n | ^^^^^\n |\n = expected 'expression', got 'group'" + - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'group'\n --> test:1:1\n |\n 1 | group\n | ^^^^^" - "did not consume all input: 'group' @ 1:3-8\n" - "did not consume all input: 'group' @ 1:6-11\n" - - " --> test:1:2\n |\n 1 | (,)group\n | ^\n |\n = expected 'expression', got ','" - - " --> test:1:2\n |\n 1 | (+, -,)group\n | ^\n |\n = expected 'expression', got '+'" - - " --> test:1:2\n |\n 1 | (,+, -)group\n | ^\n |\n = expected 'expression', got ','" + - "Error [EPAR0370009]: unexpected string: expected 'expression', got ','\n --> test:1:2\n |\n 1 | (,)group\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', got '+'\n --> test:1:2\n |\n 1 | (+, -,)group\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', got ','\n --> test:1:2\n |\n 1 | (,+, -)group\n | ^" - "did not consume all input: 'group' @ 1:6-11\n" - "did not consume all input: 'group' @ 1:12-17\n" - "did not consume all input: 'group' @ 1:15-20\n" diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/field.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/field.leo.out index c7f5f3576f..83d189a382 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/field.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/field.leo.out @@ -9,7 +9,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: 123field - Value: Implicit: @@ -18,7 +18,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "123" - Value: Field: @@ -27,7 +27,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: 456field - Value: Field: @@ -36,7 +36,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 86 - path: test + path: "" content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802field - Value: Field: @@ -45,7 +45,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 406 - path: test + path: "" content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802field - Value: Field: @@ -54,7 +54,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 340130024field - Value: Field: @@ -63,7 +63,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 158951116field - Value: Field: @@ -72,7 +72,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 155529659field - Value: Field: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 642023166field - Value: Field: @@ -90,7 +90,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 228481736field - Value: Field: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 469712960field - Value: Field: @@ -108,7 +108,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 929437719field - Value: Field: @@ -117,7 +117,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 721072814field - Value: Field: @@ -126,7 +126,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 363254789field - Value: Field: @@ -135,7 +135,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 906732565field - Value: Field: @@ -144,7 +144,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 288246391field - Value: Field: @@ -153,7 +153,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 724940549field - Value: Field: @@ -162,7 +162,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 487101620field - Value: Field: @@ -171,7 +171,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 261373583field - Value: Field: @@ -180,7 +180,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 891163927field - Value: Field: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 743967544field - Value: Field: @@ -198,7 +198,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 8372586field - Value: Field: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 461793278field - Value: Field: @@ -216,7 +216,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 806307045field - Value: Field: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 122764546field - Value: Field: @@ -234,7 +234,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 356336181field - Value: Field: @@ -243,7 +243,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 158370903field - Value: Field: @@ -252,7 +252,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 774460877field - Value: Field: @@ -261,7 +261,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 557174131field - Value: Field: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 492401267field - Value: Field: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 893445620field - Value: Field: @@ -288,7 +288,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 957757048field - Value: Field: @@ -297,7 +297,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 721540649field - Value: Field: @@ -306,7 +306,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 390746493field - Value: Field: @@ -315,7 +315,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 211251725field - Value: Field: @@ -324,7 +324,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 938266114field - Value: Field: @@ -333,7 +333,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 156985870field - Value: Field: @@ -342,7 +342,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 703831126field - Value: Field: @@ -351,7 +351,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 729964155field - Value: Field: @@ -360,7 +360,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 988151305field - Value: Field: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 320872435field - Value: Field: @@ -378,7 +378,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 719287167field - Value: Field: @@ -387,7 +387,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 152289486field - Value: Field: @@ -396,7 +396,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 740067975field - Value: Field: @@ -405,7 +405,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 728627816field - Value: Field: @@ -414,7 +414,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 385008978field - Value: Field: @@ -423,7 +423,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 553967635field - Value: Field: @@ -432,7 +432,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 71980713field - Value: Field: @@ -441,7 +441,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 519444716field - Value: Field: @@ -450,7 +450,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 116499965field - Value: Field: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 717422268field - Value: Field: @@ -468,7 +468,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 18966279field - Value: Field: @@ -477,7 +477,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 22458638field - Value: Field: @@ -486,7 +486,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 857282620field - Value: Field: @@ -495,7 +495,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 920675898field - Value: Field: @@ -504,7 +504,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 762235516field - Value: Field: @@ -513,7 +513,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 469018377field - Value: Field: @@ -522,7 +522,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 199986521field - Value: Field: @@ -531,7 +531,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 536679358field - Value: Field: @@ -540,7 +540,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 591399452field - Value: Field: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 83083158field - Value: Field: @@ -558,7 +558,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 599449051field - Value: Field: @@ -567,7 +567,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 445442318field - Value: Field: @@ -576,7 +576,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 585486590field - Value: Field: @@ -585,7 +585,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 209278800field - Value: Field: @@ -594,7 +594,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 873568117field - Value: Field: @@ -603,7 +603,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 664470940field - Value: Field: @@ -612,7 +612,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 465262783field - Value: Field: @@ -621,7 +621,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 605652874field - Value: Field: @@ -630,7 +630,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 376803940field - Value: Field: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 965247040field - Value: Field: @@ -648,7 +648,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 598474509field - Value: Field: @@ -657,7 +657,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 845119918field - Value: Field: @@ -666,7 +666,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 648159133field - Value: Field: @@ -675,7 +675,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 669051032field - Value: Field: @@ -684,7 +684,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 800600261field - Value: Field: @@ -693,7 +693,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 434689764field - Value: Field: @@ -702,7 +702,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 520060080field - Value: Field: @@ -711,7 +711,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 804659385field - Value: Field: @@ -720,7 +720,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 537828058field - Value: Field: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 716600292field - Value: Field: @@ -738,7 +738,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 387020273field - Value: Field: @@ -747,7 +747,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 199375617field - Value: Field: @@ -756,7 +756,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 680337189field - Value: Field: @@ -765,7 +765,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 818479931field - Value: Field: @@ -774,7 +774,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 893693281field - Value: Field: @@ -783,7 +783,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 87377802field - Value: Field: @@ -792,7 +792,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 84699261field - Value: Field: @@ -801,7 +801,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 292826090field - Value: Field: @@ -810,7 +810,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 569171405field - Value: Field: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 387436237field - Value: Field: @@ -828,7 +828,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 150682190field - Value: Field: @@ -837,7 +837,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 888770419field - Value: Field: @@ -846,7 +846,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 824696431field - Value: Field: @@ -855,7 +855,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 765659803field - Value: Field: @@ -864,7 +864,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 270163693field - Value: Field: @@ -873,7 +873,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 427940240field - Value: Field: @@ -882,7 +882,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 504997332field - Value: Field: @@ -891,7 +891,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 337808338field - Value: Field: @@ -900,7 +900,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 907200008field - Value: Field: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 757177889field - Value: Field: @@ -918,7 +918,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 696697188field - Value: Field: @@ -927,7 +927,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 41376051field - Value: Field: @@ -936,7 +936,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 496293518field - Value: Field: @@ -945,5 +945,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 251218820field diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/i128.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/i128.leo.out index f0d886348f..cb3fa6dd2e 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/i128.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/i128.leo.out @@ -10,7 +10,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: 123i128 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: 456i128 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 85 - path: test + path: "" content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802i128 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 405 - path: test + path: "" content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802i128 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 340130024i128 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 158951116i128 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 155529659i128 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 642023166i128 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 228481736i128 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 469712960i128 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 929437719i128 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 721072814i128 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 363254789i128 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 906732565i128 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 288246391i128 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 724940549i128 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 487101620i128 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 261373583i128 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 891163927i128 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 743967544i128 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 8372586i128 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 461793278i128 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 806307045i128 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 122764546i128 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 356336181i128 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 158370903i128 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 774460877i128 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 557174131i128 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 492401267i128 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 893445620i128 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 957757048i128 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 721540649i128 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 390746493i128 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 211251725i128 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 938266114i128 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 156985870i128 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 703831126i128 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 729964155i128 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 988151305i128 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 320872435i128 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 719287167i128 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 152289486i128 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 740067975i128 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 728627816i128 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 385008978i128 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 553967635i128 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 71980713i128 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 519444716i128 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 116499965i128 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 717422268i128 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 18966279i128 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 22458638i128 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 857282620i128 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 920675898i128 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 762235516i128 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 469018377i128 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 199986521i128 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 536679358i128 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 591399452i128 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 83083158i128 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 599449051i128 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 445442318i128 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 585486590i128 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 209278800i128 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 873568117i128 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 664470940i128 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 465262783i128 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 605652874i128 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 376803940i128 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 965247040i128 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 598474509i128 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 845119918i128 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 648159133i128 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 669051032i128 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 800600261i128 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 434689764i128 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 520060080i128 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 804659385i128 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 537828058i128 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 716600292i128 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 387020273i128 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 199375617i128 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 680337189i128 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 818479931i128 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 893693281i128 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 87377802i128 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 84699261i128 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 292826090i128 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 569171405i128 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 387436237i128 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 150682190i128 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 888770419i128 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 824696431i128 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 765659803i128 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 270163693i128 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 427940240i128 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 504997332i128 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 337808338i128 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 907200008i128 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 757177889i128 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 696697188i128 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 41376051i128 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 496293518i128 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 251218820i128 diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/i16.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/i16.leo.out index 82a8fc8b1b..4172ff2c40 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/i16.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/i16.leo.out @@ -10,7 +10,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 123i16 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 456i16 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 84 - path: test + path: "" content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802i16 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 404 - path: test + path: "" content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802i16 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 340130024i16 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 158951116i16 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 155529659i16 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 642023166i16 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 228481736i16 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 469712960i16 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 929437719i16 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 721072814i16 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 363254789i16 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 906732565i16 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 288246391i16 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 724940549i16 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 487101620i16 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 261373583i16 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 891163927i16 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 743967544i16 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 8372586i16 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 461793278i16 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 806307045i16 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 122764546i16 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 356336181i16 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 158370903i16 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 774460877i16 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 557174131i16 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 492401267i16 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 893445620i16 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 957757048i16 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 721540649i16 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 390746493i16 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 211251725i16 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 938266114i16 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 156985870i16 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 703831126i16 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 729964155i16 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 988151305i16 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 320872435i16 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 719287167i16 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 152289486i16 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 740067975i16 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 728627816i16 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 385008978i16 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 553967635i16 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 71980713i16 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 519444716i16 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 116499965i16 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 717422268i16 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 18966279i16 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 22458638i16 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 857282620i16 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 920675898i16 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 762235516i16 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 469018377i16 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 199986521i16 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 536679358i16 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 591399452i16 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 83083158i16 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 599449051i16 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 445442318i16 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 585486590i16 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 209278800i16 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 873568117i16 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 664470940i16 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 465262783i16 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 605652874i16 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 376803940i16 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 965247040i16 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 598474509i16 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 845119918i16 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 648159133i16 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 669051032i16 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 800600261i16 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 434689764i16 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 520060080i16 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 804659385i16 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 537828058i16 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 716600292i16 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 387020273i16 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 199375617i16 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 680337189i16 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 818479931i16 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 893693281i16 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 87377802i16 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 84699261i16 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 292826090i16 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 569171405i16 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 387436237i16 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 150682190i16 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 888770419i16 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 824696431i16 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 765659803i16 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 270163693i16 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 427940240i16 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 504997332i16 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 337808338i16 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 907200008i16 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 757177889i16 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 696697188i16 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 41376051i16 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 496293518i16 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 251218820i16 diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/i32.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/i32.leo.out index 82d66bdbf5..d5e7d115ac 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/i32.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/i32.leo.out @@ -10,7 +10,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 123i32 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 456i32 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 84 - path: test + path: "" content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802i32 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 404 - path: test + path: "" content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802i32 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 340130024i32 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 158951116i32 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 155529659i32 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 642023166i32 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 228481736i32 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 469712960i32 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 929437719i32 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 721072814i32 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 363254789i32 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 906732565i32 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 288246391i32 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 724940549i32 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 487101620i32 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 261373583i32 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 891163927i32 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 743967544i32 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 8372586i32 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 461793278i32 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 806307045i32 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 122764546i32 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 356336181i32 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 158370903i32 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 774460877i32 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 557174131i32 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 492401267i32 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 893445620i32 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 957757048i32 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 721540649i32 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 390746493i32 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 211251725i32 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 938266114i32 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 156985870i32 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 703831126i32 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 729964155i32 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 988151305i32 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 320872435i32 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 719287167i32 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 152289486i32 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 740067975i32 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 728627816i32 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 385008978i32 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 553967635i32 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 71980713i32 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 519444716i32 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 116499965i32 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 717422268i32 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 18966279i32 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 22458638i32 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 857282620i32 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 920675898i32 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 762235516i32 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 469018377i32 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 199986521i32 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 536679358i32 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 591399452i32 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 83083158i32 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 599449051i32 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 445442318i32 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 585486590i32 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 209278800i32 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 873568117i32 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 664470940i32 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 465262783i32 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 605652874i32 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 376803940i32 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 965247040i32 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 598474509i32 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 845119918i32 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 648159133i32 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 669051032i32 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 800600261i32 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 434689764i32 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 520060080i32 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 804659385i32 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 537828058i32 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 716600292i32 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 387020273i32 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 199375617i32 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 680337189i32 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 818479931i32 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 893693281i32 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 87377802i32 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 84699261i32 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 292826090i32 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 569171405i32 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 387436237i32 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 150682190i32 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 888770419i32 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 824696431i32 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 765659803i32 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 270163693i32 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 427940240i32 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 504997332i32 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 337808338i32 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 907200008i32 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 757177889i32 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 696697188i32 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 41376051i32 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 496293518i32 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 251218820i32 diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/i64.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/i64.leo.out index 24949c2f99..f38e693037 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/i64.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/i64.leo.out @@ -10,7 +10,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 123i64 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 456i64 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 84 - path: test + path: "" content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802i64 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 404 - path: test + path: "" content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802i64 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 340130024i64 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 158951116i64 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 155529659i64 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 642023166i64 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 228481736i64 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 469712960i64 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 929437719i64 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 721072814i64 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 363254789i64 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 906732565i64 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 288246391i64 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 724940549i64 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 487101620i64 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 261373583i64 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 891163927i64 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 743967544i64 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 8372586i64 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 461793278i64 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 806307045i64 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 122764546i64 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 356336181i64 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 158370903i64 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 774460877i64 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 557174131i64 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 492401267i64 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 893445620i64 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 957757048i64 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 721540649i64 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 390746493i64 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 211251725i64 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 938266114i64 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 156985870i64 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 703831126i64 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 729964155i64 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 988151305i64 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 320872435i64 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 719287167i64 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 152289486i64 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 740067975i64 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 728627816i64 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 385008978i64 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 553967635i64 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 71980713i64 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 519444716i64 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 116499965i64 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 717422268i64 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 18966279i64 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 22458638i64 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 857282620i64 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 920675898i64 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 762235516i64 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 469018377i64 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 199986521i64 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 536679358i64 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 591399452i64 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 83083158i64 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 599449051i64 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 445442318i64 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 585486590i64 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 209278800i64 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 873568117i64 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 664470940i64 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 465262783i64 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 605652874i64 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 376803940i64 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 965247040i64 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 598474509i64 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 845119918i64 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 648159133i64 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 669051032i64 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 800600261i64 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 434689764i64 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 520060080i64 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 804659385i64 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 537828058i64 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 716600292i64 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 387020273i64 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 199375617i64 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 680337189i64 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 818479931i64 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 893693281i64 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 87377802i64 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 84699261i64 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 292826090i64 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 569171405i64 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 387436237i64 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 150682190i64 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 888770419i64 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 824696431i64 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 765659803i64 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 270163693i64 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 427940240i64 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 504997332i64 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 337808338i64 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 907200008i64 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 757177889i64 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 696697188i64 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 41376051i64 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 496293518i64 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 251218820i64 diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/i8.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/i8.leo.out index 7b06304a6a..d8ceae2783 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/i8.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/i8.leo.out @@ -10,7 +10,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 123i8 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 456i8 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 83 - path: test + path: "" content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802i8 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 403 - path: test + path: "" content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802i8 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 340130024i8 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 158951116i8 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 155529659i8 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 642023166i8 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 228481736i8 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 469712960i8 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 929437719i8 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 721072814i8 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 363254789i8 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 906732565i8 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 288246391i8 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 724940549i8 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 487101620i8 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 261373583i8 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 891163927i8 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 743967544i8 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: 8372586i8 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 461793278i8 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 806307045i8 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 122764546i8 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 356336181i8 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 158370903i8 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 774460877i8 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 557174131i8 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 492401267i8 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 893445620i8 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 957757048i8 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 721540649i8 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 390746493i8 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 211251725i8 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 938266114i8 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 156985870i8 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 703831126i8 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 729964155i8 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 988151305i8 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 320872435i8 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 719287167i8 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 152289486i8 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 740067975i8 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 728627816i8 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 385008978i8 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 553967635i8 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 71980713i8 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 519444716i8 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 116499965i8 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 717422268i8 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 18966279i8 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 22458638i8 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 857282620i8 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 920675898i8 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 762235516i8 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 469018377i8 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 199986521i8 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 536679358i8 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 591399452i8 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 83083158i8 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 599449051i8 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 445442318i8 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 585486590i8 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 209278800i8 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 873568117i8 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 664470940i8 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 465262783i8 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 605652874i8 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 376803940i8 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 965247040i8 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 598474509i8 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 845119918i8 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 648159133i8 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 669051032i8 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 800600261i8 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 434689764i8 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 520060080i8 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 804659385i8 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 537828058i8 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 716600292i8 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 387020273i8 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 199375617i8 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 680337189i8 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 818479931i8 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 893693281i8 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 87377802i8 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 84699261i8 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 292826090i8 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 569171405i8 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 387436237i8 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 150682190i8 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 888770419i8 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 824696431i8 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 765659803i8 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 270163693i8 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 427940240i8 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 504997332i8 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 337808338i8 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 907200008i8 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 757177889i8 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 696697188i8 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 41376051i8 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 496293518i8 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 251218820i8 diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/implicit.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/implicit.leo.out index 43e759dcc6..970daaae96 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/implicit.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/implicit.leo.out @@ -9,7 +9,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "123" - Value: Implicit: @@ -18,7 +18,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "123" - Value: Implicit: @@ -27,7 +27,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "456" - Value: Implicit: @@ -36,7 +36,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 81 - path: test + path: "" content: "87377802873778028737780287377802873778028737780287377802873778028737780287377802" - Value: Implicit: @@ -45,7 +45,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 401 - path: test + path: "" content: "8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802" - Value: Implicit: @@ -54,7 +54,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "340130024" - Value: Implicit: @@ -63,7 +63,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "158951116" - Value: Implicit: @@ -72,7 +72,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "155529659" - Value: Implicit: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "642023166" - Value: Implicit: @@ -90,7 +90,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "228481736" - Value: Implicit: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "469712960" - Value: Implicit: @@ -108,7 +108,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "929437719" - Value: Implicit: @@ -117,7 +117,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "721072814" - Value: Implicit: @@ -126,7 +126,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "363254789" - Value: Implicit: @@ -135,7 +135,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "906732565" - Value: Implicit: @@ -144,7 +144,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "288246391" - Value: Implicit: @@ -153,7 +153,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "724940549" - Value: Implicit: @@ -162,7 +162,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "487101620" - Value: Implicit: @@ -171,7 +171,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "261373583" - Value: Implicit: @@ -180,7 +180,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "891163927" - Value: Implicit: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "743967544" - Value: Implicit: @@ -198,7 +198,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "8372586" - Value: Implicit: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "461793278" - Value: Implicit: @@ -216,7 +216,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "806307045" - Value: Implicit: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "122764546" - Value: Implicit: @@ -234,7 +234,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "356336181" - Value: Implicit: @@ -243,7 +243,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "158370903" - Value: Implicit: @@ -252,7 +252,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "774460877" - Value: Implicit: @@ -261,7 +261,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "557174131" - Value: Implicit: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "492401267" - Value: Implicit: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "893445620" - Value: Implicit: @@ -288,7 +288,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "957757048" - Value: Implicit: @@ -297,7 +297,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "721540649" - Value: Implicit: @@ -306,7 +306,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "390746493" - Value: Implicit: @@ -315,7 +315,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "211251725" - Value: Implicit: @@ -324,7 +324,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "938266114" - Value: Implicit: @@ -333,7 +333,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "156985870" - Value: Implicit: @@ -342,7 +342,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "703831126" - Value: Implicit: @@ -351,7 +351,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "729964155" - Value: Implicit: @@ -360,7 +360,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "988151305" - Value: Implicit: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "320872435" - Value: Implicit: @@ -378,7 +378,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "719287167" - Value: Implicit: @@ -387,7 +387,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "152289486" - Value: Implicit: @@ -396,7 +396,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "740067975" - Value: Implicit: @@ -405,7 +405,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "728627816" - Value: Implicit: @@ -414,7 +414,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "385008978" - Value: Implicit: @@ -423,7 +423,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "553967635" - Value: Implicit: @@ -432,7 +432,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "71980713" - Value: Implicit: @@ -441,7 +441,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "519444716" - Value: Implicit: @@ -450,7 +450,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "116499965" - Value: Implicit: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "717422268" - Value: Implicit: @@ -468,7 +468,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "18966279" - Value: Implicit: @@ -477,7 +477,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "22458638" - Value: Implicit: @@ -486,7 +486,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "857282620" - Value: Implicit: @@ -495,7 +495,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "920675898" - Value: Implicit: @@ -504,7 +504,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "762235516" - Value: Implicit: @@ -513,7 +513,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "469018377" - Value: Implicit: @@ -522,7 +522,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "199986521" - Value: Implicit: @@ -531,7 +531,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "536679358" - Value: Implicit: @@ -540,7 +540,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "591399452" - Value: Implicit: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "83083158" - Value: Implicit: @@ -558,7 +558,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "599449051" - Value: Implicit: @@ -567,7 +567,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "445442318" - Value: Implicit: @@ -576,7 +576,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "585486590" - Value: Implicit: @@ -585,7 +585,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "209278800" - Value: Implicit: @@ -594,7 +594,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "873568117" - Value: Implicit: @@ -603,7 +603,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "664470940" - Value: Implicit: @@ -612,7 +612,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "465262783" - Value: Implicit: @@ -621,7 +621,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "605652874" - Value: Implicit: @@ -630,7 +630,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "376803940" - Value: Implicit: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "965247040" - Value: Implicit: @@ -648,7 +648,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "598474509" - Value: Implicit: @@ -657,7 +657,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "845119918" - Value: Implicit: @@ -666,7 +666,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "648159133" - Value: Implicit: @@ -675,7 +675,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "669051032" - Value: Implicit: @@ -684,7 +684,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "800600261" - Value: Implicit: @@ -693,7 +693,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "434689764" - Value: Implicit: @@ -702,7 +702,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "520060080" - Value: Implicit: @@ -711,7 +711,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "804659385" - Value: Implicit: @@ -720,7 +720,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "537828058" - Value: Implicit: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "716600292" - Value: Implicit: @@ -738,7 +738,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "387020273" - Value: Implicit: @@ -747,7 +747,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "199375617" - Value: Implicit: @@ -756,7 +756,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "680337189" - Value: Implicit: @@ -765,7 +765,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "818479931" - Value: Implicit: @@ -774,7 +774,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "893693281" - Value: Implicit: @@ -783,7 +783,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "87377802" - Value: Implicit: @@ -792,7 +792,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "84699261" - Value: Implicit: @@ -801,7 +801,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "292826090" - Value: Implicit: @@ -810,7 +810,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "569171405" - Value: Implicit: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "387436237" - Value: Implicit: @@ -828,7 +828,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "150682190" - Value: Implicit: @@ -837,7 +837,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "888770419" - Value: Implicit: @@ -846,7 +846,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "824696431" - Value: Implicit: @@ -855,7 +855,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "765659803" - Value: Implicit: @@ -864,7 +864,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "270163693" - Value: Implicit: @@ -873,7 +873,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "427940240" - Value: Implicit: @@ -882,7 +882,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "504997332" - Value: Implicit: @@ -891,7 +891,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "337808338" - Value: Implicit: @@ -900,7 +900,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "907200008" - Value: Implicit: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "757177889" - Value: Implicit: @@ -918,7 +918,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "696697188" - Value: Implicit: @@ -927,7 +927,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "41376051" - Value: Implicit: @@ -936,7 +936,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "496293518" - Value: Implicit: @@ -945,5 +945,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "251218820" diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/mono_group.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/mono_group.leo.out index 9e959269ac..a2aca76916 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/mono_group.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/mono_group.leo.out @@ -10,7 +10,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: 123group - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "123" - Value: Group: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: 456group - Value: Group: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 86 - path: test + path: "" content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802group - Value: Group: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 406 - path: test + path: "" content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802group - Value: Group: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 340130024group - Value: Group: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 158951116group - Value: Group: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 155529659group - Value: Group: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 642023166group - Value: Group: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 228481736group - Value: Group: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 469712960group - Value: Group: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 929437719group - Value: Group: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 721072814group - Value: Group: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 363254789group - Value: Group: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 906732565group - Value: Group: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 288246391group - Value: Group: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 724940549group - Value: Group: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 487101620group - Value: Group: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 261373583group - Value: Group: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 891163927group - Value: Group: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 743967544group - Value: Group: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 8372586group - Value: Group: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 461793278group - Value: Group: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 806307045group - Value: Group: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 122764546group - Value: Group: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 356336181group - Value: Group: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 158370903group - Value: Group: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 774460877group - Value: Group: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 557174131group - Value: Group: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 492401267group - Value: Group: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 893445620group - Value: Group: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 957757048group - Value: Group: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 721540649group - Value: Group: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 390746493group - Value: Group: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 211251725group - Value: Group: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 938266114group - Value: Group: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 156985870group - Value: Group: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 703831126group - Value: Group: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 729964155group - Value: Group: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 988151305group - Value: Group: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 320872435group - Value: Group: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 719287167group - Value: Group: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 152289486group - Value: Group: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 740067975group - Value: Group: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 728627816group - Value: Group: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 385008978group - Value: Group: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 553967635group - Value: Group: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 71980713group - Value: Group: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 519444716group - Value: Group: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 116499965group - Value: Group: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 717422268group - Value: Group: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 18966279group - Value: Group: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 22458638group - Value: Group: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 857282620group - Value: Group: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 920675898group - Value: Group: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 762235516group - Value: Group: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 469018377group - Value: Group: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 199986521group - Value: Group: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 536679358group - Value: Group: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 591399452group - Value: Group: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 83083158group - Value: Group: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 599449051group - Value: Group: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 445442318group - Value: Group: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 585486590group - Value: Group: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 209278800group - Value: Group: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 873568117group - Value: Group: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 664470940group - Value: Group: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 465262783group - Value: Group: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 605652874group - Value: Group: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 376803940group - Value: Group: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 965247040group - Value: Group: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 598474509group - Value: Group: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 845119918group - Value: Group: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 648159133group - Value: Group: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 669051032group - Value: Group: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 800600261group - Value: Group: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 434689764group - Value: Group: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 520060080group - Value: Group: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 804659385group - Value: Group: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 537828058group - Value: Group: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 716600292group - Value: Group: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 387020273group - Value: Group: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 199375617group - Value: Group: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 680337189group - Value: Group: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 818479931group - Value: Group: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 893693281group - Value: Group: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 87377802group - Value: Group: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 84699261group - Value: Group: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 292826090group - Value: Group: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 569171405group - Value: Group: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 387436237group - Value: Group: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 150682190group - Value: Group: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 888770419group - Value: Group: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 824696431group - Value: Group: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 765659803group - Value: Group: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 270163693group - Value: Group: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 427940240group - Value: Group: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 504997332group - Value: Group: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 337808338group - Value: Group: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 907200008group - Value: Group: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 757177889group - Value: Group: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 696697188group - Value: Group: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 41376051group - Value: Group: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 496293518group - Value: Group: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: 251218820group diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/u128.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/u128.leo.out index f1048e6469..6a8b3e1a53 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/u128.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/u128.leo.out @@ -10,7 +10,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: 123u128 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: 456u128 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 85 - path: test + path: "" content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802u128 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 405 - path: test + path: "" content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802u128 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 340130024u128 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 158951116u128 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 155529659u128 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 642023166u128 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 228481736u128 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 469712960u128 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 929437719u128 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 721072814u128 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 363254789u128 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 906732565u128 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 288246391u128 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 724940549u128 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 487101620u128 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 261373583u128 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 891163927u128 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 743967544u128 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 8372586u128 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 461793278u128 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 806307045u128 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 122764546u128 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 356336181u128 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 158370903u128 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 774460877u128 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 557174131u128 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 492401267u128 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 893445620u128 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 957757048u128 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 721540649u128 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 390746493u128 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 211251725u128 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 938266114u128 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 156985870u128 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 703831126u128 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 729964155u128 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 988151305u128 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 320872435u128 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 719287167u128 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 152289486u128 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 740067975u128 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 728627816u128 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 385008978u128 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 553967635u128 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 71980713u128 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 519444716u128 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 116499965u128 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 717422268u128 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 18966279u128 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 22458638u128 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 857282620u128 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 920675898u128 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 762235516u128 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 469018377u128 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 199986521u128 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 536679358u128 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 591399452u128 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 83083158u128 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 599449051u128 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 445442318u128 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 585486590u128 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 209278800u128 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 873568117u128 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 664470940u128 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 465262783u128 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 605652874u128 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 376803940u128 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 965247040u128 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 598474509u128 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 845119918u128 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 648159133u128 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 669051032u128 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 800600261u128 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 434689764u128 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 520060080u128 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 804659385u128 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 537828058u128 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 716600292u128 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 387020273u128 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 199375617u128 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 680337189u128 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 818479931u128 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 893693281u128 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 87377802u128 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 84699261u128 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 292826090u128 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 569171405u128 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 387436237u128 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 150682190u128 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 888770419u128 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 824696431u128 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 765659803u128 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 270163693u128 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 427940240u128 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 504997332u128 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 337808338u128 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 907200008u128 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 757177889u128 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 696697188u128 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 41376051u128 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 496293518u128 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: 251218820u128 diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/u16.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/u16.leo.out index 324a0abcce..2c0fa81b0f 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/u16.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/u16.leo.out @@ -10,7 +10,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 123u8 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 456u8 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 83 - path: test + path: "" content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802u8 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 403 - path: test + path: "" content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802u8 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 340130024u8 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 158951116u8 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 155529659u8 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 642023166u8 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 228481736u8 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 469712960u8 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 929437719u8 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 721072814u8 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 363254789u8 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 906732565u8 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 288246391u8 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 724940549u8 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 487101620u8 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 261373583u8 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 891163927u8 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 743967544u8 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: 8372586u8 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 461793278u8 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 806307045u8 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 122764546u8 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 356336181u8 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 158370903u8 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 774460877u8 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 557174131u8 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 492401267u8 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 893445620u8 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 957757048u8 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 721540649u8 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 390746493u8 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 211251725u8 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 938266114u8 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 156985870u8 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 703831126u8 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 729964155u8 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 988151305u8 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 320872435u8 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 719287167u8 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 152289486u8 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 740067975u8 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 728627816u8 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 385008978u8 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 553967635u8 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 71980713u8 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 519444716u8 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 116499965u8 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 717422268u8 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 18966279u8 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 22458638u8 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 857282620u8 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 920675898u8 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 762235516u8 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 469018377u8 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 199986521u8 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 536679358u8 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 591399452u8 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 83083158u8 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 599449051u8 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 445442318u8 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 585486590u8 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 209278800u8 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 873568117u8 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 664470940u8 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 465262783u8 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 605652874u8 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 376803940u8 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 965247040u8 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 598474509u8 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 845119918u8 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 648159133u8 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 669051032u8 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 800600261u8 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 434689764u8 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 520060080u8 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 804659385u8 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 537828058u8 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 716600292u8 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 387020273u8 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 199375617u8 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 680337189u8 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 818479931u8 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 893693281u8 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 87377802u8 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 84699261u8 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 292826090u8 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 569171405u8 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 387436237u8 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 150682190u8 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 888770419u8 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 824696431u8 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 765659803u8 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 270163693u8 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 427940240u8 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 504997332u8 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 337808338u8 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 907200008u8 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 757177889u8 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 696697188u8 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 41376051u8 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 496293518u8 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 251218820u8 diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/u32.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/u32.leo.out index ba97127eac..5b7c9e4485 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/u32.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/u32.leo.out @@ -10,7 +10,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 123u32 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 456u32 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 84 - path: test + path: "" content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802u32 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 404 - path: test + path: "" content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802u32 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 340130024u32 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 158951116u32 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 155529659u32 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 642023166u32 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 228481736u32 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 469712960u32 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 929437719u32 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 721072814u32 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 363254789u32 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 906732565u32 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 288246391u32 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 724940549u32 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 487101620u32 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 261373583u32 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 891163927u32 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 743967544u32 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 8372586u32 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 461793278u32 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 806307045u32 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 122764546u32 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 356336181u32 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 158370903u32 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 774460877u32 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 557174131u32 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 492401267u32 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 893445620u32 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 957757048u32 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 721540649u32 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 390746493u32 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 211251725u32 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 938266114u32 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 156985870u32 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 703831126u32 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 729964155u32 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 988151305u32 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 320872435u32 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 719287167u32 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 152289486u32 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 740067975u32 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 728627816u32 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 385008978u32 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 553967635u32 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 71980713u32 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 519444716u32 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 116499965u32 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 717422268u32 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 18966279u32 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 22458638u32 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 857282620u32 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 920675898u32 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 762235516u32 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 469018377u32 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 199986521u32 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 536679358u32 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 591399452u32 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 83083158u32 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 599449051u32 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 445442318u32 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 585486590u32 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 209278800u32 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 873568117u32 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 664470940u32 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 465262783u32 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 605652874u32 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 376803940u32 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 965247040u32 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 598474509u32 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 845119918u32 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 648159133u32 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 669051032u32 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 800600261u32 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 434689764u32 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 520060080u32 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 804659385u32 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 537828058u32 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 716600292u32 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 387020273u32 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 199375617u32 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 680337189u32 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 818479931u32 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 893693281u32 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 87377802u32 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 84699261u32 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 292826090u32 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 569171405u32 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 387436237u32 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 150682190u32 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 888770419u32 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 824696431u32 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 765659803u32 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 270163693u32 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 427940240u32 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 504997332u32 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 337808338u32 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 907200008u32 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 757177889u32 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 696697188u32 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 41376051u32 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 496293518u32 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 251218820u32 diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/u64.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/u64.leo.out index ba97127eac..5b7c9e4485 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/u64.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/u64.leo.out @@ -10,7 +10,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 123u32 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: 456u32 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 84 - path: test + path: "" content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802u32 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 404 - path: test + path: "" content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802u32 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 340130024u32 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 158951116u32 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 155529659u32 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 642023166u32 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 228481736u32 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 469712960u32 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 929437719u32 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 721072814u32 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 363254789u32 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 906732565u32 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 288246391u32 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 724940549u32 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 487101620u32 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 261373583u32 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 891163927u32 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 743967544u32 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 8372586u32 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 461793278u32 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 806307045u32 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 122764546u32 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 356336181u32 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 158370903u32 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 774460877u32 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 557174131u32 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 492401267u32 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 893445620u32 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 957757048u32 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 721540649u32 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 390746493u32 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 211251725u32 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 938266114u32 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 156985870u32 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 703831126u32 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 729964155u32 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 988151305u32 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 320872435u32 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 719287167u32 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 152289486u32 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 740067975u32 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 728627816u32 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 385008978u32 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 553967635u32 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 71980713u32 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 519444716u32 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 116499965u32 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 717422268u32 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 18966279u32 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 22458638u32 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 857282620u32 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 920675898u32 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 762235516u32 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 469018377u32 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 199986521u32 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 536679358u32 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 591399452u32 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 83083158u32 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 599449051u32 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 445442318u32 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 585486590u32 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 209278800u32 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 873568117u32 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 664470940u32 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 465262783u32 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 605652874u32 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 376803940u32 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 965247040u32 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 598474509u32 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 845119918u32 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 648159133u32 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 669051032u32 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 800600261u32 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 434689764u32 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 520060080u32 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 804659385u32 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 537828058u32 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 716600292u32 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 387020273u32 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 199375617u32 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 680337189u32 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 818479931u32 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 893693281u32 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 87377802u32 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 84699261u32 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 292826090u32 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 569171405u32 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 387436237u32 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 150682190u32 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 888770419u32 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 824696431u32 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 765659803u32 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 270163693u32 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 427940240u32 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 504997332u32 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 337808338u32 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 907200008u32 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 757177889u32 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 696697188u32 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 41376051u32 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 496293518u32 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: 251218820u32 diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/u8.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/u8.leo.out index 324a0abcce..2c0fa81b0f 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/u8.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/u8.leo.out @@ -10,7 +10,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 123u8 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: 456u8 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 83 - path: test + path: "" content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802u8 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 403 - path: test + path: "" content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802u8 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 340130024u8 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 158951116u8 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 155529659u8 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 642023166u8 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 228481736u8 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 469712960u8 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 929437719u8 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 721072814u8 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 363254789u8 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 906732565u8 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 288246391u8 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 724940549u8 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 487101620u8 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 261373583u8 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 891163927u8 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 743967544u8 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: 8372586u8 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 461793278u8 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 806307045u8 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 122764546u8 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 356336181u8 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 158370903u8 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 774460877u8 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 557174131u8 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 492401267u8 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 893445620u8 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 957757048u8 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 721540649u8 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 390746493u8 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 211251725u8 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 938266114u8 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 156985870u8 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 703831126u8 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 729964155u8 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 988151305u8 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 320872435u8 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 719287167u8 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 152289486u8 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 740067975u8 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 728627816u8 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 385008978u8 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 553967635u8 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 71980713u8 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 519444716u8 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 116499965u8 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 717422268u8 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 18966279u8 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 22458638u8 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 857282620u8 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 920675898u8 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 762235516u8 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 469018377u8 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 199986521u8 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 536679358u8 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 591399452u8 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 83083158u8 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 599449051u8 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 445442318u8 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 585486590u8 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 209278800u8 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 873568117u8 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 664470940u8 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 465262783u8 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 605652874u8 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 376803940u8 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 965247040u8 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 598474509u8 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 845119918u8 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 648159133u8 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 669051032u8 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 800600261u8 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 434689764u8 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 520060080u8 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 804659385u8 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 537828058u8 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 716600292u8 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 387020273u8 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 199375617u8 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 680337189u8 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 818479931u8 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 893693281u8 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 87377802u8 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 84699261u8 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 292826090u8 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 569171405u8 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 387436237u8 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 150682190u8 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 888770419u8 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 824696431u8 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 765659803u8 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 270163693u8 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 427940240u8 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 504997332u8 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 337808338u8 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 907200008u8 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 757177889u8 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 696697188u8 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: 41376051u8 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 496293518u8 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: 251218820u8 diff --git a/tests/expectations/parser/parser/expression/literal/string_fail.leo.out b/tests/expectations/parser/parser/expression/literal/string_fail.leo.out index 891ec74b3c..07ac3097ed 100644 --- a/tests/expectations/parser/parser/expression/literal/string_fail.leo.out +++ b/tests/expectations/parser/parser/expression/literal/string_fail.leo.out @@ -2,10 +2,10 @@ namespace: Token expectation: Fail outputs: - - " --> test:1:1\n |\n 1 | \"Hello world!\n | ^\n |\n = unexpected token: '\"'" - - " --> test:1:1\n |\n 1 | \"\\\"\n | ^\n |\n = unexpected token: '\"'" - - " --> test:1:1\n |\n 1 | \"\\l\"\n | ^\n |\n = unexpected token: '\"'" - - " --> test:1:1\n |\n 1 | \"\\uaaa\"\n | ^\n |\n = unexpected token: '\"'" - - " --> test:1:1\n |\n 1 | \"\\u\"\n | ^\n |\n = unexpected token: '\"'" - - " --> test:1:1\n |\n 1 | \"\\xFF\"\n | ^\n |\n = unexpected token: '\"'" - - " --> test:1:1\n |\n 1 | \"\\x\"\n | ^\n |\n = unexpected token: '\"'" + - "Error [EPAR0370000]: \"\n --> test:1:1\n |\n 1 | \"Hello world!\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: \"\n --> test:1:1\n |\n 1 | \"\\\"\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: \"\n --> test:1:1\n |\n 1 | \"\\l\"\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: \"\n --> test:1:1\n |\n 1 | \"\\uaaa\"\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: \"\n --> test:1:1\n |\n 1 | \"\\u\"\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: \"\n --> test:1:1\n |\n 1 | \"\\xFF\"\n | ^\n |\n = HELP TODO" + - "Error [EPAR0370000]: \"\n --> test:1:1\n |\n 1 | \"\\x\"\n | ^\n |\n = HELP TODO" diff --git a/tests/expectations/parser/parser/expression/literal/string_parse.leo.out b/tests/expectations/parser/parser/expression/literal/string_parse.leo.out index 15539db427..a46854fcb4 100644 --- a/tests/expectations/parser/parser/expression/literal/string_parse.leo.out +++ b/tests/expectations/parser/parser/expression/literal/string_parse.leo.out @@ -14,7 +14,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "\"string\"" - Value: String: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 21 - path: test + path: "" content: "\"another { } string\"" - Value: String: @@ -57,7 +57,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: "\"{ ] [ ; a\"" - Value: String: @@ -66,7 +66,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "\"\\u{FFA}\"" - Value: String: @@ -75,7 +75,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: "\"\\u{afafa}\"" - Value: String: @@ -84,7 +84,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: "\"\\u{afaf}\"" - Value: String: @@ -93,7 +93,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "\"\\u{afa}\"" - Value: String: @@ -102,7 +102,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "\"\\u{af}\"" - Value: String: @@ -111,7 +111,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "\"\\u{a}\"" - Value: String: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "\"\\x0A\"" - Value: String: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "\"\\x7F\"" - Value: String: @@ -156,7 +156,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 28 - path: test + path: "" content: "\"aa \\\\ \\\" \\n aa \\t \\r \\0\"" - Value: String: @@ -171,7 +171,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: "\"test 😒€\"" - Value: String: @@ -182,5 +182,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: "\"😭😂😘\"" diff --git a/tests/expectations/parser/parser/expression/ternary.leo.out b/tests/expectations/parser/parser/expression/ternary.leo.out index 0d672f23d9..9fef5ba769 100644 --- a/tests/expectations/parser/parser/expression/ternary.leo.out +++ b/tests/expectations/parser/parser/expression/ternary.leo.out @@ -4,69 +4,69 @@ expectation: Pass outputs: - Ternary: condition: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? y : z\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ? y : z\\\"}\"}" if_true: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? y : z\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ? y : z\\\"}\"}" if_false: - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? y : z\\\"}\"}" + Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ? y : z\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "x ? y : z" - Ternary: condition: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" if_true: Ternary: condition: - Identifier: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" + Identifier: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" if_true: - Identifier: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" + Identifier: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" if_false: - Identifier: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" + Identifier: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 14 - path: test + path: "" content: "x ? a ? b : c : z" if_false: - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" + Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: test + path: "" content: "x ? a ? b : c : z" - Ternary: condition: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" if_true: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" if_false: Ternary: condition: - Identifier: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" + Identifier: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" if_true: - Identifier: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" + Identifier: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" if_false: - Identifier: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" + Identifier: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 18 - path: test + path: "" content: "x ? y : a ? b : c" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: test + path: "" content: "x ? y : a ? b : c" diff --git a/tests/expectations/parser/parser/expression/tuple.leo.out b/tests/expectations/parser/parser/expression/tuple.leo.out index f5ec2aa11b..cfed424a4b 100644 --- a/tests/expectations/parser/parser/expression/tuple.leo.out +++ b/tests/expectations/parser/parser/expression/tuple.leo.out @@ -11,9 +11,9 @@ outputs: col_stop: 0 path: "" content: "" - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"(x)\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"(y)\\\"}\"}" - - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"(z)\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x)\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(y)\\\"}\"}" + - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(z)\\\"}\"}" - Value: Implicit: - "" @@ -23,29 +23,29 @@ outputs: col_stop: 0 path: "" content: "" - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"(x,)\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x,)\\\"}\"}" - TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"(x,y)\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"(x,y)\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x,y)\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x,y)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: "(x,y)" - TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"(x,y,z)\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"(x,y,z)\\\"}\"}" - - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"(x,y,z)\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x,y,z)\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x,y,z)\\\"}\"}" + - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x,y,z)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "(x,y,z)" - TupleInit: elements: @@ -56,7 +56,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "(123,123)" - Value: Implicit: @@ -65,14 +65,14 @@ outputs: line_stop: 1 col_start: 6 col_stop: 9 - path: test + path: "" content: "(123,123)" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "(123,123)" - TupleInit: elements: [] @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 3 - path: test + path: "" content: () - TupleInit: elements: [] @@ -90,5 +90,5 @@ outputs: line_stop: 1 col_start: 2 col_stop: 4 - path: test + path: "" content: (()) diff --git a/tests/expectations/parser/parser/expression/unary/negate.leo.out b/tests/expectations/parser/parser/expression/unary/negate.leo.out index de785f2be6..fc683e6957 100644 --- a/tests/expectations/parser/parser/expression/unary/negate.leo.out +++ b/tests/expectations/parser/parser/expression/unary/negate.leo.out @@ -4,27 +4,27 @@ expectation: Pass outputs: - Unary: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"-x\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"-x\\\"}\"}" op: Negate span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 3 - path: test + path: "" content: "-x" - Unary: inner: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"-x.y\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"-x.y\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"-x.y\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"-x.y\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "-x.y" op: Negate span: @@ -32,20 +32,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "-x.y" - Unary: inner: CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"-x::y\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"-x::y\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"-x::y\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"-x::y\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 6 - path: test + path: "" content: "-x::y" op: Negate span: @@ -53,20 +53,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: "-x::y" - Unary: inner: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"-x()\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"-x()\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "-x()" op: Negate span: @@ -74,20 +74,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "-x()" - Unary: inner: Unary: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"--x\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"--x\\\"}\"}" op: Negate span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 4 - path: test + path: "" content: "--x" op: Negate span: @@ -95,20 +95,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "--x" - Unary: inner: Unary: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"-!x\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"-!x\\\"}\"}" op: Not span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 4 - path: test + path: "" content: "-!x" op: Negate span: @@ -116,5 +116,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "-!x" diff --git a/tests/expectations/parser/parser/expression/unary/not.leo.out b/tests/expectations/parser/parser/expression/unary/not.leo.out index 5c93154572..15d331191c 100644 --- a/tests/expectations/parser/parser/expression/unary/not.leo.out +++ b/tests/expectations/parser/parser/expression/unary/not.leo.out @@ -4,27 +4,27 @@ expectation: Pass outputs: - Unary: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"!x\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"!x\\\"}\"}" op: Not span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 3 - path: test + path: "" content: "!x" - Unary: inner: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"!x.y\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"!x.y\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"!x.y\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"!x.y\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "!x.y" op: Not span: @@ -32,20 +32,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "!x.y" - Unary: inner: CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"!x::y\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"!x::y\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"!x::y\\\"}\"}" + name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"!x::y\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 6 - path: test + path: "" content: "!x::y" op: Not span: @@ -53,20 +53,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: "!x::y" - Unary: inner: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"!x()\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"!x()\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 5 - path: test + path: "" content: "!x()" op: Not span: @@ -74,20 +74,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "!x()" - Unary: inner: Unary: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"!!x\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"!!x\\\"}\"}" op: Not span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 4 - path: test + path: "" content: "!!x" op: Not span: @@ -95,20 +95,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "!!x" - Unary: inner: Unary: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"!-x\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"!-x\\\"}\"}" op: Negate span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 4 - path: test + path: "" content: "!-x" op: Not span: @@ -116,5 +116,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "!-x" diff --git a/tests/expectations/parser/parser/functions/annotated.leo.out b/tests/expectations/parser/parser/functions/annotated.leo.out index 29612e265a..36507df8ff 100644 --- a/tests/expectations/parser/parser/functions/annotated.leo.out +++ b/tests/expectations/parser/parser/functions/annotated.leo.out @@ -8,18 +8,18 @@ outputs: circuits: {} global_consts: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": annotations: - span: line_start: 3 line_stop: 3 col_start: 1 col_stop: 6 - path: test + path: "" content: "@test" - name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"@test\\\"}\"}" + name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test\\\"}\"}" arguments: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" input: [] output: ~ block: @@ -33,26 +33,26 @@ outputs: line_stop: 5 col_start: 12 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 5 line_stop: 5 col_start: 5 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 6 col_start: 14 col_stop: 2 - path: test - content: "function x() {\n...\n}" + path: "" + content: "function x() {\n ...\n}" span: line_start: 4 line_stop: 6 col_start: 1 col_stop: 2 - path: test - content: "function x() {\n...\n}" + path: "" + content: "function x() {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/annotated_fail.leo.out b/tests/expectations/parser/parser/functions/annotated_fail.leo.out index b4b2bc739d..f3bf4dee20 100644 --- a/tests/expectations/parser/parser/functions/annotated_fail.leo.out +++ b/tests/expectations/parser/parser/functions/annotated_fail.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - " --> test:3:12\n |\n 3 | @test(test,)\n | ^\n |\n = expected 'identifier', 'number' -- got ')'" + - "Error [EPAR0370005]: expected 'identifier', 'number' -- got ')'\n --> test:3:12\n |\n 3 | @test(test,)\n | ^" diff --git a/tests/expectations/parser/parser/functions/annotated_param.leo.out b/tests/expectations/parser/parser/functions/annotated_param.leo.out index 72ca72549e..a2654b5268 100644 --- a/tests/expectations/parser/parser/functions/annotated_param.leo.out +++ b/tests/expectations/parser/parser/functions/annotated_param.leo.out @@ -8,19 +8,19 @@ outputs: circuits: {} global_consts: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": annotations: - span: line_start: 3 line_stop: 3 col_start: 1 col_stop: 12 - path: test + path: "" content: "@test(test)" - name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"@test(test)\\\"}\"}" + name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test(test)\\\"}\"}" arguments: - test - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" input: [] output: ~ block: @@ -34,26 +34,26 @@ outputs: line_stop: 5 col_start: 12 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 5 line_stop: 5 col_start: 5 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 6 col_start: 14 col_stop: 2 - path: test - content: "function x() {\n...\n}" + path: "" + content: "function x() {\n ...\n}" span: line_start: 4 line_stop: 6 col_start: 1 col_stop: 2 - path: test - content: "function x() {\n...\n}" + path: "" + content: "function x() {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/annotated_twice.leo.out b/tests/expectations/parser/parser/functions/annotated_twice.leo.out index a83199ec50..2d67d2236c 100644 --- a/tests/expectations/parser/parser/functions/annotated_twice.leo.out +++ b/tests/expectations/parser/parser/functions/annotated_twice.leo.out @@ -8,27 +8,27 @@ outputs: circuits: {} global_consts: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": annotations: - span: line_start: 3 line_stop: 3 col_start: 1 col_stop: 6 - path: test + path: "" content: "@test @test2" - name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"@test @test2\\\"}\"}" + name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test @test2\\\"}\"}" arguments: [] - span: line_start: 3 line_stop: 3 col_start: 7 col_stop: 13 - path: test + path: "" content: "@test @test2" - name: "{\"name\":\"test2\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"@test @test2\\\"}\"}" + name: "{\"name\":\"test2\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test @test2\\\"}\"}" arguments: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" input: [] output: ~ block: @@ -42,26 +42,26 @@ outputs: line_stop: 5 col_start: 12 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 5 line_stop: 5 col_start: 5 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 6 col_start: 14 col_stop: 2 - path: test - content: "function x() {\n...\n}" + path: "" + content: "function x() {\n ...\n}" span: line_start: 4 line_stop: 6 col_start: 1 col_stop: 2 - path: test - content: "function x() {\n...\n}" + path: "" + content: "function x() {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/const_input_fail.leo.out b/tests/expectations/parser/parser/functions/const_input_fail.leo.out index 468e683fd9..d0d34e7510 100644 --- a/tests/expectations/parser/parser/functions/const_input_fail.leo.out +++ b/tests/expectations/parser/parser/functions/const_input_fail.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - " --> test:3:18\n |\n 3 | function x(const input) {\n | ^^^^^\n |\n = expected 'ident', got 'input'" + - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'input'\n --> test:3:18\n |\n 3 | function x(const input) {\n | ^^^^^" diff --git a/tests/expectations/parser/parser/functions/const_param.leo.out b/tests/expectations/parser/parser/functions/const_param.leo.out index 609a83247f..1a7d0c68dd 100644 --- a/tests/expectations/parser/parser/functions/const_param.leo.out +++ b/tests/expectations/parser/parser/functions/const_param.leo.out @@ -8,12 +8,12 @@ outputs: circuits: {} global_consts: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}" input: - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}" const_: false mutable: true type_: @@ -23,10 +23,10 @@ outputs: line_stop: 3 col_start: 12 col_stop: 13 - path: test + path: "" content: "function x(x: u32, const y: i32) {" - Variable: - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}" const_: true mutable: false type_: @@ -36,7 +36,7 @@ outputs: line_stop: 3 col_start: 26 col_stop: 27 - path: test + path: "" content: "function x(x: u32, const y: i32) {" output: ~ block: @@ -50,35 +50,35 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 3 line_stop: 5 col_start: 34 col_stop: 2 - path: test - content: "function x(x: u32, const y: i32) {\n...\n}" + path: "" + content: "function x(x: u32, const y: i32) {\n ...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: test - content: "function x(x: u32, const y: i32) {\n...\n}" - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}": + path: "" + content: "function x(x: u32, const y: i32) {\n ...\n}" + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}" input: - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}" const_: true mutable: false type_: @@ -88,10 +88,10 @@ outputs: line_stop: 7 col_start: 18 col_stop: 19 - path: test + path: "" content: "function x(const x: u32, y: i32) {" - Variable: - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}" const_: false mutable: true type_: @@ -101,7 +101,7 @@ outputs: line_stop: 7 col_start: 26 col_stop: 27 - path: test + path: "" content: "function x(const x: u32, y: i32) {" output: ~ block: @@ -115,26 +115,26 @@ outputs: line_stop: 8 col_start: 12 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 8 line_stop: 8 col_start: 5 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 7 line_stop: 9 col_start: 34 col_stop: 2 - path: test - content: "function x(const x: u32, y: i32) {\n...\n}" + path: "" + content: "function x(const x: u32, y: i32) {\n ...\n}" span: line_start: 7 line_stop: 9 col_start: 1 col_stop: 2 - path: test - content: "function x(const x: u32, y: i32) {\n...\n}" + path: "" + content: "function x(const x: u32, y: i32) {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/const_self_bad.leo.out b/tests/expectations/parser/parser/functions/const_self_bad.leo.out index 3b6e210cef..0bce0f5a14 100644 --- a/tests/expectations/parser/parser/functions/const_self_bad.leo.out +++ b/tests/expectations/parser/parser/functions/const_self_bad.leo.out @@ -8,11 +8,11 @@ outputs: circuits: {} global_consts: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}" input: - - ConstSelfKeyword: "{\"name\":\"const self\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":22,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}" + - ConstSelfKeyword: "{\"name\":\"const self\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}" output: ~ block: statements: @@ -25,26 +25,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 3 line_stop: 5 col_start: 24 col_stop: 2 - path: test - content: "function x(const self) {\n...\n}" + path: "" + content: "function x(const self) {\n ...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: test - content: "function x(const self) {\n...\n}" + path: "" + content: "function x(const self) {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/empty.leo.out b/tests/expectations/parser/parser/functions/empty.leo.out index 5ead848ab3..74f3b12e79 100644 --- a/tests/expectations/parser/parser/functions/empty.leo.out +++ b/tests/expectations/parser/parser/functions/empty.leo.out @@ -8,9 +8,9 @@ outputs: circuits: {} global_consts: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" input: [] output: ~ block: @@ -24,26 +24,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 3 line_stop: 5 col_start: 14 col_stop: 2 - path: test - content: "function x() {\n...\n}" + path: "" + content: "function x() {\n ...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: test - content: "function x() {\n...\n}" + path: "" + content: "function x() {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/empty2.leo.out b/tests/expectations/parser/parser/functions/empty2.leo.out index 16574b1dc3..9e6e0e1b79 100644 --- a/tests/expectations/parser/parser/functions/empty2.leo.out +++ b/tests/expectations/parser/parser/functions/empty2.leo.out @@ -8,9 +8,9 @@ outputs: circuits: {} global_consts: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {}\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {}\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {}\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {}\\\"}\"}" input: [] output: ~ block: @@ -20,12 +20,12 @@ outputs: line_stop: 3 col_start: 14 col_stop: 16 - path: test + path: "" content: "function x() {}" span: line_start: 3 line_stop: 3 col_start: 1 col_stop: 16 - path: test + path: "" content: "function x() {}" diff --git a/tests/expectations/parser/parser/functions/param_array.leo.out b/tests/expectations/parser/parser/functions/param_array.leo.out index c9b3cc79cd..367878395b 100644 --- a/tests/expectations/parser/parser/functions/param_array.leo.out +++ b/tests/expectations/parser/parser/functions/param_array.leo.out @@ -8,12 +8,12 @@ outputs: circuits: {} global_consts: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: [u8; 12]) {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: [u8; 12]) {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: [u8; 12]) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: [u8; 12]) {\\\"}\"}" input: - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: [u8; 12]) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: [u8; 12]) {\\\"}\"}" const_: false mutable: true type_: @@ -25,7 +25,7 @@ outputs: line_stop: 3 col_start: 12 col_stop: 13 - path: test + path: "" content: "function x(x: [u8; 12]) {" output: ~ block: @@ -39,26 +39,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 3 line_stop: 5 col_start: 25 col_stop: 2 - path: test - content: "function x(x: [u8; 12]) {\n...\n}" + path: "" + content: "function x(x: [u8; 12]) {\n ...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: test - content: "function x(x: [u8; 12]) {\n...\n}" + path: "" + content: "function x(x: [u8; 12]) {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/param_circuit.leo.out b/tests/expectations/parser/parser/functions/param_circuit.leo.out index e998fe7f92..45bb7dcde7 100644 --- a/tests/expectations/parser/parser/functions/param_circuit.leo.out +++ b/tests/expectations/parser/parser/functions/param_circuit.leo.out @@ -8,22 +8,22 @@ outputs: circuits: {} global_consts: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}" input: - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}" const_: false mutable: true type_: - Circuit: "{\"name\":\"MyCircuit\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":15,\\\"col_stop\\\":24,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}" + Circuit: "{\"name\":\"MyCircuit\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":15,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}" span: line_start: 3 line_stop: 3 col_start: 12 col_stop: 13 - path: test + path: "" content: "function x(x: MyCircuit) {" output: ~ block: @@ -37,26 +37,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 3 line_stop: 5 col_start: 26 col_stop: 2 - path: test - content: "function x(x: MyCircuit) {\n...\n}" + path: "" + content: "function x(x: MyCircuit) {\n ...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: test - content: "function x(x: MyCircuit) {\n...\n}" + path: "" + content: "function x(x: MyCircuit) {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/param_tuple.leo.out b/tests/expectations/parser/parser/functions/param_tuple.leo.out index 9597b18cb3..ef7a74d3de 100644 --- a/tests/expectations/parser/parser/functions/param_tuple.leo.out +++ b/tests/expectations/parser/parser/functions/param_tuple.leo.out @@ -8,12 +8,12 @@ outputs: circuits: {} global_consts: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}" input: - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}" const_: false mutable: true type_: @@ -25,7 +25,7 @@ outputs: line_stop: 3 col_start: 12 col_stop: 13 - path: test + path: "" content: "function x(x: (u32, i32)) {" output: ~ block: @@ -39,26 +39,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 3 line_stop: 5 col_start: 27 col_stop: 2 - path: test - content: "function x(x: (u32, i32)) {\n...\n}" + path: "" + content: "function x(x: (u32, i32)) {\n ...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: test - content: "function x(x: (u32, i32)) {\n...\n}" + path: "" + content: "function x(x: (u32, i32)) {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/params.leo.out b/tests/expectations/parser/parser/functions/params.leo.out index 9c74dafafd..d1ea6ac6c4 100644 --- a/tests/expectations/parser/parser/functions/params.leo.out +++ b/tests/expectations/parser/parser/functions/params.leo.out @@ -8,12 +8,12 @@ outputs: circuits: {} global_consts: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" input: - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" const_: false mutable: true type_: @@ -23,10 +23,10 @@ outputs: line_stop: 3 col_start: 12 col_stop: 13 - path: test + path: "" content: "function x(x: u32, y: i32) {" - Variable: - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" const_: false mutable: true type_: @@ -36,7 +36,7 @@ outputs: line_stop: 3 col_start: 20 col_stop: 21 - path: test + path: "" content: "function x(x: u32, y: i32) {" output: ~ block: @@ -50,26 +50,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 3 line_stop: 5 col_start: 28 col_stop: 2 - path: test - content: "function x(x: u32, y: i32) {\n...\n}" + path: "" + content: "function x(x: u32, y: i32) {\n ...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: test - content: "function x(x: u32, y: i32) {\n...\n}" + path: "" + content: "function x(x: u32, y: i32) {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/params_return.leo.out b/tests/expectations/parser/parser/functions/params_return.leo.out index 6b1980e238..194d6069d2 100644 --- a/tests/expectations/parser/parser/functions/params_return.leo.out +++ b/tests/expectations/parser/parser/functions/params_return.leo.out @@ -8,12 +8,12 @@ outputs: circuits: {} global_consts: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}" input: - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}" const_: false mutable: true type_: @@ -23,10 +23,10 @@ outputs: line_stop: 3 col_start: 12 col_stop: 13 - path: test + path: "" content: "function x(x: u32, y: i32) -> u32 {" - Variable: - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}" const_: false mutable: true type_: @@ -36,7 +36,7 @@ outputs: line_stop: 3 col_start: 20 col_stop: 21 - path: test + path: "" content: "function x(x: u32, y: i32) -> u32 {" output: IntegerType: U32 @@ -51,26 +51,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 3 line_stop: 5 col_start: 35 col_stop: 2 - path: test - content: "function x(x: u32, y: i32) -> u32 {\n...\n}" + path: "" + content: "function x(x: u32, y: i32) -> u32 {\n ...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: test - content: "function x(x: u32, y: i32) -> u32 {\n...\n}" + path: "" + content: "function x(x: u32, y: i32) -> u32 {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/return.leo.out b/tests/expectations/parser/parser/functions/return.leo.out index 3baa2a2e79..9d8f155ffa 100644 --- a/tests/expectations/parser/parser/functions/return.leo.out +++ b/tests/expectations/parser/parser/functions/return.leo.out @@ -8,9 +8,9 @@ outputs: circuits: {} global_consts: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() -> u32 {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() -> u32 {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() -> u32 {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() -> u32 {\\\"}\"}" input: [] output: IntegerType: U32 @@ -25,26 +25,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 3 line_stop: 5 col_start: 21 col_stop: 2 - path: test - content: "function x() -> u32 {\n...\n}" + path: "" + content: "function x() -> u32 {\n ...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: test - content: "function x() -> u32 {\n...\n}" + path: "" + content: "function x() -> u32 {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/return_tuple.leo.out b/tests/expectations/parser/parser/functions/return_tuple.leo.out index aa853f04df..cd07553041 100644 --- a/tests/expectations/parser/parser/functions/return_tuple.leo.out +++ b/tests/expectations/parser/parser/functions/return_tuple.leo.out @@ -8,9 +8,9 @@ outputs: circuits: {} global_consts: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() -> (u32, u32) {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() -> (u32, u32) {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() -> (u32, u32) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() -> (u32, u32) {\\\"}\"}" input: [] output: Tuple: @@ -27,26 +27,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: test + path: "" content: " return ();" span: line_start: 3 line_stop: 5 col_start: 28 col_stop: 2 - path: test - content: "function x() -> (u32, u32) {\n...\n}" + path: "" + content: "function x() -> (u32, u32) {\n ...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: test - content: "function x() -> (u32, u32) {\n...\n}" + path: "" + content: "function x() -> (u32, u32) {\n ...\n}" diff --git a/tests/expectations/parser/parser/import/alias.leo.out b/tests/expectations/parser/parser/import/alias.leo.out index e0c181f3d7..548fd7c84c 100644 --- a/tests/expectations/parser/parser/import/alias.leo.out +++ b/tests/expectations/parser/parser/import/alias.leo.out @@ -7,31 +7,31 @@ outputs: imports: - package_or_packages: Package: - name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import a.b as bar;\\\"}\"}" + 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\\\":\\\"test\\\",\\\"content\\\":\\\"import a.b as bar;\\\"}\"}" - alias: "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":15,\\\"col_stop\\\":18,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import a.b as bar;\\\"}\"}" + 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: test + path: "" content: import a.b as bar; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 18 - path: test + path: "" content: import a.b as bar; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 18 - path: test + path: "" content: import a.b as bar; circuits: {} global_consts: {} diff --git a/tests/expectations/parser/parser/import/basic.leo.out b/tests/expectations/parser/parser/import/basic.leo.out index 7293ccb78e..17a6ffdce3 100644 --- a/tests/expectations/parser/parser/import/basic.leo.out +++ b/tests/expectations/parser/parser/import/basic.leo.out @@ -7,31 +7,31 @@ outputs: imports: - package_or_packages: Package: - name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import a.b;\\\"}\"}" + 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\\\":\\\"test\\\",\\\"content\\\":\\\"import a.b;\\\"}\"}" + 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: test + path: "" content: import a.b; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 11 - path: test + path: "" content: import a.b; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 11 - path: test + path: "" content: import a.b; circuits: {} global_consts: {} 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 5b3301be42..e9201ce299 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 @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - " --> test:3:8\n |\n 3 | import a.();\n | ^\n |\n = Cannot import empty list" + - "Error [EPAR0370002]: Cannot import empty list\n --> test:3:8\n |\n 3 | import a.();\n | ^" diff --git a/tests/expectations/parser/parser/import/invalid.leo.out b/tests/expectations/parser/parser/import/invalid.leo.out index 941b1887cd..b71e40aa89 100644 --- a/tests/expectations/parser/parser/import/invalid.leo.out +++ b/tests/expectations/parser/parser/import/invalid.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - " --> test:3:18\n |\n 3 | import foo as bar;\n | ^\n |\n = expected '.' -- got ';'" + - "Error [EPAR0370005]: expected . -- got ';'\n --> test:3:18\n |\n 3 | import foo as bar;\n | ^" diff --git a/tests/expectations/parser/parser/import/many_import.leo.out b/tests/expectations/parser/parser/import/many_import.leo.out index c8bf9349c8..fe11e6dc50 100644 --- a/tests/expectations/parser/parser/import/many_import.leo.out +++ b/tests/expectations/parser/parser/import/many_import.leo.out @@ -7,130 +7,130 @@ outputs: imports: - package_or_packages: Packages: - name: "{\"name\":\"test-import\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import test-import.( // local import\\\"}\"}" + 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\\\":\\\"test\\\",\\\"content\\\":\\\" Point,\\\"}\"}" + 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: test + path: "" content: " Point," - Symbol: - symbol: "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" foo,\\\"}\"}" + 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: test + path: "" content: " foo," span: line_start: 3 line_stop: 5 col_start: 8 col_stop: 8 - path: test - content: "import test-import.( // local import\n...\n foo," + path: "" + content: "import test-import.( // local import\n ...\n foo," span: line_start: 3 line_stop: 5 col_start: 8 col_stop: 8 - path: test - content: "import test-import.( // local import\n...\n foo," + path: "" + content: "import test-import.( // local import\n ...\n foo," - package_or_packages: Packages: - name: "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import bar.( // imports directory import\\\"}\"}" + 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\\\":\\\"test\\\",\\\"content\\\":\\\" Bar,\\\"}\"}" + 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: test + path: "" content: " Bar," - Multiple: - name: "{\"name\":\"baz\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" baz.(Baz, Bazzar),\\\"}\"}" + 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\\\":\\\"test\\\",\\\"content\\\":\\\" baz.(Baz, Bazzar),\\\"}\"}" + 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: test + path: "" content: " baz.(Baz, Bazzar)," - Symbol: - symbol: "{\"name\":\"Bazzar\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":15,\\\"col_stop\\\":21,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" baz.(Baz, Bazzar),\\\"}\"}" + 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: test + path: "" content: " baz.(Baz, Bazzar)," span: line_start: 10 line_stop: 10 col_start: 5 col_stop: 21 - path: test + path: "" content: " baz.(Baz, Bazzar)," - SubPackage: - name: "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" bat.bat.Bat,\\\"}\"}" + 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\\\":\\\"test\\\",\\\"content\\\":\\\" bat.bat.Bat,\\\"}\"}" + 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\\\":\\\"test\\\",\\\"content\\\":\\\" bat.bat.Bat,\\\"}\"}" + 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: test + path: "" content: " bat.bat.Bat," span: line_start: 11 line_stop: 11 col_start: 9 col_stop: 16 - path: test + path: "" content: " bat.bat.Bat," span: line_start: 11 line_stop: 11 col_start: 5 col_stop: 16 - path: test + path: "" content: " bat.bat.Bat," span: line_start: 8 line_stop: 11 col_start: 8 col_stop: 16 - path: test - content: "import bar.( // imports directory import\n...\n bat.bat.Bat," + path: "" + content: "import bar.( // imports directory import\n ...\n ...\n bat.bat.Bat," span: line_start: 8 line_stop: 11 col_start: 8 col_stop: 16 - path: test - content: "import bar.( // imports directory import\n...\n bat.bat.Bat," + path: "" + content: "import bar.( // imports directory import\n ...\n ...\n bat.bat.Bat," circuits: {} global_consts: {} functions: {} diff --git a/tests/expectations/parser/parser/import/many_import_star.leo.out b/tests/expectations/parser/parser/import/many_import_star.leo.out index d1555ed1e0..1e129a584b 100644 --- a/tests/expectations/parser/parser/import/many_import_star.leo.out +++ b/tests/expectations/parser/parser/import/many_import_star.leo.out @@ -7,7 +7,7 @@ outputs: imports: - package_or_packages: Package: - name: "{\"name\":\"test-import\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import test-import.*; // local import\\\"}\"}" + 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: @@ -15,25 +15,25 @@ outputs: line_stop: 3 col_start: 20 col_stop: 21 - path: test + path: "" content: import test-import.*; // local import span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 21 - path: test + path: "" content: import test-import.*; // local import span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 21 - path: test + 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\\\":\\\"test\\\",\\\"content\\\":\\\"import bar.*; // imports directory import\\\"}\"}" + 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: @@ -41,28 +41,28 @@ outputs: line_stop: 5 col_start: 12 col_stop: 13 - path: test + path: "" content: import bar.*; // imports directory import span: line_start: 5 line_stop: 5 col_start: 8 col_stop: 13 - path: test + path: "" content: import bar.*; // imports directory import span: line_start: 5 line_stop: 5 col_start: 8 col_stop: 13 - path: test + 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\\\":\\\"test\\\",\\\"content\\\":\\\"import bar.baz.*; // imports directory import\\\"}\"}" + 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\\\":\\\"test\\\",\\\"content\\\":\\\"import bar.baz.*; // imports directory import\\\"}\"}" + 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: @@ -70,38 +70,38 @@ outputs: line_stop: 6 col_start: 16 col_stop: 17 - path: test + path: "" content: import bar.baz.*; // imports directory import span: line_start: 6 line_stop: 6 col_start: 12 col_stop: 17 - path: test + path: "" content: import bar.baz.*; // imports directory import span: line_start: 6 line_stop: 6 col_start: 8 col_stop: 17 - path: test + path: "" content: import bar.baz.*; // imports directory import span: line_start: 6 line_stop: 6 col_start: 8 col_stop: 17 - path: test + 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\\\":\\\"test\\\",\\\"content\\\":\\\"import bar.bat.bat.*; // imports directory import\\\"}\"}" + 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\\\":\\\"test\\\",\\\"content\\\":\\\"import bar.bat.bat.*; // imports directory import\\\"}\"}" + 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\\\":\\\"test\\\",\\\"content\\\":\\\"import bar.bat.bat.*; // imports directory import\\\"}\"}" + 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: @@ -109,39 +109,39 @@ outputs: line_stop: 7 col_start: 20 col_stop: 21 - path: test + path: "" content: import bar.bat.bat.*; // imports directory import span: line_start: 7 line_stop: 7 col_start: 16 col_stop: 21 - path: test + path: "" content: import bar.bat.bat.*; // imports directory import span: line_start: 7 line_stop: 7 col_start: 12 col_stop: 21 - path: test + path: "" content: import bar.bat.bat.*; // imports directory import span: line_start: 7 line_stop: 7 col_start: 8 col_stop: 21 - path: test + path: "" content: import bar.bat.bat.*; // imports directory import span: line_start: 7 line_stop: 7 col_start: 8 col_stop: 21 - path: test + 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\\\":\\\"test\\\",\\\"content\\\":\\\"import car.*; // imports directory import\\\"}\"}" + 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: @@ -149,21 +149,21 @@ outputs: line_stop: 8 col_start: 12 col_stop: 13 - path: test + path: "" content: import car.*; // imports directory import span: line_start: 8 line_stop: 8 col_start: 8 col_stop: 13 - path: test + path: "" content: import car.*; // imports directory import span: line_start: 8 line_stop: 8 col_start: 8 col_stop: 13 - path: test + path: "" content: import car.*; // imports directory import circuits: {} global_consts: {} diff --git a/tests/expectations/parser/parser/import/names.leo.out b/tests/expectations/parser/parser/import/names.leo.out index 9bc9319577..1c38d71a94 100644 --- a/tests/expectations/parser/parser/import/names.leo.out +++ b/tests/expectations/parser/parser/import/names.leo.out @@ -7,87 +7,87 @@ outputs: imports: - package_or_packages: Package: - name: "{\"name\":\"a0-f\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import a0-f.foo;\\\"}\"}" + 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\\\":\\\"test\\\",\\\"content\\\":\\\"import a0-f.foo;\\\"}\"}" + 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: test + path: "" content: import a0-f.foo; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 16 - path: test + path: "" content: import a0-f.foo; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 16 - path: test + 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\\\":\\\"test\\\",\\\"content\\\":\\\"import a-9.bar;\\\"}\"}" + 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\\\":\\\"test\\\",\\\"content\\\":\\\"import a-9.bar;\\\"}\"}" + 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: test + path: "" content: import a-9.bar; span: line_start: 4 line_stop: 4 col_start: 8 col_stop: 15 - path: test + path: "" content: import a-9.bar; span: line_start: 4 line_stop: 4 col_start: 8 col_stop: 15 - path: test + 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\\\":\\\"test\\\",\\\"content\\\":\\\"import hello-world.hello;\\\"}\"}" + 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\\\":\\\"test\\\",\\\"content\\\":\\\"import hello-world.hello;\\\"}\"}" + 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: test + path: "" content: import hello-world.hello; span: line_start: 5 line_stop: 5 col_start: 8 col_stop: 25 - path: test + path: "" content: import hello-world.hello; span: line_start: 5 line_stop: 5 col_start: 8 col_stop: 25 - path: test + path: "" content: import hello-world.hello; circuits: {} global_consts: {} diff --git a/tests/expectations/parser/parser/import/names_underscore.leo.out b/tests/expectations/parser/parser/import/names_underscore.leo.out index 952c5c0ac7..c9f7799293 100644 --- a/tests/expectations/parser/parser/import/names_underscore.leo.out +++ b/tests/expectations/parser/parser/import/names_underscore.leo.out @@ -7,31 +7,31 @@ outputs: imports: - package_or_packages: Package: - name: "{\"name\":\"hello_world\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import hello_world.foo;\\\"}\"}" + 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\\\":\\\"test\\\",\\\"content\\\":\\\"import hello_world.foo;\\\"}\"}" + 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: test + path: "" content: import hello_world.foo; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 23 - path: test + path: "" content: import hello_world.foo; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 23 - path: test + path: "" content: import hello_world.foo; circuits: {} global_consts: {} diff --git a/tests/expectations/parser/parser/import/star.leo.out b/tests/expectations/parser/parser/import/star.leo.out index f9e234a287..b2cce28fdc 100644 --- a/tests/expectations/parser/parser/import/star.leo.out +++ b/tests/expectations/parser/parser/import/star.leo.out @@ -7,7 +7,7 @@ outputs: imports: - package_or_packages: Package: - name: "{\"name\":\"test-import\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import test-import.*;\\\"}\"}" + 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: @@ -15,21 +15,21 @@ outputs: line_stop: 3 col_start: 20 col_stop: 21 - path: test + path: "" content: import test-import.*; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 21 - path: test + path: "" content: import test-import.*; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 21 - path: test + path: "" content: import test-import.*; circuits: {} global_consts: {} diff --git a/tests/expectations/parser/parser/statement/assign.leo.out b/tests/expectations/parser/parser/statement/assign.leo.out index d992c636a2..422cb1d114 100644 --- a/tests/expectations/parser/parser/statement/assign.leo.out +++ b/tests/expectations/parser/parser/statement/assign.leo.out @@ -5,35 +5,35 @@ outputs: - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x = expr;\\\"}\"}" accesses: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: x = expr; value: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: x = expr; - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x = ();\\\"}\"}" accesses: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: x = (); value: TupleInit: @@ -43,114 +43,114 @@ outputs: line_stop: 1 col_start: 5 col_stop: 7 - path: test + path: "" content: x = (); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: x = (); - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x = x+y;\\\"}\"}" accesses: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: x = x+y; value: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 8 - path: test + path: "" content: x = x+y; span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: x = x+y; - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x = (x,y);\\\"}\"}" accesses: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: "x = (x,y);" value: TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 10 - path: test + path: "" content: "x = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "x = (x,y);" - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x = x();\\\"}\"}" accesses: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 2 - path: test + path: "" content: x = x(); value: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 8 - path: test + path: "" content: x = x(); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: x = x(); - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0] = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0] = y;\\\"}\"}" accesses: - ArrayIndex: Value: @@ -160,28 +160,28 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: "x[0] = y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "x[0] = y;" value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0] = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0] = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 9 - path: test + path: "" content: "x[0] = y;" - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0u32] = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0u32] = y;\\\"}\"}" accesses: - ArrayIndex: Value: @@ -192,28 +192,28 @@ outputs: line_stop: 1 col_start: 3 col_stop: 7 - path: test + path: "" content: "x[0u32] = y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "x[0u32] = y;" value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0u32] = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0u32] = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: "x[0u32] = y;" - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0 = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.0 = y;\\\"}\"}" accesses: - Tuple: - value: "0" @@ -221,28 +221,28 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x.0 = y; span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x.0 = y; value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0 = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.0 = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: x.0 = y; - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[1..2] = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[1..2] = y;\\\"}\"}" accesses: - ArrayRange: - Value: @@ -252,7 +252,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: "x[1..2] = y;" - Value: Implicit: @@ -261,28 +261,28 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: "x[1..2] = y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: test + path: "" content: "x[1..2] = y;" value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[1..2] = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[1..2] = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: "x[1..2] = y;" - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..2] = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..2] = y;\\\"}\"}" accesses: - ArrayRange: - ~ @@ -293,28 +293,28 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: "x[..2] = y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "x[..2] = y;" value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..2] = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..2] = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: "x[..2] = y;" - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[2..] = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[2..] = y;\\\"}\"}" accesses: - ArrayRange: - Value: @@ -324,7 +324,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: test + path: "" content: "x[2..] = y;" - ~ span: @@ -332,21 +332,21 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: test + path: "" content: "x[2..] = y;" value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[2..] = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[2..] = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: "x[2..] = y;" - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..] = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..] = y;\\\"}\"}" accesses: - ArrayRange: - ~ @@ -356,21 +356,21 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: "x[..] = y;" value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..] = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..] = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: "x[..] = y;" - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0[0][..] = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.0[0][..] = y;\\\"}\"}" accesses: - Tuple: - value: "0" @@ -378,7 +378,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: "x.0[0][..] = y;" - ArrayIndex: Value: @@ -388,7 +388,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: "x.0[0][..] = y;" - ArrayRange: - ~ @@ -398,14 +398,14 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: "x.0[0][..] = y;" value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0[0][..] = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.0[0][..] = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: "x.0[0][..] = y;" diff --git a/tests/expectations/parser/parser/statement/block.leo.out b/tests/expectations/parser/parser/statement/block.leo.out index 6e40c82b0f..4ad226b576 100644 --- a/tests/expectations/parser/parser/statement/block.leo.out +++ b/tests/expectations/parser/parser/statement/block.leo.out @@ -9,7 +9,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 3 - path: test + path: "" content: "{}" - Block: statements: @@ -22,22 +22,22 @@ outputs: line_stop: 2 col_start: 8 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 1 line_stop: 3 col_start: 1 col_stop: 2 - path: test - content: "{\n...\n}" + path: "" + content: "{\n ...\n}" - Block: statements: - Block: @@ -47,14 +47,14 @@ outputs: line_stop: 1 col_start: 2 col_stop: 4 - path: test + path: "" content: "{{}}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: "{{}}" - Block: statements: @@ -69,34 +69,34 @@ outputs: line_stop: 3 col_start: 8 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 3 line_stop: 3 col_start: 1 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 2 line_stop: 4 col_start: 1 col_stop: 2 - path: test - content: "{\n...\n}" + path: "" + content: "{\n ...\n}" span: line_start: 1 line_stop: 5 col_start: 1 col_stop: 2 - path: test - content: "{\n...\n}" + path: "" + content: "{\n ...\n ...\n ...\n}" - Block: statements: - Conditional: condition: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if x {\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"if x {\\\"}\"}" block: statements: - Return: @@ -108,34 +108,34 @@ outputs: line_stop: 3 col_start: 8 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 3 line_stop: 3 col_start: 1 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 2 line_stop: 4 col_start: 6 col_stop: 2 - path: test - content: "if x {\n...\n}" + path: "" + content: "if x {\n ...\n}" next: ~ span: line_start: 2 line_stop: 4 col_start: 1 col_stop: 2 - path: test - content: "if x {\n...\n}" + path: "" + content: "if x {\n ...\n}" span: line_start: 1 line_stop: 5 col_start: 1 col_stop: 2 - path: test - content: "{\n...\n}" + path: "" + content: "{\n ...\n ...\n ...\n}" diff --git a/tests/expectations/parser/parser/statement/conditional.leo.out b/tests/expectations/parser/parser/statement/conditional.leo.out index c29e4db887..3fd8752374 100644 --- a/tests/expectations/parser/parser/statement/conditional.leo.out +++ b/tests/expectations/parser/parser/statement/conditional.leo.out @@ -4,7 +4,7 @@ expectation: Pass outputs: - Conditional: condition: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if x {\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"if x {\\\"}\"}" block: statements: - Return: @@ -16,33 +16,33 @@ outputs: line_stop: 2 col_start: 8 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 1 line_stop: 3 col_start: 6 col_stop: 2 - path: test - content: "if x {\n...\n}" + path: "" + content: "if x {\n ...\n}" next: ~ span: line_start: 1 line_stop: 3 col_start: 1 col_stop: 2 - path: test - content: "if x {\n...\n}" + path: "" + content: "if x {\n ...\n}" - Conditional: condition: - Identifier: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if Self {\\\"}\"}" + Identifier: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"if Self {\\\"}\"}" block: statements: - Return: @@ -54,33 +54,33 @@ outputs: line_stop: 2 col_start: 8 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 1 line_stop: 3 col_start: 9 col_stop: 2 - path: test - content: "if Self {\n...\n}" + path: "" + content: "if Self {\n ...\n}" next: ~ span: line_start: 1 line_stop: 3 col_start: 1 col_stop: 2 - path: test - content: "if Self {\n...\n}" + path: "" + content: "if Self {\n ...\n}" - Conditional: condition: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if (x) {\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"if (x) {\\\"}\"}" block: statements: - Return: @@ -92,33 +92,33 @@ outputs: line_stop: 2 col_start: 8 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 1 line_stop: 3 col_start: 8 col_stop: 2 - path: test - content: "if (x) {\n...\n}" + path: "" + content: "if (x) {\n ...\n}" next: ~ span: line_start: 1 line_stop: 3 col_start: 1 col_stop: 2 - path: test - content: "if (x) {\n...\n}" + path: "" + content: "if (x) {\n ...\n}" - Conditional: condition: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if (x) {} else {}\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"if (x) {} else {}\\\"}\"}" block: statements: [] span: @@ -126,7 +126,7 @@ outputs: line_stop: 1 col_start: 8 col_stop: 10 - path: test + path: "" content: "if (x) {} else {}" next: Block: @@ -136,29 +136,29 @@ outputs: line_stop: 1 col_start: 16 col_stop: 18 - path: test + path: "" content: "if (x) {} else {}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: test + path: "" content: "if (x) {} else {}" - Conditional: condition: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if x+y {} else if x+z {} else {}\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"if x+y {} else if x+z {} else {}\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if x+y {} else if x+z {} else {}\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"if x+y {} else if x+z {} else {}\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 4 col_stop: 7 - path: test + path: "" content: "if x+y {} else if x+z {} else {}" block: statements: [] @@ -167,23 +167,23 @@ outputs: line_stop: 1 col_start: 8 col_stop: 10 - path: test + path: "" content: "if x+y {} else if x+z {} else {}" next: Conditional: condition: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if x+y {} else if x+z {} else {}\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"if x+y {} else if x+z {} else {}\\\"}\"}" right: - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if x+y {} else if x+z {} else {}\\\"}\"}" + Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"if x+y {} else if x+z {} else {}\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 19 col_stop: 22 - path: test + path: "" content: "if x+y {} else if x+z {} else {}" block: statements: [] @@ -192,7 +192,7 @@ outputs: line_stop: 1 col_start: 23 col_stop: 25 - path: test + path: "" content: "if x+y {} else if x+z {} else {}" next: Block: @@ -202,48 +202,48 @@ outputs: line_stop: 1 col_start: 31 col_stop: 33 - path: test + path: "" content: "if x+y {} else if x+z {} else {}" span: line_start: 1 line_stop: 1 col_start: 16 col_stop: 33 - path: test + path: "" content: "if x+y {} else if x+z {} else {}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 33 - path: test + path: "" content: "if x+y {} else if x+z {} else {}" - Conditional: condition: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if x+y {\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"if x+y {\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if x+y {\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"if x+y {\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 4 col_stop: 7 - path: test + path: "" content: "if x+y {" block: statements: - Expression: expression: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"expr;\\\"}\"}" span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 5 - path: test + path: "" content: expr; - Return: expression: @@ -254,27 +254,27 @@ outputs: line_stop: 3 col_start: 8 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 3 line_stop: 3 col_start: 1 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 1 line_stop: 4 col_start: 8 col_stop: 2 - path: test - content: "if x+y {\n...\n}" + path: "" + content: "if x+y {\n ...\n ...\n}" next: ~ span: line_start: 1 line_stop: 4 col_start: 1 col_stop: 2 - path: test - content: "if x+y {\n...\n}\n" + path: "" + content: "if x+y {\n ...\n ...\n}" diff --git a/tests/expectations/parser/parser/statement/conditional_fail.leo.out b/tests/expectations/parser/parser/statement/conditional_fail.leo.out index c54b2c1841..8a62d7823e 100644 --- a/tests/expectations/parser/parser/statement/conditional_fail.leo.out +++ b/tests/expectations/parser/parser/statement/conditional_fail.leo.out @@ -2,4 +2,4 @@ namespace: ParseStatement expectation: Fail outputs: - - " --> test:1:17\n |\n 1 | if true {} else let x = 2;\n | ^^^^^^^^^\n |\n = expected 'Block or Conditional', got 'let mut x = 2;'" + - "Error [EPAR0370008]: unexpected statement: expected 'Block or Conditional', got 'let mut x = 2;'\n --> test:1:17\n |\n 1 | if true {} else let x = 2;\n | ^^^^^^^^^" diff --git a/tests/expectations/parser/parser/statement/console.leo.out b/tests/expectations/parser/parser/statement/console.leo.out index 4ff3e93b83..f8bb2b4c7d 100644 --- a/tests/expectations/parser/parser/statement/console.leo.out +++ b/tests/expectations/parser/parser/statement/console.leo.out @@ -5,13 +5,13 @@ outputs: - Console: function: Assert: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.assert(x);\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"console.assert(x);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 17 - path: test + path: "" content: console.assert(x); - Console: function: @@ -20,20 +20,20 @@ outputs: - Scalar: 123 - Scalar: 125 parameters: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.error(\\\\\\\"{}\\\\\\\", x);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"console.error(\\\\\\\"{}\\\\\\\", x);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 15 col_stop: 22 - path: test + path: "" content: "console.error(\"{}\", x);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 22 - path: test + path: "" content: "console.error(\"{}\", x);" - Console: function: @@ -44,21 +44,21 @@ outputs: - Scalar: 123 - Scalar: 125 parameters: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.error(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.error(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"console.error(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"console.error(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 15 col_stop: 27 - path: test + path: "" content: "console.error(\"{}{}\", x, y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 27 - path: test + path: "" content: "console.error(\"{}{}\", x, y);" - Console: function: @@ -71,14 +71,14 @@ outputs: line_stop: 1 col_start: 15 col_stop: 18 - path: test + path: "" content: "console.error(\"x\");" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: test + path: "" content: "console.error(\"x\");" - Console: function: @@ -87,20 +87,20 @@ outputs: - Scalar: 123 - Scalar: 125 parameters: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.log(\\\\\\\"{}\\\\\\\", x);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"console.log(\\\\\\\"{}\\\\\\\", x);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 13 col_stop: 20 - path: test + path: "" content: "console.log(\"{}\", x);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 20 - path: test + path: "" content: "console.log(\"{}\", x);" - Console: function: @@ -111,21 +111,21 @@ outputs: - Scalar: 123 - Scalar: 125 parameters: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.log(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":24,\\\"col_stop\\\":25,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.log(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"console.log(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":24,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"console.log(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 13 col_stop: 25 - path: test + path: "" content: "console.log(\"{}{}\", x, y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 25 - path: test + path: "" content: "console.log(\"{}{}\", x, y);" - Console: function: @@ -138,12 +138,12 @@ outputs: line_stop: 1 col_start: 13 col_stop: 16 - path: test + path: "" content: "console.log(\"x\");" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 16 - path: test + path: "" content: "console.log(\"x\");" diff --git a/tests/expectations/parser/parser/statement/definition.leo.out b/tests/expectations/parser/parser/statement/definition.leo.out index fa12ad7cea..04b085addb 100644 --- a/tests/expectations/parser/parser/statement/definition.leo.out +++ b/tests/expectations/parser/parser/statement/definition.leo.out @@ -6,35 +6,35 @@ outputs: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: let x = expr; type_: ~ value: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: let x = expr; - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: let x = (); type_: ~ value: @@ -45,146 +45,146 @@ outputs: line_stop: 1 col_start: 9 col_stop: 11 - path: test + path: "" content: let x = (); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: let x = (); - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: let x = x+y; type_: ~ value: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 12 - path: test + path: "" content: let x = x+y; span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: let x = x+y; - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: "let x = (x,y);" type_: ~ value: TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 14 - path: test + path: "" content: "let x = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: "let x = (x,y);" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: let x = x(); type_: ~ value: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 12 - path: test + path: "" content: let x = x(); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: let x = x(); - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: test + path: "" content: const x = expr; type_: ~ value: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 15 - path: test + path: "" content: const x = expr; - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: test + path: "" content: const x = (); type_: ~ value: @@ -195,147 +195,147 @@ outputs: line_stop: 1 col_start: 11 col_stop: 13 - path: test + path: "" content: const x = (); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: const x = (); - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: test + path: "" content: const x = x+y; type_: ~ value: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 14 - path: test + path: "" content: const x = x+y; span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: const x = x+y; - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: test + path: "" content: "const x = (x,y);" type_: ~ value: TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 16 - path: test + path: "" content: "const x = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 16 - path: test + path: "" content: "const x = (x,y);" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: test + path: "" content: const x = x(); type_: ~ value: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 14 - path: test + path: "" content: const x = x(); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: const x = x(); - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x: u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: "let x: u32 = expr;" type_: IntegerType: U32 value: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":18,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x: u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: test + path: "" content: "let x: u32 = expr;" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x: u32 = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: "let x: u32 = ();" type_: IntegerType: U32 @@ -347,150 +347,150 @@ outputs: line_stop: 1 col_start: 14 col_stop: 16 - path: test + path: "" content: "let x: u32 = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 16 - path: test + path: "" content: "let x: u32 = ();" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x: u32 = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: "let x: u32 = x+y;" type_: IntegerType: U32 value: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x: u32 = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x: u32 = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 14 col_stop: 17 - path: test + path: "" content: "let x: u32 = x+y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 17 - path: test + path: "" content: "let x: u32 = x+y;" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x: u32 = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: "let x: u32 = (x,y);" type_: IntegerType: U32 value: TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":15,\\\"col_stop\\\":16,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":15,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x: u32 = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x: u32 = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 14 col_stop: 19 - path: test + path: "" content: "let x: u32 = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 19 - path: test + path: "" content: "let x: u32 = (x,y);" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x: u32 = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: test + path: "" content: "let x: u32 = x();" type_: IntegerType: U32 value: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x: u32 = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 14 col_stop: 17 - path: test + path: "" content: "let x: u32 = x();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 17 - path: test + path: "" content: "let x: u32 = x();" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x: u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: test + path: "" content: "const x: u32 = expr;" type_: IntegerType: U32 value: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x: u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 20 - path: test + path: "" content: "const x: u32 = expr;" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x: u32 = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: test + path: "" content: "const x: u32 = ();" type_: IntegerType: U32 @@ -502,167 +502,167 @@ outputs: line_stop: 1 col_start: 16 col_stop: 18 - path: test + path: "" content: "const x: u32 = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: test + path: "" content: "const x: u32 = ();" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x: u32 = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: test + path: "" content: "const x: u32 = x+y;" type_: IntegerType: U32 value: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x: u32 = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x: u32 = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 16 col_stop: 19 - path: test + path: "" content: "const x: u32 = x+y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 19 - path: test + path: "" content: "const x: u32 = x+y;" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x: u32 = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: test + path: "" content: "const x: u32 = (x,y);" type_: IntegerType: U32 value: TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x: u32 = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x: u32 = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 16 col_stop: 21 - path: test + path: "" content: "const x: u32 = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 21 - path: test + path: "" content: "const x: u32 = (x,y);" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x: u32 = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: test + path: "" content: "const x: u32 = x();" type_: IntegerType: U32 value: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x: u32 = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 16 col_stop: 19 - path: test + path: "" content: "const x: u32 = x();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 19 - path: test + path: "" content: "const x: u32 = x();" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: "let (x, y) = expr;" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = expr;\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: "let (x, y) = expr;" type_: ~ value: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":18,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: test + path: "" content: "let (x, y) = expr;" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: "let (x, y) = ();" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = ();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: "let (x, y) = ();" type_: ~ value: @@ -673,191 +673,191 @@ outputs: line_stop: 1 col_start: 14 col_stop: 16 - path: test + path: "" content: "let (x, y) = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 16 - path: test + path: "" content: "let (x, y) = ();" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: "let (x, y) = x+y;" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: "let (x, y) = x+y;" type_: ~ value: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 14 col_stop: 17 - path: test + path: "" content: "let (x, y) = x+y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 17 - path: test + path: "" content: "let (x, y) = x+y;" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: "let (x, y) = (x,y);" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = (x,y);\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: "let (x, y) = (x,y);" type_: ~ value: TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":15,\\\"col_stop\\\":16,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":15,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 14 col_stop: 19 - path: test + path: "" content: "let (x, y) = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 19 - path: test + path: "" content: "let (x, y) = (x,y);" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: "let (x, y) = x();" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = x();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: "let (x, y) = x();" type_: ~ value: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 14 col_stop: 17 - path: test + path: "" content: "let (x, y) = x();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 17 - path: test + path: "" content: "let (x, y) = x();" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: test + path: "" content: "const (x, y) = expr;" - mutable: false - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = expr;\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: "const (x, y) = expr;" type_: ~ value: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 20 - path: test + path: "" content: "const (x, y) = expr;" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: test + path: "" content: "const (x, y) = ();" - mutable: false - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = ();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: "const (x, y) = ();" type_: ~ value: @@ -868,192 +868,192 @@ outputs: line_stop: 1 col_start: 16 col_stop: 18 - path: test + path: "" content: "const (x, y) = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: test + path: "" content: "const (x, y) = ();" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: test + path: "" content: "const (x, y) = x+y;" - mutable: false - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: "const (x, y) = x+y;" type_: ~ value: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 16 col_stop: 19 - path: test + path: "" content: "const (x, y) = x+y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 19 - path: test + path: "" content: "const (x, y) = x+y;" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: test + path: "" content: "const (x, y) = (x,y);" - mutable: false - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = (x,y);\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: "const (x, y) = (x,y);" type_: ~ value: TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 16 col_stop: 21 - path: test + path: "" content: "const (x, y) = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 21 - path: test + path: "" content: "const (x, y) = (x,y);" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: test + path: "" content: "const (x, y) = x();" - mutable: false - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = x();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: "const (x, y) = x();" type_: ~ value: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 16 col_stop: 19 - path: test + path: "" content: "const (x, y) = x();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 19 - path: test + path: "" content: "const (x, y) = x();" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: "let (x, y): u32 = expr;" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = expr;\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: "let (x, y): u32 = expr;" type_: IntegerType: U32 value: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":23,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 23 - path: test + path: "" content: "let (x, y): u32 = expr;" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: "let (x, y): u32 = ();" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = ();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: "let (x, y): u32 = ();" type_: IntegerType: U32 @@ -1065,195 +1065,195 @@ outputs: line_stop: 1 col_start: 19 col_stop: 21 - path: test + path: "" content: "let (x, y): u32 = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 21 - path: test + path: "" content: "let (x, y): u32 = ();" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: "let (x, y): u32 = x+y;" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = x+y;\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: "let (x, y): u32 = x+y;" type_: IntegerType: U32 value: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 19 col_stop: 22 - path: test + path: "" content: "let (x, y): u32 = x+y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 22 - path: test + path: "" content: "let (x, y): u32 = x+y;" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: "let (x, y): u32 = (x,y);" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = (x,y);\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: "let (x, y): u32 = (x,y);" type_: IntegerType: U32 value: TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":22,\\\"col_stop\\\":23,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":22,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 19 col_stop: 24 - path: test + path: "" content: "let (x, y): u32 = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 24 - path: test + path: "" content: "let (x, y): u32 = (x,y);" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: "let (x, y): u32 = x();" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = x();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: test + path: "" content: "let (x, y): u32 = x();" type_: IntegerType: U32 value: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y): u32 = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 19 col_stop: 22 - path: test + path: "" content: "let (x, y): u32 = x();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 22 - path: test + path: "" content: "let (x, y): u32 = x();" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: test + path: "" content: "const (x, y): u32 = expr;" - mutable: false - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = expr;\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: "const (x, y): u32 = expr;" type_: IntegerType: U32 value: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":25,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 25 - path: test + path: "" content: "const (x, y): u32 = expr;" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: test + path: "" content: "const (x, y): u32 = ();" - mutable: false - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = ();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: "const (x, y): u32 = ();" type_: IntegerType: U32 @@ -1265,163 +1265,163 @@ outputs: line_stop: 1 col_start: 21 col_stop: 23 - path: test + path: "" content: "const (x, y): u32 = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 23 - path: test + path: "" content: "const (x, y): u32 = ();" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: test + path: "" content: "const (x, y): u32 = x+y;" - mutable: false - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = x+y;\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: "const (x, y): u32 = x+y;" type_: IntegerType: U32 value: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 21 col_stop: 24 - path: test + path: "" content: "const (x, y): u32 = x+y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 24 - path: test + path: "" content: "const (x, y): u32 = x+y;" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: test + path: "" content: "const (x, y): u32 = (x,y);" - mutable: false - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = (x,y);\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: "const (x, y): u32 = (x,y);" type_: IntegerType: U32 value: TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":22,\\\"col_stop\\\":23,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":24,\\\"col_stop\\\":25,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":22,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":24,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 21 col_stop: 26 - path: test + path: "" content: "const (x, y): u32 = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 26 - path: test + path: "" content: "const (x, y): u32 = (x,y);" - Definition: declaration_type: Const variable_names: - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: test + path: "" content: "const (x, y): u32 = x();" - mutable: false - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = x();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: test + path: "" content: "const (x, y): u32 = x();" type_: IntegerType: U32 value: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y): u32 = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 21 col_stop: 24 - path: test + path: "" content: "const (x, y): u32 = x();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 24 - path: test + path: "" content: "const (x, y): u32 = x();" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x,y,) = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x,y,) = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: "let (x,y,) = ();" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x,y,) = ();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x,y,) = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: test + path: "" content: "let (x,y,) = ();" type_: ~ value: @@ -1432,26 +1432,26 @@ outputs: line_stop: 1 col_start: 14 col_stop: 16 - path: test + path: "" content: "let (x,y,) = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 16 - path: test + path: "" content: "let (x,y,) = ();" - Definition: declaration_type: Let variable_names: - mutable: true - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x,) = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x,) = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: test + path: "" content: "let (x,) = ();" type_: ~ value: @@ -1462,12 +1462,12 @@ outputs: line_stop: 1 col_start: 12 col_stop: 14 - path: test + path: "" content: "let (x,) = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 14 - path: test + path: "" content: "let (x,) = ();" diff --git a/tests/expectations/parser/parser/statement/definition_fail.leo.out b/tests/expectations/parser/parser/statement/definition_fail.leo.out index fcb8db8960..11640aa977 100644 --- a/tests/expectations/parser/parser/statement/definition_fail.leo.out +++ b/tests/expectations/parser/parser/statement/definition_fail.leo.out @@ -2,26 +2,26 @@ namespace: ParseStatement expectation: Fail outputs: - - " --> test:1:0\n |\n 1 | let mut x = expr;\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | let mut x = ();\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | let mut x = x+y;\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | let mut x = (x,y);\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | let mut x = x();\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | const mut x = expr;\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | const mut x = ();\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | const mut x = x+y;\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | const mut x = (x,y);\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | const mut x = x();\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | let mut x: u32 = expr;\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | let mut x: u32 = ();\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | let mut x: u32 = x+y;\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | let mut x: u32 = (x,y);\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | let mut x: u32 = x();\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | const mut x: u32 = expr;\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | const mut x: u32 = ();\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | const mut x: u32 = x+y;\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | const mut x: u32 = (x,y);\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:0\n |\n 1 | const mut x: u32 = x();\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default." - - " --> test:1:10\n |\n 1 | let (x,y,,) = ();\n | ^\n |\n = expected 'ident', got ','" - - " --> test:1:6\n |\n 1 | let (,x,y) = ();\n | ^\n |\n = expected 'ident', got ','" - - " --> test:1:8\n |\n 1 | let (x,,y) = ();\n | ^\n |\n = expected 'ident', got ','" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x = expr;\n | ^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x = ();\n | ^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x = x+y;\n | ^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x = (x,y);\n | ^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x = x();\n | ^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x = expr;\n | ^^^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x = ();\n | ^^^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x = x+y;\n | ^^^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x = (x,y);\n | ^^^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x = x();\n | ^^^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x: u32 = expr;\n | ^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x: u32 = ();\n | ^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x: u32 = x+y;\n | ^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x: u32 = (x,y);\n | ^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x: u32 = x();\n | ^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x: u32 = expr;\n | ^^^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x: u32 = ();\n | ^^^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x: u32 = x+y;\n | ^^^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x: u32 = (x,y);\n | ^^^^^^^^^" + - "Error [EPAR0370015]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x: u32 = x();\n | ^^^^^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:10\n |\n 1 | let (x,y,,) = ();\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:6\n |\n 1 | let (,x,y) = ();\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:8\n |\n 1 | let (x,,y) = ();\n | ^" diff --git a/tests/expectations/parser/parser/statement/expression.leo.out b/tests/expectations/parser/parser/statement/expression.leo.out index f9542ff844..d03278d686 100644 --- a/tests/expectations/parser/parser/statement/expression.leo.out +++ b/tests/expectations/parser/parser/statement/expression.leo.out @@ -4,13 +4,13 @@ expectation: Pass outputs: - Expression: expression: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: test + path: "" content: expr; - Expression: expression: @@ -21,74 +21,74 @@ outputs: line_stop: 1 col_start: 1 col_stop: 3 - path: test + path: "" content: (); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 3 - path: test + path: "" content: (); - Expression: expression: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x+y; span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x+y; - Expression: expression: TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"(x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"(x,y);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x,y);\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: "(x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 6 - path: test + path: "" content: "(x,y);" - Expression: expression: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x(); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: test + path: "" content: x(); diff --git a/tests/expectations/parser/parser/statement/iteration.leo.out b/tests/expectations/parser/parser/statement/iteration.leo.out index 045effafff..77c4649a09 100644 --- a/tests/expectations/parser/parser/statement/iteration.leo.out +++ b/tests/expectations/parser/parser/statement/iteration.leo.out @@ -3,7 +3,7 @@ namespace: ParseStatement expectation: Pass outputs: - Iteration: - variable: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"for x in 0..7 {}\\\"}\"}" + variable: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"for x in 0..7 {}\\\"}\"}" start: Value: Implicit: @@ -12,7 +12,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: "for x in 0..7 {}" stop: Value: @@ -22,7 +22,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: test + path: "" content: "for x in 0..7 {}" inclusive: false block: @@ -32,17 +32,17 @@ outputs: line_stop: 1 col_start: 15 col_stop: 17 - path: test + path: "" content: "for x in 0..7 {}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 17 - path: test + path: "" content: "for x in 0..7 {}" - Iteration: - variable: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"for x in 0..7 {\\\"}\"}" + variable: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"for x in 0..7 {\\\"}\"}" start: Value: Implicit: @@ -51,7 +51,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: "for x in 0..7 {" stop: Value: @@ -61,7 +61,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: test + path: "" content: "for x in 0..7 {" inclusive: false block: @@ -75,31 +75,31 @@ outputs: line_stop: 2 col_start: 8 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 1 line_stop: 3 col_start: 15 col_stop: 2 - path: test - content: "for x in 0..7 {\n...\n}" + path: "" + content: "for x in 0..7 {\n ...\n}" span: line_start: 1 line_stop: 3 col_start: 1 col_stop: 2 - path: test - content: "for x in 0..7 {\n...\n}" + path: "" + content: "for x in 0..7 {\n ...\n}" - Iteration: - variable: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"for x in 0..99u8 {\\\"}\"}" + variable: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"for x in 0..99u8 {\\\"}\"}" start: Value: Implicit: @@ -108,7 +108,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: "for x in 0..99u8 {" stop: Value: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 17 - path: test + path: "" content: "for x in 0..99u8 {" inclusive: false block: @@ -133,31 +133,31 @@ outputs: line_stop: 2 col_start: 8 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 1 line_stop: 3 col_start: 18 col_stop: 2 - path: test - content: "for x in 0..99u8 {\n...\n}" + path: "" + content: "for x in 0..99u8 {\n ...\n}" span: line_start: 1 line_stop: 3 col_start: 1 col_stop: 2 - path: test - content: "for x in 0..99u8 {\n...\n}" + path: "" + content: "for x in 0..99u8 {\n ...\n}" - Iteration: - variable: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"for x in 0..Self {\\\"}\"}" + variable: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"for x in 0..Self {\\\"}\"}" start: Value: Implicit: @@ -166,10 +166,10 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: test + path: "" content: "for x in 0..Self {" stop: - Identifier: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"for x in 0..Self {\\\"}\"}" + Identifier: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"for x in 0..Self {\\\"}\"}" inclusive: false block: statements: @@ -182,26 +182,26 @@ outputs: line_stop: 2 col_start: 8 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 1 line_stop: 3 col_start: 18 col_stop: 2 - path: test - content: "for x in 0..Self {\n...\n}" + path: "" + content: "for x in 0..Self {\n ...\n}" span: line_start: 1 line_stop: 3 col_start: 1 col_stop: 2 - path: test - content: "for x in 0..Self {\n...\n}" + path: "" + content: "for x in 0..Self {\n ...\n}" diff --git a/tests/expectations/parser/parser/statement/return.leo.out b/tests/expectations/parser/parser/statement/return.leo.out index 938e0d0efe..8fa07e1f42 100644 --- a/tests/expectations/parser/parser/statement/return.leo.out +++ b/tests/expectations/parser/parser/statement/return.leo.out @@ -4,13 +4,13 @@ expectation: Pass outputs: - Return: expression: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"return expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"return expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: test + path: "" content: return expr; - Return: expression: @@ -21,14 +21,14 @@ outputs: line_stop: 1 col_start: 8 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: return (); - Return: expression: @@ -39,56 +39,56 @@ outputs: line_stop: 1 col_start: 8 col_stop: 10 - path: test + path: "" content: return (); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: test + path: "" content: return (); - Return: expression: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"return x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"return x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"return x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"return x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 11 - path: test + path: "" content: return x+y; span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: test + path: "" content: return x+y; - Return: expression: TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"return (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"return (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"return (x,y);\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"return (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 13 - path: test + path: "" content: "return (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 13 - path: test + path: "" content: "return (x,y);" - Return: expression: @@ -99,12 +99,12 @@ outputs: line_stop: 2 col_start: 1 col_stop: 2 - path: test + path: "" content: 5; span: line_start: 1 line_stop: 2 col_start: 1 col_stop: 2 - path: test + path: "" content: "return\n5;" diff --git a/tests/expectations/parser/parser/statement/return_fail.leo.out b/tests/expectations/parser/parser/statement/return_fail.leo.out index 9f5a9e7204..05811b1484 100644 --- a/tests/expectations/parser/parser/statement/return_fail.leo.out +++ b/tests/expectations/parser/parser/statement/return_fail.leo.out @@ -2,6 +2,6 @@ namespace: ParseStatement expectation: Fail outputs: - - " --> test:1:1\n |\n 1 | return\n | ^^^^^^\n |\n = unexpected EOF" - - " --> test:1:8\n |\n 1 | return 5\n | ^\n |\n = unexpected EOF" - - " --> test:2:1\n |\n 2 | if x {}\n | ^^\n |\n = expected 'expression', got 'if'" + - "Error [EPAR0370003]: unexpected EOF\n --> test:1:1\n |\n 1 | return\n | ^^^^^^" + - "Error [EPAR0370003]: unexpected EOF\n --> test:1:8\n |\n 1 | return 5\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:2:1\n |\n 2 | if x {}\n | ^^"