From d0c9c90451ada9f1d27a963c6bb026920b8cebe3 Mon Sep 17 00:00:00 2001 From: damirka Date: Mon, 29 Mar 2021 10:57:37 +0300 Subject: [PATCH 01/41] adds constraint check (falsy) --- .circleci/config.yml | 13 +++++++++++++ .circleci/leo-check-constraints.sh | 17 +++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 .circleci/leo-check-constraints.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index b8dd6eeddb..3da311c667 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -158,6 +158,19 @@ jobs: export LEO=/home/circleci/project/project/bin/leo ./project/.circleci/leo-add-remove.sh + leo-check-constraints: + docker: + - image: cimg/rust:1.50.0 + resource_class: xlarge + steps: + - attach_workspace: + at: /home/circleci/project/ + - run: + name: leo check constraints for Pedersen Hash + command: | + export LEO=/home/circleci/project/project/bin/leo + ./project/.circleci/leo-check-constraints.sh + leo-login-logout: docker: - image: cimg/rust:1.50.0 diff --git a/.circleci/leo-check-constraints.sh b/.circleci/leo-check-constraints.sh new file mode 100755 index 0000000000..398674d001 --- /dev/null +++ b/.circleci/leo-check-constraints.sh @@ -0,0 +1,17 @@ +# leo new hello-world + +cd examples/pedersen-hash + +PEDERSEH_HASH_CONSTRAINTS=1539 + +# 1. build +# 2. find lines with constraint number +# 3. find lines with $PEDERSEH_HASH_CONSTRAINTS +# 4. count lines +# 4.Er if result is 0 -> constraint number changed +# 4.Ok if result is 1 -> all good + +[[ $($LEO build | grep "Number of constraints" | grep $PEDERSEH_HASH_CONSTRAINTS | wc -l) -eq 0 ]] || { + echo >&2 "Number of constraints for Pedersen Hash is not $PEDERSEN_HASH_CONSTRAINTS"; + exit 1; +} From f86eb624c2a9b70c3f76d42d726b87ad471f0250 Mon Sep 17 00:00:00 2001 From: damirka Date: Mon, 29 Mar 2021 11:00:31 +0300 Subject: [PATCH 02/41] added main workflow --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3da311c667..f7984b21c2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -232,6 +232,9 @@ workflows: - leo-add-remove: requires: - leo-executable + - leo-check-constraints: + requires: + - leo-executable - leo-login-logout: requires: - leo-executable From 877ece4fa26f0d93c2b4c2d8370f381dde51a6f5 Mon Sep 17 00:00:00 2001 From: damirka Date: Mon, 29 Mar 2021 11:36:16 +0300 Subject: [PATCH 03/41] fixed path --- .circleci/leo-check-constraints.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/leo-check-constraints.sh b/.circleci/leo-check-constraints.sh index 398674d001..dc92232287 100755 --- a/.circleci/leo-check-constraints.sh +++ b/.circleci/leo-check-constraints.sh @@ -1,6 +1,6 @@ # leo new hello-world -cd examples/pedersen-hash +cd ./project/examples/pedersen-hash PEDERSEH_HASH_CONSTRAINTS=1539 From 75ed21d17e7eec9e4ca0e78ae99113a835459109 Mon Sep 17 00:00:00 2001 From: damirka Date: Mon, 29 Mar 2021 11:42:32 +0300 Subject: [PATCH 04/41] should work now --- .circleci/leo-check-constraints.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/leo-check-constraints.sh b/.circleci/leo-check-constraints.sh index dc92232287..a4f049cbed 100755 --- a/.circleci/leo-check-constraints.sh +++ b/.circleci/leo-check-constraints.sh @@ -2,7 +2,7 @@ cd ./project/examples/pedersen-hash -PEDERSEH_HASH_CONSTRAINTS=1539 +export PEDERSEH_HASH_CONSTRAINTS=1539 # 1. build # 2. find lines with constraint number @@ -11,7 +11,7 @@ PEDERSEH_HASH_CONSTRAINTS=1539 # 4.Er if result is 0 -> constraint number changed # 4.Ok if result is 1 -> all good -[[ $($LEO build | grep "Number of constraints" | grep $PEDERSEH_HASH_CONSTRAINTS | wc -l) -eq 0 ]] || { +[[ $($LEO build | grep "Number of constraints" | grep $PEDERSEH_HASH_CONSTRAINTS | wc -l) -eq 1 ]] || { echo >&2 "Number of constraints for Pedersen Hash is not $PEDERSEN_HASH_CONSTRAINTS"; exit 1; } From 8adfe4ea3cc4bc8ddd17fc5fa013ab82f0bfdc55 Mon Sep 17 00:00:00 2001 From: damirka Date: Mon, 29 Mar 2021 11:50:13 +0300 Subject: [PATCH 05/41] again trying falsy --- .circleci/leo-check-constraints.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/leo-check-constraints.sh b/.circleci/leo-check-constraints.sh index a4f049cbed..d0c6c2ec7f 100755 --- a/.circleci/leo-check-constraints.sh +++ b/.circleci/leo-check-constraints.sh @@ -2,7 +2,7 @@ cd ./project/examples/pedersen-hash -export PEDERSEH_HASH_CONSTRAINTS=1539 +export PEDERSEH_HASH_CONSTRAINTS=1538 # 1. build # 2. find lines with constraint number From a8cea5c894220e5c5a061f42d18aef1c19e601eb Mon Sep 17 00:00:00 2001 From: damirka Date: Mon, 29 Mar 2021 11:59:19 +0300 Subject: [PATCH 06/41] finally it works --- .circleci/leo-check-constraints.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/leo-check-constraints.sh b/.circleci/leo-check-constraints.sh index d0c6c2ec7f..0d8ba5bba5 100755 --- a/.circleci/leo-check-constraints.sh +++ b/.circleci/leo-check-constraints.sh @@ -2,16 +2,16 @@ cd ./project/examples/pedersen-hash -export PEDERSEH_HASH_CONSTRAINTS=1538 +export PEDERSEN_HASH_CONSTRAINTS=1539 # 1. build # 2. find lines with constraint number -# 3. find lines with $PEDERSEH_HASH_CONSTRAINTS +# 3. find lines with $PEDERSEN_HASH_CONSTRAINTS # 4. count lines # 4.Er if result is 0 -> constraint number changed # 4.Ok if result is 1 -> all good -[[ $($LEO build | grep "Number of constraints" | grep $PEDERSEH_HASH_CONSTRAINTS | wc -l) -eq 1 ]] || { +[[ $($LEO build | grep "Number of constraints" | grep $PEDERSEN_HASH_CONSTRAINTS | wc -l) -eq 1 ]] || { echo >&2 "Number of constraints for Pedersen Hash is not $PEDERSEN_HASH_CONSTRAINTS"; exit 1; } From 8eba9fb21d446d98cd813e1a0c86b575fbfc596e Mon Sep 17 00:00:00 2001 From: damirka Date: Mon, 29 Mar 2021 18:44:46 +0300 Subject: [PATCH 07/41] added string search instead of line count --- .circleci/leo-check-constraints.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.circleci/leo-check-constraints.sh b/.circleci/leo-check-constraints.sh index 0d8ba5bba5..3fbf3ac9ca 100755 --- a/.circleci/leo-check-constraints.sh +++ b/.circleci/leo-check-constraints.sh @@ -6,12 +6,11 @@ export PEDERSEN_HASH_CONSTRAINTS=1539 # 1. build # 2. find lines with constraint number -# 3. find lines with $PEDERSEN_HASH_CONSTRAINTS -# 4. count lines -# 4.Er if result is 0 -> constraint number changed +# 3. search this line for CONSTRAINTS number +# 4.Er if result is 0 -> constraint number changed exit 1 # 4.Ok if result is 1 -> all good -[[ $($LEO build | grep "Number of constraints" | grep $PEDERSEN_HASH_CONSTRAINTS | wc -l) -eq 1 ]] || { +[[ $(cargo run -q -- build | grep constraints) == *"$PEDERSEN_HASH_CONSTRAINTS"* ]] || { echo >&2 "Number of constraints for Pedersen Hash is not $PEDERSEN_HASH_CONSTRAINTS"; exit 1; -} +} From 30e973b91ec47c0f41b39f77a0bff16c788d1f84 Mon Sep 17 00:00:00 2001 From: damirka Date: Mon, 29 Mar 2021 23:09:52 +0300 Subject: [PATCH 08/41] simplified bash script, added constraints number output --- .circleci/leo-check-constraints.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/leo-check-constraints.sh b/.circleci/leo-check-constraints.sh index 3fbf3ac9ca..34bcd1c453 100755 --- a/.circleci/leo-check-constraints.sh +++ b/.circleci/leo-check-constraints.sh @@ -1,16 +1,16 @@ # leo new hello-world -cd ./project/examples/pedersen-hash +cd ./examples/pedersen-hash -export PEDERSEN_HASH_CONSTRAINTS=1539 +export PEDERSEN_HASH_CONSTRAINTS=1539; -# 1. build -# 2. find lines with constraint number -# 3. search this line for CONSTRAINTS number -# 4.Er if result is 0 -> constraint number changed exit 1 -# 4.Ok if result is 1 -> all good +# line that we're searching for is: +# `Build Number of constraints - 1539` +export ACTUAL_CONSTRAINTS=$($LEO build | grep constraints | awk '{print $NF}') -[[ $(cargo run -q -- build | grep constraints) == *"$PEDERSEN_HASH_CONSTRAINTS"* ]] || { +# if else expression with only else block +[[ PEDERSEN_HASH_CONSTRAINTS -eq ACTUAL_CONSTRAINTS ]] || { echo >&2 "Number of constraints for Pedersen Hash is not $PEDERSEN_HASH_CONSTRAINTS"; + echo >&2 "Real number of constraints is $ACTUAL_CONSTRAINTS"; exit 1; } From 7a531efb84da13b2b912fb41b3d272f97ba25bbb Mon Sep 17 00:00:00 2001 From: damirka Date: Mon, 29 Mar 2021 23:20:41 +0300 Subject: [PATCH 09/41] fix path to examples --- .circleci/leo-check-constraints.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/leo-check-constraints.sh b/.circleci/leo-check-constraints.sh index 34bcd1c453..c1c686d74b 100755 --- a/.circleci/leo-check-constraints.sh +++ b/.circleci/leo-check-constraints.sh @@ -1,6 +1,6 @@ # leo new hello-world -cd ./examples/pedersen-hash +cd ./project/examples/pedersen-hash export PEDERSEN_HASH_CONSTRAINTS=1539; From 541b83d4921ec282fb05806f7581a1338796aaa7 Mon Sep 17 00:00:00 2001 From: gluax Date: Tue, 6 Apr 2021 14:07:37 -0400 Subject: [PATCH 10/41] working on directing expressions so far --- compiler/src/lib.rs | 3 + compiler/src/stages/mod.rs | 20 ++ compiler/src/stages/reducing_director.rs | 360 +++++++++++++++++++++++ 3 files changed, 383 insertions(+) create mode 100644 compiler/src/stages/mod.rs create mode 100644 compiler/src/stages/reducing_director.rs diff --git a/compiler/src/lib.rs b/compiler/src/lib.rs index 6b36c3d356..7e871e49ab 100644 --- a/compiler/src/lib.rs +++ b/compiler/src/lib.rs @@ -60,5 +60,8 @@ pub use value::*; pub mod stage; pub use stage::*; +pub mod stages; +pub use stages::*; + pub mod option; pub use option::*; diff --git a/compiler/src/stages/mod.rs b/compiler/src/stages/mod.rs new file mode 100644 index 0000000000..b10097b2aa --- /dev/null +++ b/compiler/src/stages/mod.rs @@ -0,0 +1,20 @@ +// 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 . + +//! Compiles a Leo program from a file path. + +pub mod reducing_director; +pub use reducing_director::*; diff --git a/compiler/src/stages/reducing_director.rs b/compiler/src/stages/reducing_director.rs new file mode 100644 index 0000000000..bbf3e8d7b1 --- /dev/null +++ b/compiler/src/stages/reducing_director.rs @@ -0,0 +1,360 @@ +// 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 . + +//! Compiles a Leo program from a file path. + +use crate::CompilerOptions; +use leo_asg::{ + ArrayAccessExpression as AsgArrayAccessExpression, + ArrayInitExpression as AsgArrayInitExpression, + ArrayInlineExpression as AsgArrayInlineExpression, + ArrayRangeAccessExpression as AsgArrayRangeAccessExpression, + BinaryExpression as AsgBinaryExpression, + CallExpression as AsgCallExpression, + CastExpression as AsgCastExpression, + CircuitAccessExpression as AsgCircuitAccessExpression, + CircuitInitExpression as AsgCircuitInitExpression, + Constant as AsgConstant, + Expression as AsgExpression, + TernaryExpression as AsgTernaryExpression, + TupleAccessExpression as AsgTupleAccessExpression, + TupleInitExpression as AsgTupleInitExpression, + UnaryExpression as AsgUnaryExpression, + VariableRef as AsgVariableRef, +}; +use leo_ast::{ + ArrayAccessExpression as AstArrayAccessExpression, + ArrayInitExpression as AstArrayInitExpression, + ArrayInlineExpression as AstArrayInlineExpression, + ArrayRangeAccessExpression as AstArrayRangeAccessExpression, + BinaryExpression as AstBinaryExpression, + CallExpression as AstCallExpression, + CanonicalizeError, + CastExpression as AstCastExpression, + CircuitInitExpression as AstCircuitInitExpression, + CircuitMemberAccessExpression as AstCircuitAccessExpression, + Expression as AstExpression, + ReconstructingReducer, + SpreadOrExpression, + TernaryExpression as AstTernaryExpression, + TupleAccessExpression as AstTupleAccessExpression, + TupleInitExpression as AstTupleInitExpression, + UnaryExpression as AstUnaryExpression, + ValueExpression, +}; + +pub struct CombineAstAsgDirector { + ast_reducer: R, + options: CompilerOptions, + in_circuit: bool, +} + +impl CombineAstAsgDirector { + pub fn new(ast_reducer: R, options: CompilerOptions) -> Self { + Self { + ast_reducer, + options, + in_circuit: false, + } + } + + pub fn reduce_expression( + &mut self, + ast: &AstExpression, + asg: &AsgExpression, + ) -> Result { + let new = match (ast, asg) { + // AsgExpression::Identifier(identifier) => AsgExpression::Identifier(self.reduce_identifier(&identifier)?), + // AsgExpression::Value(value) => AsgExpression::Value(self.reduce_value(&value)?), + // AsgExpression::Binary(binary) => AsgExpression::Binary(self.reduce_binary(&binary)?), + // AsgExpression::Unary(unary) => AsgExpression::Unary(self.reduce_unary(&unary)?), + // AsgExpression::Ternary(ternary) => AsgExpression::Ternary(self.reduce_ternary(&ternary)?), + // AsgExpression::Cast(cast) => AsgExpression::Cast(self.reduce_cast(&cast)?), + + // AsgExpression::ArrayInline(array_inline) => AsgExpression::ArrayInline(self.reduce_array_inline(&array_inline)?), + // AsgExpression::ArrayInit(array_init) => AsgExpression::ArrayInit(self.reduce_array_init(&array_init)?), + // AsgExpression::ArrayAccess(array_access) => AsgExpression::ArrayAccess(self.reduce_array_access(&array_access)?), + // AsgExpression::ArrayRangeAccess(array_range_access) => { + // AsgExpression::ArrayRangeAccess(self.reduce_array_range_access(&array_range_access)?) + // } + + // AsgExpression::TupleInit(tuple_init) => AsgExpression::TupleInit(self.reduce_tuple_init(&tuple_init)?), + // AsgExpression::TupleAccess(tuple_access) => AsgExpression::TupleAccess(self.reduce_tuple_access(&tuple_access)?), + + // AsgExpression::CircuitInit(circuit_init) => AsgExpression::CircuitInit(self.reduce_circuit_init(&circuit_init)?), + // AsgExpression::CircuitMemberAccess(circuit_member_access) => { + // AsgExpression::CircuitMemberAccess(self.reduce_circuit_member_access(&circuit_member_access)?) + // } + // AsgExpression::CircuitStaticFunctionAccess(circuit_static_fn_access) => { + // AsgExpression::CircuitStaticFunctionAccess( + // self.reduce_circuit_static_fn_access(&circuit_static_fn_access)?, + // ) + // } + + // AsgExpression::Call(call) => AsgExpression::Call(self.reduce_call(&call)?), + _ => ast.clone(), + }; + + self.ast_reducer.reduce_expression(ast, new, self.in_circuit) + } + + pub fn reduce_array_access( + &mut self, + ast: &AstArrayAccessExpression, + asg: &AsgArrayAccessExpression, + ) -> Result { + let array = self.reduce_expression(&ast.array, asg.array.get())?; + let index = self.reduce_expression(&ast.index, asg.index.get())?; + + self.ast_reducer.reduce_array_access(ast, array, index, self.in_circuit) + } + + pub fn reduce_array_init( + &mut self, + ast: &AstArrayInitExpression, + asg: &AsgArrayInitExpression, + ) -> Result { + let element = self.reduce_expression(&ast.element, asg.element.get())?; + + self.ast_reducer.reduce_array_init(ast, element, self.in_circuit) + } + + pub fn reduce_array_inline( + &mut self, + ast: &AstArrayInlineExpression, + asg: &AsgArrayInlineExpression, + ) -> Result { + let mut elements = vec![]; + for (ast_element, asg_element) in ast.elements.iter().zip(asg.elements.iter()) { + let reduced_element = match ast_element { + SpreadOrExpression::Expression(ast_expression) => { + SpreadOrExpression::Expression(self.reduce_expression(ast_expression, asg_element.0.get())?) + } + SpreadOrExpression::Spread(ast_expression) => { + SpreadOrExpression::Spread(self.reduce_expression(ast_expression, asg_element.0.get())?) + } + }; + + elements.push(reduced_element); + } + + self.ast_reducer.reduce_array_inline(ast, elements, self.in_circuit) + } + + pub fn reduce_array_range_access( + &mut self, + ast: &AstArrayRangeAccessExpression, + asg: &AsgArrayRangeAccessExpression, + ) -> 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)?), + _ => None, + }; + let right = match (ast.right.as_ref(), asg.right.get()) { + (Some(ast_right), Some(asg_right)) => Some(self.reduce_expression(ast_right, asg_right)?), + _ => None, + }; + + self.ast_reducer + .reduce_array_range_access(ast, array, left, right, self.in_circuit) + } + + pub fn reduce_binary( + &mut self, + ast: &AstBinaryExpression, + asg: &AsgBinaryExpression, + ) -> 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(), self.in_circuit) + } + + 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()) + + let mut arguments = vec![]; + for (ast_arg, asg_arg) in ast.arguments.iter().zip(asg.arguments.iter()) { + arguments.push(self.reduce_expression(ast_arg, asg_arg.get())?); + } + + Ok(ast.clone()) + // self.ast_reducer.reduce_call(ast, function, arguments, self.in_circuit) + } + + pub fn reduce_cast_expression( + &mut self, + ast: &AstCastExpression, + asg: &AsgCastExpression, + ) -> Result { + let inner = self.reduce_expression(&ast.inner, &asg.inner.get())?; + // TODO REDUCE TYPE let target_type; + + Ok(ast.clone()) + + // self.ast_reducer.reduce_cast(ast, inner, target_type, self.in_circuit) + } + + pub fn reduce_constant( + &mut self, + ast: &ValueExpression, + asg: &AsgConstant, + ) -> Result { + // TODO REDUCE GV + let new = match ast { + // AstConstant::Group(group_value) => { + // AstConstant::Group(Box::new(self.reduce_group_value(&group_value)?)) + // } + _ => ast.clone(), + }; + + self.ast_reducer.reduce_value(ast, new) + } + + pub fn reduce_circuit_access( + &mut self, + ast: &AstCircuitAccessExpression, + asg: &AsgCircuitAccessExpression, + ) -> Result { + // TODO FIGURE IT OUT + // 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)); + + Ok(ast.clone()) + // self.reducer + // .reduce_circuit_member_access(ast, circuit, name, self.in_circuit) + } + + pub fn reduce_circuit_init( + &mut self, + ast: &AstCircuitInitExpression, + asg: &AsgCircuitInitExpression, + ) -> Result { + // TODO FIGURE IT OUT + // let name = self.reduce_identifier(&circuit_init.name)?; + // let values = asg + // .values + // .iter() + // .map(|(ident, e)| (ident.clone(), self.reduce_expression(e.get()))) + // .collect(); + + // let mut members = vec![]; + // for member in ast.members.iter() { + // // members.push(self.reduce_circuit_implied_variable_definition(member)?); + // } + + Ok(ast.clone()) + // self.ast_reducer + // .reduce_circuit_init(ast, name, members, self.in_circuit) + } + + pub fn reduce_ternary_expression( + &mut self, + ast: &AstTernaryExpression, + asg: &AsgTernaryExpression, + ) -> 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())?; + + self.ast_reducer + .reduce_ternary(ast, condition, if_true, if_false, self.in_circuit) + } + + pub fn reduce_tuple_access( + &mut self, + ast: &AstTupleAccessExpression, + asg: &AsgTupleAccessExpression, + ) -> Result { + let tuple = self.reduce_expression(&ast.tuple, asg.tuple_ref.get())?; + + self.ast_reducer.reduce_tuple_access(ast, tuple, self.in_circuit) + } + + pub fn reduce_tuple_init( + &mut self, + ast: &AstTupleInitExpression, + asg: &AsgTupleInitExpression, + ) -> 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())?; + elements.push(element); + } + + self.ast_reducer.reduce_tuple_init(ast, elements, self.in_circuit) + } + + 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(), self.in_circuit) + } + + pub fn reduce_variable_ref( + &mut self, + ast: &ValueExpression, + asg: &AsgVariableRef, + ) -> Result { + // TODO FIGURE IT OUT + let new = match ast { + // ValueExpression::Group(group_value) => { + // ValueExpression::Group(Box::new(self.reduce_group_value(&group_value)?)) + // } + _ => ast.clone(), + }; + + Ok(new) + // self.ast_reducer.reduce_value(value, new) + } + + // pub fn reduce_program(&mut self, ast: &leo_ast::Program, asg: &leo_asg::Program) -> Result { + // pub fn new(ast_reducer: AstR) -> Self { + // Self { + // ast_reducer + // } + // } + + // let mut circuits = IndexMap::new(); + // for ((asg_ident, asg_circuit), (ast_ident, ast_circuit)) in asg.circuits.iter().zip(&ast.circuits) { + // circuits.insert( + // self.reduce_identifier(asg_ident, ast_ident), + // self.reduce_circuit(asg_circuit, ast_circuit) + // ); + // } + + // let mut functions = IndexMap::new(); + // for ((asg_ident, asg_function), (ast_identifier, ast_function)) in asg.functions.iter().zip(&ast.functions) { + // // etc + // } + + // self.ast_reducer.reduce_program(ast, ast.expected_input, ast.imports, IndexMap::new(), IndexMap::new()) + // } +} From ac9414590f293861098ca9bc0a1753cdb89d02ee Mon Sep 17 00:00:00 2001 From: gluax Date: Tue, 6 Apr 2021 17:09:36 -0400 Subject: [PATCH 11/41] reduce type and the basis for type_inference ast --- Cargo.lock | 1 + compiler/Cargo.toml | 3 + compiler/src/option.rs | 2 + compiler/src/stages/reducing_director.rs | 138 +++++++++++++++++------ 4 files changed, 112 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fac6a616e0..e5a8f8cc57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1315,6 +1315,7 @@ dependencies = [ "snarkvm-r1cs", "snarkvm-utilities", "tempfile", + "tendril", "thiserror", "tracing", ] diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index 01c90ad6aa..32d1b57da9 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -49,6 +49,9 @@ version = "1.2.3" path = "../asg-passes" version = "1.2.3" +[dependencies.tendril] +version = "0.4" + [dependencies.snarkvm-curves] version = "0.2.1" default-features = false diff --git a/compiler/src/option.rs b/compiler/src/option.rs index be5f8964e5..d66e7068ce 100644 --- a/compiler/src/option.rs +++ b/compiler/src/option.rs @@ -22,6 +22,7 @@ pub struct CompilerOptions { pub canonicalization_enabled: bool, pub constant_folding_enabled: bool, pub dead_code_elimination_enabled: bool, + pub type_inference_enabled: bool, } impl Default for CompilerOptions { @@ -33,6 +34,7 @@ impl Default for CompilerOptions { canonicalization_enabled: true, constant_folding_enabled: true, dead_code_elimination_enabled: true, + type_inference_enabled: true, } } } diff --git a/compiler/src/stages/reducing_director.rs b/compiler/src/stages/reducing_director.rs index bbf3e8d7b1..9bcb2ccbb4 100644 --- a/compiler/src/stages/reducing_director.rs +++ b/compiler/src/stages/reducing_director.rs @@ -32,11 +32,13 @@ use leo_asg::{ TernaryExpression as AsgTernaryExpression, TupleAccessExpression as AsgTupleAccessExpression, TupleInitExpression as AsgTupleInitExpression, + Type as AsgType, UnaryExpression as AsgUnaryExpression, VariableRef as AsgVariableRef, }; use leo_ast::{ ArrayAccessExpression as AstArrayAccessExpression, + ArrayDimensions, ArrayInitExpression as AstArrayInitExpression, ArrayInlineExpression as AstArrayInlineExpression, ArrayRangeAccessExpression as AstArrayRangeAccessExpression, @@ -45,16 +47,21 @@ use leo_ast::{ CanonicalizeError, CastExpression as AstCastExpression, CircuitInitExpression as AstCircuitInitExpression, - CircuitMemberAccessExpression as AstCircuitAccessExpression, + CircuitMemberAccessExpression, + CircuitStaticFunctionAccessExpression, Expression as AstExpression, + PositiveNumber, ReconstructingReducer, + Span, SpreadOrExpression, TernaryExpression as AstTernaryExpression, TupleAccessExpression as AstTupleAccessExpression, TupleInitExpression as AstTupleInitExpression, + Type as AstType, UnaryExpression as AstUnaryExpression, ValueExpression, }; +use tendril::StrTendril; pub struct CombineAstAsgDirector { ast_reducer: R, @@ -71,40 +78,94 @@ impl CombineAstAsgDirector { } } + 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 { + AstType::Array( + Box::new(self.reduce_type(ast_type, asg_type, span)?), + ArrayDimensions(vec![PositiveNumber { + value: StrTendril::from(format!("{}", asg_dimensions)), + }]), + ) + } else { + AstType::Array( + Box::new(self.reduce_type(ast_type, asg_type, span)?), + ast_dimensions.clone(), + ) + } + } + (AstType::Tuple(ast_types), AsgType::Tuple(asg_types)) => { + let mut reduced_types = vec![]; + for (ast_type, asg_type) in ast_types.iter().zip(asg_types.iter()) { + reduced_types.push(self.reduce_type(ast_type, asg_type, span)?); + } + + AstType::Tuple(reduced_types) + } + // TODO REDUCE CIRCUIT TYPE + // Just need reduce identifier I believe + // (AstType::Circuit(ast), AsgType::Circuit(asg)) => AstType::Circuit(self.reduce_identifier(identifier)?), + _ if !self.options.type_inference_enabled => ast.clone(), + _ => asg.into(), + }; + + self.ast_reducer.reduce_type(ast, new, self.in_circuit, span) + } + pub fn reduce_expression( &mut self, ast: &AstExpression, asg: &AsgExpression, ) -> Result { let new = match (ast, asg) { + // TODO what to do for the following: + // Ast::Identifier, Ast::Value, Asg::Constant, Asg::ValueRef + // AsgExpression::Identifier(identifier) => AsgExpression::Identifier(self.reduce_identifier(&identifier)?), // AsgExpression::Value(value) => AsgExpression::Value(self.reduce_value(&value)?), - // AsgExpression::Binary(binary) => AsgExpression::Binary(self.reduce_binary(&binary)?), - // AsgExpression::Unary(unary) => AsgExpression::Unary(self.reduce_unary(&unary)?), - // AsgExpression::Ternary(ternary) => AsgExpression::Ternary(self.reduce_ternary(&ternary)?), - // AsgExpression::Cast(cast) => AsgExpression::Cast(self.reduce_cast(&cast)?), + (AstExpression::Binary(ast), AsgExpression::Binary(asg)) => { + AstExpression::Binary(self.reduce_binary(&ast, &asg)?) + } + (AstExpression::Unary(ast), AsgExpression::Unary(asg)) => { + AstExpression::Unary(self.reduce_unary(&ast, &asg)?) + } + (AstExpression::Ternary(ast), AsgExpression::Ternary(asg)) => { + AstExpression::Ternary(self.reduce_ternary(&ast, &asg)?) + } + (AstExpression::Cast(ast), AsgExpression::Cast(asg)) => AstExpression::Cast(self.reduce_cast(&ast, &asg)?), - // AsgExpression::ArrayInline(array_inline) => AsgExpression::ArrayInline(self.reduce_array_inline(&array_inline)?), - // AsgExpression::ArrayInit(array_init) => AsgExpression::ArrayInit(self.reduce_array_init(&array_init)?), - // AsgExpression::ArrayAccess(array_access) => AsgExpression::ArrayAccess(self.reduce_array_access(&array_access)?), - // AsgExpression::ArrayRangeAccess(array_range_access) => { - // AsgExpression::ArrayRangeAccess(self.reduce_array_range_access(&array_range_access)?) - // } + (AstExpression::ArrayInline(ast), AsgExpression::ArrayInline(asg)) => { + AstExpression::ArrayInline(self.reduce_array_inline(&ast, &asg)?) + } + (AstExpression::ArrayInit(ast), AsgExpression::ArrayInit(asg)) => { + AstExpression::ArrayInit(self.reduce_array_init(&ast, &asg)?) + } + (AstExpression::ArrayAccess(ast), AsgExpression::ArrayAccess(asg)) => { + AstExpression::ArrayAccess(self.reduce_array_access(&ast, &asg)?) + } + (AstExpression::ArrayRangeAccess(ast), AsgExpression::ArrayRangeAccess(asg)) => { + AstExpression::ArrayRangeAccess(self.reduce_array_range_access(&ast, &asg)?) + } - // AsgExpression::TupleInit(tuple_init) => AsgExpression::TupleInit(self.reduce_tuple_init(&tuple_init)?), - // AsgExpression::TupleAccess(tuple_access) => AsgExpression::TupleAccess(self.reduce_tuple_access(&tuple_access)?), + (AstExpression::TupleInit(ast), AsgExpression::TupleInit(asg)) => { + AstExpression::TupleInit(self.reduce_tuple_init(&ast, &asg)?) + } + (AstExpression::TupleAccess(ast), AsgExpression::TupleAccess(asg)) => { + AstExpression::TupleAccess(self.reduce_tuple_access(&ast, &asg)?) + } - // AsgExpression::CircuitInit(circuit_init) => AsgExpression::CircuitInit(self.reduce_circuit_init(&circuit_init)?), - // AsgExpression::CircuitMemberAccess(circuit_member_access) => { - // AsgExpression::CircuitMemberAccess(self.reduce_circuit_member_access(&circuit_member_access)?) - // } - // AsgExpression::CircuitStaticFunctionAccess(circuit_static_fn_access) => { - // AsgExpression::CircuitStaticFunctionAccess( - // self.reduce_circuit_static_fn_access(&circuit_static_fn_access)?, - // ) - // } + (AstExpression::CircuitInit(ast), AsgExpression::CircuitInit(asg)) => { + AstExpression::CircuitInit(self.reduce_circuit_init(&ast, &asg)?) + } + (AstExpression::CircuitMemberAccess(ast), AsgExpression::CircuitAccess(asg)) => { + AstExpression::CircuitMemberAccess(self.reduce_circuit_member_access(&ast, &asg)?) + } + (AstExpression::CircuitStaticFunctionAccess(ast), AsgExpression::CircuitAccess(asg)) => { + AstExpression::CircuitStaticFunctionAccess(self.reduce_circuit_static_fn_access(&ast, &asg)?) + } - // AsgExpression::Call(call) => AsgExpression::Call(self.reduce_call(&call)?), + (AstExpression::Call(ast), AsgExpression::Call(asg)) => AstExpression::Call(self.reduce_call(&ast, &asg)?), _ => ast.clone(), }; @@ -203,17 +264,15 @@ impl CombineAstAsgDirector { // self.ast_reducer.reduce_call(ast, function, arguments, self.in_circuit) } - pub fn reduce_cast_expression( + pub fn reduce_cast( &mut self, ast: &AstCastExpression, asg: &AsgCastExpression, ) -> Result { let inner = self.reduce_expression(&ast.inner, &asg.inner.get())?; - // TODO REDUCE TYPE let target_type; + let target_type = self.reduce_type(&ast.target_type, &asg.target_type, &ast.span)?; - Ok(ast.clone()) - - // self.ast_reducer.reduce_cast(ast, inner, target_type, self.in_circuit) + self.ast_reducer.reduce_cast(ast, inner, target_type, self.in_circuit) } pub fn reduce_constant( @@ -232,11 +291,11 @@ impl CombineAstAsgDirector { self.ast_reducer.reduce_value(ast, new) } - pub fn reduce_circuit_access( + pub fn reduce_circuit_member_access( &mut self, - ast: &AstCircuitAccessExpression, + ast: &CircuitMemberAccessExpression, asg: &AsgCircuitAccessExpression, - ) -> Result { + ) -> Result { // TODO FIGURE IT OUT // let circuit = self.reduce_expression(&circuit_member_access.circuit)?; // let name = self.reduce_identifier(&circuit_member_access.name)?; @@ -247,6 +306,21 @@ impl CombineAstAsgDirector { // .reduce_circuit_member_access(ast, circuit, name, self.in_circuit) } + pub fn reduce_circuit_static_fn_access( + &mut self, + ast: &CircuitStaticFunctionAccessExpression, + asg: &AsgCircuitAccessExpression, + ) -> Result { + // TODO FIGURE IT OUT + // 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)); + + Ok(ast.clone()) + // self.reducer + // .reduce_circuit_static_fn_access(ast, circuit, name, self.in_circuit) + } + pub fn reduce_circuit_init( &mut self, ast: &AstCircuitInitExpression, @@ -270,7 +344,7 @@ impl CombineAstAsgDirector { // .reduce_circuit_init(ast, name, members, self.in_circuit) } - pub fn reduce_ternary_expression( + pub fn reduce_ternary( &mut self, ast: &AstTernaryExpression, asg: &AsgTernaryExpression, From 55dae9bc146ac653586a6bac2e32d664ce155068 Mon Sep 17 00:00:00 2001 From: gluax Date: Wed, 7 Apr 2021 13:21:10 -0400 Subject: [PATCH 12/41] push some expression solving, start statements --- compiler/src/stages/reducing_director.rs | 126 ++++++++++++++--------- 1 file changed, 75 insertions(+), 51 deletions(-) diff --git a/compiler/src/stages/reducing_director.rs b/compiler/src/stages/reducing_director.rs index 9bcb2ccbb4..3769342403 100644 --- a/compiler/src/stages/reducing_director.rs +++ b/compiler/src/stages/reducing_director.rs @@ -17,6 +17,7 @@ //! Compiles a Leo program from a file path. use crate::CompilerOptions; +use indexmap::IndexMap; use leo_asg::{ ArrayAccessExpression as AsgArrayAccessExpression, ArrayInitExpression as AsgArrayInitExpression, @@ -29,6 +30,7 @@ use leo_asg::{ CircuitInitExpression as AsgCircuitInitExpression, Constant as AsgConstant, Expression as AsgExpression, + Statement as AsgStatement, TernaryExpression as AsgTernaryExpression, TupleAccessExpression as AsgTupleAccessExpression, TupleInitExpression as AsgTupleInitExpression, @@ -46,6 +48,7 @@ use leo_ast::{ CallExpression as AstCallExpression, CanonicalizeError, CastExpression as AstCastExpression, + CircuitImpliedVariableDefinition, CircuitInitExpression as AstCircuitInitExpression, CircuitMemberAccessExpression, CircuitStaticFunctionAccessExpression, @@ -54,6 +57,7 @@ use leo_ast::{ ReconstructingReducer, Span, SpreadOrExpression, + Statement as AstStatement, TernaryExpression as AstTernaryExpression, TupleAccessExpression as AstTupleAccessExpression, TupleInitExpression as AstTupleInitExpression, @@ -103,9 +107,6 @@ impl CombineAstAsgDirector { AstType::Tuple(reduced_types) } - // TODO REDUCE CIRCUIT TYPE - // Just need reduce identifier I believe - // (AstType::Circuit(ast), AsgType::Circuit(asg)) => AstType::Circuit(self.reduce_identifier(identifier)?), _ if !self.options.type_inference_enabled => ast.clone(), _ => asg.into(), }; @@ -254,14 +255,15 @@ impl CombineAstAsgDirector { // TODO FIGURE IT OUT // let function = self.reduce_expression(&ast.function, asg.function.get())?; // let target = asg.target.get().map(|exp| self.reduce_expression()) + // Is this needed? let mut arguments = vec![]; for (ast_arg, asg_arg) in ast.arguments.iter().zip(asg.arguments.iter()) { arguments.push(self.reduce_expression(ast_arg, asg_arg.get())?); } - Ok(ast.clone()) - // self.ast_reducer.reduce_call(ast, function, arguments, self.in_circuit) + self.ast_reducer + .reduce_call(ast, *ast.function.clone(), arguments, self.in_circuit) } pub fn reduce_cast( @@ -278,9 +280,10 @@ impl CombineAstAsgDirector { pub fn reduce_constant( &mut self, ast: &ValueExpression, - asg: &AsgConstant, + _asg: &AsgConstant, ) -> Result { // TODO REDUCE GV + // Is this needed? let new = match ast { // AstConstant::Group(group_value) => { // AstConstant::Group(Box::new(self.reduce_group_value(&group_value)?)) @@ -294,31 +297,50 @@ impl CombineAstAsgDirector { pub fn reduce_circuit_member_access( &mut self, ast: &CircuitMemberAccessExpression, - asg: &AsgCircuitAccessExpression, + _asg: &AsgCircuitAccessExpression, ) -> Result { // TODO FIGURE IT OUT // 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)); + // does it matter? - Ok(ast.clone()) - // self.reducer - // .reduce_circuit_member_access(ast, circuit, name, self.in_circuit) + self.ast_reducer + .reduce_circuit_member_access(ast, *ast.circuit.clone(), ast.name.clone(), self.in_circuit) } pub fn reduce_circuit_static_fn_access( &mut self, ast: &CircuitStaticFunctionAccessExpression, - asg: &AsgCircuitAccessExpression, + _asg: &AsgCircuitAccessExpression, ) -> Result { // TODO FIGURE IT OUT // 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)); + // does it matter? - Ok(ast.clone()) - // self.reducer - // .reduce_circuit_static_fn_access(ast, circuit, name, self.in_circuit) + self.ast_reducer + .reduce_circuit_static_fn_access(ast, *ast.circuit.clone(), ast.name.clone(), self.in_circuit) + } + + pub fn reduce_circuit_implied_variable_definition( + &mut self, + ast: &CircuitImpliedVariableDefinition, + asg: &AsgExpression, + ) -> Result { + let expression = ast + .expression + .as_ref() + .map(|ast_expr| self.reduce_expression(ast_expr, asg)) + .transpose()?; + + self.ast_reducer.reduce_circuit_implied_variable_definition( + ast, + ast.identifier.clone(), + expression, + self.in_circuit, + ) } pub fn reduce_circuit_init( @@ -326,22 +348,13 @@ impl CombineAstAsgDirector { ast: &AstCircuitInitExpression, asg: &AsgCircuitInitExpression, ) -> Result { - // TODO FIGURE IT OUT - // let name = self.reduce_identifier(&circuit_init.name)?; - // let values = asg - // .values - // .iter() - // .map(|(ident, e)| (ident.clone(), self.reduce_expression(e.get()))) - // .collect(); + 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())?); + } - // let mut members = vec![]; - // for member in ast.members.iter() { - // // members.push(self.reduce_circuit_implied_variable_definition(member)?); - // } - - Ok(ast.clone()) - // self.ast_reducer - // .reduce_circuit_init(ast, name, members, self.in_circuit) + self.ast_reducer + .reduce_circuit_init(ast, ast.name.clone(), members, self.in_circuit) } pub fn reduce_ternary( @@ -395,7 +408,7 @@ impl CombineAstAsgDirector { pub fn reduce_variable_ref( &mut self, ast: &ValueExpression, - asg: &AsgVariableRef, + _asg: &AsgVariableRef, ) -> Result { // TODO FIGURE IT OUT let new = match ast { @@ -409,26 +422,37 @@ impl CombineAstAsgDirector { // self.ast_reducer.reduce_value(value, new) } - // pub fn reduce_program(&mut self, ast: &leo_ast::Program, asg: &leo_asg::Program) -> Result { - // pub fn new(ast_reducer: AstR) -> Self { - // Self { - // ast_reducer - // } - // } - - // let mut circuits = IndexMap::new(); - // for ((asg_ident, asg_circuit), (ast_ident, ast_circuit)) in asg.circuits.iter().zip(&ast.circuits) { - // circuits.insert( - // self.reduce_identifier(asg_ident, ast_ident), - // self.reduce_circuit(asg_circuit, ast_circuit) - // ); - // } - - // let mut functions = IndexMap::new(); - // for ((asg_ident, asg_function), (ast_identifier, ast_function)) in asg.functions.iter().zip(&ast.functions) { - // // etc - // } - - // self.ast_reducer.reduce_program(ast, ast.expected_input, ast.imports, IndexMap::new(), IndexMap::new()) + // pub fn reduce_statement(&mut self, ast: AstStatement, asg: AsgStatement) -> Result { + // let new = match (ast, asg) // } + + pub fn reduce_program( + &mut self, + ast: &leo_ast::Program, + asg: &leo_asg::Program, + ) -> Result { + let mut circuits = IndexMap::new(); + for ((asg_ident, asg_circuit), (ast_ident, ast_circuit)) in asg.circuits.iter().zip(&ast.circuits) { + circuits.insert( + // self.reduce_identifier(asg_ident, ast_ident), + ast_ident.clone(), + // self.reduce_circuit(asg_circuit, ast_circuit) + ast_circuit.clone(), + ); + } + + let mut functions = IndexMap::new(); + for ((asg_ident, asg_function), (ast_identifier, ast_function)) in asg.functions.iter().zip(&ast.functions) { + // etc + functions.insert(ast_identifier.clone(), ast_function.clone()); + } + + self.ast_reducer.reduce_program( + ast, + ast.expected_input.clone(), + ast.imports.clone(), + circuits, + functions, + ) + } } From 97b434986d99cafdb239ad95755b365de21a460c Mon Sep 17 00:00:00 2001 From: gluax Date: Thu, 8 Apr 2021 16:06:44 -0400 Subject: [PATCH 13/41] statements --- compiler/src/stages/reducing_director.rs | 248 ++++++++++++++++++++++- 1 file changed, 245 insertions(+), 3 deletions(-) diff --git a/compiler/src/stages/reducing_director.rs b/compiler/src/stages/reducing_director.rs index 3769342403..fd8a0a30a3 100644 --- a/compiler/src/stages/reducing_director.rs +++ b/compiler/src/stages/reducing_director.rs @@ -23,13 +23,23 @@ use leo_asg::{ ArrayInitExpression as AsgArrayInitExpression, ArrayInlineExpression as AsgArrayInlineExpression, ArrayRangeAccessExpression as AsgArrayRangeAccessExpression, + AssignAccess as AsgAssignAccess, + AssignStatement as AsgAssignStatement, BinaryExpression as AsgBinaryExpression, + BlockStatement as AsgBlockStatement, CallExpression as AsgCallExpression, CastExpression as AsgCastExpression, CircuitAccessExpression as AsgCircuitAccessExpression, CircuitInitExpression as AsgCircuitInitExpression, + ConditionalStatement as AsgConditionalStatement, + ConsoleFunction as AsgConsoleFunction, + ConsoleStatement as AsgConsoleStatement, Constant as AsgConstant, + DefinitionStatement as AsgDefinitionStatement, Expression as AsgExpression, + ExpressionStatement as AsgExpressionStatement, + IterationStatement as AsgIterationStatement, + ReturnStatement as AsgReturnStatement, Statement as AsgStatement, TernaryExpression as AsgTernaryExpression, TupleAccessExpression as AsgTupleAccessExpression, @@ -44,7 +54,11 @@ use leo_ast::{ ArrayInitExpression as AstArrayInitExpression, ArrayInlineExpression as AstArrayInlineExpression, ArrayRangeAccessExpression as AstArrayRangeAccessExpression, + AssignStatement as AstAssignStatement, + Assignee, + AssigneeAccess as AstAssignAccess, BinaryExpression as AstBinaryExpression, + Block as AstBlockStatement, CallExpression as AstCallExpression, CanonicalizeError, CastExpression as AstCastExpression, @@ -52,9 +66,17 @@ use leo_ast::{ CircuitInitExpression as AstCircuitInitExpression, CircuitMemberAccessExpression, CircuitStaticFunctionAccessExpression, + ConditionalStatement as AstConditionalStatement, + ConsoleFunction as AstConsoleFunction, + ConsoleStatement as AstConsoleStatement, + DefinitionStatement as AstDefinitionStatement, Expression as AstExpression, + ExpressionStatement as AstExpressionStatement, + FormattedString, + IterationStatement as AstIterationStatement, PositiveNumber, ReconstructingReducer, + ReturnStatement as AstReturnStatement, Span, SpreadOrExpression, Statement as AstStatement, @@ -422,9 +444,229 @@ impl CombineAstAsgDirector { // self.ast_reducer.reduce_value(value, new) } - // pub fn reduce_statement(&mut self, ast: AstStatement, asg: AsgStatement) -> Result { - // let new = match (ast, asg) - // } + pub fn reduce_statement( + &mut self, + ast_statement: &AstStatement, + asg_statement: &AsgStatement, + ) -> Result { + let new = match (ast_statement, asg_statement) { + (AstStatement::Assign(ast), AsgStatement::Assign(asg)) => { + AstStatement::Assign(self.reduce_assign(ast, asg)?) + } + (AstStatement::Block(ast), AsgStatement::Block(asg)) => AstStatement::Block(self.reduce_block(ast, asg)?), + (AstStatement::Conditional(ast), AsgStatement::Conditional(asg)) => { + AstStatement::Conditional(self.reduce_conditional(ast, asg)?) + } + (AstStatement::Console(ast), AsgStatement::Console(asg)) => { + AstStatement::Console(self.reduce_console(ast, asg)?) + } + (AstStatement::Definition(ast), AsgStatement::Definition(asg)) => { + AstStatement::Definition(self.reduce_definition(ast, asg)?) + } + (AstStatement::Expression(ast), AsgStatement::Expression(asg)) => { + AstStatement::Expression(self.reduce_expression_statement(ast, asg)?) + } + // (AstStatement::Iteration(ast), AsgStatement::Iteration(asg)) => AstStatement::Iteration(self.reduce_iteration(ast, asg)?), + // (AstStatement::Return(ast), AsgStatement::Return(asg)) => AstStatement::Return(self.reduce_return(ast, asg)?), + _ => ast_statement.clone(), + }; + + self.ast_reducer.reduce_statement(ast_statement, new, self.in_circuit) + } + + 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()) { + (Some(ast_left), Some(asg_left)) => Some(self.reduce_expression(ast_left, asg_left)?), + _ => None, + }; + let right = match (ast_right.as_ref(), asg_right.get()) { + (Some(ast_right), Some(asg_right)) => Some(self.reduce_expression(ast_right, asg_right)?), + _ => None, + }; + + AstAssignAccess::ArrayRange(left, right) + } + (AstAssignAccess::ArrayIndex(ast_index), AsgAssignAccess::ArrayIndex(asg_index)) => { + let index = self.reduce_expression(&ast_index, asg_index.get())?; + AstAssignAccess::ArrayIndex(index) + } + _ => ast.clone(), + }; + + self.ast_reducer.reduce_assignee_access(ast, new, self.in_circuit) + } + + pub fn reduce_assignee( + &mut self, + ast: &Assignee, + asg: &Vec, + ) -> Result { + let mut accesses = vec![]; + for (ast_access, asg_access) in ast.accesses.iter().zip(asg.iter()) { + accesses.push(self.reduce_assign_access(ast_access, asg_access)?); + } + + self.ast_reducer + .reduce_assignee(ast, ast.identifier.clone(), accesses, self.in_circuit) + } + + 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, self.in_circuit) + } + + 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())?); + } + + self.ast_reducer.reduce_block(ast, statements, self.in_circuit) + } + + pub fn reduce_conditional( + &mut self, + ast: &AstConditionalStatement, + asg: &AsgConditionalStatement, + ) -> 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 { + // TODO throw error? + block = ast.block.clone(); + } + let next = match (ast.next.as_ref(), asg.next.get()) { + (Some(ast_next), Some(asg_next)) => Some(self.reduce_statement(ast_next, asg_next)?), + _ => None, + }; + + self.ast_reducer + .reduce_conditional(ast, condition, block, next, self.in_circuit) + } + + pub fn reduce_console( + &mut self, + ast: &AstConsoleStatement, + asg: &AsgConsoleStatement, + ) -> 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())?) + } + (AstConsoleFunction::Debug(ast_format), AsgConsoleFunction::Debug(asg_format)) + | (AstConsoleFunction::Error(ast_format), AsgConsoleFunction::Error(asg_format)) + | (AstConsoleFunction::Log(ast_format), AsgConsoleFunction::Log(asg_format)) => { + let mut parameters = vec![]; + for (ast_parameter, asg_parameter) in ast_format.parameters.iter().zip(asg_format.parameters.iter()) { + parameters.push(self.reduce_expression(&ast_parameter, asg_parameter.get())?); + } + + let formatted = FormattedString { + parts: ast_format.parts.clone(), + parameters, + span: ast_format.span.clone(), + }; + + match &ast.function { + AstConsoleFunction::Debug(_) => AstConsoleFunction::Debug(formatted), + AstConsoleFunction::Error(_) => AstConsoleFunction::Error(formatted), + AstConsoleFunction::Log(_) => AstConsoleFunction::Log(formatted), + _ => unimplemented!(), // impossible + } + } + _ => ast.function.clone(), + }; + + self.ast_reducer.reduce_console(ast, function, self.in_circuit) + } + + pub fn reduce_definition( + &mut self, + ast: &AstDefinitionStatement, + asg: &AsgDefinitionStatement, + ) -> Result { + let type_; + + if asg.variables.len() > 1 { + let mut types = vec![]; + for variable in asg.variables.iter() { + types.push(variable.borrow().type_.clone()); + } + + type_ = ast + .type_ + .as_ref() + .map(|type_| self.reduce_type(type_, &AsgType::Tuple(types), &ast.span)) + .transpose()?; + } else { + type_ = ast + .type_ + .as_ref() + .map(|type_| self.reduce_type(type_, &asg.variables.first().unwrap().borrow().type_, &ast.span)) + .transpose()?; + } + + let value = self.reduce_expression(&ast.value, asg.value.get())?; + + self.ast_reducer + .reduce_definition(ast, ast.variable_names.clone(), type_, value, self.in_circuit) + } + + pub fn reduce_expression_statement( + &mut self, + ast: &AstExpressionStatement, + asg: &AsgExpressionStatement, + ) -> Result { + let inner_expression = self.reduce_expression(&ast.expression, asg.expression.get())?; + self.ast_reducer + .reduce_expression_statement(ast, inner_expression, self.in_circuit) + } + + pub fn reduce_iteration( + &mut self, + ast: &AstIterationStatement, + asg: &AsgIterationStatement, + ) -> 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 { + block = ast.block.clone(); + } + + self.ast_reducer + .reduce_iteration(ast, ast.variable.clone(), start, stop, block, self.in_circuit) + } + + 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, self.in_circuit) + } pub fn reduce_program( &mut self, From cb2f77c7e4d9ba49ed43f23003c2d0c1616702ff Mon Sep 17 00:00:00 2001 From: gluax Date: Thu, 8 Apr 2021 16:36:37 -0400 Subject: [PATCH 14/41] program in, time to test --- compiler/src/stages/reducing_director.rs | 90 +++++++++++++++++++----- 1 file changed, 73 insertions(+), 17 deletions(-) diff --git a/compiler/src/stages/reducing_director.rs b/compiler/src/stages/reducing_director.rs index fd8a0a30a3..9f8ecc41b5 100644 --- a/compiler/src/stages/reducing_director.rs +++ b/compiler/src/stages/reducing_director.rs @@ -29,8 +29,10 @@ use leo_asg::{ BlockStatement as AsgBlockStatement, CallExpression as AsgCallExpression, CastExpression as AsgCastExpression, + Circuit as AsgCircuit, CircuitAccessExpression as AsgCircuitAccessExpression, CircuitInitExpression as AsgCircuitInitExpression, + CircuitMember as AsgCircuitMember, ConditionalStatement as AsgConditionalStatement, ConsoleFunction as AsgConsoleFunction, ConsoleStatement as AsgConsoleStatement, @@ -38,6 +40,7 @@ use leo_asg::{ DefinitionStatement as AsgDefinitionStatement, Expression as AsgExpression, ExpressionStatement as AsgExpressionStatement, + Function as AsgFunction, IterationStatement as AsgIterationStatement, ReturnStatement as AsgReturnStatement, Statement as AsgStatement, @@ -62,8 +65,10 @@ use leo_ast::{ CallExpression as AstCallExpression, CanonicalizeError, CastExpression as AstCastExpression, + Circuit as AstCircuit, CircuitImpliedVariableDefinition, CircuitInitExpression as AstCircuitInitExpression, + CircuitMember as AstCircuitMember, CircuitMemberAccessExpression, CircuitStaticFunctionAccessExpression, ConditionalStatement as AstConditionalStatement, @@ -73,6 +78,7 @@ use leo_ast::{ Expression as AstExpression, ExpressionStatement as AstExpressionStatement, FormattedString, + Function as AstFunction, IterationStatement as AstIterationStatement, PositiveNumber, ReconstructingReducer, @@ -123,7 +129,7 @@ impl CombineAstAsgDirector { } (AstType::Tuple(ast_types), AsgType::Tuple(asg_types)) => { let mut reduced_types = vec![]; - for (ast_type, asg_type) in ast_types.iter().zip(asg_types.iter()) { + for (ast_type, asg_type) in ast_types.iter().zip(asg_types) { reduced_types.push(self.reduce_type(ast_type, asg_type, span)?); } @@ -502,13 +508,9 @@ impl CombineAstAsgDirector { self.ast_reducer.reduce_assignee_access(ast, new, self.in_circuit) } - pub fn reduce_assignee( - &mut self, - ast: &Assignee, - asg: &Vec, - ) -> 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.iter()) { + for (ast_access, asg_access) in ast.accesses.iter().zip(asg) { accesses.push(self.reduce_assign_access(ast_access, asg_access)?); } @@ -674,19 +676,13 @@ impl CombineAstAsgDirector { asg: &leo_asg::Program, ) -> Result { let mut circuits = IndexMap::new(); - for ((asg_ident, asg_circuit), (ast_ident, ast_circuit)) in asg.circuits.iter().zip(&ast.circuits) { - circuits.insert( - // self.reduce_identifier(asg_ident, ast_ident), - ast_ident.clone(), - // self.reduce_circuit(asg_circuit, ast_circuit) - ast_circuit.clone(), - ); + for ((ast_ident, ast_circuit), (_asg_ident, asg_circuit)) in ast.circuits.iter().zip(&asg.circuits) { + circuits.insert(ast_ident.clone(), self.reduce_circuit(ast_circuit, asg_circuit)?); } let mut functions = IndexMap::new(); - for ((asg_ident, asg_function), (ast_identifier, ast_function)) in asg.functions.iter().zip(&ast.functions) { - // etc - functions.insert(ast_identifier.clone(), ast_function.clone()); + for ((ast_ident, ast_function), (_asg_ident, asg_function)) in ast.functions.iter().zip(&asg.functions) { + functions.insert(ast_ident.clone(), self.reduce_function(ast_function, asg_function)?); } self.ast_reducer.reduce_program( @@ -697,4 +693,64 @@ impl CombineAstAsgDirector { functions, ) } + + pub fn reduce_function(&mut self, ast: &AstFunction, asg: &AsgFunction) -> Result { + let output = ast + .output + .as_ref() + .map(|type_| self.reduce_type(type_, &asg.output, &ast.span)) + .transpose()?; + + let mut statements = vec![]; + for (ast_statement, asg_statement) in ast.block.statements.iter().zip(asg.body.get()) { + statements.push(self.reduce_statement(ast_statement, asg_statement)?); + } + + let block = AstBlockStatement { + statements, + span: ast.block.span.clone(), + }; + + self.ast_reducer.reduce_function( + ast, + ast.identifier.clone(), + ast.annotations.clone(), + ast.input.clone(), + output, + block, + self.in_circuit, + ) + } + + pub fn reduce_circuit_member( + &mut self, + ast: &AstCircuitMember, + asg: &AsgCircuitMember, + ) -> Result { + self.in_circuit = !self.in_circuit; + let new = match (ast, asg) { + (AstCircuitMember::CircuitVariable(identifier, ast_type), AsgCircuitMember::Variable(asg_type)) => { + AstCircuitMember::CircuitVariable( + identifier.clone(), + self.reduce_type(ast_type, asg_type, &identifier.span)?, + ) + } + (AstCircuitMember::CircuitFunction(ast_function), AsgCircuitMember::Function(asg_function)) => { + AstCircuitMember::CircuitFunction(self.reduce_function(ast_function, asg_function)?) + } + _ => ast.clone(), + }; + self.in_circuit = !self.in_circuit; + + self.ast_reducer.reduce_circuit_member(ast, new) + } + + 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)?); + } + + self.ast_reducer.reduce_circuit(ast, ast.circuit_name.clone(), members) + } } From f963782d9090597406f4f01c9b255b6d451abd52 Mon Sep 17 00:00:00 2001 From: gluax Date: Thu, 8 Apr 2021 17:56:56 -0400 Subject: [PATCH 15/41] some bug fixing --- compiler/src/stages/reducing_director.rs | 43 +++++++++++++++--------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/compiler/src/stages/reducing_director.rs b/compiler/src/stages/reducing_director.rs index 9f8ecc41b5..340f65cdf1 100644 --- a/compiler/src/stages/reducing_director.rs +++ b/compiler/src/stages/reducing_director.rs @@ -135,8 +135,7 @@ impl CombineAstAsgDirector { AstType::Tuple(reduced_types) } - _ if !self.options.type_inference_enabled => ast.clone(), - _ => asg.into(), + _ => ast.clone(), }; self.ast_reducer.reduce_type(ast, new, self.in_circuit, span) @@ -472,8 +471,12 @@ impl CombineAstAsgDirector { (AstStatement::Expression(ast), AsgStatement::Expression(asg)) => { AstStatement::Expression(self.reduce_expression_statement(ast, asg)?) } - // (AstStatement::Iteration(ast), AsgStatement::Iteration(asg)) => AstStatement::Iteration(self.reduce_iteration(ast, asg)?), - // (AstStatement::Return(ast), AsgStatement::Return(asg)) => AstStatement::Return(self.reduce_return(ast, asg)?), + (AstStatement::Iteration(ast), AsgStatement::Iteration(asg)) => { + AstStatement::Iteration(self.reduce_iteration(ast, asg)?) + } + (AstStatement::Return(ast), AsgStatement::Return(asg)) => { + AstStatement::Return(self.reduce_return(ast, asg)?) + } _ => ast_statement.clone(), }; @@ -613,17 +616,23 @@ impl CombineAstAsgDirector { types.push(variable.borrow().type_.clone()); } - type_ = ast - .type_ - .as_ref() - .map(|type_| self.reduce_type(type_, &AsgType::Tuple(types), &ast.span)) - .transpose()?; + let asg_type = AsgType::Tuple(types); + + type_ = match &ast.type_ { + Some(ast_type) => Some(self.reduce_type(&ast_type, &asg_type, &ast.span)?), + None if self.options.type_inference_enabled => Some((&asg_type).into()), + _ => None, + }; } else { - type_ = ast - .type_ - .as_ref() - .map(|type_| self.reduce_type(type_, &asg.variables.first().unwrap().borrow().type_, &ast.span)) - .transpose()?; + type_ = match &ast.type_ { + Some(ast_type) => { + Some(self.reduce_type(&ast_type, &asg.variables.first().unwrap().borrow().type_, &ast.span)?) + } + None if self.options.type_inference_enabled => { + Some((&asg.variables.first().unwrap().borrow().type_).into()) + } + _ => None, + }; } let value = self.reduce_expression(&ast.value, asg.value.get())?; @@ -702,8 +711,10 @@ impl CombineAstAsgDirector { .transpose()?; let mut statements = vec![]; - for (ast_statement, asg_statement) in ast.block.statements.iter().zip(asg.body.get()) { - statements.push(self.reduce_statement(ast_statement, asg_statement)?); + if let Some(AsgStatement::Block(asg_block)) = asg.body.get() { + for (ast_statement, asg_statement) in ast.block.statements.iter().zip(asg_block.statements.iter()) { + statements.push(self.reduce_statement(ast_statement, asg_statement.get())?); + } } let block = AstBlockStatement { From 214d9e0f8c23d433654b11c9f1bd13c8e2b91e04 Mon Sep 17 00:00:00 2001 From: gluax Date: Mon, 12 Apr 2021 12:33:06 -0400 Subject: [PATCH 16/41] More generic errors for reducing --- .../errors.rs => errors/canonicalization.rs} | 4 +- ast/src/errors/combiner.rs | 37 +++++++ ast/src/errors/mod.rs | 9 ++ ast/src/errors/reducer.rs | 43 ++++++++ ast/src/lib.rs | 2 +- ast/src/reducer/canonicalization.rs | 22 ++-- ast/src/reducer/mod.rs | 3 - ast/src/reducer/reconstructing_director.rs | 101 ++++++++---------- ast/src/reducer/reconstructing_reducer.rs | 96 ++++++++--------- compiler/src/errors/compiler.rs | 4 +- compiler/src/stages/reducing_director.rs | 82 +++++++------- 11 files changed, 237 insertions(+), 166 deletions(-) rename ast/src/{reducer/errors.rs => errors/canonicalization.rs} (94%) create mode 100644 ast/src/errors/combiner.rs create mode 100644 ast/src/errors/reducer.rs diff --git a/ast/src/reducer/errors.rs b/ast/src/errors/canonicalization.rs similarity index 94% rename from ast/src/reducer/errors.rs rename to ast/src/errors/canonicalization.rs index 0ed9d40942..febe7bd0f0 100644 --- a/ast/src/reducer/errors.rs +++ b/ast/src/errors/canonicalization.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::{FormattedError, Span}; +use crate::{FormattedError, LeoError, Span}; #[derive(Debug, Error)] pub enum CanonicalizeError { @@ -22,6 +22,8 @@ pub enum CanonicalizeError { 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)) diff --git a/ast/src/errors/combiner.rs b/ast/src/errors/combiner.rs new file mode 100644 index 0000000000..8ad146d1cd --- /dev/null +++ b/ast/src/errors/combiner.rs @@ -0,0 +1,37 @@ +// 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 CombinerError { + #[error("{}", _0)] + Error(#[from] FormattedError), +} + +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) + } +} diff --git a/ast/src/errors/mod.rs b/ast/src/errors/mod.rs index c998e0c485..88bfd8f2b4 100644 --- a/ast/src/errors/mod.rs +++ b/ast/src/errors/mod.rs @@ -14,7 +14,16 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . +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 new file mode 100644 index 0000000000..e8b582af85 --- /dev/null +++ b/ast/src/errors/reducer.rs @@ -0,0 +1,43 @@ +// 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 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/lib.rs b/ast/src/lib.rs index c50b3021bc..4601a74959 100644 --- a/ast/src/lib.rs +++ b/ast/src/lib.rs @@ -83,7 +83,7 @@ impl Ast { } /// Mutates the program ast by preforming canonicalization on it. - pub fn canonicalize(&mut self) -> Result<(), CanonicalizeError> { + pub fn canonicalize(&mut self) -> Result<(), ReducerError> { self.ast = ReconstructingDirector::new(Canonicalizer::default()).reduce_program(self.as_repr())?; Ok(()) } diff --git a/ast/src/reducer/canonicalization.rs b/ast/src/reducer/canonicalization.rs index fc199a42a6..23d2c29028 100644 --- a/ast/src/reducer/canonicalization.rs +++ b/ast/src/reducer/canonicalization.rs @@ -394,11 +394,13 @@ 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(CanonicalizeError::invalid_array_dimension_size(span)); + return Err(ReducerError::from(CanonicalizeError::invalid_array_dimension_size( + span, + ))); } let mut next = Type::Array(type_, ArrayDimensions(vec![dimensions.remove_last().unwrap()])); @@ -415,7 +417,9 @@ impl ReconstructingReducer for Canonicalizer { Ok(array) } - Type::SelfType if !self.in_circuit => Err(CanonicalizeError::big_self_outside_of_circuit(span)), + Type::SelfType if !self.in_circuit => { + Err(ReducerError::from(CanonicalizeError::big_self_outside_of_circuit(span))) + } _ => Ok(new.clone()), } } @@ -424,9 +428,11 @@ impl ReconstructingReducer for Canonicalizer { &mut self, array_init: &ArrayInitExpression, element: Expression, - ) -> Result { + ) -> Result { if array_init.dimensions.is_zero() { - return Err(CanonicalizeError::invalid_array_dimension_size(&array_init.span)); + return Err(ReducerError::from(CanonicalizeError::invalid_array_dimension_size( + &array_init.span, + ))); } let element = Box::new(element); @@ -473,7 +479,7 @@ impl ReconstructingReducer for Canonicalizer { assign: &AssignStatement, assignee: Assignee, value: Expression, - ) -> Result { + ) -> Result { match value { Expression::Value(value_expr) if assign.operation != AssignOperation::Assign => { let mut left = Box::new(Expression::Identifier(assignee.identifier.clone())); @@ -551,7 +557,7 @@ impl ReconstructingReducer for Canonicalizer { input: Vec, output: Option, block: Block, - ) -> Result { + ) -> Result { let new_output = match output { None => Some(Type::Tuple(vec![])), _ => output, @@ -572,7 +578,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/mod.rs b/ast/src/reducer/mod.rs index d5d4d52982..144997d8e1 100644 --- a/ast/src/reducer/mod.rs +++ b/ast/src/reducer/mod.rs @@ -17,9 +17,6 @@ mod canonicalization; pub use canonicalization::*; -mod errors; -pub use errors::*; - mod reconstructing_reducer; pub use reconstructing_reducer::*; diff --git a/ast/src/reducer/reconstructing_director.rs b/ast/src/reducer/reconstructing_director.rs index ae78b2dc33..c554790a9b 100644 --- a/ast/src/reducer/reconstructing_director.rs +++ b/ast/src/reducer/reconstructing_director.rs @@ -29,7 +29,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 +48,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) => Expression::Value(self.reduce_value(&value)?), @@ -83,15 +83,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(), @@ -100,7 +100,7 @@ impl ReconstructingDirector { self.reducer.reduce_group_value(group_value, new) } - 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) => { ValueExpression::Group(Box::new(self.reduce_group_value(&group_value)?)) @@ -111,20 +111,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)?; @@ -132,7 +132,7 @@ 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)?; @@ -142,7 +142,7 @@ impl ReconstructingDirector { pub fn reduce_array_inline( &mut self, array_inline: &ArrayInlineExpression, - ) -> Result { + ) -> Result { let mut elements = vec![]; for element in array_inline.elements.iter() { let reduced_element = match element { @@ -160,10 +160,7 @@ 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) @@ -172,7 +169,7 @@ impl ReconstructingDirector { pub fn reduce_array_access( &mut self, array_access: &ArrayAccessExpression, - ) -> Result { + ) -> Result { let array = self.reduce_expression(&array_access.array)?; let index = self.reduce_expression(&array_access.index)?; @@ -182,7 +179,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,10 +196,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)?); @@ -214,7 +208,7 @@ impl ReconstructingDirector { pub fn reduce_tuple_access( &mut self, tuple_access: &TupleAccessExpression, - ) -> Result { + ) -> Result { let tuple = self.reduce_expression(&tuple_access.tuple)?; self.reducer.reduce_tuple_access(tuple_access, tuple) @@ -223,7 +217,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 @@ -238,7 +232,7 @@ impl ReconstructingDirector { pub fn reduce_circuit_init( &mut self, circuit_init: &CircuitInitExpression, - ) -> Result { + ) -> Result { let name = self.reduce_identifier(&circuit_init.name)?; let mut members = vec![]; @@ -252,7 +246,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)?; @@ -263,7 +257,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)?; @@ -271,7 +265,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![]; @@ -283,7 +277,7 @@ 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)?), @@ -298,22 +292,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)?); @@ -330,7 +321,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()?; @@ -346,7 +337,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![]; @@ -357,7 +348,7 @@ 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)?; @@ -367,7 +358,7 @@ impl ReconstructingDirector { pub fn reduce_conditional( &mut self, conditional: &ConditionalStatement, - ) -> Result { + ) -> Result { let condition = self.reduce_expression(&conditional.condition)?; let block = self.reduce_block(&conditional.block)?; let next = conditional @@ -379,10 +370,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)?; @@ -394,7 +382,7 @@ impl ReconstructingDirector { pub fn reduce_console( &mut self, console_function_call: &ConsoleStatement, - ) -> Result { + ) -> Result { let function = match &console_function_call.function { ConsoleFunction::Assert(expression) => ConsoleFunction::Assert(self.reduce_expression(expression)?), ConsoleFunction::Debug(format) | ConsoleFunction::Error(format) | ConsoleFunction::Log(format) => { @@ -413,7 +401,7 @@ impl ReconstructingDirector { ConsoleFunction::Debug(_) => ConsoleFunction::Debug(formatted), ConsoleFunction::Error(_) => ConsoleFunction::Error(formatted), ConsoleFunction::Log(_) => ConsoleFunction::Log(formatted), - _ => unimplemented!(), // impossible + _ => return Err(ReducerError::impossible_console_assert_call(&format.span)), } } }; @@ -424,12 +412,12 @@ impl ReconstructingDirector { pub fn reduce_expression_statement( &mut self, expression: &ExpressionStatement, - ) -> Result { + ) -> 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)?); @@ -439,7 +427,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)?); @@ -469,14 +457,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)?) @@ -490,7 +478,7 @@ impl ReconstructingDirector { pub fn reduce_package_or_packages( &mut self, package_or_packages: &PackageOrPackages, - ) -> Result { + ) -> Result { let new = match package_or_packages { PackageOrPackages::Package(package) => PackageOrPackages::Package(Package { name: self.reduce_identifier(&package.name)?, @@ -507,16 +495,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)?, @@ -530,7 +515,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![]; @@ -541,13 +526,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 4fb076fd44..637bad2869 100644 --- a/ast/src/reducer/reconstructing_reducer.rs +++ b/ast/src/reducer/reconstructing_reducer.rs @@ -23,27 +23,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(), @@ -51,11 +47,7 @@ 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) } @@ -63,7 +55,7 @@ pub trait ReconstructingReducer { &mut self, _value: &ValueExpression, new: ValueExpression, - ) -> Result { + ) -> Result { Ok(new) } @@ -73,7 +65,7 @@ pub trait ReconstructingReducer { left: Expression, right: Expression, op: BinaryOperation, - ) -> Result { + ) -> Result { Ok(BinaryExpression { left: Box::new(left), right: Box::new(right), @@ -87,7 +79,7 @@ pub trait ReconstructingReducer { unary: &UnaryExpression, inner: Expression, op: UnaryOperation, - ) -> Result { + ) -> Result { Ok(UnaryExpression { inner: Box::new(inner), op, @@ -101,7 +93,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), @@ -115,7 +107,7 @@ pub trait ReconstructingReducer { cast: &CastExpression, inner: Expression, target_type: Type, - ) -> Result { + ) -> Result { Ok(CastExpression { inner: Box::new(inner), target_type, @@ -127,7 +119,7 @@ pub trait ReconstructingReducer { &mut self, array_inline: &ArrayInlineExpression, elements: Vec, - ) -> Result { + ) -> Result { Ok(ArrayInlineExpression { elements, span: array_inline.span.clone(), @@ -138,7 +130,7 @@ pub trait ReconstructingReducer { &mut self, array_init: &ArrayInitExpression, element: Expression, - ) -> Result { + ) -> Result { Ok(ArrayInitExpression { element: Box::new(element), dimensions: array_init.dimensions.clone(), @@ -151,7 +143,7 @@ pub trait ReconstructingReducer { array_access: &ArrayAccessExpression, array: Expression, index: Expression, - ) -> Result { + ) -> Result { Ok(ArrayAccessExpression { array: Box::new(array), index: Box::new(index), @@ -165,7 +157,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)), @@ -178,7 +170,7 @@ pub trait ReconstructingReducer { &mut self, tuple_init: &TupleInitExpression, elements: Vec, - ) -> Result { + ) -> Result { Ok(TupleInitExpression { elements, span: tuple_init.span.clone(), @@ -189,7 +181,7 @@ pub trait ReconstructingReducer { &mut self, tuple_access: &TupleAccessExpression, tuple: Expression, - ) -> Result { + ) -> Result { Ok(TupleAccessExpression { tuple: Box::new(tuple), index: tuple_access.index.clone(), @@ -202,7 +194,7 @@ pub trait ReconstructingReducer { _variable: &CircuitImpliedVariableDefinition, identifier: Identifier, expression: Option, - ) -> Result { + ) -> Result { Ok(CircuitImpliedVariableDefinition { identifier, expression }) } @@ -211,7 +203,7 @@ pub trait ReconstructingReducer { circuit_init: &CircuitInitExpression, name: Identifier, members: Vec, - ) -> Result { + ) -> Result { Ok(CircuitInitExpression { name, members, @@ -224,7 +216,7 @@ pub trait ReconstructingReducer { circuit_member_access: &CircuitMemberAccessExpression, circuit: Expression, name: Identifier, - ) -> Result { + ) -> Result { Ok(CircuitMemberAccessExpression { circuit: Box::new(circuit), name, @@ -237,7 +229,7 @@ pub trait ReconstructingReducer { circuit_static_fn_access: &CircuitStaticFunctionAccessExpression, circuit: Expression, name: Identifier, - ) -> Result { + ) -> Result { Ok(CircuitStaticFunctionAccessExpression { circuit: Box::new(circuit), name, @@ -250,7 +242,7 @@ pub trait ReconstructingReducer { call: &CallExpression, function: Expression, arguments: Vec, - ) -> Result { + ) -> Result { Ok(CallExpression { function: Box::new(function), arguments, @@ -259,7 +251,7 @@ 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) } @@ -267,7 +259,7 @@ pub trait ReconstructingReducer { &mut self, return_statement: &ReturnStatement, expression: Expression, - ) -> Result { + ) -> Result { Ok(ReturnStatement { expression, span: return_statement.span.clone(), @@ -278,7 +270,7 @@ pub trait ReconstructingReducer { &mut self, variable_name: &VariableName, identifier: Identifier, - ) -> Result { + ) -> Result { Ok(VariableName { mutable: variable_name.mutable, identifier, @@ -292,7 +284,7 @@ pub trait ReconstructingReducer { variable_names: Vec, type_: Option, value: Expression, - ) -> Result { + ) -> Result { Ok(DefinitionStatement { declaration_type: definition.declaration_type.clone(), variable_names, @@ -306,7 +298,7 @@ pub trait ReconstructingReducer { &mut self, _access: &AssigneeAccess, new: AssigneeAccess, - ) -> Result { + ) -> Result { Ok(new) } @@ -315,7 +307,7 @@ pub trait ReconstructingReducer { assignee: &Assignee, identifier: Identifier, accesses: Vec, - ) -> Result { + ) -> Result { Ok(Assignee { identifier, accesses, @@ -328,7 +320,7 @@ pub trait ReconstructingReducer { assign: &AssignStatement, assignee: Assignee, value: Expression, - ) -> Result { + ) -> Result { Ok(AssignStatement { operation: assign.operation.clone(), assignee, @@ -343,7 +335,7 @@ pub trait ReconstructingReducer { condition: Expression, block: Block, statement: Option, - ) -> Result { + ) -> Result { Ok(ConditionalStatement { condition, block, @@ -359,7 +351,7 @@ pub trait ReconstructingReducer { start: Expression, stop: Expression, block: Block, - ) -> Result { + ) -> Result { Ok(IterationStatement { variable, start, @@ -373,7 +365,7 @@ pub trait ReconstructingReducer { &mut self, console: &ConsoleStatement, function: ConsoleFunction, - ) -> Result { + ) -> Result { Ok(ConsoleStatement { function, span: console.span.clone(), @@ -384,14 +376,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(), @@ -406,7 +398,7 @@ pub trait ReconstructingReducer { imports: Vec, circuits: IndexMap, functions: IndexMap, - ) -> Result { + ) -> Result { Ok(Program { name: program.name.clone(), expected_input, @@ -421,7 +413,7 @@ pub trait ReconstructingReducer { variable: &FunctionInputVariable, identifier: Identifier, type_: Type, - ) -> Result { + ) -> Result { Ok(FunctionInputVariable { identifier, const_: variable.const_, @@ -435,7 +427,7 @@ pub trait ReconstructingReducer { &mut self, _input: &FunctionInput, new: FunctionInput, - ) -> Result { + ) -> Result { Ok(new) } @@ -443,7 +435,7 @@ pub trait ReconstructingReducer { &mut self, _package_or_packages: &PackageOrPackages, new: PackageOrPackages, - ) -> Result { + ) -> Result { Ok(new) } @@ -451,7 +443,7 @@ pub trait ReconstructingReducer { &mut self, import: &ImportStatement, package_or_packages: PackageOrPackages, - ) -> Result { + ) -> Result { Ok(ImportStatement { package_or_packages, span: import.span.clone(), @@ -462,7 +454,7 @@ pub trait ReconstructingReducer { &mut self, _circuit_member: &CircuitMember, new: CircuitMember, - ) -> Result { + ) -> Result { Ok(new) } @@ -471,15 +463,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, @@ -496,7 +484,7 @@ pub trait ReconstructingReducer { input: Vec, output: Option, block: Block, - ) -> Result { + ) -> Result { Ok(Function { identifier, annotations, diff --git a/compiler/src/errors/compiler.rs b/compiler/src/errors/compiler.rs index f66cdd488a..f0da27c838 100644 --- a/compiler/src/errors/compiler.rs +++ b/compiler/src/errors/compiler.rs @@ -16,7 +16,7 @@ use crate::errors::FunctionError; use leo_asg::{AsgConvertError, FormattedError}; -use leo_ast::{CanonicalizeError, LeoError}; +use leo_ast::{LeoError, ReducerError}; use leo_input::InputParserError; use leo_parser::SyntaxError; use leo_state::LocalDataVerificationError; @@ -56,7 +56,7 @@ pub enum CompilerError { AsgConvertError(#[from] AsgConvertError), #[error("{}", _0)] - CanonicalizeError(#[from] CanonicalizeError), + ReducerError(#[from] ReducerError), } impl LeoError for CompilerError {} diff --git a/compiler/src/stages/reducing_director.rs b/compiler/src/stages/reducing_director.rs index ad7cd4b822..69d9a06c49 100644 --- a/compiler/src/stages/reducing_director.rs +++ b/compiler/src/stages/reducing_director.rs @@ -63,7 +63,6 @@ use leo_ast::{ BinaryExpression as AstBinaryExpression, Block as AstBlockStatement, CallExpression as AstCallExpression, - CanonicalizeError, CastExpression as AstCastExpression, Circuit as AstCircuit, CircuitImpliedVariableDefinition, @@ -71,6 +70,7 @@ use leo_ast::{ CircuitMember as AstCircuitMember, CircuitMemberAccessExpression, CircuitStaticFunctionAccessExpression, + CombinerError, ConditionalStatement as AstConditionalStatement, ConsoleFunction as AstConsoleFunction, ConsoleStatement as AstConsoleStatement, @@ -82,6 +82,7 @@ use leo_ast::{ IterationStatement as AstIterationStatement, PositiveNumber, ReconstructingReducer, + ReducerError, ReturnStatement as AstReturnStatement, Span, SpreadOrExpression, @@ -105,7 +106,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 { @@ -140,7 +141,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstExpression, asg: &AsgExpression, - ) -> Result { + ) -> Result { let new = match (ast, asg) { // TODO what to do for the following: // Ast::Identifier, Ast::Value, Asg::Constant, Asg::ValueRef @@ -199,7 +200,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())?; @@ -210,7 +211,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) @@ -220,7 +221,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 { @@ -242,7 +243,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)?), @@ -260,7 +261,7 @@ 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())?; @@ -271,7 +272,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstCallExpression, asg: &AsgCallExpression, - ) -> Result { + ) -> 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()) @@ -289,7 +290,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstCastExpression, asg: &AsgCastExpression, - ) -> Result { + ) -> 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)?; @@ -300,7 +301,7 @@ impl CombineAstAsgDirector { &mut self, ast: &ValueExpression, _asg: &AsgConstant, - ) -> Result { + ) -> Result { // TODO REDUCE GV // Is this needed? let new = match ast { @@ -317,7 +318,7 @@ impl CombineAstAsgDirector { &mut self, ast: &CircuitMemberAccessExpression, _asg: &AsgCircuitAccessExpression, - ) -> Result { + ) -> Result { // TODO FIGURE IT OUT // let circuit = self.reduce_expression(&circuit_member_access.circuit)?; // let name = self.reduce_identifier(&circuit_member_access.name)?; @@ -332,7 +333,7 @@ impl CombineAstAsgDirector { &mut self, ast: &CircuitStaticFunctionAccessExpression, _asg: &AsgCircuitAccessExpression, - ) -> Result { + ) -> Result { // TODO FIGURE IT OUT // let circuit = self.reduce_expression(&circuit_member_access.circuit)?; // let name = self.reduce_identifier(&circuit_member_access.name)?; @@ -347,7 +348,7 @@ impl CombineAstAsgDirector { &mut self, ast: &CircuitImpliedVariableDefinition, asg: &AsgExpression, - ) -> Result { + ) -> Result { let expression = ast .expression .as_ref() @@ -362,7 +363,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())?); @@ -375,7 +376,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())?; @@ -387,7 +388,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) @@ -397,7 +398,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())?; @@ -411,7 +412,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstUnaryExpression, asg: &AsgUnaryExpression, - ) -> Result { + ) -> Result { let inner = self.reduce_expression(&ast.inner, asg.inner.get())?; self.ast_reducer.reduce_unary(ast, inner, ast.op.clone()) @@ -421,7 +422,7 @@ impl CombineAstAsgDirector { &mut self, ast: &ValueExpression, _asg: &AsgVariableRef, - ) -> Result { + ) -> Result { // TODO FIGURE IT OUT let new = match ast { // ValueExpression::Group(group_value) => { @@ -438,7 +439,7 @@ 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)?) @@ -472,7 +473,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstAssignAccess, asg: &AsgAssignAccess, - ) -> Result { + ) -> 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()) { @@ -496,7 +497,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)?); @@ -509,7 +510,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstAssignStatement, asg: &AsgAssignStatement, - ) -> Result { + ) -> Result { let assignee = self.reduce_assignee(&ast.assignee, &asg.target_accesses)?; let value = self.reduce_expression(&ast.value, asg.value.get())?; @@ -520,7 +521,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstBlockStatement, asg: &AsgBlockStatement, - ) -> Result { + ) -> 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())?); @@ -533,14 +534,15 @@ 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 { - // TODO throw error? - block = ast.block.clone(); + return Err(ReducerError::from(CombinerError::asg_statement_not_block( + &asg.span.as_ref().unwrap(), + ))); } let next = match (ast.next.as_ref(), asg.next.get()) { (Some(ast_next), Some(asg_next)) => Some(self.reduce_statement(ast_next, asg_next)?), @@ -554,7 +556,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())?) @@ -577,7 +579,7 @@ impl CombineAstAsgDirector { AstConsoleFunction::Debug(_) => AstConsoleFunction::Debug(formatted), AstConsoleFunction::Error(_) => AstConsoleFunction::Error(formatted), AstConsoleFunction::Log(_) => AstConsoleFunction::Log(formatted), - _ => unimplemented!(), // impossible + _ => return Err(ReducerError::impossible_console_assert_call(&ast_format.span)), } } _ => ast.function.clone(), @@ -590,7 +592,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstDefinitionStatement, asg: &AsgDefinitionStatement, - ) -> Result { + ) -> Result { let type_; if asg.variables.len() > 1 { @@ -628,7 +630,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) } @@ -637,14 +639,16 @@ 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 { - block = ast.block.clone(); + return Err(ReducerError::from(CombinerError::asg_statement_not_block( + &asg.span.as_ref().unwrap(), + ))); } self.ast_reducer @@ -655,7 +659,7 @@ impl CombineAstAsgDirector { &mut self, ast: &AstReturnStatement, asg: &AsgReturnStatement, - ) -> Result { + ) -> Result { let expression = self.reduce_expression(&ast.expression, asg.expression.get())?; self.ast_reducer.reduce_return(ast, expression) @@ -665,7 +669,7 @@ impl CombineAstAsgDirector { &mut self, ast: &leo_ast::Program, asg: &leo_asg::Program, - ) -> Result { + ) -> 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) { @@ -687,7 +691,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() @@ -720,7 +724,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( @@ -737,7 +741,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)?); From f612ed441a4bea34e8a7a6308d1d0c69526ea218 Mon Sep 17 00:00:00 2001 From: gluax Date: Mon, 12 Apr 2021 16:21:44 -0400 Subject: [PATCH 17/41] type inference, and canonicalization bug fixes --- ast/src/reducer/canonicalization.rs | 137 +++++++---- compiler/src/stages/reducing_director.rs | 64 ++++-- .../canonicalization/compound_assignment.json | 213 +++++++++++++++++- .../canonicalization/compound_assignment.leo | 4 + 4 files changed, 348 insertions(+), 70 deletions(-) diff --git a/ast/src/reducer/canonicalization.rs b/ast/src/reducer/canonicalization.rs index 23d2c29028..65ccc2ba83 100644 --- a/ast/src/reducer/canonicalization.rs +++ b/ast/src/reducer/canonicalization.rs @@ -38,6 +38,67 @@ impl Default for Canonicalizer { } impl Canonicalizer { + pub fn canonicalize_accesses( + &mut self, + start: Expression, + accesses: &[AssigneeAccess], + span: &Span, + ) -> Result, ReducerError> { + let mut left = Box::new(start); + + for access in accesses.iter() { + match self.canonicalize_assignee_access(&access) { + AssigneeAccess::ArrayIndex(index) => { + left = Box::new(Expression::ArrayAccess(ArrayAccessExpression { + array: left, + index: Box::new(index), + span: span.clone(), + })); + } + AssigneeAccess::Tuple(positive_number, _) => { + left = Box::new(Expression::TupleAccess(TupleAccessExpression { + tuple: left, + index: positive_number, + span: span.clone(), + })); + } + AssigneeAccess::Member(identifier) => { + left = Box::new(Expression::CircuitMemberAccess(CircuitMemberAccessExpression { + circuit: left, + name: identifier, + span: span.clone(), + })); + } + _ => unimplemented!(), // No reason for someone to compute ArrayRanges. + } + } + + Ok(left) + } + + pub fn compound_operation_converstion( + &mut self, + operation: &AssignOperation, + ) -> Result { + match operation { + AssignOperation::Assign => unimplemented!(), // Impossible + AssignOperation::Add => Ok(BinaryOperation::Add), + AssignOperation::Sub => Ok(BinaryOperation::Sub), + AssignOperation::Mul => Ok(BinaryOperation::Mul), + AssignOperation::Div => Ok(BinaryOperation::Div), + AssignOperation::Pow => Ok(BinaryOperation::Pow), + AssignOperation::Or => Ok(BinaryOperation::Or), + AssignOperation::And => Ok(BinaryOperation::And), + AssignOperation::BitOr => Ok(BinaryOperation::BitOr), + AssignOperation::BitAnd => Ok(BinaryOperation::BitAnd), + AssignOperation::BitXor => Ok(BinaryOperation::BitXor), + AssignOperation::Shr => Ok(BinaryOperation::Shr), + AssignOperation::ShrSigned => Ok(BinaryOperation::ShrSigned), + AssignOperation::Shl => Ok(BinaryOperation::Shl), + AssignOperation::Mod => Ok(BinaryOperation::Mod), + } + } + fn is_self_type(&mut self, type_option: Option<&Type>) -> bool { matches!(type_option, Some(Type::SelfType)) } @@ -481,55 +542,37 @@ impl ReconstructingReducer for Canonicalizer { value: Expression, ) -> Result { match value { + Expression::Binary(binary_expr) if assign.operation != AssignOperation::Assign => { + let left = self.canonicalize_accesses( + Expression::Identifier(assignee.identifier.clone()), + &assignee.accesses, + &assign.span, + )?; + let right = Box::new(Expression::Binary(binary_expr)); + let op = self.compound_operation_converstion(&assign.operation)?; + + let new_value = Expression::Binary(BinaryExpression { + left, + right, + op, + span: assign.span.clone(), + }); + + Ok(AssignStatement { + operation: AssignOperation::Assign, + assignee, + value: new_value, + span: assign.span.clone(), + }) + } Expression::Value(value_expr) if assign.operation != AssignOperation::Assign => { - let mut left = Box::new(Expression::Identifier(assignee.identifier.clone())); - - for access in assignee.accesses.iter().rev() { - match self.canonicalize_assignee_access(&access) { - AssigneeAccess::ArrayIndex(index) => { - left = Box::new(Expression::ArrayAccess(ArrayAccessExpression { - array: left, - index: Box::new(index), - span: assign.span.clone(), - })); - } - AssigneeAccess::Tuple(positive_number, _) => { - left = Box::new(Expression::TupleAccess(TupleAccessExpression { - tuple: left, - index: positive_number, - span: assign.span.clone(), - })); - } - AssigneeAccess::Member(identifier) => { - left = Box::new(Expression::CircuitMemberAccess(CircuitMemberAccessExpression { - circuit: left, - name: identifier, - span: assign.span.clone(), - })); - } - _ => unimplemented!(), // No reason for someone to compute ArrayRanges. - } - } - + let left = self.canonicalize_accesses( + Expression::Identifier(assignee.identifier.clone()), + &assignee.accesses, + &assign.span, + )?; let right = Box::new(Expression::Value(value_expr)); - - let op = match assign.operation { - AssignOperation::Assign => unimplemented!(), // Imposible - AssignOperation::Add => BinaryOperation::Add, - AssignOperation::Sub => BinaryOperation::Sub, - AssignOperation::Mul => BinaryOperation::Mul, - AssignOperation::Div => BinaryOperation::Div, - AssignOperation::Pow => BinaryOperation::Pow, - AssignOperation::Or => BinaryOperation::Or, - AssignOperation::And => BinaryOperation::And, - AssignOperation::BitOr => BinaryOperation::BitOr, - AssignOperation::BitAnd => BinaryOperation::BitAnd, - AssignOperation::BitXor => BinaryOperation::BitXor, - AssignOperation::Shr => BinaryOperation::Shr, - AssignOperation::ShrSigned => BinaryOperation::ShrSigned, - AssignOperation::Shl => BinaryOperation::Shl, - AssignOperation::Mod => BinaryOperation::Mod, - }; + let op = self.compound_operation_converstion(&assign.operation)?; let new_value = Expression::Binary(BinaryExpression { left, diff --git a/compiler/src/stages/reducing_director.rs b/compiler/src/stages/reducing_director.rs index 69d9a06c49..3ad9eedcf8 100644 --- a/compiler/src/stages/reducing_director.rs +++ b/compiler/src/stages/reducing_director.rs @@ -36,11 +36,13 @@ use leo_asg::{ ConditionalStatement as AsgConditionalStatement, ConsoleFunction as AsgConsoleFunction, ConsoleStatement as AsgConsoleStatement, + ConstValue, Constant as AsgConstant, DefinitionStatement as AsgDefinitionStatement, Expression as AsgExpression, ExpressionStatement as AsgExpressionStatement, Function as AsgFunction, + GroupValue as AsgGroupValue, IterationStatement as AsgIterationStatement, ReturnStatement as AsgReturnStatement, Statement as AsgStatement, @@ -79,6 +81,8 @@ use leo_ast::{ ExpressionStatement as AstExpressionStatement, FormattedString, Function as AstFunction, + GroupTuple, + GroupValue as AstGroupValue, IterationStatement as AstIterationStatement, PositiveNumber, ReconstructingReducer, @@ -144,10 +148,12 @@ impl CombineAstAsgDirector { ) -> Result { let new = match (ast, asg) { // TODO what to do for the following: - // Ast::Identifier, Ast::Value, Asg::Constant, Asg::ValueRef + // Ast::Identifier, Asg::ValueRef // AsgExpression::Identifier(identifier) => AsgExpression::Identifier(self.reduce_identifier(&identifier)?), - // AsgExpression::Value(value) => AsgExpression::Value(self.reduce_value(&value)?), + (AstExpression::Value(value), AsgExpression::Constant(const_)) => { + AstExpression::Value(self.reduce_value(&value, &const_)?) + } (AstExpression::Binary(ast), AsgExpression::Binary(asg)) => { AstExpression::Binary(self.reduce_binary(&ast, &asg)?) } @@ -297,23 +303,6 @@ impl CombineAstAsgDirector { self.ast_reducer.reduce_cast(ast, inner, target_type) } - pub fn reduce_constant( - &mut self, - ast: &ValueExpression, - _asg: &AsgConstant, - ) -> Result { - // TODO REDUCE GV - // Is this needed? - let new = match ast { - // AstConstant::Group(group_value) => { - // AstConstant::Group(Box::new(self.reduce_group_value(&group_value)?)) - // } - _ => ast.clone(), - }; - - self.ast_reducer.reduce_value(ast, new) - } - pub fn reduce_circuit_member_access( &mut self, ast: &CircuitMemberAccessExpression, @@ -418,6 +407,43 @@ impl CombineAstAsgDirector { self.ast_reducer.reduce_unary(ast, inner, ast.op.clone()) } + pub fn reduce_value(&mut self, ast: &ValueExpression, asg: &AsgConstant) -> Result { + let mut new = ast.clone(); + + if self.options.type_inference_enabled { + if let ValueExpression::Implicit(tendril, span) = ast { + match &asg.value { + ConstValue::Int(int) => { + new = ValueExpression::Integer(int.get_int_type(), tendril.clone(), span.clone()); + } + ConstValue::Group(group) => { + let group_value = match group { + AsgGroupValue::Single(_) => AstGroupValue::Single(tendril.clone(), span.clone()), + AsgGroupValue::Tuple(x, y) => AstGroupValue::Tuple(GroupTuple { + x: x.into(), + y: y.into(), + span: span.clone(), + }), + }; + new = ValueExpression::Group(Box::new(group_value)); + } + ConstValue::Field(_) => { + new = ValueExpression::Field(tendril.clone(), span.clone()); + } + ConstValue::Address(_) => { + new = ValueExpression::Address(tendril.clone(), span.clone()); + } + ConstValue::Boolean(_) => { + new = ValueExpression::Boolean(tendril.clone(), span.clone()); + } + _ => unimplemented!(), // impossible? + } + } + } + + self.ast_reducer.reduce_value(ast, new) + } + pub fn reduce_variable_ref( &mut self, ast: &ValueExpression, diff --git a/compiler/tests/canonicalization/compound_assignment.json b/compiler/tests/canonicalization/compound_assignment.json index fa2c4825a5..fbf7fb8c6f 100644 --- a/compiler/tests/canonicalization/compound_assignment.json +++ b/compiler/tests/canonicalization/compound_assignment.json @@ -843,24 +843,229 @@ "content": " console.assert(foo.f == 8u8);" } } + }, + { + "Definition": { + "declaration_type": "Let", + "variable_names": [ + { + "mutable": true, + "identifier": "{\"name\":\"complex\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":7,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let complex = 2u8;\\\"}\"}", + "span": { + "line_start": 21, + "line_stop": 21, + "col_start": 7, + "col_stop": 14, + "path": "", + "content": " let complex = 2u8;" + } + } + ], + "type_": null, + "value": { + "Value": { + "Integer": [ + "U8", + "2", + { + "line_start": 21, + "line_stop": 21, + "col_start": 17, + "col_stop": 20, + "path": "", + "content": " let complex = 2u8;" + } + ] + } + }, + "span": { + "line_start": 21, + "line_stop": 21, + "col_start": 3, + "col_stop": 20, + "path": "", + "content": " let complex = 2u8;" + } + } + }, + { + "Assign": { + "operation": "Assign", + "assignee": { + "identifier": "{\"name\":\"complex\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":3,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" complex += 22u8 - 2u8+ 1u8;\\\"}\"}", + "accesses": [], + "span": { + "line_start": 22, + "line_stop": 22, + "col_start": 3, + "col_stop": 10, + "path": "", + "content": " complex += 22u8 - 2u8+ 1u8;" + } + }, + "value": { + "Binary": { + "left": { + "Identifier": "{\"name\":\"complex\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":3,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" complex += 22u8 - 2u8+ 1u8;\\\"}\"}" + }, + "right": { + "Binary": { + "left": { + "Binary": { + "left": { + "Value": { + "Integer": [ + "U8", + "22", + { + "line_start": 22, + "line_stop": 22, + "col_start": 14, + "col_stop": 18, + "path": "", + "content": " complex += 22u8 - 2u8+ 1u8;" + } + ] + } + }, + "right": { + "Value": { + "Integer": [ + "U8", + "2", + { + "line_start": 22, + "line_stop": 22, + "col_start": 21, + "col_stop": 24, + "path": "", + "content": " complex += 22u8 - 2u8+ 1u8;" + } + ] + } + }, + "op": "Sub", + "span": { + "line_start": 22, + "line_stop": 22, + "col_start": 14, + "col_stop": 24, + "path": "", + "content": " complex += 22u8 - 2u8+ 1u8;" + } + } + }, + "right": { + "Value": { + "Integer": [ + "U8", + "1", + { + "line_start": 22, + "line_stop": 22, + "col_start": 26, + "col_stop": 29, + "path": "", + "content": " complex += 22u8 - 2u8+ 1u8;" + } + ] + } + }, + "op": "Add", + "span": { + "line_start": 22, + "line_stop": 22, + "col_start": 14, + "col_stop": 29, + "path": "", + "content": " complex += 22u8 - 2u8+ 1u8;" + } + } + }, + "op": "Add", + "span": { + "line_start": 22, + "line_stop": 22, + "col_start": 3, + "col_stop": 29, + "path": "", + "content": " complex += 22u8 - 2u8+ 1u8;" + } + } + }, + "span": { + "line_start": 22, + "line_stop": 22, + "col_start": 3, + "col_stop": 29, + "path": "", + "content": " complex += 22u8 - 2u8+ 1u8;" + } + } + }, + { + "Console": { + "function": { + "Assert": { + "Binary": { + "left": { + "Identifier": "{\"name\":\"complex\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":18,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(complex == 23u8);\\\"}\"}" + }, + "right": { + "Value": { + "Integer": [ + "U8", + "23", + { + "line_start": 23, + "line_stop": 23, + "col_start": 29, + "col_stop": 33, + "path": "", + "content": " console.assert(complex == 23u8);" + } + ] + } + }, + "op": "Eq", + "span": { + "line_start": 23, + "line_stop": 23, + "col_start": 18, + "col_stop": 33, + "path": "", + "content": " console.assert(complex == 23u8);" + } + } + } + }, + "span": { + "line_start": 23, + "line_stop": 23, + "col_start": 3, + "col_stop": 33, + "path": "", + "content": " console.assert(complex == 23u8);" + } + } } ], "span": { "line_start": 4, - "line_stop": 20, + "line_stop": 24, "col_start": 17, "col_stop": 2, "path": "", - "content": "function main() {\n...\n} " + "content": "function main() {\n...\n}" } }, "span": { "line_start": 4, - "line_stop": 20, + "line_stop": 24, "col_start": 1, "col_stop": 2, "path": "", - "content": "function main() {\n...\n} \n\n\n\n\n\n\n\n\n\n\n\n\n\n" + "content": "function main() {\n...\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" } } } diff --git a/compiler/tests/canonicalization/compound_assignment.leo b/compiler/tests/canonicalization/compound_assignment.leo index 346d4de3c7..722bac89ea 100644 --- a/compiler/tests/canonicalization/compound_assignment.leo +++ b/compiler/tests/canonicalization/compound_assignment.leo @@ -17,4 +17,8 @@ function main() { let foo = Foo { f: 6u8 }; foo.f += 2u8; console.assert(foo.f == 8u8); + + let complex = 2u8; + complex += 22u8 - 2u8+ 1u8; + console.assert(complex == 23u8); } \ No newline at end of file From 61e791c67146c264e8d81c44464be7fe96100747 Mon Sep 17 00:00:00 2001 From: gluax Date: Tue, 13 Apr 2021 11:52:01 -0400 Subject: [PATCH 18/41] type inference tests --- ast/src/errors/combiner.rs | 12 + ast/src/lib.rs | 2 +- ast/src/reducer/canonicalization.rs | 9 +- compiler/tests/mod.rs | 1 + compiler/tests/type_inference/basic.json | 962 ++++++++++++++++++ compiler/tests/type_inference/basic.leo | 21 + .../type_inference/for_loop_and_compound.json | 242 +++++ .../type_inference/for_loop_and_compound.leo | 7 + compiler/tests/type_inference/mod.rs | 115 +++ 9 files changed, 1366 insertions(+), 5 deletions(-) create mode 100644 compiler/tests/type_inference/basic.json create mode 100644 compiler/tests/type_inference/basic.leo create mode 100644 compiler/tests/type_inference/for_loop_and_compound.json create mode 100644 compiler/tests/type_inference/for_loop_and_compound.leo create mode 100644 compiler/tests/type_inference/mod.rs diff --git a/ast/src/errors/combiner.rs b/ast/src/errors/combiner.rs index 8ad146d1cd..7c8aa72375 100644 --- a/ast/src/errors/combiner.rs +++ b/ast/src/errors/combiner.rs @@ -34,4 +34,16 @@ impl CombinerError { Self::new_from_span(message, span) } + + pub fn illegal_compound_array_access(span: &Span) -> Self { + let message = "Illegal compound assignement with array range".to_string(); + + Self::new_from_span(message, span) + } + + pub fn illegal_compound_operation(span: &Span) -> Self { + let message = "Illegal compound assignment operator =".to_string(); + + Self::new_from_span(message, span) + } } diff --git a/ast/src/lib.rs b/ast/src/lib.rs index 4601a74959..7fab42c3be 100644 --- a/ast/src/lib.rs +++ b/ast/src/lib.rs @@ -71,7 +71,7 @@ pub use node::*; /// These data types form a tree that begins from a [`Program`] type root. /// /// A new [`Ast`] can be created from a [`Grammar`] generated by the pest parser in the `grammar` module. -#[derive(Debug, Eq, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct Ast { ast: Program, } diff --git a/ast/src/reducer/canonicalization.rs b/ast/src/reducer/canonicalization.rs index 65ccc2ba83..8c27232b47 100644 --- a/ast/src/reducer/canonicalization.rs +++ b/ast/src/reducer/canonicalization.rs @@ -69,7 +69,7 @@ impl Canonicalizer { span: span.clone(), })); } - _ => unimplemented!(), // No reason for someone to compute ArrayRanges. + _ => return Err(ReducerError::from(CombinerError::illegal_compound_array_access(&span))), } } @@ -79,9 +79,10 @@ impl Canonicalizer { pub fn compound_operation_converstion( &mut self, operation: &AssignOperation, + span: &Span, ) -> Result { match operation { - AssignOperation::Assign => unimplemented!(), // Impossible + AssignOperation::Assign => Err(ReducerError::from(CombinerError::illegal_compound_operation(&span))), AssignOperation::Add => Ok(BinaryOperation::Add), AssignOperation::Sub => Ok(BinaryOperation::Sub), AssignOperation::Mul => Ok(BinaryOperation::Mul), @@ -549,7 +550,7 @@ impl ReconstructingReducer for Canonicalizer { &assign.span, )?; let right = Box::new(Expression::Binary(binary_expr)); - let op = self.compound_operation_converstion(&assign.operation)?; + let op = self.compound_operation_converstion(&assign.operation, &assign.span)?; let new_value = Expression::Binary(BinaryExpression { left, @@ -572,7 +573,7 @@ impl ReconstructingReducer for Canonicalizer { &assign.span, )?; let right = Box::new(Expression::Value(value_expr)); - let op = self.compound_operation_converstion(&assign.operation)?; + let op = self.compound_operation_converstion(&assign.operation, &assign.span)?; let new_value = Expression::Binary(BinaryExpression { left, diff --git a/compiler/tests/mod.rs b/compiler/tests/mod.rs index 96069ffe54..3065734e61 100644 --- a/compiler/tests/mod.rs +++ b/compiler/tests/mod.rs @@ -37,6 +37,7 @@ pub mod mutability; pub mod statements; pub mod syntax; pub mod tuples; +pub mod type_inference; use leo_asg::{new_alloc_context, new_context, AsgContext}; use leo_ast::{InputValue, MainInput}; diff --git a/compiler/tests/type_inference/basic.json b/compiler/tests/type_inference/basic.json new file mode 100644 index 0000000000..6f588d2f3c --- /dev/null +++ b/compiler/tests/type_inference/basic.json @@ -0,0 +1,962 @@ +{ + "name": "", + "expected_input": [], + "imports": [], + "circuits": { + "{\"name\":\"Foo\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit Foo {}\\\"}\"}": { + "circuit_name": "{\"name\":\"Foo\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit Foo {}\\\"}\"}", + "members": [] + } + }, + "functions": { + "{\"name\":\"two\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function two() -> u8 {\\\"}\"}": { + "annotations": [], + "identifier": "{\"name\":\"two\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function two() -> u8 {\\\"}\"}", + "input": [], + "output": { + "IntegerType": "U8" + }, + "block": { + "statements": [ + { + "Return": { + "expression": { + "Value": { + "Integer": [ + "U8", + "2", + { + "line_start": 4, + "line_stop": 4, + "col_start": 10, + "col_stop": 13, + "path": "", + "content": " return 2u8" + } + ] + } + }, + "span": { + "line_start": 4, + "line_stop": 4, + "col_start": 3, + "col_stop": 13, + "path": "", + "content": " return 2u8" + } + } + } + ], + "span": { + "line_start": 3, + "line_stop": 5, + "col_start": 22, + "col_stop": 2, + "path": "", + "content": "function two() -> u8 {\n...\n}" + } + }, + "span": { + "line_start": 3, + "line_stop": 5, + "col_start": 1, + "col_stop": 2, + "path": "", + "content": "function two() -> u8 {\n...\n}" + } + }, + "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main() {\\\"}\"}": { + "annotations": [], + "identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main() {\\\"}\"}", + "input": [], + "output": { + "Tuple": [] + }, + "block": { + "statements": [ + { + "Definition": { + "declaration_type": "Const", + "variable_names": [ + { + "mutable": false, + "identifier": "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const a = 1u8;\\\"}\"}", + "span": { + "line_start": 8, + "line_stop": 8, + "col_start": 9, + "col_stop": 10, + "path": "", + "content": " const a = 1u8;" + } + } + ], + "type_": { + "IntegerType": "U8" + }, + "value": { + "Value": { + "Integer": [ + "U8", + "1", + { + "line_start": 8, + "line_stop": 8, + "col_start": 13, + "col_stop": 16, + "path": "", + "content": " const a = 1u8;" + } + ] + } + }, + "span": { + "line_start": 8, + "line_stop": 8, + "col_start": 3, + "col_stop": 16, + "path": "", + "content": " const a = 1u8;" + } + } + }, + { + "Definition": { + "declaration_type": "Const", + "variable_names": [ + { + "mutable": false, + "identifier": "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const b = 1field;\\\"}\"}", + "span": { + "line_start": 9, + "line_stop": 9, + "col_start": 9, + "col_stop": 10, + "path": "", + "content": " const b = 1field;" + } + } + ], + "type_": "Field", + "value": { + "Value": { + "Field": [ + "1", + { + "line_start": 9, + "line_stop": 9, + "col_start": 13, + "col_stop": 19, + "path": "", + "content": " const b = 1field;" + } + ] + } + }, + "span": { + "line_start": 9, + "line_stop": 9, + "col_start": 3, + "col_stop": 19, + "path": "", + "content": " const b = 1field;" + } + } + }, + { + "Definition": { + "declaration_type": "Const", + "variable_names": [ + { + "mutable": false, + "identifier": "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const c = 1group;\\\"}\"}", + "span": { + "line_start": 10, + "line_stop": 10, + "col_start": 9, + "col_stop": 10, + "path": "", + "content": " const c = 1group;" + } + } + ], + "type_": "Group", + "value": { + "Value": { + "Group": { + "Single": [ + "1", + { + "line_start": 10, + "line_stop": 10, + "col_start": 13, + "col_stop": 19, + "path": "", + "content": " const c = 1group;" + } + ] + } + } + }, + "span": { + "line_start": 10, + "line_stop": 10, + "col_start": 3, + "col_stop": 19, + "path": "", + "content": " const c = 1group;" + } + } + }, + { + "Definition": { + "declaration_type": "Const", + "variable_names": [ + { + "mutable": false, + "identifier": "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const d = (0, 1)group;\\\"}\"}", + "span": { + "line_start": 11, + "line_stop": 11, + "col_start": 9, + "col_stop": 10, + "path": "", + "content": " const d = (0, 1)group;" + } + } + ], + "type_": "Group", + "value": { + "Value": { + "Group": { + "Tuple": { + "x": { + "Number": [ + "0", + { + "line_start": 11, + "line_stop": 11, + "col_start": 14, + "col_stop": 15, + "path": "", + "content": " const d = (0, 1)group;" + } + ] + }, + "y": { + "Number": [ + "1", + { + "line_start": 11, + "line_stop": 11, + "col_start": 17, + "col_stop": 18, + "path": "", + "content": " const d = (0, 1)group;" + } + ] + }, + "span": { + "line_start": 11, + "line_stop": 11, + "col_start": 14, + "col_stop": 24, + "path": "", + "content": " const d = (0, 1)group;" + } + } + } + } + }, + "span": { + "line_start": 11, + "line_stop": 11, + "col_start": 3, + "col_stop": 24, + "path": "", + "content": " const d = (0, 1)group;" + } + } + }, + { + "Definition": { + "declaration_type": "Const", + "variable_names": [ + { + "mutable": false, + "identifier": "{\"name\":\"e\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const e = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8);\\\"}\"}", + "span": { + "line_start": 12, + "line_stop": 12, + "col_start": 9, + "col_stop": 10, + "path": "", + "content": " const e = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8);" + } + } + ], + "type_": "Address", + "value": { + "Value": { + "Address": [ + "aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8", + { + "line_start": 12, + "line_stop": 12, + "col_start": 13, + "col_stop": 85, + "path": "", + "content": " const e = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8);" + } + ] + } + }, + "span": { + "line_start": 12, + "line_stop": 12, + "col_start": 3, + "col_stop": 85, + "path": "", + "content": " const e = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8);" + } + } + }, + { + "Definition": { + "declaration_type": "Const", + "variable_names": [ + { + "mutable": false, + "identifier": "{\"name\":\"f\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const f = two();\\\"}\"}", + "span": { + "line_start": 13, + "line_stop": 13, + "col_start": 9, + "col_stop": 10, + "path": "", + "content": " const f = two();" + } + } + ], + "type_": { + "IntegerType": "U8" + }, + "value": { + "Call": { + "function": { + "Identifier": "{\"name\":\"two\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":13,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const f = two();\\\"}\"}" + }, + "arguments": [], + "span": { + "line_start": 13, + "line_stop": 13, + "col_start": 13, + "col_stop": 18, + "path": "", + "content": " const f = two();" + } + } + }, + "span": { + "line_start": 13, + "line_stop": 13, + "col_start": 3, + "col_stop": 18, + "path": "", + "content": " const f = two();" + } + } + }, + { + "Definition": { + "declaration_type": "Const", + "variable_names": [ + { + "mutable": false, + "identifier": "{\"name\":\"g\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const g = [0u8; (3, 2)];\\\"}\"}", + "span": { + "line_start": 14, + "line_stop": 14, + "col_start": 9, + "col_stop": 10, + "path": "", + "content": " const g = [0u8; (3, 2)];" + } + } + ], + "type_": { + "Array": [ + { + "Array": [ + { + "IntegerType": "U8" + }, + [ + { + "value": "2" + } + ] + ] + }, + [ + { + "value": "3" + } + ] + ] + }, + "value": { + "ArrayInit": { + "element": { + "ArrayInit": { + "element": { + "Value": { + "Integer": [ + "U8", + "0", + { + "line_start": 14, + "line_stop": 14, + "col_start": 14, + "col_stop": 17, + "path": "", + "content": " const g = [0u8; (3, 2)];" + } + ] + } + }, + "dimensions": [ + { + "value": "2" + } + ], + "span": { + "line_start": 14, + "line_stop": 14, + "col_start": 13, + "col_stop": 26, + "path": "", + "content": " const g = [0u8; (3, 2)];" + } + } + }, + "dimensions": [ + { + "value": "3" + } + ], + "span": { + "line_start": 14, + "line_stop": 14, + "col_start": 13, + "col_stop": 26, + "path": "", + "content": " const g = [0u8; (3, 2)];" + } + } + }, + "span": { + "line_start": 14, + "line_stop": 14, + "col_start": 3, + "col_stop": 26, + "path": "", + "content": " const g = [0u8; (3, 2)];" + } + } + }, + { + "Definition": { + "declaration_type": "Const", + "variable_names": [ + { + "mutable": false, + "identifier": "{\"name\":\"h\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const h = [[0u8; 3]; 2];\\\"}\"}", + "span": { + "line_start": 15, + "line_stop": 15, + "col_start": 9, + "col_stop": 10, + "path": "", + "content": " const h = [[0u8; 3]; 2];" + } + } + ], + "type_": { + "Array": [ + { + "Array": [ + { + "IntegerType": "U8" + }, + [ + { + "value": "3" + } + ] + ] + }, + [ + { + "value": "2" + } + ] + ] + }, + "value": { + "ArrayInit": { + "element": { + "ArrayInit": { + "element": { + "Value": { + "Integer": [ + "U8", + "0", + { + "line_start": 15, + "line_stop": 15, + "col_start": 15, + "col_stop": 18, + "path": "", + "content": " const h = [[0u8; 3]; 2];" + } + ] + } + }, + "dimensions": [ + { + "value": "3" + } + ], + "span": { + "line_start": 15, + "line_stop": 15, + "col_start": 14, + "col_stop": 22, + "path": "", + "content": " const h = [[0u8; 3]; 2];" + } + } + }, + "dimensions": [ + { + "value": "2" + } + ], + "span": { + "line_start": 15, + "line_stop": 15, + "col_start": 13, + "col_stop": 26, + "path": "", + "content": " const h = [[0u8; 3]; 2];" + } + } + }, + "span": { + "line_start": 15, + "line_stop": 15, + "col_start": 3, + "col_stop": 26, + "path": "", + "content": " const h = [[0u8; 3]; 2];" + } + } + }, + { + "Definition": { + "declaration_type": "Const", + "variable_names": [ + { + "mutable": false, + "identifier": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const i = [1u8, 1u8, 1u8];\\\"}\"}", + "span": { + "line_start": 16, + "line_stop": 16, + "col_start": 9, + "col_stop": 10, + "path": "", + "content": " const i = [1u8, 1u8, 1u8];" + } + } + ], + "type_": { + "Array": [ + { + "IntegerType": "U8" + }, + [ + { + "value": "3" + } + ] + ] + }, + "value": { + "ArrayInline": { + "elements": [ + { + "Expression": { + "Value": { + "Integer": [ + "U8", + "1", + { + "line_start": 16, + "line_stop": 16, + "col_start": 14, + "col_stop": 17, + "path": "", + "content": " const i = [1u8, 1u8, 1u8];" + } + ] + } + } + }, + { + "Expression": { + "Value": { + "Integer": [ + "U8", + "1", + { + "line_start": 16, + "line_stop": 16, + "col_start": 19, + "col_stop": 22, + "path": "", + "content": " const i = [1u8, 1u8, 1u8];" + } + ] + } + } + }, + { + "Expression": { + "Value": { + "Integer": [ + "U8", + "1", + { + "line_start": 16, + "line_stop": 16, + "col_start": 24, + "col_stop": 27, + "path": "", + "content": " const i = [1u8, 1u8, 1u8];" + } + ] + } + } + } + ], + "span": { + "line_start": 16, + "line_stop": 16, + "col_start": 13, + "col_stop": 28, + "path": "", + "content": " const i = [1u8, 1u8, 1u8];" + } + } + }, + "span": { + "line_start": 16, + "line_stop": 16, + "col_start": 3, + "col_stop": 28, + "path": "", + "content": " const i = [1u8, 1u8, 1u8];" + } + } + }, + { + "Definition": { + "declaration_type": "Const", + "variable_names": [ + { + "mutable": false, + "identifier": "{\"name\":\"j\",\"span\":\"{\\\"line_start\\\":17,\\\"line_stop\\\":17,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const j = true;\\\"}\"}", + "span": { + "line_start": 17, + "line_stop": 17, + "col_start": 9, + "col_stop": 10, + "path": "", + "content": " const j = true;" + } + } + ], + "type_": "Boolean", + "value": { + "Value": { + "Boolean": [ + "true", + { + "line_start": 17, + "line_stop": 17, + "col_start": 13, + "col_stop": 17, + "path": "", + "content": " const j = true;" + } + ] + } + }, + "span": { + "line_start": 17, + "line_stop": 17, + "col_start": 3, + "col_stop": 17, + "path": "", + "content": " const j = true;" + } + } + }, + { + "Definition": { + "declaration_type": "Const", + "variable_names": [ + { + "mutable": false, + "identifier": "{\"name\":\"k\",\"span\":\"{\\\"line_start\\\":18,\\\"line_stop\\\":18,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const k = (1u8, 1u8);\\\"}\"}", + "span": { + "line_start": 18, + "line_stop": 18, + "col_start": 9, + "col_stop": 10, + "path": "", + "content": " const k = (1u8, 1u8);" + } + } + ], + "type_": { + "Tuple": [ + { + "IntegerType": "U8" + }, + { + "IntegerType": "U8" + } + ] + }, + "value": { + "TupleInit": { + "elements": [ + { + "Value": { + "Integer": [ + "U8", + "1", + { + "line_start": 18, + "line_stop": 18, + "col_start": 14, + "col_stop": 17, + "path": "", + "content": " const k = (1u8, 1u8);" + } + ] + } + }, + { + "Value": { + "Integer": [ + "U8", + "1", + { + "line_start": 18, + "line_stop": 18, + "col_start": 19, + "col_stop": 22, + "path": "", + "content": " const k = (1u8, 1u8);" + } + ] + } + } + ], + "span": { + "line_start": 18, + "line_stop": 18, + "col_start": 13, + "col_stop": 23, + "path": "", + "content": " const k = (1u8, 1u8);" + } + } + }, + "span": { + "line_start": 18, + "line_stop": 18, + "col_start": 3, + "col_stop": 23, + "path": "", + "content": " const k = (1u8, 1u8);" + } + } + }, + { + "Definition": { + "declaration_type": "Const", + "variable_names": [ + { + "mutable": false, + "identifier": "{\"name\":\"l\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const l = (1u8, 1u8, true);\\\"}\"}", + "span": { + "line_start": 19, + "line_stop": 19, + "col_start": 9, + "col_stop": 10, + "path": "", + "content": " const l = (1u8, 1u8, true);" + } + } + ], + "type_": { + "Tuple": [ + { + "IntegerType": "U8" + }, + { + "IntegerType": "U8" + }, + "Boolean" + ] + }, + "value": { + "TupleInit": { + "elements": [ + { + "Value": { + "Integer": [ + "U8", + "1", + { + "line_start": 19, + "line_stop": 19, + "col_start": 14, + "col_stop": 17, + "path": "", + "content": " const l = (1u8, 1u8, true);" + } + ] + } + }, + { + "Value": { + "Integer": [ + "U8", + "1", + { + "line_start": 19, + "line_stop": 19, + "col_start": 19, + "col_stop": 22, + "path": "", + "content": " const l = (1u8, 1u8, true);" + } + ] + } + }, + { + "Value": { + "Boolean": [ + "true", + { + "line_start": 19, + "line_stop": 19, + "col_start": 24, + "col_stop": 28, + "path": "", + "content": " const l = (1u8, 1u8, true);" + } + ] + } + } + ], + "span": { + "line_start": 19, + "line_stop": 19, + "col_start": 13, + "col_stop": 29, + "path": "", + "content": " const l = (1u8, 1u8, true);" + } + } + }, + "span": { + "line_start": 19, + "line_stop": 19, + "col_start": 3, + "col_stop": 29, + "path": "", + "content": " const l = (1u8, 1u8, true);" + } + } + }, + { + "Definition": { + "declaration_type": "Const", + "variable_names": [ + { + "mutable": false, + "identifier": "{\"name\":\"m\",\"span\":\"{\\\"line_start\\\":20,\\\"line_stop\\\":20,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const m = Foo {};\\\"}\"}", + "span": { + "line_start": 20, + "line_stop": 20, + "col_start": 9, + "col_stop": 10, + "path": "", + "content": " const m = Foo {};" + } + } + ], + "type_": { + "Circuit": "{\"name\":\"Foo\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit Foo {}\\\"}\"}" + }, + "value": { + "CircuitInit": { + "name": "{\"name\":\"Foo\",\"span\":\"{\\\"line_start\\\":20,\\\"line_stop\\\":20,\\\"col_start\\\":13,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const m = Foo {};\\\"}\"}", + "members": [], + "span": { + "line_start": 20, + "line_stop": 20, + "col_start": 13, + "col_stop": 19, + "path": "", + "content": " const m = Foo {};" + } + } + }, + "span": { + "line_start": 20, + "line_stop": 20, + "col_start": 3, + "col_stop": 19, + "path": "", + "content": " const m = Foo {};" + } + } + } + ], + "span": { + "line_start": 7, + "line_stop": 21, + "col_start": 17, + "col_stop": 2, + "path": "", + "content": "function main() {\n...\n}" + } + }, + "span": { + "line_start": 7, + "line_stop": 21, + "col_start": 1, + "col_stop": 2, + "path": "", + "content": "function main() {\n...\n}\n\n\n\n\n\n\n\n\n\n\n\n" + } + } + } + } \ No newline at end of file diff --git a/compiler/tests/type_inference/basic.leo b/compiler/tests/type_inference/basic.leo new file mode 100644 index 0000000000..c83c7df815 --- /dev/null +++ b/compiler/tests/type_inference/basic.leo @@ -0,0 +1,21 @@ +circuit Foo {} + +function two() -> u8 { + return 2u8 +} + +function main() { + const a = 1u8; + const b = 1field; + const c = 1group; + const d = (0, 1)group; + const e = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const f = two(); + const g = [0u8; (3, 2)]; + const h = [[0u8; 3]; 2]; + const i = [1u8, 1u8, 1u8]; + const j = true; + const k = (1u8, 1u8); + const l = (1u8, 1u8, true); + const m = Foo {}; +} \ No newline at end of file diff --git a/compiler/tests/type_inference/for_loop_and_compound.json b/compiler/tests/type_inference/for_loop_and_compound.json new file mode 100644 index 0000000000..f0079573d1 --- /dev/null +++ b/compiler/tests/type_inference/for_loop_and_compound.json @@ -0,0 +1,242 @@ +{ + "name": "", + "expected_input": [], + "imports": [], + "circuits": {}, + "functions": { + "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main() {\\\"}\"}": { + "annotations": [], + "identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main() {\\\"}\"}", + "input": [], + "output": { + "Tuple": [] + }, + "block": { + "statements": [ + { + "Definition": { + "declaration_type": "Let", + "variable_names": [ + { + "mutable": true, + "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let x = 10u16;\\\"}\"}", + "span": { + "line_start": 2, + "line_stop": 2, + "col_start": 9, + "col_stop": 10, + "path": "", + "content": " let x = 10u16;" + } + } + ], + "type_": { + "IntegerType": "U16" + }, + "value": { + "Value": { + "Integer": [ + "U16", + "10", + { + "line_start": 2, + "line_stop": 2, + "col_start": 13, + "col_stop": 18, + "path": "", + "content": " let x = 10u16;" + } + ] + } + }, + "span": { + "line_start": 2, + "line_stop": 2, + "col_start": 5, + "col_stop": 18, + "path": "", + "content": " let x = 10u16;" + } + } + }, + { + "Iteration": { + "variable": "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for i in 0..3 {\\\"}\"}", + "start": { + "Value": { + "Integer": [ + "U32", + "0", + { + "line_start": 3, + "line_stop": 3, + "col_start": 14, + "col_stop": 15, + "path": "", + "content": " for i in 0..3 {" + } + ] + } + }, + "stop": { + "Value": { + "Integer": [ + "U32", + "3", + { + "line_start": 3, + "line_stop": 3, + "col_start": 17, + "col_stop": 18, + "path": "", + "content": " for i in 0..3 {" + } + ] + } + }, + "block": { + "statements": [ + { + "Assign": { + "operation": "Assign", + "assignee": { + "identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x -= 1;\\\"}\"}", + "accesses": [], + "span": { + "line_start": 4, + "line_stop": 4, + "col_start": 9, + "col_stop": 10, + "path": "", + "content": " x -= 1;" + } + }, + "value": { + "Binary": { + "left": { + "Identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x -= 1;\\\"}\"}" + }, + "right": { + "Value": { + "Integer": [ + "U16", + "1", + { + "line_start": 4, + "line_stop": 4, + "col_start": 14, + "col_stop": 15, + "path": "", + "content": " x -= 1;" + } + ] + } + }, + "op": "Sub", + "span": { + "line_start": 4, + "line_stop": 4, + "col_start": 9, + "col_stop": 15, + "path": "", + "content": " x -= 1;" + } + } + }, + "span": { + "line_start": 4, + "line_stop": 4, + "col_start": 9, + "col_stop": 15, + "path": "", + "content": " x -= 1;" + } + } + } + ], + "span": { + "line_start": 3, + "line_stop": 5, + "col_start": 19, + "col_stop": 6, + "path": "", + "content": " for i in 0..3 {\n...\n }" + } + }, + "span": { + "line_start": 3, + "line_stop": 5, + "col_start": 5, + "col_stop": 6, + "path": "", + "content": " for i in 0..3 {\n...\n }" + } + } + }, + { + "Console": { + "function": { + "Assert": { + "Binary": { + "left": { + "Identifier": "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(x == 7u16);\\\"}\"}" + }, + "right": { + "Value": { + "Integer": [ + "U16", + "7", + { + "line_start": 6, + "line_stop": 6, + "col_start": 25, + "col_stop": 29, + "path": "", + "content": " console.assert(x == 7u16);" + } + ] + } + }, + "op": "Eq", + "span": { + "line_start": 6, + "line_stop": 6, + "col_start": 20, + "col_stop": 29, + "path": "", + "content": " console.assert(x == 7u16);" + } + } + } + }, + "span": { + "line_start": 6, + "line_stop": 6, + "col_start": 5, + "col_stop": 29, + "path": "", + "content": " console.assert(x == 7u16);" + } + } + } + ], + "span": { + "line_start": 1, + "line_stop": 7, + "col_start": 17, + "col_stop": 2, + "path": "", + "content": "function main() {\n...\n}" + } + }, + "span": { + "line_start": 1, + "line_stop": 7, + "col_start": 1, + "col_stop": 2, + "path": "", + "content": "function main() {\n...\n}\n\n\n\n" + } + } + } + } \ No newline at end of file diff --git a/compiler/tests/type_inference/for_loop_and_compound.leo b/compiler/tests/type_inference/for_loop_and_compound.leo new file mode 100644 index 0000000000..92c27ff24b --- /dev/null +++ b/compiler/tests/type_inference/for_loop_and_compound.leo @@ -0,0 +1,7 @@ +function main() { + let x = 10u16; + for i in 0..3 { + x -= 1; + } + console.assert(x == 7u16); +} \ No newline at end of file diff --git a/compiler/tests/type_inference/mod.rs b/compiler/tests/type_inference/mod.rs new file mode 100644 index 0000000000..0e505442c7 --- /dev/null +++ b/compiler/tests/type_inference/mod.rs @@ -0,0 +1,115 @@ +// 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::{assert_satisfied, parse_program}; +#[allow(unused)] +use leo_asg::{new_context, Asg, AsgContext}; +use leo_ast::{Ast, ReconstructingReducer}; +use leo_compiler::{CombineAstAsgDirector, CompilerOptions}; +use leo_imports::ImportParser; +use leo_parser::parser; + +thread_local! { + static THREAD_GLOBAL_CONTEXT: AsgContext<'static> = { + let leaked = Box::leak(Box::new(leo_asg::new_alloc_context())); + leo_asg::new_context(leaked) + } +} + +pub fn thread_leaked_context() -> AsgContext<'static> { + THREAD_GLOBAL_CONTEXT.with(|f| *f) +} + +struct TypeInferenceCombiner { + in_circuit: bool, +} + +impl ReconstructingReducer for TypeInferenceCombiner { + fn in_circuit(&self) -> bool { + self.in_circuit + } + + fn swap_in_circuit(&mut self) { + self.in_circuit = !self.in_circuit; + } +} + +impl Default for TypeInferenceCombiner { + fn default() -> Self { + Self { in_circuit: false } + } +} + +pub fn parse_program_ast(file_string: &str) -> Ast { + const TEST_PROGRAM_PATH: &str = ""; + let test_program_file_path = std::path::PathBuf::from(TEST_PROGRAM_PATH); + + let mut ast = Ast::new( + parser::parse(test_program_file_path.to_str().expect("unwrap fail"), &file_string) + .expect("Failed to parse file."), + ); + ast.canonicalize().expect("Failed to canonicalize program."); + + let program = ast.clone().into_repr(); + let asg = Asg::new(thread_leaked_context(), &program, &mut ImportParser::default()) + .expect("Failed to create ASG from AST"); + + let new_ast = Ast::new( + CombineAstAsgDirector::new(TypeInferenceCombiner::default(), CompilerOptions::default()) + .reduce_program(&ast.clone().into_repr(), &asg.into_repr()) + .expect("Failed to convert ASG to AST"), + ); + + new_ast +} + +#[test] +fn test_basic() { + // Check program is valid. + let program_string = include_str!("basic.leo"); + let program = parse_program(program_string).unwrap(); + assert_satisfied(program); + + // Check we get expected ast. + let ast = parse_program_ast(program_string); + let expected_json = include_str!("basic.json"); + let expected_ast: Ast = Ast::from_json_string(expected_json).expect("Unable to parse json."); + + assert_eq!(expected_ast, ast); +} + +#[test] +fn test_for_loop_and_compound() { + // Check program is valid. + let program_string = include_str!("for_loop_and_compound.leo"); + let program = parse_program(program_string).unwrap(); + assert_satisfied(program); + + // Check we get expected ast. + let ast = parse_program_ast(program_string); + let expected_json = include_str!("for_loop_and_compound.json"); + let expected_ast: Ast = Ast::from_json_string(expected_json).expect("Unable to parse json."); + + assert_eq!(expected_ast, ast); +} + +// #[test] +// fn test_big_self_outside_circuit_fail() { +// // Check program is invalid. +// let program_string = include_str!("big_self_outside_circuit_fail.leo"); +// let program = parse_program(program_string); +// assert!(program.is_err()); +// } From fdf54ea9a164198b89165462a9136752df8440a0 Mon Sep 17 00:00:00 2001 From: gluax Date: Tue, 13 Apr 2021 13:36:16 -0400 Subject: [PATCH 19/41] make macro to make this easier --- compiler/src/option.rs | 11 ++++ compiler/src/stages/mod.rs | 3 ++ compiler/src/stages/reducing_director.rs | 25 +++++---- compiler/src/stages/stage.rs | 65 ++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 10 deletions(-) create mode 100644 compiler/src/stages/stage.rs diff --git a/compiler/src/option.rs b/compiler/src/option.rs index d66e7068ce..d5fde97243 100644 --- a/compiler/src/option.rs +++ b/compiler/src/option.rs @@ -25,6 +25,17 @@ pub struct CompilerOptions { pub type_inference_enabled: bool, } +impl CompilerOptions { + pub fn new_all_false() -> Self { + Self { + canonicalization_enabled: false, + constant_folding_enabled: false, + dead_code_elimination_enabled: false, + type_inference_enabled: false, + } + } +} + impl Default for CompilerOptions { /// /// All compiler optimizations are enabled by default. diff --git a/compiler/src/stages/mod.rs b/compiler/src/stages/mod.rs index b10097b2aa..41658f96af 100644 --- a/compiler/src/stages/mod.rs +++ b/compiler/src/stages/mod.rs @@ -18,3 +18,6 @@ pub mod reducing_director; pub use reducing_director::*; + +pub mod stage; +pub use stage::*; diff --git a/compiler/src/stages/reducing_director.rs b/compiler/src/stages/reducing_director.rs index 3ad9eedcf8..86bd6274d0 100644 --- a/compiler/src/stages/reducing_director.rs +++ b/compiler/src/stages/reducing_director.rs @@ -16,7 +16,6 @@ //! Compiles a Leo program from a file path. -use crate::CompilerOptions; use indexmap::IndexMap; use leo_asg::{ ArrayAccessExpression as AsgArrayAccessExpression, @@ -100,20 +99,26 @@ use leo_ast::{ }; use tendril::StrTendril; -pub struct CombineAstAsgDirector { - ast_reducer: R, - options: CompilerOptions, +pub trait CombinerOptions { + fn type_inference_enabled(&self) -> bool { + false + } } -impl CombineAstAsgDirector { - pub fn new(ast_reducer: R, options: CompilerOptions) -> Self { +pub struct CombineAstAsgDirector { + ast_reducer: R, + options: O, +} + +impl CombineAstAsgDirector { + pub fn new(ast_reducer: R, options: O) -> Self { Self { ast_reducer, options } } 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 { + if self.options.type_inference_enabled() { AstType::Array( Box::new(self.reduce_type(ast_type, asg_type, span)?), ArrayDimensions(vec![PositiveNumber { @@ -410,7 +415,7 @@ impl CombineAstAsgDirector { pub fn reduce_value(&mut self, ast: &ValueExpression, asg: &AsgConstant) -> Result { let mut new = ast.clone(); - if self.options.type_inference_enabled { + if self.options.type_inference_enabled() { if let ValueExpression::Implicit(tendril, span) = ast { match &asg.value { ConstValue::Int(int) => { @@ -631,7 +636,7 @@ impl CombineAstAsgDirector { type_ = match &ast.type_ { Some(ast_type) => Some(self.reduce_type(&ast_type, &asg_type, &ast.span)?), - None if self.options.type_inference_enabled => Some((&asg_type).into()), + None if self.options.type_inference_enabled() => Some((&asg_type).into()), _ => None, }; } else { @@ -639,7 +644,7 @@ impl CombineAstAsgDirector { Some(ast_type) => { Some(self.reduce_type(&ast_type, &asg.variables.first().unwrap().borrow().type_, &ast.span)?) } - None if self.options.type_inference_enabled => { + None if self.options.type_inference_enabled() => { Some((&asg.variables.first().unwrap().borrow().type_).into()) } _ => None, diff --git a/compiler/src/stages/stage.rs b/compiler/src/stages/stage.rs new file mode 100644 index 0000000000..2db1a117ed --- /dev/null +++ b/compiler/src/stages/stage.rs @@ -0,0 +1,65 @@ +// 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 . + +//! Compiles a Leo program from a file path. + +use crate::{CombineAstAsgDirector, CombinerOptions}; +use leo_asg::Program as AsgProgram; +use leo_ast::{Ast, Program as AstProgram, ReconstructingReducer, ReducerError}; + +macro_rules! stage { + ($stage_name:ident, $function:item) => { + pub struct $stage_name { + in_circuit: bool, + } + + pub struct Options; + + impl CombinerOptions for Options { + $function + } + + impl ReconstructingReducer for $stage_name { + fn in_circuit(&self) -> bool { + self.in_circuit + } + + fn swap_in_circuit(&mut self) { + self.in_circuit = !self.in_circuit; + } + } + + impl Default for $stage_name { + fn default() -> Self { + Self { in_circuit: false } + } + } + + impl $stage_name { + pub fn stage_ast(ast: &AstProgram, asg: &AsgProgram) -> Result { + Ok(Ast::new(CombineAstAsgDirector::new(Self::default(), Options{}) + .reduce_program(ast, asg)?)) + } + } + }; +} + +stage!( + TypeInferenceStage, + fn type_inference_enabled(&self) -> bool { + true + } +); From a54488b45f9dfd97b550ce4d53f682202a269bc7 Mon Sep 17 00:00:00 2001 From: gluax Date: Tue, 13 Apr 2021 13:49:16 -0400 Subject: [PATCH 20/41] use stage macro for cleaner type inference --- compiler/src/stages/stage.rs | 2 +- compiler/tests/type_inference/mod.rs | 32 +++++----------------------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/compiler/src/stages/stage.rs b/compiler/src/stages/stage.rs index 2db1a117ed..d388d5b19c 100644 --- a/compiler/src/stages/stage.rs +++ b/compiler/src/stages/stage.rs @@ -49,7 +49,7 @@ macro_rules! stage { } impl $stage_name { - pub fn stage_ast(ast: &AstProgram, asg: &AsgProgram) -> Result { + pub fn stage_ast(&self, ast: &AstProgram, asg: &AsgProgram) -> Result { Ok(Ast::new(CombineAstAsgDirector::new(Self::default(), Options{}) .reduce_program(ast, asg)?)) } diff --git a/compiler/tests/type_inference/mod.rs b/compiler/tests/type_inference/mod.rs index 0e505442c7..8544b51d4e 100644 --- a/compiler/tests/type_inference/mod.rs +++ b/compiler/tests/type_inference/mod.rs @@ -17,8 +17,8 @@ use crate::{assert_satisfied, parse_program}; #[allow(unused)] use leo_asg::{new_context, Asg, AsgContext}; -use leo_ast::{Ast, ReconstructingReducer}; -use leo_compiler::{CombineAstAsgDirector, CompilerOptions}; +use leo_ast::Ast; +use leo_compiler::TypeInferenceStage; use leo_imports::ImportParser; use leo_parser::parser; @@ -33,26 +33,6 @@ pub fn thread_leaked_context() -> AsgContext<'static> { THREAD_GLOBAL_CONTEXT.with(|f| *f) } -struct TypeInferenceCombiner { - in_circuit: bool, -} - -impl ReconstructingReducer for TypeInferenceCombiner { - fn in_circuit(&self) -> bool { - self.in_circuit - } - - fn swap_in_circuit(&mut self) { - self.in_circuit = !self.in_circuit; - } -} - -impl Default for TypeInferenceCombiner { - fn default() -> Self { - Self { in_circuit: false } - } -} - pub fn parse_program_ast(file_string: &str) -> Ast { const TEST_PROGRAM_PATH: &str = ""; let test_program_file_path = std::path::PathBuf::from(TEST_PROGRAM_PATH); @@ -67,11 +47,9 @@ pub fn parse_program_ast(file_string: &str) -> Ast { let asg = Asg::new(thread_leaked_context(), &program, &mut ImportParser::default()) .expect("Failed to create ASG from AST"); - let new_ast = Ast::new( - CombineAstAsgDirector::new(TypeInferenceCombiner::default(), CompilerOptions::default()) - .reduce_program(&ast.clone().into_repr(), &asg.into_repr()) - .expect("Failed to convert ASG to AST"), - ); + let new_ast = TypeInferenceStage::default() + .stage_ast(&program, &asg.into_repr()) + .expect("Failed to produce type inference ast."); new_ast } From dc5d75da854bc62379d9562122b3601b15142239 Mon Sep 17 00:00:00 2001 From: gluax Date: Tue, 13 Apr 2021 15:33:00 -0400 Subject: [PATCH 21/41] some clean up --- compiler/src/compiler.rs | 1 + compiler/src/option.rs | 13 ------------- compiler/src/stages/reducing_director.rs | 8 -------- 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/compiler/src/compiler.rs b/compiler/src/compiler.rs index 0b19ea3b77..a5a18c8cc3 100644 --- a/compiler/src/compiler.rs +++ b/compiler/src/compiler.rs @@ -216,6 +216,7 @@ impl<'a, F: PrimeField, G: GroupType> Compiler<'a, F, G> { // Use the parser to construct the abstract syntax tree (ast). let mut ast = parse_ast(self.main_file_path.to_str().unwrap_or_default(), program_string)?; + // Preform compiler optimization via canonicalizing AST if its enabled. if self.options.canonicalization_enabled { ast.canonicalize()?; diff --git a/compiler/src/option.rs b/compiler/src/option.rs index d5fde97243..be5f8964e5 100644 --- a/compiler/src/option.rs +++ b/compiler/src/option.rs @@ -22,18 +22,6 @@ pub struct CompilerOptions { pub canonicalization_enabled: bool, pub constant_folding_enabled: bool, pub dead_code_elimination_enabled: bool, - pub type_inference_enabled: bool, -} - -impl CompilerOptions { - pub fn new_all_false() -> Self { - Self { - canonicalization_enabled: false, - constant_folding_enabled: false, - dead_code_elimination_enabled: false, - type_inference_enabled: false, - } - } } impl Default for CompilerOptions { @@ -45,7 +33,6 @@ impl Default for CompilerOptions { canonicalization_enabled: true, constant_folding_enabled: true, dead_code_elimination_enabled: true, - type_inference_enabled: true, } } } diff --git a/compiler/src/stages/reducing_director.rs b/compiler/src/stages/reducing_director.rs index 86bd6274d0..d33d0d77c6 100644 --- a/compiler/src/stages/reducing_director.rs +++ b/compiler/src/stages/reducing_director.rs @@ -152,10 +152,6 @@ impl CombineAstAsgDirector { asg: &AsgExpression, ) -> Result { let new = match (ast, asg) { - // TODO what to do for the following: - // Ast::Identifier, Asg::ValueRef - - // AsgExpression::Identifier(identifier) => AsgExpression::Identifier(self.reduce_identifier(&identifier)?), (AstExpression::Value(value), AsgExpression::Constant(const_)) => { AstExpression::Value(self.reduce_value(&value, &const_)?) } @@ -313,11 +309,9 @@ impl CombineAstAsgDirector { ast: &CircuitMemberAccessExpression, _asg: &AsgCircuitAccessExpression, ) -> Result { - // TODO FIGURE IT OUT // 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)); - // does it matter? self.ast_reducer .reduce_circuit_member_access(ast, *ast.circuit.clone(), ast.name.clone()) @@ -328,11 +322,9 @@ impl CombineAstAsgDirector { ast: &CircuitStaticFunctionAccessExpression, _asg: &AsgCircuitAccessExpression, ) -> Result { - // TODO FIGURE IT OUT // 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)); - // does it matter? self.ast_reducer .reduce_circuit_static_fn_access(ast, *ast.circuit.clone(), ast.name.clone()) From f7ec5de7c9dd6d0ebf96201f320226d0adffaf56 Mon Sep 17 00:00:00 2001 From: gluax Date: Thu, 15 Apr 2021 17:08:30 -0400 Subject: [PATCH 22/41] fix address in test --- compiler/tests/type_inference/basic.leo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/tests/type_inference/basic.leo b/compiler/tests/type_inference/basic.leo index 9535d0448e..112d5bb338 100644 --- a/compiler/tests/type_inference/basic.leo +++ b/compiler/tests/type_inference/basic.leo @@ -9,7 +9,7 @@ function main() { const b = 1field; const c = 1group; const d = (0, 1)group; - const e = address(aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); + const e = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; const f = two(); const g = [0u8; (3, 2)]; const h = [[0u8; 3]; 2]; From 6e68444e5932be18e6df08d6279c7ea2edeccf2a Mon Sep 17 00:00:00 2001 From: "@damndam" Date: Sat, 17 Apr 2021 18:12:25 +0300 Subject: [PATCH 23/41] adds --api argument to leo binary --- leo/api.rs | 2 +- leo/context.rs | 8 ++++---- leo/main.rs | 11 +++++++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/leo/api.rs b/leo/api.rs index 311c1da53b..0087ebf35d 100644 --- a/leo/api.rs +++ b/leo/api.rs @@ -100,7 +100,7 @@ impl Api { }; // only one error is possible here - let res = res.send().map_err(|_| anyhow!("Unable to connect to Aleo PM"))?; + let res = res.send().map_err(|_| anyhow!("Unable to connect to Aleo PM. Check URL if you specified custom API endpoint"))?; // where magic begins route.process(res) diff --git a/leo/context.rs b/leo/context.rs index bddd54e5f2..f0314939ac 100644 --- a/leo/context.rs +++ b/leo/context.rs @@ -48,19 +48,19 @@ impl Context { } /// Create a new context for the current directory. -pub fn create_context(path: PathBuf) -> Result { +pub fn create_context(path: PathBuf, api_url: Option) -> Result { let token = config::read_token().ok(); - let api = Api::new(PACKAGE_MANAGER_URL.to_string(), token); + let api = Api::new(api_url.unwrap_or(PACKAGE_MANAGER_URL.to_string()), token); Ok(Context { api, path: Some(path) }) } /// Returns project context. -pub fn get_context() -> Result { +pub fn get_context(api_url: Option) -> Result { let token = config::read_token().ok(); - let api = Api::new(PACKAGE_MANAGER_URL.to_string(), token); + let api = Api::new(api_url.unwrap_or(PACKAGE_MANAGER_URL.to_string()), token); Ok(Context { api, path: None }) } diff --git a/leo/main.rs b/leo/main.rs index a0784f70fe..afd0bee32d 100644 --- a/leo/main.rs +++ b/leo/main.rs @@ -55,6 +55,13 @@ struct Opt { #[structopt(subcommand)] command: CommandOpts, + #[structopt( + long, + global = true, + help = "Aleo PM API Url" + )] + api: Option, + #[structopt( long, global = true, @@ -192,8 +199,8 @@ fn main() { // Get custom root folder and create context for it. // If not specified, default context will be created in cwd. let context = handle_error(match opt.path { - Some(path) => context::create_context(path), - None => context::get_context(), + Some(path) => context::create_context(path, opt.api), + None => context::get_context(opt.api), }); handle_error(match opt.command { From d933a49eb05f3687cf4650ea1b6e076cb8ee5307 Mon Sep 17 00:00:00 2001 From: Protryon Date: Mon, 19 Apr 2021 06:46:22 -0700 Subject: [PATCH 24/41] extract test framework --- Cargo.lock | 10 + Cargo.toml | 3 +- parser/Cargo.toml | 4 + parser/src/test.rs | 614 +++--------------- test-framework/Cargo.toml | 28 + test-framework/src/error.rs | 124 ++++ test-framework/src/fetch.rs | 56 ++ test-framework/src/lib.rs | 27 + test-framework/src/output.rs | 25 + test-framework/src/runner.rs | 196 ++++++ test-framework/src/test.rs | 34 + .../parser}/parser/circuits/big_self.leo.out | 16 +- .../parser}/parser/circuits/empty.leo.out | 4 +- .../circuits/field_and_functions.leo.out | 28 +- .../parser}/parser/circuits/fields.leo.out | 8 +- .../parser}/parser/circuits/functions.leo.out | 24 +- .../parser}/parser/circuits/mut_self.leo.out | 16 +- .../parser}/parser/circuits/self.leo.out | 16 +- .../expression/access/array_access.leo.out | 84 +-- .../access/array_range_access.leo.out | 130 ++-- .../parser/expression/access/call.leo.out | 68 +- .../parser/expression/access/circuit.leo.out | 48 +- .../expression/access/circuit_static.leo.out | 48 +- .../parser/expression/access/tuple.leo.out | 30 +- .../parser/expression/array_init.leo.out | 28 +- .../parser/expression/array_init_fail.leo.out | 0 .../parser/expression/array_inline.leo.out | 64 +- .../expression/array_inline_fail.leo.out | 0 .../parser/expression/binary/add.leo.out | 68 +- .../parser/expression/binary/and.leo.out | 22 +- .../parser/expression/binary/div.leo.out | 36 +- .../parser/expression/binary/eq.leo.out | 68 +- .../parser/expression/binary/exp.leo.out | 48 +- .../parser/expression/binary/gt.leo.out | 68 +- .../parser/expression/binary/gte.leo.out | 68 +- .../parser/expression/binary/lt.leo.out | 68 +- .../parser/expression/binary/lte.leo.out | 68 +- .../parser/expression/binary/mul.leo.out | 58 +- .../parser/expression/binary/ne.leo.out | 68 +- .../parser/expression/binary/or.leo.out | 68 +- .../parser/expression/binary/sub.leo.out | 36 +- .../parser}/parser/expression/cast.leo.out | 56 +- .../parser/expression/circuit_init.leo.out | 60 +- .../expression/circuit_init_fail.leo.out | 0 .../parser}/parser/expression/ident.leo.out | 38 +- .../parser/expression/literal/address.leo.out | 0 .../expression/literal/address_fail.leo.out | 0 .../expression/literal/address_parse.leo.out | 8 +- .../parser/expression/literal/bool.leo.out | 0 .../expression/literal/bool_parse.leo.out | 4 +- .../parser/expression/literal/comment.leo.out | 0 .../literal/formatted_string.leo.out | 0 .../parser/expression/literal/group.leo.out | 130 ++-- .../expression/literal/group_fail.leo.out | 0 .../parser/expression/literal/int.leo.out | 0 .../literal/int_parse/field.leo.out | 210 +++--- .../expression/literal/int_parse/i128.leo.out | 210 +++--- .../expression/literal/int_parse/i16.leo.out | 210 +++--- .../expression/literal/int_parse/i32.leo.out | 210 +++--- .../expression/literal/int_parse/i64.leo.out | 210 +++--- .../expression/literal/int_parse/i8.leo.out | 210 +++--- .../literal/int_parse/implicit.leo.out | 210 +++--- .../literal/int_parse/mono_group.leo.out | 210 +++--- .../expression/literal/int_parse/u128.leo.out | 210 +++--- .../expression/literal/int_parse/u16.leo.out | 210 +++--- .../expression/literal/int_parse/u32.leo.out | 210 +++--- .../expression/literal/int_parse/u64.leo.out | 210 +++--- .../expression/literal/int_parse/u8.leo.out | 210 +++--- .../expression/literal/postfix_types.leo.out | 0 .../parser}/parser/expression/ternary.leo.out | 36 +- .../parser}/parser/expression/tuple.leo.out | 32 +- .../parser/expression/unary/negate.leo.out | 38 +- .../parser/expression/unary/not.leo.out | 38 +- .../parser/functions/annotated.leo.out | 16 +- .../parser/functions/annotated_param.leo.out | 16 +- .../parser/functions/annotated_twice.leo.out | 20 +- .../parser/functions/const_input_fail.leo.out | 0 .../parser/functions/const_param.leo.out | 40 +- .../parser/functions/const_self_bad.leo.out | 14 +- .../parser}/parser/functions/empty.leo.out | 12 +- .../parser}/parser/functions/empty2.leo.out | 8 +- .../parser/functions/param_array.leo.out | 16 +- .../parser/functions/param_circuit.leo.out | 18 +- .../parser/functions/param_tuple.leo.out | 16 +- .../parser}/parser/functions/params.leo.out | 20 +- .../parser/functions/params_return.leo.out | 20 +- .../parser}/parser/functions/return.leo.out | 12 +- .../parser/functions/return_tuple.leo.out | 12 +- .../parser}/parser/import/alias.leo.out | 12 +- .../parser}/parser/import/basic.leo.out | 10 +- .../parser}/parser/import/many_import.leo.out | 48 +- .../parser/import/many_import_star.leo.out | 52 +- .../parser}/parser/import/names.leo.out | 30 +- .../parser/import/names_underscore.leo.out | 10 +- .../parser}/parser/import/star.leo.out | 8 +- .../parser}/parser/statement/assign.leo.out | 132 ++-- .../parser}/parser/statement/block.leo.out | 32 +- .../parser/statement/conditional.leo.out | 64 +- .../parser}/parser/statement/console.leo.out | 58 +- .../parser/statement/definition.leo.out | 500 +++++++------- .../parser/statement/definition_fail.leo.out | 0 .../parser/statement/expression.leo.out | 30 +- .../parser/statement/iteration.leo.out | 52 +- .../parser}/parser/statement/return.leo.out | 32 +- .../parser/statement/return_fail.leo.out | 0 tests/old/fail/address/empty.leo | 3 - tests/old/fail/address/invalid_length.leo | 3 - tests/old/fail/address/invalid_prefix.leo | 3 - tests/old/fail/array/initializer_fail.leo | 3 - tests/old/fail/array/type_fail.leo | 3 - tests/old/fail/circuits/self_circuit.leo | 9 - tests/old/fail/console/log_fail.leo | 3 - tests/old/fail/import/names_a_dash.leo | 3 - tests/old/fail/import/names_dash_a.leo | 3 - tests/old/fail/import/names_dollar.leo | 3 - tests/old/fail/syntax/address_fail.leo | 3 - tests/old/fail/syntax/console_fail.leo | 3 - tests/old/fail/syntax/field_fail.leo | 3 - tests/old/fail/syntax/group_fail.leo | 3 - tests/old/fail/syntax/i8_fail.leo | 3 - tests/old/fail/syntax/input_fail.leo | 3 - tests/old/fail/syntax/self_keyword_fail.leo | 3 - tests/old/fail/syntax/self_type_fail.leo | 3 - tests/old/fail/syntax/semicolon.leo | 3 - tests/old/fail/syntax/true_fail.leo | 3 - tests/old/fail/syntax/u8_fail.leo | 3 - .../old/pass/address/console_assert_fail.leo | 6 - .../old/pass/address/console_assert_pass.leo | 6 - tests/old/pass/address/equal.leo | 3 - tests/old/pass/address/implicit_invalid.leo | 3 - tests/old/pass/address/implicit_valid.leo | 3 - tests/old/pass/address/input.leo | 5 - tests/old/pass/address/ternary.leo | 8 - tests/old/pass/address/valid.leo | 3 - tests/old/pass/array/initializer.leo | 3 - tests/old/pass/array/initializer_input.leo | 3 - tests/old/pass/array/inline.leo | 3 - tests/old/pass/array/input_nested_3x2.leo | 3 - tests/old/pass/array/input_tuple_3x2.leo | 3 - tests/old/pass/array/input_tuple_3x2_fail.leo | 3 - .../old/pass/array/multi_fail_initializer.leo | 3 - tests/old/pass/array/multi_fail_inline.leo | 4 - tests/old/pass/array/multi_initializer.leo | 7 - .../old/pass/array/multi_initializer_fail.leo | 3 - tests/old/pass/array/nested.leo | 4 - tests/old/pass/array/nested_3x2_value.leo | 8 - .../old/pass/array/nested_3x2_value_fail.leo | 4 - tests/old/pass/array/registers.leo | 3 - tests/old/pass/array/slice.leo | 6 - tests/old/pass/array/slice_lower.leo | 8 - tests/old/pass/array/spread.leo | 7 - tests/old/pass/array/tuple_3x2_value.leo | 8 - tests/old/pass/array/tuple_3x2_value_fail.leo | 4 - tests/old/pass/array/type_input_3x2.leo | 5 - tests/old/pass/array/type_input_4x3x2.leo | 8 - .../array/type_nested_value_nested_3x2.leo | 7 - .../type_nested_value_nested_3x2_fail.leo | 3 - .../array/type_nested_value_nested_4x3x2.leo | 10 - .../type_nested_value_nested_4x3x2_fail.leo | 3 - .../array/type_nested_value_tuple_3x2.leo | 7 - .../type_nested_value_tuple_3x2_fail.leo | 3 - .../array/type_nested_value_tuple_4x3x2.leo | 10 - .../type_nested_value_tuple_4x3x2_fail.leo | 3 - .../array/type_tuple_value_nested_3x2.leo | 7 - .../type_tuple_value_nested_3x2_fail.leo | 3 - .../array/type_tuple_value_nested_4x3x2.leo | 10 - .../type_tuple_value_nested_4x3x2_fail.leo | 3 - .../pass/array/type_tuple_value_tuple_3x2.leo | 7 - .../array/type_tuple_value_tuple_3x2_fail.leo | 3 - .../array/type_tuple_value_tuple_4x3x2.leo | 10 - .../type_tuple_value_tuple_4x3x2_fail.leo | 3 - tests/old/pass/array/variable_slice_fail.leo | 7 - tests/old/pass/boolean/all.leo | 8 - tests/old/pass/boolean/assert_eq_input.leo | 3 - tests/old/pass/boolean/conditional_mut.leo | 6 - tests/old/pass/boolean/false_and_false.leo | 5 - tests/old/pass/boolean/false_or_false.leo | 5 - tests/old/pass/boolean/not_false.leo | 3 - tests/old/pass/boolean/not_mutable.leo | 4 - tests/old/pass/boolean/not_true.leo | 3 - tests/old/pass/boolean/not_u32.leo | 3 - tests/old/pass/boolean/output_register.leo | 3 - tests/old/pass/boolean/true_and_false.leo | 5 - tests/old/pass/boolean/true_and_true.leo | 5 - tests/old/pass/boolean/true_and_u32.leo | 3 - tests/old/pass/boolean/true_or_false.leo | 5 - tests/old/pass/boolean/true_or_true.leo | 5 - tests/old/pass/boolean/true_or_u32.leo | 3 - ...define_circuit_inside_circuit_function.leo | 13 - .../pass/circuits/duplicate_name_context.leo | 13 - tests/old/pass/circuits/inline.leo | 7 - tests/old/pass/circuits/inline_fail.leo | 7 - .../old/pass/circuits/inline_member_fail.leo | 8 - .../old/pass/circuits/inline_member_pass.leo | 13 - tests/old/pass/circuits/inline_undefined.leo | 3 - tests/old/pass/circuits/member_function.leo | 13 - .../pass/circuits/member_function_fail.leo | 10 - .../pass/circuits/member_function_invalid.leo | 10 - .../pass/circuits/member_function_nested.leo | 18 - .../pass/circuits/member_static_function.leo | 11 - .../member_static_function_invalid.leo | 9 - .../member_static_function_nested.leo | 15 - .../member_static_function_undefined.leo | 9 - tests/old/pass/circuits/member_variable.leo | 9 - .../circuits/member_variable_and_function.leo | 15 - .../pass/circuits/member_variable_fail.leo | 9 - tests/old/pass/circuits/mut_function_fail.leo | 11 - .../pass/circuits/mut_self_function_fail.leo | 15 - .../mut_self_static_function_fail.leo | 15 - tests/old/pass/circuits/mut_self_variable.leo | 22 - .../circuits/mut_self_variable_branch.leo | 32 - .../mut_self_variable_conditional.leo | 15 - .../pass/circuits/mut_self_variable_fail.leo | 13 - .../circuits/mut_static_function_fail.leo | 9 - tests/old/pass/circuits/mut_variable.leo | 17 - tests/old/pass/circuits/mut_variable_fail.leo | 9 - tests/old/pass/circuits/pedersen_mock.leo | 27 - tests/old/pass/circuits/self_fail.leo | 3 - tests/old/pass/circuits/self_member.leo | 14 - .../old/pass/circuits/self_member_invalid.leo | 12 - .../pass/circuits/self_member_undefined.leo | 10 - tests/old/pass/compiler/main.leo | 3 - tests/old/pass/console/assert.leo | 3 - tests/old/pass/console/conditional_assert.leo | 7 - tests/old/pass/console/debug.leo | 3 - tests/old/pass/console/error.leo | 3 - tests/old/pass/console/log.leo | 3 - tests/old/pass/console/log_conditional.leo | 6 - tests/old/pass/console/log_input.leo | 3 - tests/old/pass/console/log_parameter.leo | 3 - .../pass/console/log_parameter_fail_empty.leo | 3 - .../pass/console/log_parameter_fail_none.leo | 3 - .../console/log_parameter_fail_unknown.leo | 3 - tests/old/pass/console/log_parameter_many.leo | 3 - tests/old/pass/core/arguments_length_fail.leo | 9 - tests/old/pass/core/arguments_type_fail.leo | 10 - tests/old/pass/core/blake2s_input.leo | 5 - tests/old/pass/core/blake2s_random.leo | 7 - tests/old/pass/core/core_circuit_invalid.leo | 3 - .../old/pass/core/core_circuit_star_fail.leo | 3 - tests/old/pass/core/core_package_invalid.leo | 3 - .../core/core_unstable_package_invalid.leo | 3 - tests/old/pass/core/unstable_blake2s.leo | 10 - tests/old/pass/definition/out_of_order.leo | 6 - .../definition/out_of_order_with_import.leo | 7 - tests/old/pass/field/add.leo | 3 - tests/old/pass/field/console_assert.leo | 3 - tests/old/pass/field/div.leo | 3 - tests/old/pass/field/eq.leo | 3 - tests/old/pass/field/field.leo | 4 - tests/old/pass/field/mul.leo | 3 - tests/old/pass/field/negate.leo | 3 - tests/old/pass/field/sub.leo | 3 - tests/old/pass/field/ternary.leo | 5 - tests/old/pass/function/array_input.leo | 6 - .../function/array_params_direct_call.leo | 9 - .../old/pass/function/conditional_return.leo | 7 - tests/old/pass/function/empty.leo | 5 - tests/old/pass/function/iteration.leo | 13 - .../old/pass/function/iteration_repeated.leo | 15 - tests/old/pass/function/multiple_returns.leo | 10 - .../pass/function/multiple_returns_fail.leo | 7 - .../multiple_returns_fail_conditional.leo | 9 - .../pass/function/multiple_returns_main.leo | 3 - tests/old/pass/function/newlines.leo | 9 - tests/old/pass/function/repeated.leo | 9 - tests/old/pass/function/return.leo | 7 - .../function/return_array_nested_fail.leo | 7 - .../function/return_array_nested_pass.leo | 12 - .../pass/function/return_array_tuple_fail.leo | 7 - .../pass/function/return_array_tuple_pass.leo | 12 - tests/old/pass/function/return_tuple.leo | 11 - .../function/return_tuple_conditional.leo | 15 - tests/old/pass/function/scope_fail.leo | 8 - tests/old/pass/function/undefined.leo | 3 - tests/old/pass/function/value_unchanged.leo | 19 - tests/old/pass/group/add.leo | 3 - tests/old/pass/group/assert_eq.leo | 3 - tests/old/pass/group/both_sign_high.leo | 3 - tests/old/pass/group/both_sign_inferred.leo | 3 - tests/old/pass/group/both_sign_low.leo | 3 - tests/old/pass/group/eq.leo | 3 - tests/old/pass/group/input.leo | 3 - tests/old/pass/group/negate.leo | 3 - tests/old/pass/group/one.leo | 3 - tests/old/pass/group/point.leo | 3 - tests/old/pass/group/point_input.leo | 3 - .../old/pass/group/positive_and_negative.leo | 10 - tests/old/pass/group/sub.leo | 3 - tests/old/pass/group/ternary.leo | 5 - tests/old/pass/group/x_and_y.leo | 3 - tests/old/pass/group/x_sign_high.leo | 3 - tests/old/pass/group/x_sign_inferred.leo | 3 - tests/old/pass/group/x_sign_low.leo | 3 - tests/old/pass/group/y_sign_high.leo | 3 - tests/old/pass/group/y_sign_inferred.leo | 3 - tests/old/pass/group/y_sign_low.leo | 3 - tests/old/pass/group/zero.leo | 3 - tests/old/pass/import/a-9.leo | 1 - tests/old/pass/import/a0-f.leo | 1 - tests/old/pass/import/alias.leo | 5 - tests/old/pass/import/basic.leo | 5 - tests/old/pass/import/bat.leo | 3 - tests/old/pass/import/baz.leo | 7 - tests/old/pass/import/hello-world.leo | 1 - tests/old/pass/import/lib.leo | 3 - tests/old/pass/import/many_import.leo | 26 - tests/old/pass/import/many_import_star.leo | 19 - tests/old/pass/import/multiple.leo | 10 - tests/old/pass/import/names.leo | 5 - tests/old/pass/import/names_underscore.leo | 3 - tests/old/pass/import/star.leo | 7 - tests/old/pass/import/star_fail.leo | 4 - tests/old/pass/import/test-import.leo | 8 - tests/old/pass/integers/i128/add.leo | 3 - .../old/pass/integers/i128/console_assert.leo | 3 - tests/old/pass/integers/i128/div.leo | 3 - tests/old/pass/integers/i128/eq.leo | 3 - tests/old/pass/integers/i128/ge.leo | 3 - tests/old/pass/integers/i128/gt.leo | 3 - tests/old/pass/integers/i128/input.leo | 3 - tests/old/pass/integers/i128/le.leo | 3 - tests/old/pass/integers/i128/lt.leo | 3 - tests/old/pass/integers/i128/max.leo | 3 - tests/old/pass/integers/i128/max_fail.leo | 3 - tests/old/pass/integers/i128/min.leo | 3 - tests/old/pass/integers/i128/min_fail.leo | 3 - tests/old/pass/integers/i128/mod.rs | 134 ---- tests/old/pass/integers/i128/mul.leo | 3 - tests/old/pass/integers/i128/ne.leo | 3 - tests/old/pass/integers/i128/negate.leo | 3 - tests/old/pass/integers/i128/negate_min.leo | 4 - tests/old/pass/integers/i128/negate_zero.leo | 5 - tests/old/pass/integers/i128/pow.leo | 3 - tests/old/pass/integers/i128/sub.leo | 3 - tests/old/pass/integers/i128/ternary.leo | 5 - tests/old/pass/integers/i16/add.leo | 3 - .../old/pass/integers/i16/console_assert.leo | 3 - tests/old/pass/integers/i16/div.leo | 3 - tests/old/pass/integers/i16/eq.leo | 3 - tests/old/pass/integers/i16/ge.leo | 3 - tests/old/pass/integers/i16/gt.leo | 3 - tests/old/pass/integers/i16/input.leo | 3 - tests/old/pass/integers/i16/le.leo | 3 - tests/old/pass/integers/i16/lt.leo | 3 - tests/old/pass/integers/i16/max.leo | 3 - tests/old/pass/integers/i16/max_fail.leo | 3 - tests/old/pass/integers/i16/min.leo | 3 - tests/old/pass/integers/i16/min_fail.leo | 3 - tests/old/pass/integers/i16/mod.rs | 133 ---- tests/old/pass/integers/i16/mul.leo | 3 - tests/old/pass/integers/i16/ne.leo | 3 - tests/old/pass/integers/i16/negate.leo | 3 - tests/old/pass/integers/i16/negate_min.leo | 4 - tests/old/pass/integers/i16/negate_zero.leo | 5 - tests/old/pass/integers/i16/pow.leo | 3 - tests/old/pass/integers/i16/sub.leo | 3 - tests/old/pass/integers/i16/ternary.leo | 5 - tests/old/pass/integers/i32/add.leo | 3 - .../old/pass/integers/i32/console_assert.leo | 3 - tests/old/pass/integers/i32/div.leo | 3 - tests/old/pass/integers/i32/eq.leo | 3 - tests/old/pass/integers/i32/ge.leo | 3 - tests/old/pass/integers/i32/gt.leo | 3 - tests/old/pass/integers/i32/input.leo | 3 - tests/old/pass/integers/i32/le.leo | 3 - tests/old/pass/integers/i32/lt.leo | 3 - tests/old/pass/integers/i32/max.leo | 3 - tests/old/pass/integers/i32/max_fail.leo | 3 - tests/old/pass/integers/i32/min.leo | 3 - tests/old/pass/integers/i32/min_fail.leo | 3 - tests/old/pass/integers/i32/mod.rs | 133 ---- tests/old/pass/integers/i32/mul.leo | 3 - tests/old/pass/integers/i32/ne.leo | 3 - tests/old/pass/integers/i32/negate.leo | 3 - tests/old/pass/integers/i32/negate_min.leo | 4 - tests/old/pass/integers/i32/negate_zero.leo | 5 - tests/old/pass/integers/i32/pow.leo | 3 - tests/old/pass/integers/i32/sub.leo | 3 - tests/old/pass/integers/i32/ternary.leo | 5 - tests/old/pass/integers/i64/add.leo | 3 - .../old/pass/integers/i64/console_assert.leo | 3 - tests/old/pass/integers/i64/div.leo | 3 - tests/old/pass/integers/i64/eq.leo | 3 - tests/old/pass/integers/i64/ge.leo | 3 - tests/old/pass/integers/i64/gt.leo | 3 - tests/old/pass/integers/i64/input.leo | 3 - tests/old/pass/integers/i64/le.leo | 3 - tests/old/pass/integers/i64/lt.leo | 3 - tests/old/pass/integers/i64/max.leo | 3 - tests/old/pass/integers/i64/max_fail.leo | 3 - tests/old/pass/integers/i64/min.leo | 3 - tests/old/pass/integers/i64/min_fail.leo | 3 - tests/old/pass/integers/i64/mod.rs | 134 ---- tests/old/pass/integers/i64/mul.leo | 3 - tests/old/pass/integers/i64/ne.leo | 3 - tests/old/pass/integers/i64/negate.leo | 3 - tests/old/pass/integers/i64/negate_min.leo | 4 - tests/old/pass/integers/i64/negate_zero.leo | 5 - tests/old/pass/integers/i64/pow.leo | 3 - tests/old/pass/integers/i64/sub.leo | 3 - tests/old/pass/integers/i64/ternary.leo | 5 - tests/old/pass/integers/i8/add.leo | 3 - tests/old/pass/integers/i8/console_assert.leo | 3 - tests/old/pass/integers/i8/div.leo | 3 - tests/old/pass/integers/i8/eq.leo | 3 - tests/old/pass/integers/i8/ge.leo | 3 - tests/old/pass/integers/i8/gt.leo | 3 - tests/old/pass/integers/i8/input.leo | 3 - tests/old/pass/integers/i8/le.leo | 3 - tests/old/pass/integers/i8/lt.leo | 3 - tests/old/pass/integers/i8/max.leo | 3 - tests/old/pass/integers/i8/max_fail.leo | 3 - tests/old/pass/integers/i8/min.leo | 3 - tests/old/pass/integers/i8/min_fail.leo | 3 - tests/old/pass/integers/i8/mod.rs | 133 ---- tests/old/pass/integers/i8/mul.leo | 3 - tests/old/pass/integers/i8/ne.leo | 3 - tests/old/pass/integers/i8/negate.leo | 3 - tests/old/pass/integers/i8/negate_min.leo | 4 - tests/old/pass/integers/i8/negate_zero.leo | 5 - tests/old/pass/integers/i8/pow.leo | 3 - tests/old/pass/integers/i8/sub.leo | 3 - tests/old/pass/integers/i8/ternary.leo | 5 - tests/old/pass/integers/u128/add.leo | 3 - .../old/pass/integers/u128/console_assert.leo | 3 - tests/old/pass/integers/u128/div.leo | 3 - tests/old/pass/integers/u128/eq.leo | 3 - tests/old/pass/integers/u128/ge.leo | 3 - tests/old/pass/integers/u128/gt.leo | 3 - tests/old/pass/integers/u128/input.leo | 3 - tests/old/pass/integers/u128/le.leo | 3 - tests/old/pass/integers/u128/lt.leo | 3 - tests/old/pass/integers/u128/max.leo | 3 - tests/old/pass/integers/u128/max_fail.leo | 3 - tests/old/pass/integers/u128/min.leo | 3 - tests/old/pass/integers/u128/min_fail.leo | 3 - tests/old/pass/integers/u128/mod.rs | 118 ---- tests/old/pass/integers/u128/mul.leo | 3 - tests/old/pass/integers/u128/ne.leo | 3 - tests/old/pass/integers/u128/pow.leo | 3 - tests/old/pass/integers/u128/sub.leo | 3 - tests/old/pass/integers/u128/ternary.leo | 5 - tests/old/pass/integers/u16/add.leo | 3 - .../old/pass/integers/u16/console_assert.leo | 3 - tests/old/pass/integers/u16/div.leo | 3 - tests/old/pass/integers/u16/eq.leo | 3 - tests/old/pass/integers/u16/ge.leo | 3 - tests/old/pass/integers/u16/gt.leo | 3 - tests/old/pass/integers/u16/input.leo | 3 - tests/old/pass/integers/u16/le.leo | 3 - tests/old/pass/integers/u16/lt.leo | 3 - tests/old/pass/integers/u16/max.leo | 3 - tests/old/pass/integers/u16/max_fail.leo | 3 - tests/old/pass/integers/u16/min.leo | 3 - tests/old/pass/integers/u16/min_fail.leo | 3 - tests/old/pass/integers/u16/mod.rs | 118 ---- tests/old/pass/integers/u16/mul.leo | 3 - tests/old/pass/integers/u16/ne.leo | 3 - tests/old/pass/integers/u16/pow.leo | 3 - tests/old/pass/integers/u16/sub.leo | 3 - tests/old/pass/integers/u16/ternary.leo | 5 - tests/old/pass/integers/u32/add.leo | 3 - .../old/pass/integers/u32/console_assert.leo | 3 - tests/old/pass/integers/u32/div.leo | 3 - tests/old/pass/integers/u32/eq.leo | 3 - tests/old/pass/integers/u32/ge.leo | 3 - tests/old/pass/integers/u32/gt.leo | 3 - tests/old/pass/integers/u32/input.leo | 3 - tests/old/pass/integers/u32/le.leo | 3 - tests/old/pass/integers/u32/lt.leo | 3 - tests/old/pass/integers/u32/max.leo | 3 - tests/old/pass/integers/u32/max_fail.leo | 3 - tests/old/pass/integers/u32/min.leo | 3 - tests/old/pass/integers/u32/min_fail.leo | 3 - tests/old/pass/integers/u32/mod.rs | 118 ---- tests/old/pass/integers/u32/mul.leo | 3 - tests/old/pass/integers/u32/ne.leo | 3 - tests/old/pass/integers/u32/pow.leo | 3 - tests/old/pass/integers/u32/sub.leo | 3 - tests/old/pass/integers/u32/ternary.leo | 5 - tests/old/pass/integers/u64/add.leo | 3 - .../old/pass/integers/u64/console_assert.leo | 3 - tests/old/pass/integers/u64/div.leo | 3 - tests/old/pass/integers/u64/eq.leo | 3 - tests/old/pass/integers/u64/ge.leo | 3 - tests/old/pass/integers/u64/gt.leo | 3 - tests/old/pass/integers/u64/input.leo | 3 - tests/old/pass/integers/u64/le.leo | 3 - tests/old/pass/integers/u64/lt.leo | 3 - tests/old/pass/integers/u64/max.leo | 3 - tests/old/pass/integers/u64/max_fail.leo | 3 - tests/old/pass/integers/u64/min.leo | 3 - tests/old/pass/integers/u64/min_fail.leo | 3 - tests/old/pass/integers/u64/mod.rs | 118 ---- tests/old/pass/integers/u64/mul.leo | 3 - tests/old/pass/integers/u64/ne.leo | 3 - tests/old/pass/integers/u64/pow.leo | 3 - tests/old/pass/integers/u64/sub.leo | 3 - tests/old/pass/integers/u64/ternary.leo | 5 - tests/old/pass/integers/u8/add.leo | 3 - tests/old/pass/integers/u8/console_assert.leo | 3 - tests/old/pass/integers/u8/div.leo | 3 - tests/old/pass/integers/u8/eq.leo | 3 - tests/old/pass/integers/u8/ge.leo | 3 - tests/old/pass/integers/u8/gt.leo | 3 - tests/old/pass/integers/u8/input.leo | 3 - tests/old/pass/integers/u8/le.leo | 3 - tests/old/pass/integers/u8/lt.leo | 3 - tests/old/pass/integers/u8/max.leo | 3 - tests/old/pass/integers/u8/max_fail.leo | 3 - tests/old/pass/integers/u8/min.leo | 3 - tests/old/pass/integers/u8/min_fail.leo | 3 - tests/old/pass/integers/u8/mod.rs | 118 ---- tests/old/pass/integers/u8/mul.leo | 3 - tests/old/pass/integers/u8/ne.leo | 3 - tests/old/pass/integers/u8/pow.leo | 3 - tests/old/pass/integers/u8/sub.leo | 3 - tests/old/pass/integers/u8/ternary.leo | 5 - tests/old/pass/mutability/array.leo | 5 - tests/old/pass/mutability/array_mut.leo | 7 - .../old/pass/mutability/array_splice_mut.leo | 9 - tests/old/pass/mutability/array_tuple_mut.leo | 8 - tests/old/pass/mutability/circuit.leo | 9 - .../pass/mutability/circuit_function_mut.leo | 9 - tests/old/pass/mutability/circuit_mut.leo | 11 - .../circuit_static_function_mut.leo | 9 - .../pass/mutability/circuit_variable_mut.leo | 11 - tests/old/pass/mutability/const.leo | 5 - tests/old/pass/mutability/function_input.leo | 4 - .../pass/mutability/function_input_mut.leo | 6 - tests/old/pass/mutability/let.leo | 5 - tests/old/pass/mutability/let_mut.leo | 7 - tests/old/pass/mutability/let_mut_nested.leo | 5 - tests/old/pass/mutability/swap.leo | 20 - tests/old/pass/statements/assert.leo | 7 - tests/old/pass/statements/block.leo | 9 - tests/old/pass/statements/chain.leo | 13 - tests/old/pass/statements/for_loop.leo | 13 - tests/old/pass/statements/iteration_basic.leo | 8 - .../old/pass/statements/multiple_returns.leo | 7 - tests/old/pass/statements/mutate.leo | 15 - tests/old/pass/statements/nested.leo | 12 - .../old/pass/statements/num_returns_fail.leo | 3 - tests/old/pass/statements/ternary_basic.leo | 5 - .../pass/syntax/compare_mismatched_types.leo | 3 - tests/old/pass/syntax/undefined.leo | 3 - tests/old/pass/tuples/access.leo | 6 - tests/old/pass/tuples/basic.leo | 3 - tests/old/pass/tuples/function.leo | 10 - tests/old/pass/tuples/function_multiple.leo | 10 - tests/old/pass/tuples/function_typed.leo | 10 - tests/old/pass/tuples/input.leo | 3 - tests/old/pass/tuples/multiple.leo | 6 - tests/old/pass/tuples/multiple_typed.leo | 6 - tests/old/pass/tuples/nested.leo | 4 - tests/old/pass/tuples/nested_access.leo | 8 - tests/old/pass/tuples/nested_typed.leo | 4 - tests/old/pass/tuples/typed.leo | 3 - .../parser/functions/input_typed_fail.leo.out | 5 - 560 files changed, 3523 insertions(+), 6935 deletions(-) create mode 100644 test-framework/Cargo.toml create mode 100644 test-framework/src/error.rs create mode 100644 test-framework/src/fetch.rs create mode 100644 test-framework/src/lib.rs create mode 100644 test-framework/src/output.rs create mode 100644 test-framework/src/runner.rs create mode 100644 test-framework/src/test.rs rename tests/{ => expectations/parser}/parser/circuits/big_self.leo.out (78%) rename tests/{ => expectations/parser}/parser/circuits/empty.leo.out (74%) rename tests/{ => expectations/parser}/parser/circuits/field_and_functions.leo.out (78%) rename tests/{ => expectations/parser}/parser/circuits/fields.leo.out (73%) rename tests/{ => expectations/parser}/parser/circuits/functions.leo.out (82%) rename tests/{ => expectations/parser}/parser/circuits/mut_self.leo.out (78%) rename tests/{ => expectations/parser}/parser/circuits/self.leo.out (79%) rename tests/{ => expectations/parser}/parser/expression/access/array_access.leo.out (76%) rename tests/{ => expectations/parser}/parser/expression/access/array_range_access.leo.out (74%) rename tests/{ => expectations/parser}/parser/expression/access/call.leo.out (75%) rename tests/{ => expectations/parser}/parser/expression/access/circuit.leo.out (75%) rename tests/{ => expectations/parser}/parser/expression/access/circuit_static.leo.out (73%) rename tests/{ => expectations/parser}/parser/expression/access/tuple.leo.out (80%) rename tests/{ => expectations/parser}/parser/expression/array_init.leo.out (86%) rename tests/{ => expectations/parser}/parser/expression/array_init_fail.leo.out (100%) rename tests/{ => expectations/parser}/parser/expression/array_inline.leo.out (85%) rename tests/{ => expectations/parser}/parser/expression/array_inline_fail.leo.out (100%) rename tests/{ => expectations/parser}/parser/expression/binary/add.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/binary/and.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/binary/div.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/binary/eq.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/binary/exp.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/binary/gt.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/binary/gte.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/binary/lt.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/binary/lte.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/binary/mul.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/binary/ne.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/binary/or.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/binary/sub.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/cast.leo.out (78%) rename tests/{ => expectations/parser}/parser/expression/circuit_init.leo.out (70%) rename tests/{ => expectations/parser}/parser/expression/circuit_init_fail.leo.out (100%) rename tests/{ => expectations/parser}/parser/expression/ident.leo.out (66%) rename tests/{ => expectations/parser}/parser/expression/literal/address.leo.out (100%) rename tests/{ => expectations/parser}/parser/expression/literal/address_fail.leo.out (100%) rename tests/{ => expectations/parser}/parser/expression/literal/address_parse.leo.out (89%) rename tests/{ => expectations/parser}/parser/expression/literal/bool.leo.out (100%) rename tests/{ => expectations/parser}/parser/expression/literal/bool_parse.leo.out (86%) rename tests/{ => expectations/parser}/parser/expression/literal/comment.leo.out (100%) rename tests/{ => expectations/parser}/parser/expression/literal/formatted_string.leo.out (100%) rename tests/{ => expectations/parser}/parser/expression/literal/group.leo.out (87%) rename tests/{ => expectations/parser}/parser/expression/literal/group_fail.leo.out (100%) rename tests/{ => expectations/parser}/parser/expression/literal/int.leo.out (100%) rename tests/{ => expectations/parser}/parser/expression/literal/int_parse/field.leo.out (87%) rename tests/{ => expectations/parser}/parser/expression/literal/int_parse/i128.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/literal/int_parse/i16.leo.out (89%) rename tests/{ => expectations/parser}/parser/expression/literal/int_parse/i32.leo.out (89%) rename tests/{ => expectations/parser}/parser/expression/literal/int_parse/i64.leo.out (89%) rename tests/{ => expectations/parser}/parser/expression/literal/int_parse/i8.leo.out (89%) rename tests/{ => expectations/parser}/parser/expression/literal/int_parse/implicit.leo.out (86%) rename tests/{ => expectations/parser}/parser/expression/literal/int_parse/mono_group.leo.out (86%) rename tests/{ => expectations/parser}/parser/expression/literal/int_parse/u128.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/literal/int_parse/u16.leo.out (88%) rename tests/{ => expectations/parser}/parser/expression/literal/int_parse/u32.leo.out (89%) rename tests/{ => expectations/parser}/parser/expression/literal/int_parse/u64.leo.out (89%) rename tests/{ => expectations/parser}/parser/expression/literal/int_parse/u8.leo.out (89%) rename tests/{ => expectations/parser}/parser/expression/literal/postfix_types.leo.out (100%) rename tests/{ => expectations/parser}/parser/expression/ternary.leo.out (69%) rename tests/{ => expectations/parser}/parser/expression/tuple.leo.out (77%) rename tests/{ => expectations/parser}/parser/expression/unary/negate.leo.out (78%) rename tests/{ => expectations/parser}/parser/expression/unary/not.leo.out (79%) rename tests/{ => expectations/parser}/parser/functions/annotated.leo.out (80%) rename tests/{ => expectations/parser}/parser/functions/annotated_param.leo.out (78%) rename tests/{ => expectations/parser}/parser/functions/annotated_twice.leo.out (77%) rename tests/{ => expectations/parser}/parser/functions/const_input_fail.leo.out (100%) rename tests/{ => expectations/parser}/parser/functions/const_param.leo.out (77%) rename tests/{ => expectations/parser}/parser/functions/const_self_bad.leo.out (76%) rename tests/{ => expectations/parser}/parser/functions/empty.leo.out (83%) rename tests/{ => expectations/parser}/parser/functions/empty2.leo.out (79%) rename tests/{ => expectations/parser}/parser/functions/param_array.leo.out (79%) rename tests/{ => expectations/parser}/parser/functions/param_circuit.leo.out (77%) rename tests/{ => expectations/parser}/parser/functions/param_tuple.leo.out (79%) rename tests/{ => expectations/parser}/parser/functions/params.leo.out (80%) rename tests/{ => expectations/parser}/parser/functions/params_return.leo.out (77%) rename tests/{ => expectations/parser}/parser/functions/return.leo.out (82%) rename tests/{ => expectations/parser}/parser/functions/return_tuple.leo.out (80%) rename tests/{ => expectations/parser}/parser/import/alias.leo.out (76%) rename tests/{ => expectations/parser}/parser/import/basic.leo.out (80%) rename tests/{ => expectations/parser}/parser/import/many_import.leo.out (75%) rename tests/{ => expectations/parser}/parser/import/many_import_star.leo.out (75%) rename tests/{ => expectations/parser}/parser/import/names.leo.out (77%) rename tests/{ => expectations/parser}/parser/import/names_underscore.leo.out (75%) rename tests/{ => expectations/parser}/parser/import/star.leo.out (82%) rename tests/{ => expectations/parser}/parser/statement/assign.leo.out (78%) rename tests/{ => expectations/parser}/parser/statement/block.leo.out (86%) rename tests/{ => expectations/parser}/parser/statement/conditional.leo.out (79%) rename tests/{ => expectations/parser}/parser/statement/console.leo.out (76%) rename tests/{ => expectations/parser}/parser/statement/definition.leo.out (75%) rename tests/{ => expectations/parser}/parser/statement/definition_fail.leo.out (100%) rename tests/{ => expectations/parser}/parser/statement/expression.leo.out (76%) rename tests/{ => expectations/parser}/parser/statement/iteration.leo.out (82%) rename tests/{ => expectations/parser}/parser/statement/return.leo.out (78%) rename tests/{ => expectations/parser}/parser/statement/return_fail.leo.out (100%) delete mode 100644 tests/old/fail/address/empty.leo delete mode 100644 tests/old/fail/address/invalid_length.leo delete mode 100644 tests/old/fail/address/invalid_prefix.leo delete mode 100644 tests/old/fail/array/initializer_fail.leo delete mode 100644 tests/old/fail/array/type_fail.leo delete mode 100644 tests/old/fail/circuits/self_circuit.leo delete mode 100644 tests/old/fail/console/log_fail.leo delete mode 100644 tests/old/fail/import/names_a_dash.leo delete mode 100644 tests/old/fail/import/names_dash_a.leo delete mode 100644 tests/old/fail/import/names_dollar.leo delete mode 100644 tests/old/fail/syntax/address_fail.leo delete mode 100644 tests/old/fail/syntax/console_fail.leo delete mode 100644 tests/old/fail/syntax/field_fail.leo delete mode 100644 tests/old/fail/syntax/group_fail.leo delete mode 100644 tests/old/fail/syntax/i8_fail.leo delete mode 100644 tests/old/fail/syntax/input_fail.leo delete mode 100644 tests/old/fail/syntax/self_keyword_fail.leo delete mode 100644 tests/old/fail/syntax/self_type_fail.leo delete mode 100644 tests/old/fail/syntax/semicolon.leo delete mode 100644 tests/old/fail/syntax/true_fail.leo delete mode 100644 tests/old/fail/syntax/u8_fail.leo delete mode 100644 tests/old/pass/address/console_assert_fail.leo delete mode 100644 tests/old/pass/address/console_assert_pass.leo delete mode 100644 tests/old/pass/address/equal.leo delete mode 100644 tests/old/pass/address/implicit_invalid.leo delete mode 100644 tests/old/pass/address/implicit_valid.leo delete mode 100644 tests/old/pass/address/input.leo delete mode 100644 tests/old/pass/address/ternary.leo delete mode 100644 tests/old/pass/address/valid.leo delete mode 100644 tests/old/pass/array/initializer.leo delete mode 100644 tests/old/pass/array/initializer_input.leo delete mode 100644 tests/old/pass/array/inline.leo delete mode 100644 tests/old/pass/array/input_nested_3x2.leo delete mode 100644 tests/old/pass/array/input_tuple_3x2.leo delete mode 100644 tests/old/pass/array/input_tuple_3x2_fail.leo delete mode 100644 tests/old/pass/array/multi_fail_initializer.leo delete mode 100644 tests/old/pass/array/multi_fail_inline.leo delete mode 100644 tests/old/pass/array/multi_initializer.leo delete mode 100644 tests/old/pass/array/multi_initializer_fail.leo delete mode 100644 tests/old/pass/array/nested.leo delete mode 100644 tests/old/pass/array/nested_3x2_value.leo delete mode 100644 tests/old/pass/array/nested_3x2_value_fail.leo delete mode 100644 tests/old/pass/array/registers.leo delete mode 100644 tests/old/pass/array/slice.leo delete mode 100644 tests/old/pass/array/slice_lower.leo delete mode 100644 tests/old/pass/array/spread.leo delete mode 100644 tests/old/pass/array/tuple_3x2_value.leo delete mode 100644 tests/old/pass/array/tuple_3x2_value_fail.leo delete mode 100644 tests/old/pass/array/type_input_3x2.leo delete mode 100644 tests/old/pass/array/type_input_4x3x2.leo delete mode 100644 tests/old/pass/array/type_nested_value_nested_3x2.leo delete mode 100644 tests/old/pass/array/type_nested_value_nested_3x2_fail.leo delete mode 100644 tests/old/pass/array/type_nested_value_nested_4x3x2.leo delete mode 100644 tests/old/pass/array/type_nested_value_nested_4x3x2_fail.leo delete mode 100644 tests/old/pass/array/type_nested_value_tuple_3x2.leo delete mode 100644 tests/old/pass/array/type_nested_value_tuple_3x2_fail.leo delete mode 100644 tests/old/pass/array/type_nested_value_tuple_4x3x2.leo delete mode 100644 tests/old/pass/array/type_nested_value_tuple_4x3x2_fail.leo delete mode 100644 tests/old/pass/array/type_tuple_value_nested_3x2.leo delete mode 100644 tests/old/pass/array/type_tuple_value_nested_3x2_fail.leo delete mode 100644 tests/old/pass/array/type_tuple_value_nested_4x3x2.leo delete mode 100644 tests/old/pass/array/type_tuple_value_nested_4x3x2_fail.leo delete mode 100644 tests/old/pass/array/type_tuple_value_tuple_3x2.leo delete mode 100644 tests/old/pass/array/type_tuple_value_tuple_3x2_fail.leo delete mode 100644 tests/old/pass/array/type_tuple_value_tuple_4x3x2.leo delete mode 100644 tests/old/pass/array/type_tuple_value_tuple_4x3x2_fail.leo delete mode 100644 tests/old/pass/array/variable_slice_fail.leo delete mode 100644 tests/old/pass/boolean/all.leo delete mode 100644 tests/old/pass/boolean/assert_eq_input.leo delete mode 100644 tests/old/pass/boolean/conditional_mut.leo delete mode 100644 tests/old/pass/boolean/false_and_false.leo delete mode 100644 tests/old/pass/boolean/false_or_false.leo delete mode 100644 tests/old/pass/boolean/not_false.leo delete mode 100644 tests/old/pass/boolean/not_mutable.leo delete mode 100644 tests/old/pass/boolean/not_true.leo delete mode 100644 tests/old/pass/boolean/not_u32.leo delete mode 100644 tests/old/pass/boolean/output_register.leo delete mode 100644 tests/old/pass/boolean/true_and_false.leo delete mode 100644 tests/old/pass/boolean/true_and_true.leo delete mode 100644 tests/old/pass/boolean/true_and_u32.leo delete mode 100644 tests/old/pass/boolean/true_or_false.leo delete mode 100644 tests/old/pass/boolean/true_or_true.leo delete mode 100644 tests/old/pass/boolean/true_or_u32.leo delete mode 100644 tests/old/pass/circuits/define_circuit_inside_circuit_function.leo delete mode 100644 tests/old/pass/circuits/duplicate_name_context.leo delete mode 100644 tests/old/pass/circuits/inline.leo delete mode 100644 tests/old/pass/circuits/inline_fail.leo delete mode 100644 tests/old/pass/circuits/inline_member_fail.leo delete mode 100644 tests/old/pass/circuits/inline_member_pass.leo delete mode 100644 tests/old/pass/circuits/inline_undefined.leo delete mode 100644 tests/old/pass/circuits/member_function.leo delete mode 100644 tests/old/pass/circuits/member_function_fail.leo delete mode 100644 tests/old/pass/circuits/member_function_invalid.leo delete mode 100644 tests/old/pass/circuits/member_function_nested.leo delete mode 100644 tests/old/pass/circuits/member_static_function.leo delete mode 100644 tests/old/pass/circuits/member_static_function_invalid.leo delete mode 100644 tests/old/pass/circuits/member_static_function_nested.leo delete mode 100644 tests/old/pass/circuits/member_static_function_undefined.leo delete mode 100644 tests/old/pass/circuits/member_variable.leo delete mode 100644 tests/old/pass/circuits/member_variable_and_function.leo delete mode 100644 tests/old/pass/circuits/member_variable_fail.leo delete mode 100644 tests/old/pass/circuits/mut_function_fail.leo delete mode 100644 tests/old/pass/circuits/mut_self_function_fail.leo delete mode 100644 tests/old/pass/circuits/mut_self_static_function_fail.leo delete mode 100644 tests/old/pass/circuits/mut_self_variable.leo delete mode 100644 tests/old/pass/circuits/mut_self_variable_branch.leo delete mode 100644 tests/old/pass/circuits/mut_self_variable_conditional.leo delete mode 100644 tests/old/pass/circuits/mut_self_variable_fail.leo delete mode 100644 tests/old/pass/circuits/mut_static_function_fail.leo delete mode 100644 tests/old/pass/circuits/mut_variable.leo delete mode 100644 tests/old/pass/circuits/mut_variable_fail.leo delete mode 100644 tests/old/pass/circuits/pedersen_mock.leo delete mode 100644 tests/old/pass/circuits/self_fail.leo delete mode 100644 tests/old/pass/circuits/self_member.leo delete mode 100644 tests/old/pass/circuits/self_member_invalid.leo delete mode 100644 tests/old/pass/circuits/self_member_undefined.leo delete mode 100644 tests/old/pass/compiler/main.leo delete mode 100644 tests/old/pass/console/assert.leo delete mode 100644 tests/old/pass/console/conditional_assert.leo delete mode 100644 tests/old/pass/console/debug.leo delete mode 100644 tests/old/pass/console/error.leo delete mode 100644 tests/old/pass/console/log.leo delete mode 100644 tests/old/pass/console/log_conditional.leo delete mode 100644 tests/old/pass/console/log_input.leo delete mode 100644 tests/old/pass/console/log_parameter.leo delete mode 100644 tests/old/pass/console/log_parameter_fail_empty.leo delete mode 100644 tests/old/pass/console/log_parameter_fail_none.leo delete mode 100644 tests/old/pass/console/log_parameter_fail_unknown.leo delete mode 100644 tests/old/pass/console/log_parameter_many.leo delete mode 100644 tests/old/pass/core/arguments_length_fail.leo delete mode 100644 tests/old/pass/core/arguments_type_fail.leo delete mode 100644 tests/old/pass/core/blake2s_input.leo delete mode 100644 tests/old/pass/core/blake2s_random.leo delete mode 100644 tests/old/pass/core/core_circuit_invalid.leo delete mode 100644 tests/old/pass/core/core_circuit_star_fail.leo delete mode 100644 tests/old/pass/core/core_package_invalid.leo delete mode 100644 tests/old/pass/core/core_unstable_package_invalid.leo delete mode 100644 tests/old/pass/core/unstable_blake2s.leo delete mode 100644 tests/old/pass/definition/out_of_order.leo delete mode 100644 tests/old/pass/definition/out_of_order_with_import.leo delete mode 100644 tests/old/pass/field/add.leo delete mode 100644 tests/old/pass/field/console_assert.leo delete mode 100644 tests/old/pass/field/div.leo delete mode 100644 tests/old/pass/field/eq.leo delete mode 100644 tests/old/pass/field/field.leo delete mode 100644 tests/old/pass/field/mul.leo delete mode 100644 tests/old/pass/field/negate.leo delete mode 100644 tests/old/pass/field/sub.leo delete mode 100644 tests/old/pass/field/ternary.leo delete mode 100644 tests/old/pass/function/array_input.leo delete mode 100644 tests/old/pass/function/array_params_direct_call.leo delete mode 100644 tests/old/pass/function/conditional_return.leo delete mode 100644 tests/old/pass/function/empty.leo delete mode 100644 tests/old/pass/function/iteration.leo delete mode 100644 tests/old/pass/function/iteration_repeated.leo delete mode 100644 tests/old/pass/function/multiple_returns.leo delete mode 100644 tests/old/pass/function/multiple_returns_fail.leo delete mode 100644 tests/old/pass/function/multiple_returns_fail_conditional.leo delete mode 100644 tests/old/pass/function/multiple_returns_main.leo delete mode 100644 tests/old/pass/function/newlines.leo delete mode 100644 tests/old/pass/function/repeated.leo delete mode 100644 tests/old/pass/function/return.leo delete mode 100644 tests/old/pass/function/return_array_nested_fail.leo delete mode 100644 tests/old/pass/function/return_array_nested_pass.leo delete mode 100644 tests/old/pass/function/return_array_tuple_fail.leo delete mode 100644 tests/old/pass/function/return_array_tuple_pass.leo delete mode 100644 tests/old/pass/function/return_tuple.leo delete mode 100644 tests/old/pass/function/return_tuple_conditional.leo delete mode 100644 tests/old/pass/function/scope_fail.leo delete mode 100644 tests/old/pass/function/undefined.leo delete mode 100644 tests/old/pass/function/value_unchanged.leo delete mode 100644 tests/old/pass/group/add.leo delete mode 100644 tests/old/pass/group/assert_eq.leo delete mode 100644 tests/old/pass/group/both_sign_high.leo delete mode 100644 tests/old/pass/group/both_sign_inferred.leo delete mode 100644 tests/old/pass/group/both_sign_low.leo delete mode 100644 tests/old/pass/group/eq.leo delete mode 100644 tests/old/pass/group/input.leo delete mode 100644 tests/old/pass/group/negate.leo delete mode 100644 tests/old/pass/group/one.leo delete mode 100644 tests/old/pass/group/point.leo delete mode 100644 tests/old/pass/group/point_input.leo delete mode 100644 tests/old/pass/group/positive_and_negative.leo delete mode 100644 tests/old/pass/group/sub.leo delete mode 100644 tests/old/pass/group/ternary.leo delete mode 100644 tests/old/pass/group/x_and_y.leo delete mode 100644 tests/old/pass/group/x_sign_high.leo delete mode 100644 tests/old/pass/group/x_sign_inferred.leo delete mode 100644 tests/old/pass/group/x_sign_low.leo delete mode 100644 tests/old/pass/group/y_sign_high.leo delete mode 100644 tests/old/pass/group/y_sign_inferred.leo delete mode 100644 tests/old/pass/group/y_sign_low.leo delete mode 100644 tests/old/pass/group/zero.leo delete mode 100644 tests/old/pass/import/a-9.leo delete mode 100644 tests/old/pass/import/a0-f.leo delete mode 100644 tests/old/pass/import/alias.leo delete mode 100644 tests/old/pass/import/basic.leo delete mode 100755 tests/old/pass/import/bat.leo delete mode 100755 tests/old/pass/import/baz.leo delete mode 100644 tests/old/pass/import/hello-world.leo delete mode 100755 tests/old/pass/import/lib.leo delete mode 100644 tests/old/pass/import/many_import.leo delete mode 100644 tests/old/pass/import/many_import_star.leo delete mode 100644 tests/old/pass/import/multiple.leo delete mode 100644 tests/old/pass/import/names.leo delete mode 100644 tests/old/pass/import/names_underscore.leo delete mode 100644 tests/old/pass/import/star.leo delete mode 100644 tests/old/pass/import/star_fail.leo delete mode 100644 tests/old/pass/import/test-import.leo delete mode 100644 tests/old/pass/integers/i128/add.leo delete mode 100644 tests/old/pass/integers/i128/console_assert.leo delete mode 100644 tests/old/pass/integers/i128/div.leo delete mode 100644 tests/old/pass/integers/i128/eq.leo delete mode 100644 tests/old/pass/integers/i128/ge.leo delete mode 100644 tests/old/pass/integers/i128/gt.leo delete mode 100644 tests/old/pass/integers/i128/input.leo delete mode 100644 tests/old/pass/integers/i128/le.leo delete mode 100644 tests/old/pass/integers/i128/lt.leo delete mode 100644 tests/old/pass/integers/i128/max.leo delete mode 100644 tests/old/pass/integers/i128/max_fail.leo delete mode 100644 tests/old/pass/integers/i128/min.leo delete mode 100644 tests/old/pass/integers/i128/min_fail.leo delete mode 100644 tests/old/pass/integers/i128/mod.rs delete mode 100644 tests/old/pass/integers/i128/mul.leo delete mode 100644 tests/old/pass/integers/i128/ne.leo delete mode 100644 tests/old/pass/integers/i128/negate.leo delete mode 100644 tests/old/pass/integers/i128/negate_min.leo delete mode 100644 tests/old/pass/integers/i128/negate_zero.leo delete mode 100644 tests/old/pass/integers/i128/pow.leo delete mode 100644 tests/old/pass/integers/i128/sub.leo delete mode 100644 tests/old/pass/integers/i128/ternary.leo delete mode 100644 tests/old/pass/integers/i16/add.leo delete mode 100644 tests/old/pass/integers/i16/console_assert.leo delete mode 100644 tests/old/pass/integers/i16/div.leo delete mode 100644 tests/old/pass/integers/i16/eq.leo delete mode 100644 tests/old/pass/integers/i16/ge.leo delete mode 100644 tests/old/pass/integers/i16/gt.leo delete mode 100644 tests/old/pass/integers/i16/input.leo delete mode 100644 tests/old/pass/integers/i16/le.leo delete mode 100644 tests/old/pass/integers/i16/lt.leo delete mode 100644 tests/old/pass/integers/i16/max.leo delete mode 100644 tests/old/pass/integers/i16/max_fail.leo delete mode 100644 tests/old/pass/integers/i16/min.leo delete mode 100644 tests/old/pass/integers/i16/min_fail.leo delete mode 100644 tests/old/pass/integers/i16/mod.rs delete mode 100644 tests/old/pass/integers/i16/mul.leo delete mode 100644 tests/old/pass/integers/i16/ne.leo delete mode 100644 tests/old/pass/integers/i16/negate.leo delete mode 100644 tests/old/pass/integers/i16/negate_min.leo delete mode 100644 tests/old/pass/integers/i16/negate_zero.leo delete mode 100644 tests/old/pass/integers/i16/pow.leo delete mode 100644 tests/old/pass/integers/i16/sub.leo delete mode 100644 tests/old/pass/integers/i16/ternary.leo delete mode 100644 tests/old/pass/integers/i32/add.leo delete mode 100644 tests/old/pass/integers/i32/console_assert.leo delete mode 100644 tests/old/pass/integers/i32/div.leo delete mode 100644 tests/old/pass/integers/i32/eq.leo delete mode 100644 tests/old/pass/integers/i32/ge.leo delete mode 100644 tests/old/pass/integers/i32/gt.leo delete mode 100644 tests/old/pass/integers/i32/input.leo delete mode 100644 tests/old/pass/integers/i32/le.leo delete mode 100644 tests/old/pass/integers/i32/lt.leo delete mode 100644 tests/old/pass/integers/i32/max.leo delete mode 100644 tests/old/pass/integers/i32/max_fail.leo delete mode 100644 tests/old/pass/integers/i32/min.leo delete mode 100644 tests/old/pass/integers/i32/min_fail.leo delete mode 100644 tests/old/pass/integers/i32/mod.rs delete mode 100644 tests/old/pass/integers/i32/mul.leo delete mode 100644 tests/old/pass/integers/i32/ne.leo delete mode 100644 tests/old/pass/integers/i32/negate.leo delete mode 100644 tests/old/pass/integers/i32/negate_min.leo delete mode 100644 tests/old/pass/integers/i32/negate_zero.leo delete mode 100644 tests/old/pass/integers/i32/pow.leo delete mode 100644 tests/old/pass/integers/i32/sub.leo delete mode 100644 tests/old/pass/integers/i32/ternary.leo delete mode 100644 tests/old/pass/integers/i64/add.leo delete mode 100644 tests/old/pass/integers/i64/console_assert.leo delete mode 100644 tests/old/pass/integers/i64/div.leo delete mode 100644 tests/old/pass/integers/i64/eq.leo delete mode 100644 tests/old/pass/integers/i64/ge.leo delete mode 100644 tests/old/pass/integers/i64/gt.leo delete mode 100644 tests/old/pass/integers/i64/input.leo delete mode 100644 tests/old/pass/integers/i64/le.leo delete mode 100644 tests/old/pass/integers/i64/lt.leo delete mode 100644 tests/old/pass/integers/i64/max.leo delete mode 100644 tests/old/pass/integers/i64/max_fail.leo delete mode 100644 tests/old/pass/integers/i64/min.leo delete mode 100644 tests/old/pass/integers/i64/min_fail.leo delete mode 100644 tests/old/pass/integers/i64/mod.rs delete mode 100644 tests/old/pass/integers/i64/mul.leo delete mode 100644 tests/old/pass/integers/i64/ne.leo delete mode 100644 tests/old/pass/integers/i64/negate.leo delete mode 100644 tests/old/pass/integers/i64/negate_min.leo delete mode 100644 tests/old/pass/integers/i64/negate_zero.leo delete mode 100644 tests/old/pass/integers/i64/pow.leo delete mode 100644 tests/old/pass/integers/i64/sub.leo delete mode 100644 tests/old/pass/integers/i64/ternary.leo delete mode 100644 tests/old/pass/integers/i8/add.leo delete mode 100644 tests/old/pass/integers/i8/console_assert.leo delete mode 100644 tests/old/pass/integers/i8/div.leo delete mode 100644 tests/old/pass/integers/i8/eq.leo delete mode 100644 tests/old/pass/integers/i8/ge.leo delete mode 100644 tests/old/pass/integers/i8/gt.leo delete mode 100644 tests/old/pass/integers/i8/input.leo delete mode 100644 tests/old/pass/integers/i8/le.leo delete mode 100644 tests/old/pass/integers/i8/lt.leo delete mode 100644 tests/old/pass/integers/i8/max.leo delete mode 100644 tests/old/pass/integers/i8/max_fail.leo delete mode 100644 tests/old/pass/integers/i8/min.leo delete mode 100644 tests/old/pass/integers/i8/min_fail.leo delete mode 100644 tests/old/pass/integers/i8/mod.rs delete mode 100644 tests/old/pass/integers/i8/mul.leo delete mode 100644 tests/old/pass/integers/i8/ne.leo delete mode 100644 tests/old/pass/integers/i8/negate.leo delete mode 100644 tests/old/pass/integers/i8/negate_min.leo delete mode 100644 tests/old/pass/integers/i8/negate_zero.leo delete mode 100644 tests/old/pass/integers/i8/pow.leo delete mode 100644 tests/old/pass/integers/i8/sub.leo delete mode 100644 tests/old/pass/integers/i8/ternary.leo delete mode 100644 tests/old/pass/integers/u128/add.leo delete mode 100644 tests/old/pass/integers/u128/console_assert.leo delete mode 100644 tests/old/pass/integers/u128/div.leo delete mode 100644 tests/old/pass/integers/u128/eq.leo delete mode 100644 tests/old/pass/integers/u128/ge.leo delete mode 100644 tests/old/pass/integers/u128/gt.leo delete mode 100644 tests/old/pass/integers/u128/input.leo delete mode 100644 tests/old/pass/integers/u128/le.leo delete mode 100644 tests/old/pass/integers/u128/lt.leo delete mode 100644 tests/old/pass/integers/u128/max.leo delete mode 100644 tests/old/pass/integers/u128/max_fail.leo delete mode 100644 tests/old/pass/integers/u128/min.leo delete mode 100644 tests/old/pass/integers/u128/min_fail.leo delete mode 100644 tests/old/pass/integers/u128/mod.rs delete mode 100644 tests/old/pass/integers/u128/mul.leo delete mode 100644 tests/old/pass/integers/u128/ne.leo delete mode 100644 tests/old/pass/integers/u128/pow.leo delete mode 100644 tests/old/pass/integers/u128/sub.leo delete mode 100644 tests/old/pass/integers/u128/ternary.leo delete mode 100644 tests/old/pass/integers/u16/add.leo delete mode 100644 tests/old/pass/integers/u16/console_assert.leo delete mode 100644 tests/old/pass/integers/u16/div.leo delete mode 100644 tests/old/pass/integers/u16/eq.leo delete mode 100644 tests/old/pass/integers/u16/ge.leo delete mode 100644 tests/old/pass/integers/u16/gt.leo delete mode 100644 tests/old/pass/integers/u16/input.leo delete mode 100644 tests/old/pass/integers/u16/le.leo delete mode 100644 tests/old/pass/integers/u16/lt.leo delete mode 100644 tests/old/pass/integers/u16/max.leo delete mode 100644 tests/old/pass/integers/u16/max_fail.leo delete mode 100644 tests/old/pass/integers/u16/min.leo delete mode 100644 tests/old/pass/integers/u16/min_fail.leo delete mode 100644 tests/old/pass/integers/u16/mod.rs delete mode 100644 tests/old/pass/integers/u16/mul.leo delete mode 100644 tests/old/pass/integers/u16/ne.leo delete mode 100644 tests/old/pass/integers/u16/pow.leo delete mode 100644 tests/old/pass/integers/u16/sub.leo delete mode 100644 tests/old/pass/integers/u16/ternary.leo delete mode 100644 tests/old/pass/integers/u32/add.leo delete mode 100644 tests/old/pass/integers/u32/console_assert.leo delete mode 100644 tests/old/pass/integers/u32/div.leo delete mode 100644 tests/old/pass/integers/u32/eq.leo delete mode 100644 tests/old/pass/integers/u32/ge.leo delete mode 100644 tests/old/pass/integers/u32/gt.leo delete mode 100644 tests/old/pass/integers/u32/input.leo delete mode 100644 tests/old/pass/integers/u32/le.leo delete mode 100644 tests/old/pass/integers/u32/lt.leo delete mode 100644 tests/old/pass/integers/u32/max.leo delete mode 100644 tests/old/pass/integers/u32/max_fail.leo delete mode 100644 tests/old/pass/integers/u32/min.leo delete mode 100644 tests/old/pass/integers/u32/min_fail.leo delete mode 100644 tests/old/pass/integers/u32/mod.rs delete mode 100644 tests/old/pass/integers/u32/mul.leo delete mode 100644 tests/old/pass/integers/u32/ne.leo delete mode 100644 tests/old/pass/integers/u32/pow.leo delete mode 100644 tests/old/pass/integers/u32/sub.leo delete mode 100644 tests/old/pass/integers/u32/ternary.leo delete mode 100644 tests/old/pass/integers/u64/add.leo delete mode 100644 tests/old/pass/integers/u64/console_assert.leo delete mode 100644 tests/old/pass/integers/u64/div.leo delete mode 100644 tests/old/pass/integers/u64/eq.leo delete mode 100644 tests/old/pass/integers/u64/ge.leo delete mode 100644 tests/old/pass/integers/u64/gt.leo delete mode 100644 tests/old/pass/integers/u64/input.leo delete mode 100644 tests/old/pass/integers/u64/le.leo delete mode 100644 tests/old/pass/integers/u64/lt.leo delete mode 100644 tests/old/pass/integers/u64/max.leo delete mode 100644 tests/old/pass/integers/u64/max_fail.leo delete mode 100644 tests/old/pass/integers/u64/min.leo delete mode 100644 tests/old/pass/integers/u64/min_fail.leo delete mode 100644 tests/old/pass/integers/u64/mod.rs delete mode 100644 tests/old/pass/integers/u64/mul.leo delete mode 100644 tests/old/pass/integers/u64/ne.leo delete mode 100644 tests/old/pass/integers/u64/pow.leo delete mode 100644 tests/old/pass/integers/u64/sub.leo delete mode 100644 tests/old/pass/integers/u64/ternary.leo delete mode 100644 tests/old/pass/integers/u8/add.leo delete mode 100644 tests/old/pass/integers/u8/console_assert.leo delete mode 100644 tests/old/pass/integers/u8/div.leo delete mode 100644 tests/old/pass/integers/u8/eq.leo delete mode 100644 tests/old/pass/integers/u8/ge.leo delete mode 100644 tests/old/pass/integers/u8/gt.leo delete mode 100644 tests/old/pass/integers/u8/input.leo delete mode 100644 tests/old/pass/integers/u8/le.leo delete mode 100644 tests/old/pass/integers/u8/lt.leo delete mode 100644 tests/old/pass/integers/u8/max.leo delete mode 100644 tests/old/pass/integers/u8/max_fail.leo delete mode 100644 tests/old/pass/integers/u8/min.leo delete mode 100644 tests/old/pass/integers/u8/min_fail.leo delete mode 100644 tests/old/pass/integers/u8/mod.rs delete mode 100644 tests/old/pass/integers/u8/mul.leo delete mode 100644 tests/old/pass/integers/u8/ne.leo delete mode 100644 tests/old/pass/integers/u8/pow.leo delete mode 100644 tests/old/pass/integers/u8/sub.leo delete mode 100644 tests/old/pass/integers/u8/ternary.leo delete mode 100644 tests/old/pass/mutability/array.leo delete mode 100644 tests/old/pass/mutability/array_mut.leo delete mode 100644 tests/old/pass/mutability/array_splice_mut.leo delete mode 100644 tests/old/pass/mutability/array_tuple_mut.leo delete mode 100644 tests/old/pass/mutability/circuit.leo delete mode 100644 tests/old/pass/mutability/circuit_function_mut.leo delete mode 100644 tests/old/pass/mutability/circuit_mut.leo delete mode 100644 tests/old/pass/mutability/circuit_static_function_mut.leo delete mode 100644 tests/old/pass/mutability/circuit_variable_mut.leo delete mode 100644 tests/old/pass/mutability/const.leo delete mode 100644 tests/old/pass/mutability/function_input.leo delete mode 100644 tests/old/pass/mutability/function_input_mut.leo delete mode 100644 tests/old/pass/mutability/let.leo delete mode 100644 tests/old/pass/mutability/let_mut.leo delete mode 100644 tests/old/pass/mutability/let_mut_nested.leo delete mode 100644 tests/old/pass/mutability/swap.leo delete mode 100644 tests/old/pass/statements/assert.leo delete mode 100644 tests/old/pass/statements/block.leo delete mode 100644 tests/old/pass/statements/chain.leo delete mode 100644 tests/old/pass/statements/for_loop.leo delete mode 100644 tests/old/pass/statements/iteration_basic.leo delete mode 100644 tests/old/pass/statements/multiple_returns.leo delete mode 100644 tests/old/pass/statements/mutate.leo delete mode 100644 tests/old/pass/statements/nested.leo delete mode 100644 tests/old/pass/statements/num_returns_fail.leo delete mode 100644 tests/old/pass/statements/ternary_basic.leo delete mode 100644 tests/old/pass/syntax/compare_mismatched_types.leo delete mode 100644 tests/old/pass/syntax/undefined.leo delete mode 100644 tests/old/pass/tuples/access.leo delete mode 100644 tests/old/pass/tuples/basic.leo delete mode 100644 tests/old/pass/tuples/function.leo delete mode 100644 tests/old/pass/tuples/function_multiple.leo delete mode 100644 tests/old/pass/tuples/function_typed.leo delete mode 100644 tests/old/pass/tuples/input.leo delete mode 100644 tests/old/pass/tuples/multiple.leo delete mode 100644 tests/old/pass/tuples/multiple_typed.leo delete mode 100644 tests/old/pass/tuples/nested.leo delete mode 100644 tests/old/pass/tuples/nested_access.leo delete mode 100644 tests/old/pass/tuples/nested_typed.leo delete mode 100644 tests/old/pass/tuples/typed.leo delete mode 100644 tests/parser/functions/input_typed_fail.leo.out diff --git a/Cargo.lock b/Cargo.lock index a5661976ca..3435febc32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1413,6 +1413,7 @@ dependencies = [ "indexmap", "lazy_static", "leo-ast", + "leo-test-framework", "serde", "serde_json", "serde_yaml", @@ -1452,6 +1453,15 @@ dependencies = [ "snarkvm-r1cs", ] +[[package]] +name = "leo-test-framework" +version = "1.4.0" +dependencies = [ + "serde", + "serde_json", + "serde_yaml", +] + [[package]] name = "lexical-core" version = "0.7.5" diff --git a/Cargo.toml b/Cargo.toml index dc9bfb5f6f..cee03769f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,8 @@ members = [ "package", "parser", "state", - "synthesizer" + "synthesizer", + "test-framework" ] [dependencies.leo-ast] diff --git a/parser/Cargo.toml b/parser/Cargo.toml index 51495b9046..4b3248e2ef 100644 --- a/parser/Cargo.toml +++ b/parser/Cargo.toml @@ -54,6 +54,10 @@ version = "0.3" [dev-dependencies.serde_yaml] version = "0.8" +[dev-dependencies.leo-test-framework] +path = "../test-framework" +version = "1.4.0" + [features] default = [ ] ci_skip = [ ] diff --git a/parser/src/test.rs b/parser/src/test.rs index f44ae36119..b6dbf7ae49 100644 --- a/parser/src/test.rs +++ b/parser/src/test.rs @@ -14,158 +14,36 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use std::{ - fmt, - fs, - path::{Path, PathBuf}, - sync::Arc, -}; - -use leo_ast::{Expression, ExpressionStatement, Program, Span, Statement, ValueExpression}; +use leo_ast::{Expression, ExpressionStatement, Span, Statement, ValueExpression}; +use leo_test_framework::runner::{Namespace, ParseType, Runner}; use serde_yaml::Value; use tokenizer::Token; -use crate::{tokenizer, DeprecatedError, ParserContext, SyntaxError, TokenError}; +use crate::{tokenizer, ParserContext}; -struct TestFailure { - path: String, - errors: Vec, -} +struct TokenNamespace; -#[derive(Debug)] -enum TestError { - UnexpectedOutput { - index: usize, - expected: String, - output: String, - }, - PassedAndShouldntHave { - index: usize, - }, - FailedAndShouldntHave { - index: usize, - error: String, - }, - UnexpectedError { - index: usize, - expected: String, - output: String, - }, - MismatchedTestExpectationLength, -} - -impl fmt::Display for TestError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - TestError::UnexpectedOutput { - index, - expected, - output, - } => { - write!(f, "test #{} expected\n{}\ngot\n{}", index + 1, expected, output) - } - TestError::PassedAndShouldntHave { index } => write!(f, "test #{} passed and shouldn't have", index + 1), - TestError::FailedAndShouldntHave { index, error } => { - write!(f, "test #{} failed and shouldn't have:\n{}", index + 1, error) - } - TestError::UnexpectedError { - expected, - output, - index, - } => { - write!(f, "test #{} expected error\n{}\ngot\n{}", index + 1, expected, output) - } - TestError::MismatchedTestExpectationLength => write!(f, "invalid number of test expectations"), - } +impl Namespace for TokenNamespace { + fn parse_type(&self) -> ParseType { + ParseType::Line } -} -pub fn find_tests>(path: T, out: &mut Vec<(String, String)>) { - for entry in fs::read_dir(path).expect("fail to read tests").into_iter() { - let entry = entry.expect("fail to read tests").path(); - if entry.is_dir() { - find_tests(entry.as_path(), out); - continue; - } else if entry.extension().map(|x| x.to_str()).flatten().unwrap_or_default() != "leo" { - continue; - } - let content = fs::read_to_string(entry.as_path()).expect("failed to read test"); - out.push((entry.as_path().to_str().unwrap_or_default().to_string(), content)); + fn run_test(&self, test: &str) -> Result { + let output = tokenizer::tokenize("test", test.into()); + output + .map(|tokens| { + Value::String( + tokens + .into_iter() + .map(|x| x.to_string()) + .collect::>() + .join(","), + ) + }) + .map_err(|x| x.to_string()) } } -#[derive(serde::Serialize, serde::Deserialize, PartialEq, Debug, Clone)] -enum TestNamespace { - Parse, - ParseStatement, - ParseExpression, - Token, -} - -#[derive(serde::Serialize, serde::Deserialize, PartialEq, Debug, Clone)] -enum TestExpectationMode { - Pass, - Fail, -} - -#[derive(serde::Serialize, serde::Deserialize)] -struct TestConfig { - namespace: TestNamespace, - expectation: TestExpectationMode, -} - -#[derive(serde::Serialize, serde::Deserialize, Clone)] -struct TestExpectation { - namespace: TestNamespace, - expectation: TestExpectationMode, - outputs: Vec, -} - -fn extract_test_config(source: &str) -> Option { - let first_comment_start = source.find("/*")?; - let end_first_comment = source[first_comment_start + 2..].find("*/")?; - let comment_inner = &source[first_comment_start + 2..first_comment_start + 2 + end_first_comment]; - Some(serde_yaml::from_str(comment_inner).expect("invalid test configuration")) -} - -fn split_tests_oneline(source: &str) -> Vec<&str> { - source.lines().map(|x| x.trim()).filter(|x| !x.is_empty()).collect() -} - -fn split_tests_twoline(source: &str) -> Vec { - let mut out = vec![]; - let mut lines = vec![]; - for line in source.lines() { - let line = line.trim(); - if line.is_empty() { - if !lines.is_empty() { - out.push(lines.join("\n")); - } - lines.clear(); - continue; - } - lines.push(line); - } - let last_test = lines.join("\n"); - if !last_test.trim().is_empty() { - out.push(last_test.trim().to_string()); - } - out -} - -fn run_individual_token_test(path: &str, source: &str) -> Result { - let output = tokenizer::tokenize(path, source.into()); - output - .map(|tokens| { - tokens - .into_iter() - .map(|x| x.to_string()) - .collect::>() - .join(",") - }) - .map_err(|x| strip_path_syntax_error(x.into())) -} - fn not_fully_consumed(tokens: &mut ParserContext) -> Result<(), String> { if !tokens.has_next() { return Ok(()); @@ -178,389 +56,95 @@ fn not_fully_consumed(tokens: &mut ParserContext) -> Result<(), String> { Err(out) } -fn run_individual_expression_test(path: &str, source: &str) -> Result { - let tokenizer = tokenizer::tokenize(path, source.into()).map_err(|x| strip_path_syntax_error(x.into()))?; - if tokenizer - .iter() - .all(|x| matches!(x.token, Token::CommentLine(_) | Token::CommentBlock(_))) - { - return Ok(Expression::Value(ValueExpression::Implicit("".into(), Span::default()))); +struct ParseExpressionNamespace; + +impl Namespace for ParseExpressionNamespace { + fn parse_type(&self) -> ParseType { + ParseType::Line } - let mut tokens = ParserContext::new(tokenizer); - let parsed = tokens.parse_expression().map_err(strip_path_syntax_error)?; - not_fully_consumed(&mut tokens)?; - - Ok(parsed) -} - -fn run_individual_statement_test(path: &str, source: &str) -> Result { - let tokenizer = tokenizer::tokenize(path, source.into()).map_err(|x| strip_path_syntax_error(x.into()))?; - if tokenizer - .iter() - .all(|x| matches!(x.token, Token::CommentLine(_) | Token::CommentBlock(_))) - { - return Ok(Statement::Expression(ExpressionStatement { - expression: Expression::Value(ValueExpression::Implicit("".into(), Span::default())), - span: Span::default(), - })); - } - let mut tokens = ParserContext::new(tokenizer); - - let parsed = tokens.parse_statement().map_err(strip_path_syntax_error)?; - not_fully_consumed(&mut tokens)?; - - Ok(parsed) -} - -fn strip_path_syntax_error(mut err: SyntaxError) -> String { - let inner = match &mut err { - SyntaxError::DeprecatedError(DeprecatedError::Error(x)) => x, - SyntaxError::Error(x) => x, - SyntaxError::TokenError(TokenError::Error(x)) => x, - }; - inner.path = Arc::new("test".to_string()); - err.to_string() -} - -fn run_individual_parse_test(path: &str, source: &str) -> Result { - let tokenizer = tokenizer::tokenize(path, source.into()).map_err(|x| strip_path_syntax_error(x.into()))?; - let mut tokens = ParserContext::new(tokenizer); - - let parsed = tokens.parse_program().map_err(strip_path_syntax_error)?; - not_fully_consumed(&mut tokens)?; - - Ok(parsed) -} - -fn emit_errors( - output: Result<&T, &str>, - mode: &TestExpectationMode, - expected_output: Option, - test_index: usize, -) -> Option { - match (output, mode) { - (Ok(output), TestExpectationMode::Pass) => { - let expected_output: Option = - expected_output.map(|x| serde_yaml::from_value(x).expect("test expectation deserialize failed")); - // passed and should have - if let Some(expected_output) = expected_output.as_ref() { - if output != expected_output { - // invalid output - return Some(TestError::UnexpectedOutput { - index: test_index, - expected: expected_output.to_string(), - output: output.to_string(), - }); - } - } - None - } - (Ok(_tokens), TestExpectationMode::Fail) => Some(TestError::PassedAndShouldntHave { index: test_index }), - (Err(err), TestExpectationMode::Pass) => Some(TestError::FailedAndShouldntHave { - error: err.to_string(), - index: test_index, - }), - (Err(err), TestExpectationMode::Fail) => { - let expected_output: Option = - expected_output.map(|x| serde_yaml::from_value(x).expect("test expectation deserialize failed")); - if let Some(expected_output) = expected_output.as_deref() { - if err != expected_output { - // invalid output - return Some(TestError::UnexpectedError { - expected: expected_output.to_string(), - output: err.to_string(), - index: test_index, - }); - } - } - None + fn run_test(&self, test: &str) -> Result { + let tokenizer = tokenizer::tokenize("test", test.into()).map_err(|x| x.to_string())?; + if tokenizer + .iter() + .all(|x| matches!(x.token, Token::CommentLine(_) | Token::CommentBlock(_))) + { + return Ok(serde_yaml::to_value(&Expression::Value(ValueExpression::Implicit( + "".into(), + Span::default(), + ))) + .expect("serialization failed")); } + let mut tokens = ParserContext::new(tokenizer); + + let parsed = tokens.parse_expression().map_err(|x| x.to_string())?; + not_fully_consumed(&mut tokens)?; + + Ok(serde_yaml::to_value(&parsed).expect("serialization failed")) } } -fn run_test( - config: &TestConfig, - path: &str, - source: &str, - expectations: Option<&TestExpectation>, - errors: &mut Vec, -) -> Vec { - let end_of_header = source.find("*/").expect("failed to find header block in test"); - let source = &source[end_of_header + 2..]; - let mut outputs = vec![]; - match &config.namespace { - TestNamespace::Token => { - let tests = split_tests_oneline(source); - if let Some(expectations) = expectations.as_ref() { - if tests.len() != expectations.outputs.len() { - errors.push(TestError::MismatchedTestExpectationLength); - } - } - let mut expected_output = expectations.as_ref().map(|x| x.outputs.iter()); - for (i, test) in tests.into_iter().enumerate() { - let expected_output = expected_output - .as_mut() - .map(|x| x.next()) - .flatten() - .map(|x| x.as_str()) - .flatten(); - let output = run_individual_token_test(path, test); - if let Some(error) = emit_errors( - output.as_ref().map_err(|x| &**x), - &config.expectation, - expected_output.map(|x| Value::String(x.to_string())), - i, - ) { - errors.push(error); - } else { - outputs.push(serde_yaml::to_value(output.unwrap_or_else(|e| e)).expect("serialization failed")); - } - } - } - TestNamespace::Parse => { - if let Some(expectations) = expectations.as_ref() { - if expectations.outputs.len() != 1 { - errors.push(TestError::MismatchedTestExpectationLength); - } - } - let expected_output = expectations - .map(|x| x.outputs.get(0)) - .flatten() - .map(|x| serde_yaml::from_value(x.clone()).expect("invalid test expectation form")); - let output = run_individual_parse_test(path, source); - if let Some(error) = emit_errors( - output.as_ref().map_err(|x| &**x), - &config.expectation, - expected_output, - 0, - ) { - errors.push(error); - } else { - outputs.push( - output - .map(|x| serde_yaml::to_value(x).expect("serialization failed")) - .unwrap_or_else(|e| serde_yaml::to_value(e).expect("serialization failed")), - ); - } - } - TestNamespace::ParseStatement => { - let tests = split_tests_twoline(source); - if let Some(expectations) = expectations.as_ref() { - if tests.len() != expectations.outputs.len() { - errors.push(TestError::MismatchedTestExpectationLength); - } - } - let mut expected_output = expectations.as_ref().map(|x| x.outputs.iter()); - for (i, test) in tests.into_iter().enumerate() { - let expected_output = expected_output - .as_mut() - .map(|x| x.next()) - .flatten() - .map(|x| serde_yaml::from_value(x.clone()).expect("invalid test expectation form")); +struct ParseStatementNamespace; - let output = run_individual_statement_test(path, &test); - if let Some(error) = emit_errors( - output.as_ref().map_err(|x| &**x), - &config.expectation, - expected_output, - i, - ) { - errors.push(error); - } else { - outputs.push( - output - .map(|x| serde_yaml::to_value(x).expect("serialization failed")) - .unwrap_or_else(|e| serde_yaml::to_value(e).expect("serialization failed")), - ); - } - } - } - TestNamespace::ParseExpression => { - let tests = split_tests_oneline(source); - if let Some(expectations) = expectations.as_ref() { - if tests.len() != expectations.outputs.len() { - errors.push(TestError::MismatchedTestExpectationLength); - } - } - let mut expected_output = expectations.as_ref().map(|x| x.outputs.iter()); - for (i, test) in tests.into_iter().enumerate() { - let expected_output = expected_output - .as_mut() - .map(|x| x.next()) - .flatten() - .map(|x| serde_yaml::from_value(x.clone()).expect("invalid test expectation form")); - - let output = run_individual_expression_test(path, test); - if let Some(error) = emit_errors( - output.as_ref().map_err(|x| &**x), - &config.expectation, - expected_output, - i, - ) { - errors.push(error); - } else { - outputs.push( - output - .map(|x| serde_yaml::to_value(x).expect("serialization failed")) - .unwrap_or_else(|e| serde_yaml::to_value(e).expect("serialization failed")), - ); - } - } - } +impl Namespace for ParseStatementNamespace { + fn parse_type(&self) -> ParseType { + ParseType::ContinuousLines + } + + fn run_test(&self, test: &str) -> Result { + let tokenizer = tokenizer::tokenize("test", test.into()).map_err(|x| x.to_string())?; + if tokenizer + .iter() + .all(|x| matches!(x.token, Token::CommentLine(_) | Token::CommentBlock(_))) + { + return Ok(serde_yaml::to_value(&Statement::Expression(ExpressionStatement { + expression: Expression::Value(ValueExpression::Implicit("".into(), Span::default())), + span: Span::default(), + })) + .expect("serialization failed")); + } + let mut tokens = ParserContext::new(tokenizer); + + let parsed = tokens.parse_statement().map_err(|x| x.to_string())?; + not_fully_consumed(&mut tokens)?; + + Ok(serde_yaml::to_value(&parsed).expect("serialization failed")) + } +} + +struct ParseNamespace; + +impl Namespace for ParseNamespace { + fn parse_type(&self) -> ParseType { + ParseType::Whole + } + + fn run_test(&self, test: &str) -> Result { + let tokenizer = tokenizer::tokenize("test", test.into()).map_err(|x| x.to_string())?; + let mut tokens = ParserContext::new(tokenizer); + + let parsed = tokens.parse_program().map_err(|x| x.to_string())?; + not_fully_consumed(&mut tokens)?; + + Ok(serde_yaml::to_value(&parsed).expect("serialization failed")) + } +} + +struct TestRunner; + +impl Runner for TestRunner { + fn resolve_namespace(&self, name: &str) -> Option> { + Some(match name { + "Parse" => Box::new(ParseNamespace), + "ParseStatement" => Box::new(ParseStatementNamespace), + "ParseExpression" => Box::new(ParseExpressionNamespace), + "Token" => Box::new(TokenNamespace), + _ => return None, + }) } - outputs } #[test] pub fn parser_tests() { - let mut pass = 0; - let mut fail = Vec::new(); - let mut tests = Vec::new(); - let mut test_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - test_dir.push("../tests/parser/"); - find_tests(&test_dir, &mut tests); - let mut outputs = vec![]; - for (path, content) in tests.into_iter() { - let config = extract_test_config(&content); - if config.is_none() { - panic!("missing configuration for {}", path); - } - let config = config.unwrap(); - let mut expectation_path = path.clone(); - expectation_path += ".out"; - let expectations: Option = if std::path::Path::new(&expectation_path).exists() { - if !std::env::var("CLEAR_LEO_TEST_EXPECTATIONS") - .unwrap_or_default() - .trim() - .is_empty() - { - None - } else { - let raw = std::fs::read_to_string(&expectation_path).expect("failed to read expectations file"); - Some(serde_yaml::from_str(&raw).expect("invalid yaml in expectations file")) - } - } else { - None - }; - let mut errors = vec![]; - let raw_path = Path::new(&path); - let new_outputs = run_test( - &config, - raw_path.file_name().unwrap_or_default().to_str().unwrap_or_default(), - &content, - expectations.as_ref(), - &mut errors, - ); - if errors.is_empty() { - if expectations.is_none() { - outputs.push((expectation_path, TestExpectation { - namespace: config.namespace, - expectation: config.expectation, - outputs: new_outputs, - })); - } - pass += 1; - } else { - fail.push(TestFailure { - path: path.clone(), - errors, - }) - } - } - if !fail.is_empty() { - for (i, fail) in fail.iter().enumerate() { - println!( - "\n\n-----------------TEST #{} FAILED (and shouldn't have)-----------------", - i + 1 - ); - println!("File: {}", fail.path); - for error in &fail.errors { - println!("{}", error); - } - } - panic!("failed {}/{} tests", fail.len(), fail.len() + pass); - } else { - for (path, new_expectation) in outputs { - std::fs::write( - &path, - serde_yaml::to_string(&new_expectation).expect("failed to serialize expectation yaml"), - ) - .expect("failed to write expectation file"); - } - println!("passed {}/{} tests", pass, pass); - } -} - -#[test] -pub fn parser_pass_tests() { - let mut pass = 0; - let mut fail = Vec::new(); - let mut tests = Vec::new(); - let mut test_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - test_dir.push("../tests/old/pass/"); - find_tests(&test_dir, &mut tests); - for (path, content) in tests.into_iter() { - match crate::parse(&path, &content) { - Ok(_) => { - pass += 1; - } - Err(e) => { - fail.push(TestFailure { - path, - errors: vec![TestError::FailedAndShouldntHave { - index: 0, - error: e.to_string(), - }], - }); - } - } - } - if !fail.is_empty() { - for (i, fail) in fail.iter().enumerate() { - println!( - "\n\n-----------------TEST #{} FAILED (and shouldn't have)-----------------", - i + 1 - ); - println!("File: {}", fail.path); - for error in &fail.errors { - println!("{}", error); - } - } - panic!("failed {}/{} tests", fail.len(), fail.len() + pass); - } else { - println!("passed {}/{} tests", pass, pass); - } -} - -#[test] -pub fn parser_fail_tests() { - let mut pass = 0; - let mut fail = Vec::new(); - let mut tests = Vec::new(); - let mut test_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - test_dir.push("../tests/old/fail/"); - find_tests(&test_dir, &mut tests); - for (path, content) in tests.into_iter() { - match crate::parse(&path, &content) { - Ok(_) => { - fail.push(path); - } - Err(_e) => { - pass += 1; - } - } - } - if !fail.is_empty() { - for (i, fail) in fail.iter().enumerate() { - println!( - "\n\n-----------------TEST #{} PASSED (and shouldn't have)-----------------", - i + 1 - ); - println!("File: {}", fail); - } - panic!("failed {}/{} tests", fail.len(), fail.len() + pass); - } else { - println!("passed {}/{} tests", pass, pass); - } + leo_test_framework::run_tests(&TestRunner, "parser"); } diff --git a/test-framework/Cargo.toml b/test-framework/Cargo.toml new file mode 100644 index 0000000000..0f3e2ce847 --- /dev/null +++ b/test-framework/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "leo-test-framework" +version = "1.4.0" +authors = [ "The Aleo Team " ] +description = "Leo testing framework" +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.serde] +version = "1.0" +features = [ "derive" ] + +[dependencies.serde_json] +version = "1.0" + +[dependencies.serde_yaml] +version = "0.8" diff --git a/test-framework/src/error.rs b/test-framework/src/error.rs new file mode 100644 index 0000000000..c49ebe75f1 --- /dev/null +++ b/test-framework/src/error.rs @@ -0,0 +1,124 @@ +// 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 serde_yaml::Value; + +use crate::test::TestExpectationMode; + +pub struct TestFailure { + pub path: String, + pub errors: Vec, +} + +#[derive(Debug)] +pub enum TestError { + UnexpectedOutput { + index: usize, + expected: Value, + output: Value, + }, + PassedAndShouldntHave { + index: usize, + }, + FailedAndShouldntHave { + index: usize, + error: String, + }, + UnexpectedError { + index: usize, + expected: String, + output: String, + }, + MismatchedTestExpectationLength, +} + +impl fmt::Display for TestError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + TestError::UnexpectedOutput { + index, + expected, + output, + } => { + write!( + f, + "test #{} expected\n{}\ngot\n{}", + index + 1, + serde_yaml::to_string(&expected).expect("serialization failed"), + serde_yaml::to_string(&output).expect("serialization failed") + ) + } + TestError::PassedAndShouldntHave { index } => write!(f, "test #{} passed and shouldn't have", index + 1), + TestError::FailedAndShouldntHave { index, error } => { + write!(f, "test #{} failed and shouldn't have:\n{}", index + 1, error) + } + TestError::UnexpectedError { + expected, + output, + index, + } => { + write!(f, "test #{} expected error\n{}\ngot\n{}", index + 1, expected, output) + } + TestError::MismatchedTestExpectationLength => write!(f, "invalid number of test expectations"), + } + } +} + +pub fn emit_errors( + output: Result<&Value, &str>, + mode: &TestExpectationMode, + expected_output: Option, + test_index: usize, +) -> Option { + match (output, mode) { + (Ok(output), TestExpectationMode::Pass) => { + // passed and should have + if let Some(expected_output) = expected_output.as_ref() { + if output != expected_output { + // invalid output + return Some(TestError::UnexpectedOutput { + index: test_index, + expected: expected_output.clone(), + output: output.clone(), + }); + } + } + None + } + (Ok(_tokens), TestExpectationMode::Fail) => Some(TestError::PassedAndShouldntHave { index: test_index }), + (Err(err), TestExpectationMode::Pass) => Some(TestError::FailedAndShouldntHave { + error: err.to_string(), + index: test_index, + }), + (Err(err), TestExpectationMode::Fail) => { + let expected_output: Option = + expected_output.map(|x| serde_yaml::from_value(x).expect("test expectation deserialize failed")); + if let Some(expected_output) = expected_output.as_deref() { + if err != expected_output { + // invalid output + return Some(TestError::UnexpectedError { + expected: expected_output.to_string(), + output: err.to_string(), + index: test_index, + }); + } + } + None + } + } +} diff --git a/test-framework/src/fetch.rs b/test-framework/src/fetch.rs new file mode 100644 index 0000000000..7c9d763d84 --- /dev/null +++ b/test-framework/src/fetch.rs @@ -0,0 +1,56 @@ +// 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::{fs, path::Path}; + +pub fn find_tests>(path: T, out: &mut Vec<(String, String)>) { + for entry in fs::read_dir(path).expect("fail to read tests").into_iter() { + let entry = entry.expect("fail to read tests").path(); + if entry.is_dir() { + find_tests(entry.as_path(), out); + continue; + } else if entry.extension().map(|x| x.to_str()).flatten().unwrap_or_default() != "leo" { + continue; + } + let content = fs::read_to_string(entry.as_path()).expect("failed to read test"); + out.push((entry.as_path().to_str().unwrap_or_default().to_string(), content)); + } +} + +pub fn split_tests_oneline(source: &str) -> Vec<&str> { + source.lines().map(|x| x.trim()).filter(|x| !x.is_empty()).collect() +} + +pub fn split_tests_twoline(source: &str) -> Vec { + let mut out = vec![]; + let mut lines = vec![]; + for line in source.lines() { + let line = line.trim(); + if line.is_empty() { + if !lines.is_empty() { + out.push(lines.join("\n")); + } + lines.clear(); + continue; + } + lines.push(line); + } + let last_test = lines.join("\n"); + if !last_test.trim().is_empty() { + out.push(last_test.trim().to_string()); + } + out +} diff --git a/test-framework/src/lib.rs b/test-framework/src/lib.rs new file mode 100644 index 0000000000..b8d82df266 --- /dev/null +++ b/test-framework/src/lib.rs @@ -0,0 +1,27 @@ +// 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 error; + +pub mod fetch; + +pub mod output; + +pub mod runner; + +pub mod test; + +pub use runner::*; diff --git a/test-framework/src/output.rs b/test-framework/src/output.rs new file mode 100644 index 0000000000..1d4361657c --- /dev/null +++ b/test-framework/src/output.rs @@ -0,0 +1,25 @@ +// 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::test::TestExpectationMode; +use serde_yaml::Value; + +#[derive(serde::Serialize, serde::Deserialize, Clone)] +pub struct TestExpectation { + pub namespace: String, + pub expectation: TestExpectationMode, + pub outputs: Vec, +} diff --git a/test-framework/src/runner.rs b/test-framework/src/runner.rs new file mode 100644 index 0000000000..0a473e73b5 --- /dev/null +++ b/test-framework/src/runner.rs @@ -0,0 +1,196 @@ +// 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 serde_yaml::Value; +use std::path::{Path, PathBuf}; + +use crate::{error::*, fetch::find_tests, output::TestExpectation, test::*}; + +#[derive(Debug, PartialEq, Clone, Copy)] +pub enum ParseType { + Line, + ContinuousLines, + Whole, +} + +pub trait Namespace { + fn parse_type(&self) -> ParseType; + + fn run_test(&self, test: &str) -> Result; +} + +pub trait Runner { + fn resolve_namespace(&self, name: &str) -> Option>; +} + +pub fn run_tests(runner: &T, expectation_category: &str) { + let mut pass_categories = 0; + let mut pass_tests = 0; + let mut fail_tests = 0; + let mut fail_categories = Vec::new(); + + let mut tests = Vec::new(); + let mut test_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + test_dir.push("../tests/"); + + let mut expectation_dir = test_dir.clone(); + expectation_dir.push("expectations"); + + find_tests(&test_dir, &mut tests); + let mut outputs = vec![]; + + for (path, content) in tests.into_iter() { + let config = extract_test_config(&content); + if config.is_none() { + panic!("missing configuration for {}", path); + } + let config = config.unwrap(); + let namespace = runner.resolve_namespace(&config.namespace); + if namespace.is_none() { + continue; + } + let namespace = namespace.unwrap(); + + let path = Path::new(&path); + let relative_path = path.strip_prefix(&test_dir).expect("path error for test"); + let mut expectation_path = expectation_dir.clone(); + expectation_path.push(expectation_category); + expectation_path.push(relative_path.parent().expect("no parent dir for test")); + let mut test_name = relative_path + .file_name() + .expect("no file name for test") + .to_str() + .unwrap() + .to_string(); + test_name += ".out"; + expectation_path.push(&test_name); + + let expectations: Option = if expectation_path.exists() { + if !std::env::var("CLEAR_LEO_TEST_EXPECTATIONS") + .unwrap_or_default() + .trim() + .is_empty() + { + None + } else { + let raw = std::fs::read_to_string(&expectation_path).expect("failed to read expectations file"); + Some(serde_yaml::from_str(&raw).expect("invalid yaml in expectations file")) + } + } else { + None + }; + + let end_of_header = content.find("*/").expect("failed to find header block in test"); + let content = &content[end_of_header + 2..]; + + let tests = match namespace.parse_type() { + ParseType::Line => crate::fetch::split_tests_oneline(content) + .into_iter() + .map(|x| x.to_string()) + .collect(), + ParseType::ContinuousLines => crate::fetch::split_tests_twoline(content), + ParseType::Whole => vec![content.to_string()], + }; + + let mut errors = vec![]; + if let Some(expectations) = expectations.as_ref() { + if tests.len() != expectations.outputs.len() { + errors.push(TestError::MismatchedTestExpectationLength); + } + } + + let mut new_outputs = vec![]; + + let mut expected_output = expectations.as_ref().map(|x| x.outputs.iter()); + for (i, test) in tests.into_iter().enumerate() { + let expected_output = expected_output + .as_mut() + .map(|x| x.next()) + .flatten() + .map(|x| x.as_str()) + .flatten(); + let output = namespace.run_test(&test); + if let Some(error) = emit_errors( + output.as_ref().map_err(|x| &**x), + &config.expectation, + expected_output.map(|x| Value::String(x.to_string())), + i, + ) { + fail_tests += 1; + errors.push(error); + } else { + pass_tests += 1; + new_outputs.push( + output + .as_ref() + .map(|x| serde_yaml::to_value(x).expect("serialization failed")) + .unwrap_or_else(|e| Value::String(e.clone())), + ); + } + } + + if errors.is_empty() { + if expectations.is_none() { + outputs.push((expectation_path, TestExpectation { + namespace: config.namespace, + expectation: config.expectation, + outputs: new_outputs, + })); + } + pass_categories += 1; + } else { + fail_categories.push(TestFailure { + path: path.to_str().unwrap().to_string(), + errors, + }) + } + } + if !fail_categories.is_empty() { + for (i, fail) in fail_categories.iter().enumerate() { + println!( + "\n\n-----------------TEST #{} FAILED (and shouldn't have)-----------------", + i + 1 + ); + println!("File: {}", fail.path); + for error in &fail.errors { + println!("{}", error); + } + } + panic!( + "failed {}/{} tests in {}/{} categories", + pass_tests, + fail_tests + pass_tests, + fail_categories.len(), + fail_categories.len() + pass_categories + ); + } else { + for (path, new_expectation) in outputs { + std::fs::create_dir_all(path.parent().unwrap()).expect("failed to make test expectation parent directory"); + std::fs::write( + &path, + serde_yaml::to_string(&new_expectation).expect("failed to serialize expectation yaml"), + ) + .expect("failed to write expectation file"); + } + println!( + "passed {}/{} tests in {}/{} categories", + pass_tests, + fail_tests + pass_tests, + pass_categories, + pass_categories + ); + } +} diff --git a/test-framework/src/test.rs b/test-framework/src/test.rs new file mode 100644 index 0000000000..3e1f64694b --- /dev/null +++ b/test-framework/src/test.rs @@ -0,0 +1,34 @@ +// 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(serde::Serialize, serde::Deserialize, PartialEq, Debug, Clone)] +pub enum TestExpectationMode { + Pass, + Fail, +} + +#[derive(serde::Serialize, serde::Deserialize)] +pub struct TestConfig { + pub namespace: String, + pub expectation: TestExpectationMode, +} + +pub fn extract_test_config(source: &str) -> Option { + let first_comment_start = source.find("/*")?; + let end_first_comment = source[first_comment_start + 2..].find("*/")?; + let comment_inner = &source[first_comment_start + 2..first_comment_start + 2 + end_first_comment]; + Some(serde_yaml::from_str(comment_inner).expect("invalid test configuration")) +} diff --git a/tests/parser/circuits/big_self.leo.out b/tests/expectations/parser/parser/circuits/big_self.leo.out similarity index 78% rename from tests/parser/circuits/big_self.leo.out rename to tests/expectations/parser/parser/circuits/big_self.leo.out index ae3705231b..ee647ea625 100644 --- a/tests/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\\\":\\\"big_self.leo\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"big_self.leo\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" + "{\"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 {\\\"}\"}" members: - CircuitFunction: annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"big_self.leo\\\",\\\"content\\\":\\\" function x() -> Self {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function x() -> Self {\\\"}\"}" input: [] output: SelfType block: @@ -19,34 +19,34 @@ outputs: - Return: expression: CircuitInit: - name: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"big_self.leo\\\",\\\"content\\\":\\\" return Self {};\\\"}\"}" + name: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" return Self {};\\\"}\"}" members: [] span: line_start: 5 line_stop: 5 col_start: 16 col_stop: 23 - path: big_self.leo + path: test content: " return Self {};" span: line_start: 5 line_stop: 5 col_start: 9 col_stop: 23 - path: big_self.leo + path: test content: " return Self {};" span: line_start: 4 line_stop: 6 col_start: 26 col_stop: 6 - path: big_self.leo + path: test content: " function x() -> Self {\n...\n }" span: line_start: 4 line_stop: 6 col_start: 5 col_stop: 6 - path: big_self.leo + path: test content: " function x() -> Self {\n...\n }" functions: {} diff --git a/tests/parser/circuits/empty.leo.out b/tests/expectations/parser/parser/circuits/empty.leo.out similarity index 74% rename from tests/parser/circuits/empty.leo.out rename to tests/expectations/parser/parser/circuits/empty.leo.out index 67053ab14c..0fa7fe2114 100644 --- a/tests/parser/circuits/empty.leo.out +++ b/tests/expectations/parser/parser/circuits/empty.leo.out @@ -6,7 +6,7 @@ outputs: expected_input: [] imports: [] circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"empty.leo\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"empty.leo\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" + "{\"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 {\\\"}\"}" members: [] functions: {} diff --git a/tests/parser/circuits/field_and_functions.leo.out b/tests/expectations/parser/parser/circuits/field_and_functions.leo.out similarity index 78% rename from tests/parser/circuits/field_and_functions.leo.out rename to tests/expectations/parser/parser/circuits/field_and_functions.leo.out index 8bc4e14161..02b64f582e 100644 --- a/tests/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\\\":\\\"field_and_functions.leo\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"field_and_functions.leo\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" + "{\"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 {\\\"}\"}" members: - CircuitVariable: - - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"field_and_functions.leo\\\",\\\"content\\\":\\\" x: u32,\\\"}\"}" + - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" x: u32,\\\"}\"}" - IntegerType: U32 - CircuitVariable: - - "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"field_and_functions.leo\\\",\\\"content\\\":\\\" y: u32,\\\"}\"}" + - "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" y: u32,\\\"}\"}" - IntegerType: U32 - CircuitFunction: annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"field_and_functions.leo\\\",\\\"content\\\":\\\" function x() {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function x() {\\\"}\"}" input: [] output: ~ block: @@ -31,32 +31,32 @@ outputs: line_stop: 7 col_start: 16 col_stop: 18 - path: field_and_functions.leo + path: test content: " return ();" span: line_start: 7 line_stop: 7 col_start: 9 col_stop: 18 - path: field_and_functions.leo + path: test content: " return ();" span: line_start: 6 line_stop: 8 col_start: 18 col_stop: 6 - path: field_and_functions.leo + path: test content: " function x() {\n...\n }" span: line_start: 6 line_stop: 8 col_start: 5 col_stop: 6 - path: field_and_functions.leo + path: test content: " function x() {\n...\n }" - CircuitFunction: annotations: [] - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"field_and_functions.leo\\\",\\\"content\\\":\\\" function y() {\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function y() {\\\"}\"}" input: [] output: ~ block: @@ -70,27 +70,27 @@ outputs: line_stop: 10 col_start: 16 col_stop: 18 - path: field_and_functions.leo + path: test content: " return ();" span: line_start: 10 line_stop: 10 col_start: 9 col_stop: 18 - path: field_and_functions.leo + path: test content: " return ();" span: line_start: 9 line_stop: 11 col_start: 18 col_stop: 6 - path: field_and_functions.leo + path: test content: " function y() {\n...\n }" span: line_start: 9 line_stop: 11 col_start: 5 col_stop: 6 - path: field_and_functions.leo + path: test content: " function y() {\n...\n }" functions: {} diff --git a/tests/parser/circuits/fields.leo.out b/tests/expectations/parser/parser/circuits/fields.leo.out similarity index 73% rename from tests/parser/circuits/fields.leo.out rename to tests/expectations/parser/parser/circuits/fields.leo.out index 057eba2059..354a6892bc 100644 --- a/tests/parser/circuits/fields.leo.out +++ b/tests/expectations/parser/parser/circuits/fields.leo.out @@ -6,13 +6,13 @@ outputs: expected_input: [] imports: [] circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"fields.leo\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"fields.leo\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" + "{\"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 {\\\"}\"}" members: - CircuitVariable: - - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"fields.leo\\\",\\\"content\\\":\\\" x: u32,\\\"}\"}" + - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" x: u32,\\\"}\"}" - IntegerType: U32 - CircuitVariable: - - "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"fields.leo\\\",\\\"content\\\":\\\" y: u32,\\\"}\"}" + - "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" y: u32,\\\"}\"}" - IntegerType: U32 functions: {} diff --git a/tests/parser/circuits/functions.leo.out b/tests/expectations/parser/parser/circuits/functions.leo.out similarity index 82% rename from tests/parser/circuits/functions.leo.out rename to tests/expectations/parser/parser/circuits/functions.leo.out index 0544583815..71b4a7a2bb 100644 --- a/tests/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\\\":\\\"functions.leo\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"functions.leo\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" + "{\"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 {\\\"}\"}" members: - CircuitFunction: annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"functions.leo\\\",\\\"content\\\":\\\" function x() {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function x() {\\\"}\"}" input: [] output: ~ block: @@ -25,32 +25,32 @@ outputs: line_stop: 5 col_start: 16 col_stop: 18 - path: functions.leo + path: test content: " return ();" span: line_start: 5 line_stop: 5 col_start: 9 col_stop: 18 - path: functions.leo + path: test content: " return ();" span: line_start: 4 line_stop: 6 col_start: 18 col_stop: 6 - path: functions.leo + path: test content: " function x() {\n...\n }" span: line_start: 4 line_stop: 6 col_start: 5 col_stop: 6 - path: functions.leo + path: test content: " function x() {\n...\n }" - CircuitFunction: annotations: [] - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"functions.leo\\\",\\\"content\\\":\\\" function y() {\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function y() {\\\"}\"}" input: [] output: ~ block: @@ -64,27 +64,27 @@ outputs: line_stop: 8 col_start: 16 col_stop: 18 - path: functions.leo + path: test content: " return ();" span: line_start: 8 line_stop: 8 col_start: 9 col_stop: 18 - path: functions.leo + path: test content: " return ();" span: line_start: 7 line_stop: 9 col_start: 18 col_stop: 6 - path: functions.leo + path: test content: " function y() {\n...\n }" span: line_start: 7 line_stop: 9 col_start: 5 col_stop: 6 - path: functions.leo + path: test content: " function y() {\n...\n }" functions: {} diff --git a/tests/parser/circuits/mut_self.leo.out b/tests/expectations/parser/parser/circuits/mut_self.leo.out similarity index 78% rename from tests/parser/circuits/mut_self.leo.out rename to tests/expectations/parser/parser/circuits/mut_self.leo.out index 8b5bf15197..54800e5ed7 100644 --- a/tests/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\\\":\\\"mut_self.leo\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"mut_self.leo\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" + "{\"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 {\\\"}\"}" members: - CircuitFunction: annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"mut_self.leo\\\",\\\"content\\\":\\\" function x(mut self) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function x(mut self) {\\\"}\"}" input: - - MutSelfKeyword: "{\"name\":\"mut self\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":16,\\\"col_stop\\\":24,\\\"path\\\":\\\"mut_self.leo\\\",\\\"content\\\":\\\" function x(mut self) {\\\"}\"}" + - MutSelfKeyword: "{\"name\":\"mut self\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":16,\\\"col_stop\\\":24,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function x(mut self) {\\\"}\"}" output: ~ block: statements: @@ -26,27 +26,27 @@ outputs: line_stop: 5 col_start: 16 col_stop: 18 - path: mut_self.leo + path: test content: " return ();" span: line_start: 5 line_stop: 5 col_start: 9 col_stop: 18 - path: mut_self.leo + path: test content: " return ();" span: line_start: 4 line_stop: 6 col_start: 26 col_stop: 6 - path: mut_self.leo + path: test content: " function x(mut self) {\n...\n }" span: line_start: 4 line_stop: 6 col_start: 5 col_stop: 6 - path: mut_self.leo + path: test content: " function x(mut self) {\n...\n }" functions: {} diff --git a/tests/parser/circuits/self.leo.out b/tests/expectations/parser/parser/circuits/self.leo.out similarity index 79% rename from tests/parser/circuits/self.leo.out rename to tests/expectations/parser/parser/circuits/self.leo.out index c022f538d7..6f1445d071 100644 --- a/tests/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\\\":\\\"self.leo\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"self.leo\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" + "{\"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 {\\\"}\"}" members: - CircuitFunction: annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"self.leo\\\",\\\"content\\\":\\\" function x(self) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function x(self) {\\\"}\"}" input: - - SelfKeyword: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"self.leo\\\",\\\"content\\\":\\\" function x(self) {\\\"}\"}" + - SelfKeyword: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" function x(self) {\\\"}\"}" output: ~ block: statements: @@ -26,27 +26,27 @@ outputs: line_stop: 5 col_start: 16 col_stop: 18 - path: self.leo + path: test content: " return ();" span: line_start: 5 line_stop: 5 col_start: 9 col_stop: 18 - path: self.leo + path: test content: " return ();" span: line_start: 4 line_stop: 6 col_start: 22 col_stop: 6 - path: self.leo + path: test content: " function x(self) {\n...\n }" span: line_start: 4 line_stop: 6 col_start: 5 col_stop: 6 - path: self.leo + path: test content: " function x(self) {\n...\n }" functions: {} diff --git a/tests/parser/expression/access/array_access.leo.out b/tests/expectations/parser/parser/expression/access/array_access.leo.out similarity index 76% rename from tests/parser/expression/access/array_access.leo.out rename to tests/expectations/parser/parser/expression/access/array_access.leo.out index 53383163b5..5c820cc814 100644 --- a/tests/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\\\":\\\"array_access.leo\\\",\\\"content\\\":\\\"x[0]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0]\\\"}\"}" index: Value: Implicit: @@ -13,18 +13,18 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: array_access.leo + path: test content: "x[0]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: array_access.leo + path: test content: "x[0]" - ArrayAccess: array: - Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"array_access.leo\\\",\\\"content\\\":\\\"X[1]\\\"}\"}" + Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"X[1]\\\"}\"}" index: Value: Implicit: @@ -33,18 +33,18 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: array_access.leo + path: test content: "X[1]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: array_access.leo + path: test content: "X[1]" - ArrayAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"array_access.leo\\\",\\\"content\\\":\\\"x[0u8]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0u8]\\\"}\"}" index: Value: Integer: @@ -54,20 +54,20 @@ outputs: line_stop: 1 col_start: 3 col_stop: 6 - path: array_access.leo + path: test content: "x[0u8]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: array_access.leo + path: test content: "x[0u8]" - ArrayAccess: array: ArrayAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"array_access.leo\\\",\\\"content\\\":\\\"x[1u8][2u8]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[1u8][2u8]\\\"}\"}" index: Value: Integer: @@ -77,14 +77,14 @@ outputs: line_stop: 1 col_start: 3 col_stop: 6 - path: array_access.leo + path: test content: "x[1u8][2u8]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: array_access.leo + path: test content: "x[1u8][2u8]" index: Value: @@ -95,14 +95,14 @@ outputs: line_stop: 1 col_start: 8 col_stop: 11 - path: array_access.leo + path: test content: "x[1u8][2u8]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: array_access.leo + path: test 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\\\":\\\"array_access.leo\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" index: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"array_access.leo\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: array_access.leo + path: test content: "x[x][y][z]" index: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"array_access.leo\\\",\\\"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]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: array_access.leo + path: test content: "x[x][y][z]" index: - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"array_access.leo\\\",\\\"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]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: array_access.leo + path: test 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\\\":\\\"array_access.leo\\\",\\\"content\\\":\\\"x[0]()\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0]()\\\"}\"}" index: Value: Implicit: @@ -151,14 +151,14 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: array_access.leo + path: test content: "x[0]()" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: array_access.leo + path: test content: "x[0]()" arguments: [] span: @@ -166,20 +166,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: array_access.leo + path: test content: "x[0]()" - ArrayAccess: array: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"array_access.leo\\\",\\\"content\\\":\\\"x()[0]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x()[0]\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: array_access.leo + path: test content: "x()[0]" index: Value: @@ -189,14 +189,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: array_access.leo + path: test content: "x()[0]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: array_access.leo + path: test 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\\\":\\\"array_access.leo\\\",\\\"content\\\":\\\"x(y)::y(x)\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(y)::y(x)\\\"}\"}" arguments: - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"array_access.leo\\\",\\\"content\\\":\\\"x(y)::y(x)\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(y)::y(x)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: array_access.leo + path: test content: "x(y)::y(x)" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"array_access.leo\\\",\\\"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)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: array_access.leo + path: test content: "x(y)::y(x)" arguments: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"array_access.leo\\\",\\\"content\\\":\\\"x(y)::y(x)\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(y)::y(x)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: array_access.leo + path: test 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\\\":\\\"array_access.leo\\\",\\\"content\\\":\\\"x[x].0[x]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x].0[x]\\\"}\"}" index: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"array_access.leo\\\",\\\"content\\\":\\\"x[x].0[x]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x].0[x]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: array_access.leo + path: test content: "x[x].0[x]" index: value: "0" @@ -254,14 +254,14 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: array_access.leo + path: test content: "x[x].0[x]" index: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"array_access.leo\\\",\\\"content\\\":\\\"x[x].0[x]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x].0[x]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: array_access.leo + path: test content: "x[x].0[x]" diff --git a/tests/parser/expression/access/array_range_access.leo.out b/tests/expectations/parser/parser/expression/access/array_range_access.leo.out similarity index 74% rename from tests/parser/expression/access/array_range_access.leo.out rename to tests/expectations/parser/parser/expression/access/array_range_access.leo.out index 4d1ab7c79b..10b02e133d 100644 --- a/tests/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\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[..]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..]\\\"}\"}" left: ~ right: ~ span: @@ -12,11 +12,11 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: array_range_access.leo + path: test content: "x[..]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[1..]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[1..]\\\"}\"}" left: Value: Implicit: @@ -25,7 +25,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: array_range_access.leo + path: test content: "x[1..]" right: ~ span: @@ -33,11 +33,11 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: array_range_access.leo + path: test content: "x[1..]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[..1]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..1]\\\"}\"}" left: ~ right: Value: @@ -47,18 +47,18 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: array_range_access.leo + path: test content: "x[..1]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: array_range_access.leo + path: test content: "x[..1]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[1..1]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[1..1]\\\"}\"}" left: Value: Implicit: @@ -67,7 +67,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: array_range_access.leo + path: test content: "x[1..1]" right: Value: @@ -77,18 +77,18 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: array_range_access.leo + path: test content: "x[1..1]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: array_range_access.leo + path: test content: "x[1..1]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[0..100]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0..100]\\\"}\"}" left: Value: Implicit: @@ -97,7 +97,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: array_range_access.leo + path: test content: "x[0..100]" right: Value: @@ -107,20 +107,20 @@ outputs: line_stop: 1 col_start: 6 col_stop: 9 - path: array_range_access.leo + path: test content: "x[0..100]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: array_range_access.leo + path: test 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\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[323452345.2345234523453453][323452345.2345234523453453]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[323452345.2345234523453453][323452345.2345234523453453]\\\"}\"}" index: TupleAccess: tuple: @@ -131,7 +131,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 12 - path: array_range_access.leo + path: test content: "x[323452345.2345234523453453][323452345.2345234523453453]" index: value: "2345234523453453" @@ -140,14 +140,14 @@ outputs: line_stop: 1 col_start: 3 col_stop: 29 - path: array_range_access.leo + path: test content: "x[323452345.2345234523453453][323452345.2345234523453453]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 30 - path: array_range_access.leo + path: test content: "x[323452345.2345234523453453][323452345.2345234523453453]" index: TupleAccess: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 31 col_stop: 40 - path: array_range_access.leo + path: test content: "x[323452345.2345234523453453][323452345.2345234523453453]" index: value: "2345234523453453" @@ -168,18 +168,18 @@ outputs: line_stop: 1 col_start: 31 col_stop: 57 - path: array_range_access.leo + path: test content: "x[323452345.2345234523453453][323452345.2345234523453453]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 58 - path: array_range_access.leo + path: test 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\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[0u8..1u8]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0u8..1u8]\\\"}\"}" left: Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 6 - path: array_range_access.leo + path: test content: "x[0u8..1u8]" right: Value: @@ -200,18 +200,18 @@ outputs: line_stop: 1 col_start: 8 col_stop: 11 - path: array_range_access.leo + path: test content: "x[0u8..1u8]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: array_range_access.leo + path: test content: "x[0u8..1u8]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[0u8..]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0u8..]\\\"}\"}" left: Value: Integer: @@ -221,7 +221,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 6 - path: array_range_access.leo + path: test content: "x[0u8..]" right: ~ span: @@ -229,11 +229,11 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: array_range_access.leo + path: test content: "x[0u8..]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[..0u8]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..0u8]\\\"}\"}" left: ~ right: Value: @@ -244,18 +244,18 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: array_range_access.leo + path: test content: "x[..0u8]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 9 - path: array_range_access.leo + path: test content: "x[..0u8]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[..]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..]\\\"}\"}" left: ~ right: ~ span: @@ -263,22 +263,22 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: array_range_access.leo + path: test content: "x[..]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[x.y..]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[x.y..]\\\"}\"}" left: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[x.y..]\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[x.y..]\\\"}\"}" + 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..]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 3 col_stop: 6 - path: array_range_access.leo + path: test content: "x[x.y..]" right: ~ span: @@ -286,116 +286,116 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: array_range_access.leo + path: test content: "x[x.y..]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[..y.x]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[..y.x]\\\"}\"}" - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[..y.x]\\\"}\"}" + 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]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 8 - path: array_range_access.leo + path: test content: "x[..y.x]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 9 - path: array_range_access.leo + path: test content: "x[..y.x]" - ArrayRangeAccess: array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" + 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]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 3 col_stop: 6 - path: array_range_access.leo + path: test 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\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"array_range_access.leo\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" + 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]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 11 - path: array_range_access.leo + path: test content: "x[x.y..y.x]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: array_range_access.leo + path: test 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\\\":\\\"array_range_access.leo\\\",\\\"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\\\":\\\"test\\\",\\\"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\\\":\\\"array_range_access.leo\\\",\\\"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\\\":\\\"array_range_access.leo\\\",\\\"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\\\":\\\"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]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 3 col_stop: 6 - path: array_range_access.leo + 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\\\":\\\"array_range_access.leo\\\",\\\"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]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 3 col_stop: 8 - path: array_range_access.leo + path: test 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\\\":\\\"array_range_access.leo\\\",\\\"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\\\":\\\"array_range_access.leo\\\",\\\"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\\\":\\\"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]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 10 col_stop: 13 - path: array_range_access.leo + 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\\\":\\\"array_range_access.leo\\\",\\\"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]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 10 col_stop: 15 - path: array_range_access.leo + path: test content: "x[x.y.x..y.x.y]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 16 - path: array_range_access.leo + path: test content: "x[x.y.x..y.x.y]" diff --git a/tests/parser/expression/access/call.leo.out b/tests/expectations/parser/parser/expression/access/call.leo.out similarity index 75% rename from tests/parser/expression/access/call.leo.out rename to tests/expectations/parser/parser/expression/access/call.leo.out index ef53d339ab..ed9e9058da 100644 --- a/tests/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\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x()\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x()\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: call.leo + path: test content: x() - Call: function: - Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"X()\\\"}\"}" + Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"X()\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: call.leo + path: test content: X() - Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x(y)\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(y)\\\"}\"}" arguments: - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x(y)\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(y)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: call.leo + path: test content: x(y) - Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x(y, z)\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(y, z)\\\"}\"}" arguments: - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x(y, z)\\\"}\"}" - - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x(y, z)\\\"}\"}" + - 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)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: call.leo + path: test content: "x(y, z)" - Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x(x, y, z)\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x(x, y, z)\\\"}\"}" arguments: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x(x, y, z)\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x(x, y, z)\\\"}\"}" - - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x(x, y, z)\\\"}\"}" + - 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)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: call.leo + path: test 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\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x::y()\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x::y()\\\"}\"}" + 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()\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: call.leo + path: test content: "x::y()" arguments: [] span: @@ -82,35 +82,35 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: call.leo + path: test content: "x::y()" - Call: function: CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x::y(x)\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x::y(x)\\\"}\"}" + 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)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: call.leo + path: test content: "x::y(x)" arguments: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x::y(x)\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x::y(x)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: call.leo + path: test 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\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x.0(x)\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0(x)\\\"}\"}" index: value: "0" span: @@ -118,22 +118,22 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: call.leo + path: test content: x.0(x) arguments: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x.0(x)\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0(x)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: call.leo + path: test 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\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x[0](x)\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0](x)\\\"}\"}" index: Value: Implicit: @@ -142,21 +142,21 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: call.leo + path: test content: "x[0](x)" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: call.leo + path: test content: "x[0](x)" arguments: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"call.leo\\\",\\\"content\\\":\\\"x[0](x)\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0](x)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: call.leo + path: test content: "x[0](x)" diff --git a/tests/parser/expression/access/circuit.leo.out b/tests/expectations/parser/parser/expression/access/circuit.leo.out similarity index 75% rename from tests/parser/expression/access/circuit.leo.out rename to tests/expectations/parser/parser/expression/access/circuit.leo.out index fc218d0e8f..e10176179c 100644 --- a/tests/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\\\":\\\"circuit.leo\\\",\\\"content\\\":\\\"x.y\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"circuit.leo\\\",\\\"content\\\":\\\"x.y\\\"}\"}" + 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\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: circuit.leo + path: test content: x.y - CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"circuit.leo\\\",\\\"content\\\":\\\"X.Y\\\"}\"}" - name: "{\"name\":\"Y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"circuit.leo\\\",\\\"content\\\":\\\"X.Y\\\"}\"}" + 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\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: circuit.leo + path: test content: X.Y - CircuitMemberAccess: circuit: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"circuit.leo\\\",\\\"content\\\":\\\"x.y.z\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"circuit.leo\\\",\\\"content\\\":\\\"x.y.z\\\"}\"}" + 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\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: circuit.leo + path: test content: x.y.z - name: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"circuit.leo\\\",\\\"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\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 6 - path: circuit.leo + path: test 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\\\":\\\"circuit.leo\\\",\\\"content\\\":\\\"x.y()\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"circuit.leo\\\",\\\"content\\\":\\\"x.y()\\\"}\"}" + 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()\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: circuit.leo + path: test content: x.y() arguments: [] span: @@ -64,20 +64,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: circuit.leo + path: test content: x.y() - TupleAccess: tuple: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"circuit.leo\\\",\\\"content\\\":\\\"x.y.0\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"circuit.leo\\\",\\\"content\\\":\\\"x.y.0\\\"}\"}" + 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\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: circuit.leo + path: test content: x.y.0 index: value: "0" @@ -86,20 +86,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: circuit.leo + path: test 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\\\":\\\"circuit.leo\\\",\\\"content\\\":\\\"x.y[1]\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"circuit.leo\\\",\\\"content\\\":\\\"x.y[1]\\\"}\"}" + 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]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: circuit.leo + path: test content: "x.y[1]" index: Value: @@ -109,12 +109,12 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: circuit.leo + path: test content: "x.y[1]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: circuit.leo + path: test content: "x.y[1]" diff --git a/tests/parser/expression/access/circuit_static.leo.out b/tests/expectations/parser/parser/expression/access/circuit_static.leo.out similarity index 73% rename from tests/parser/expression/access/circuit_static.leo.out rename to tests/expectations/parser/parser/expression/access/circuit_static.leo.out index e606e3f397..eed96329a1 100644 --- a/tests/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\\\":\\\"circuit_static.leo\\\",\\\"content\\\":\\\"x::y\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"circuit_static.leo\\\",\\\"content\\\":\\\"x::y\\\"}\"}" + 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\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: circuit_static.leo + path: test content: "x::y" - CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"circuit_static.leo\\\",\\\"content\\\":\\\"X::Y\\\"}\"}" - name: "{\"name\":\"Y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"circuit_static.leo\\\",\\\"content\\\":\\\"X::Y\\\"}\"}" + 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\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: circuit_static.leo + path: test content: "X::Y" - CircuitStaticFunctionAccess: circuit: CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"circuit_static.leo\\\",\\\"content\\\":\\\"x::y::z\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"circuit_static.leo\\\",\\\"content\\\":\\\"x::y::z\\\"}\"}" + 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\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: circuit_static.leo + path: test content: "x::y::z" - name: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"circuit_static.leo\\\",\\\"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\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: circuit_static.leo + path: test 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\\\":\\\"circuit_static.leo\\\",\\\"content\\\":\\\"x::y()\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"circuit_static.leo\\\",\\\"content\\\":\\\"x::y()\\\"}\"}" + 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()\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: circuit_static.leo + path: test content: "x::y()" arguments: [] span: @@ -64,20 +64,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: circuit_static.leo + path: test content: "x::y()" - TupleAccess: tuple: CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"circuit_static.leo\\\",\\\"content\\\":\\\"x::y.0\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"circuit_static.leo\\\",\\\"content\\\":\\\"x::y.0\\\"}\"}" + 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\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: circuit_static.leo + path: test content: "x::y.0" index: value: "0" @@ -86,20 +86,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: circuit_static.leo + path: test 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\\\":\\\"circuit_static.leo\\\",\\\"content\\\":\\\"x::y[1]\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"circuit_static.leo\\\",\\\"content\\\":\\\"x::y[1]\\\"}\"}" + 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]\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: circuit_static.leo + path: test content: "x::y[1]" index: Value: @@ -109,12 +109,12 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: circuit_static.leo + path: test content: "x::y[1]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: circuit_static.leo + path: test content: "x::y[1]" diff --git a/tests/parser/expression/access/tuple.leo.out b/tests/expectations/parser/parser/expression/access/tuple.leo.out similarity index 80% rename from tests/parser/expression/access/tuple.leo.out rename to tests/expectations/parser/parser/expression/access/tuple.leo.out index 1f9c99519b..c4089a4522 100644 --- a/tests/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\\\":\\\"tuple.leo\\\",\\\"content\\\":\\\"x.0\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0\\\"}\"}" index: value: "0" span: @@ -12,11 +12,11 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: tuple.leo + path: test content: x.0 - TupleAccess: tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"tuple.leo\\\",\\\"content\\\":\\\"x.1\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.1\\\"}\"}" index: value: "1" span: @@ -24,11 +24,11 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: tuple.leo + path: test content: x.1 - TupleAccess: tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"tuple.leo\\\",\\\"content\\\":\\\"x.2\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.2\\\"}\"}" index: value: "2" span: @@ -36,13 +36,13 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: tuple.leo + path: test content: x.2 - TupleAccess: tuple: TupleAccess: tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"tuple.leo\\\",\\\"content\\\":\\\"x.0.0\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0.0\\\"}\"}" index: value: "0" span: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: tuple.leo + path: test content: x.0.0 index: value: "0" @@ -59,13 +59,13 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: tuple.leo + path: test 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\\\":\\\"tuple.leo\\\",\\\"content\\\":\\\"x.1.1\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.1.1\\\"}\"}" index: value: "1" span: @@ -73,7 +73,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: tuple.leo + path: test content: x.1.1 index: value: "1" @@ -82,13 +82,13 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: tuple.leo + path: test 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\\\":\\\"tuple.leo\\\",\\\"content\\\":\\\"x.2.2\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.2.2\\\"}\"}" index: value: "2" span: @@ -96,7 +96,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: tuple.leo + path: test content: x.2.2 index: value: "2" @@ -105,5 +105,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: tuple.leo + path: test content: x.2.2 diff --git a/tests/parser/expression/array_init.leo.out b/tests/expectations/parser/parser/expression/array_init.leo.out similarity index 86% rename from tests/parser/expression/array_init.leo.out rename to tests/expectations/parser/parser/expression/array_init.leo.out index b31e475044..c8ee3bfb32 100644 --- a/tests/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: array_init.leo + path: test content: "[0u8; 1]" dimensions: - value: "1" @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: array_init.leo + path: test content: "[0u8; 1]" - ArrayInit: element: @@ -32,7 +32,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 3 - path: array_init.leo + path: test content: "[0; 1]" dimensions: - value: "1" @@ -41,7 +41,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: array_init.leo + path: test content: "[0; 1]" - ArrayInit: element: @@ -52,7 +52,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 3 - path: array_init.leo + path: test content: "[0; (1)]" dimensions: - value: "1" @@ -61,7 +61,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: array_init.leo + path: test content: "[0; (1)]" - ArrayInit: element: @@ -72,7 +72,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 3 - path: array_init.leo + path: test content: "[0; (1, 2)]" dimensions: - value: "1" @@ -82,7 +82,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: array_init.leo + path: test content: "[0; (1, 2)]" - ArrayInit: element: @@ -93,7 +93,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 3 - path: array_init.leo + path: test content: "[0; (1, 2, 3)]" dimensions: - value: "1" @@ -104,7 +104,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: array_init.leo + path: test content: "[0; (1, 2, 3)]" - ArrayInit: element: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 4 col_stop: 5 - path: array_init.leo + path: test content: "[[[0; 3]; 2]; 1]" dimensions: - value: "3" @@ -128,7 +128,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 9 - path: array_init.leo + path: test content: "[[[0; 3]; 2]; 1]" dimensions: - value: "2" @@ -137,7 +137,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 13 - path: array_init.leo + path: test content: "[[[0; 3]; 2]; 1]" dimensions: - value: "1" @@ -146,5 +146,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 17 - path: array_init.leo + path: test content: "[[[0; 3]; 2]; 1]" diff --git a/tests/parser/expression/array_init_fail.leo.out b/tests/expectations/parser/parser/expression/array_init_fail.leo.out similarity index 100% rename from tests/parser/expression/array_init_fail.leo.out rename to tests/expectations/parser/parser/expression/array_init_fail.leo.out diff --git a/tests/parser/expression/array_inline.leo.out b/tests/expectations/parser/parser/expression/array_inline.leo.out similarity index 85% rename from tests/parser/expression/array_inline.leo.out rename to tests/expectations/parser/parser/expression/array_inline.leo.out index 188a0b7f99..ae4ccf624f 100644 --- a/tests/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: array_inline.leo + path: test content: "[0u8, 1, 2, 3]" - Expression: Value: @@ -23,7 +23,7 @@ outputs: line_stop: 1 col_start: 7 col_stop: 8 - path: array_inline.leo + path: test content: "[0u8, 1, 2, 3]" - Expression: Value: @@ -33,7 +33,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: array_inline.leo + path: test content: "[0u8, 1, 2, 3]" - Expression: Value: @@ -43,14 +43,14 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: array_inline.leo + path: test content: "[0u8, 1, 2, 3]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 15 - path: array_inline.leo + path: test content: "[0u8, 1, 2, 3]" - ArrayInline: elements: @@ -62,14 +62,14 @@ outputs: line_stop: 1 col_start: 2 col_stop: 3 - path: array_inline.leo + path: test content: "[1]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: array_inline.leo + path: test content: "[1]" - ArrayInline: elements: @@ -82,14 +82,14 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: array_inline.leo + path: test content: "[1u8]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 6 - path: array_inline.leo + path: test content: "[1u8]" - ArrayInline: elements: @@ -102,14 +102,14 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: array_inline.leo + path: test content: "[1u8,]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: array_inline.leo + path: test content: "[1u8,]" - ArrayInline: elements: @@ -121,7 +121,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 3 - path: array_inline.leo + path: test content: "[0, 1,]" - Expression: Value: @@ -131,14 +131,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: array_inline.leo + path: test content: "[0, 1,]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: array_inline.leo + path: test content: "[0, 1,]" - ArrayInline: elements: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 3 - path: array_inline.leo + path: test content: "[0,1,]" - Expression: Value: @@ -160,14 +160,14 @@ outputs: line_stop: 1 col_start: 4 col_stop: 5 - path: array_inline.leo + path: test content: "[0,1,]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: array_inline.leo + path: test content: "[0,1,]" - ArrayInline: elements: [] @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 3 - path: array_inline.leo + path: test content: "[]" - ArrayInline: elements: @@ -191,7 +191,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: array_inline.leo + path: test content: "[[1,2,3],[1,2,3]]" - Expression: Value: @@ -201,7 +201,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: array_inline.leo + path: test content: "[[1,2,3],[1,2,3]]" - Expression: Value: @@ -211,14 +211,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 8 - path: array_inline.leo + path: test content: "[[1,2,3],[1,2,3]]" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 9 - path: array_inline.leo + path: test content: "[[1,2,3],[1,2,3]]" - Expression: ArrayInline: @@ -231,7 +231,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: array_inline.leo + path: test content: "[[1,2,3],[1,2,3]]" - Expression: Value: @@ -241,7 +241,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: array_inline.leo + path: test content: "[[1,2,3],[1,2,3]]" - Expression: Value: @@ -251,21 +251,21 @@ outputs: line_stop: 1 col_start: 15 col_stop: 16 - path: array_inline.leo + path: test content: "[[1,2,3],[1,2,3]]" span: line_start: 1 line_stop: 1 col_start: 10 col_stop: 17 - path: array_inline.leo + path: test content: "[[1,2,3],[1,2,3]]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: array_inline.leo + path: test content: "[[1,2,3],[1,2,3]]" - ArrayInline: elements: @@ -277,14 +277,14 @@ outputs: line_stop: 1 col_start: 2 col_stop: 4 - path: array_inline.leo + path: test content: "[[]]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: array_inline.leo + path: test content: "[[]]" - ArrayInline: elements: @@ -296,7 +296,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 4 - path: array_inline.leo + path: test content: "[[], []]" - Expression: ArrayInline: @@ -306,12 +306,12 @@ outputs: line_stop: 1 col_start: 6 col_stop: 8 - path: array_inline.leo + path: test content: "[[], []]" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 9 - path: array_inline.leo + path: test content: "[[], []]" diff --git a/tests/parser/expression/array_inline_fail.leo.out b/tests/expectations/parser/parser/expression/array_inline_fail.leo.out similarity index 100% rename from tests/parser/expression/array_inline_fail.leo.out rename to tests/expectations/parser/parser/expression/array_inline_fail.leo.out diff --git a/tests/parser/expression/binary/add.leo.out b/tests/expectations/parser/parser/expression/binary/add.leo.out similarity index 88% rename from tests/parser/expression/binary/add.leo.out rename to tests/expectations/parser/parser/expression/binary/add.leo.out index 5595a097df..72d244dd8d 100644 --- a/tests/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: add.leo + path: test content: 1 + 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: add.leo + path: test content: 1 + 1 op: Add span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: add.leo + path: test content: 1 + 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: add.leo + path: test content: 2+3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: add.leo + path: test content: 2+3 op: Add span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: add.leo + path: test content: 2+3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: add.leo + path: test content: 1 + 2 + 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: add.leo + path: test content: 1 + 2 + 3 op: Add span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: add.leo + path: test content: 1 + 2 + 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: add.leo + path: test content: 1 + 2 + 3 op: Add span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: add.leo + path: test content: 1 + 2 + 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: add.leo + path: test content: 1 * 2 + 3 * 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: add.leo + path: test content: 1 * 2 + 3 * 4 op: Mul span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: add.leo + path: test content: 1 * 2 + 3 * 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: add.leo + path: test content: 1 * 2 + 3 * 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: add.leo + path: test content: 1 * 2 + 3 * 4 op: Mul span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: add.leo + path: test content: 1 * 2 + 3 * 4 op: Add span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: add.leo + path: test content: 1 * 2 + 3 * 4 - Binary: left: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: add.leo + path: test content: 1 + 2 - 3 right: Value: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: add.leo + path: test content: 1 + 2 - 3 op: Add span: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: add.leo + path: test content: 1 + 2 - 3 right: Value: @@ -217,7 +217,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: add.leo + path: test content: 1 + 2 - 3 op: Sub span: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: add.leo + path: test content: 1 + 2 - 3 - Binary: left: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: add.leo + path: test content: 1 * 2 + 3 * 4 - 5 * 6 right: Value: @@ -250,7 +250,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: add.leo + path: test 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: add.leo + path: test content: 1 * 2 + 3 * 4 - 5 * 6 right: Binary: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: add.leo + path: test content: 1 * 2 + 3 * 4 - 5 * 6 right: Value: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: add.leo + path: test 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: add.leo + path: test 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: add.leo + path: test content: 1 * 2 + 3 * 4 - 5 * 6 right: Binary: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 17 col_stop: 18 - path: add.leo + path: test content: 1 * 2 + 3 * 4 - 5 * 6 right: Value: @@ -318,7 +318,7 @@ outputs: line_stop: 1 col_start: 21 col_stop: 22 - path: add.leo + path: test 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: add.leo + path: test 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: add.leo + path: test content: 1 * 2 + 3 * 4 - 5 * 6 diff --git a/tests/parser/expression/binary/and.leo.out b/tests/expectations/parser/parser/expression/binary/and.leo.out similarity index 88% rename from tests/parser/expression/binary/and.leo.out rename to tests/expectations/parser/parser/expression/binary/and.leo.out index 61a88fa31d..b6f8de5d72 100644 --- a/tests/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: and.leo + path: test content: true && false right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: and.leo + path: test content: true && false op: And span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: and.leo + path: test content: true && false - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: and.leo + path: test content: false&&true right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 8 col_stop: 12 - path: and.leo + path: test content: false&&true op: And span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: and.leo + path: test content: false&&true - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: and.leo + path: test content: true&&false&&true right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 7 col_stop: 12 - path: and.leo + path: test content: true&&false&&true op: And span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: and.leo + path: test content: true&&false&&true right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 18 - path: and.leo + path: test content: true&&false&&true op: And span: @@ -107,5 +107,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 18 - path: and.leo + path: test content: true&&false&&true diff --git a/tests/parser/expression/binary/div.leo.out b/tests/expectations/parser/parser/expression/binary/div.leo.out similarity index 88% rename from tests/parser/expression/binary/div.leo.out rename to tests/expectations/parser/parser/expression/binary/div.leo.out index 3b07141bd6..45684cd859 100644 --- a/tests/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: div.leo + path: test content: 1 / 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: div.leo + path: test content: 1 / 1 op: Div span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: div.leo + path: test content: 1 / 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: div.leo + path: test content: 2/3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: div.leo + path: test content: 2/3 op: Div span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: div.leo + path: test content: 2/3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: div.leo + path: test content: 1 / 2 / 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: div.leo + path: test content: 1 / 2 / 3 op: Div span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: div.leo + path: test content: 1 / 2 / 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: div.leo + path: test content: 1 / 2 / 3 op: Div span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: div.leo + path: test content: 1 / 2 / 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: div.leo + path: test content: 1 ** 2 / 3 ** 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: div.leo + path: test content: 1 ** 2 / 3 ** 4 op: Pow span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: div.leo + path: test content: 1 ** 2 / 3 ** 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: div.leo + path: test content: 1 ** 2 / 3 ** 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 15 col_stop: 16 - path: div.leo + path: test content: 1 ** 2 / 3 ** 4 op: Pow span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 16 - path: div.leo + path: test content: 1 ** 2 / 3 ** 4 op: Div span: @@ -176,5 +176,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 16 - path: div.leo + path: test content: 1 ** 2 / 3 ** 4 diff --git a/tests/parser/expression/binary/eq.leo.out b/tests/expectations/parser/parser/expression/binary/eq.leo.out similarity index 88% rename from tests/parser/expression/binary/eq.leo.out rename to tests/expectations/parser/parser/expression/binary/eq.leo.out index d7976cc4a4..56f7df069c 100644 --- a/tests/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: eq.leo + path: test content: 1 == 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: eq.leo + path: test content: 1 == 1 op: Eq span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: eq.leo + path: test content: 1 == 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: eq.leo + path: test content: 2==3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 4 col_stop: 5 - path: eq.leo + path: test content: 2==3 op: Eq span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: eq.leo + path: test content: 2==3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: eq.leo + path: test content: 1 == 2 == 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: eq.leo + path: test content: 1 == 2 == 3 op: Eq span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: eq.leo + path: test content: 1 == 2 == 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: eq.leo + path: test content: 1 == 2 == 3 op: Eq span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: eq.leo + path: test content: 1 == 2 == 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 op: Lt span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 op: Lt span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 15 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 op: Eq span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 - Binary: left: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: eq.leo + path: test content: 1 == 2 == 3 right: Value: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: eq.leo + path: test content: 1 == 2 == 3 op: Eq span: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: eq.leo + path: test content: 1 == 2 == 3 right: Value: @@ -217,7 +217,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: eq.leo + path: test content: 1 == 2 == 3 op: Eq span: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: eq.leo + path: test content: 1 == 2 == 3 - Binary: left: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 == 5 < 6 right: Value: @@ -250,7 +250,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 == 5 < 6 op: Lt span: @@ -258,7 +258,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 == 5 < 6 right: Binary: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 == 5 < 6 right: Value: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 == 5 < 6 op: Lt span: @@ -288,7 +288,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 15 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 == 5 < 6 op: Eq span: @@ -296,7 +296,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 == 5 < 6 right: Binary: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 20 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 == 5 < 6 right: Value: @@ -318,7 +318,7 @@ outputs: line_stop: 1 col_start: 23 col_stop: 24 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 == 5 < 6 op: Lt span: @@ -326,7 +326,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 24 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 == 5 < 6 op: Eq span: @@ -334,5 +334,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 24 - path: eq.leo + path: test content: 1 < 2 == 3 < 4 == 5 < 6 diff --git a/tests/parser/expression/binary/exp.leo.out b/tests/expectations/parser/parser/expression/binary/exp.leo.out similarity index 88% rename from tests/parser/expression/binary/exp.leo.out rename to tests/expectations/parser/parser/expression/binary/exp.leo.out index b9314160fe..b0c39a877f 100644 --- a/tests/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: exp.leo + path: test content: 1 ** 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: exp.leo + path: test content: 1 ** 1 op: Pow span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: exp.leo + path: test content: 1 ** 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: exp.leo + path: test content: 2**3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 4 col_stop: 5 - path: exp.leo + path: test content: 2**3 op: Pow span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: exp.leo + path: test content: 2**3 - Binary: left: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: exp.leo + path: test content: 1 ** 2 ** 3 right: Binary: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: exp.leo + path: test content: 1 ** 2 ** 3 right: Value: @@ -91,7 +91,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: exp.leo + path: test content: 1 ** 2 ** 3 op: Pow span: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 12 - path: exp.leo + path: test content: 1 ** 2 ** 3 op: Pow span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: exp.leo + path: test content: 1 ** 2 ** 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: exp.leo + path: test 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: exp.leo + path: test content: 1 as i8 ** 3 as i8 right: Cast: @@ -141,7 +141,7 @@ outputs: line_stop: 1 col_start: 12 col_stop: 13 - path: exp.leo + path: test 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: exp.leo + path: test 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: exp.leo + path: test content: 1 as i8 ** 3 as i8 - Binary: left: @@ -171,7 +171,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: exp.leo + path: test 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: exp.leo + path: test 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: exp.leo + path: test 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: exp.leo + path: test 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: exp.leo + path: test 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: exp.leo + path: test 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: exp.leo + path: test 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: exp.leo + path: test content: 1 as i8 ** 3 as i8 ** 5 as i8 diff --git a/tests/parser/expression/binary/gt.leo.out b/tests/expectations/parser/parser/expression/binary/gt.leo.out similarity index 88% rename from tests/parser/expression/binary/gt.leo.out rename to tests/expectations/parser/parser/expression/binary/gt.leo.out index cc35d0435a..b9d5cfd72d 100644 --- a/tests/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: gt.leo + path: test content: 1 > 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: gt.leo + path: test content: 1 > 1 op: Gt span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: gt.leo + path: test content: 1 > 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: gt.leo + path: test content: 2>3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: gt.leo + path: test content: 2>3 op: Gt span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: gt.leo + path: test content: 2>3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: gt.leo + path: test content: 1 > 2 > 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: gt.leo + path: test content: 1 > 2 > 3 op: Gt span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: gt.leo + path: test content: 1 > 2 > 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: gt.leo + path: test content: 1 > 2 > 3 op: Gt span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: gt.leo + path: test content: 1 > 2 > 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: gt.leo + path: test content: 1 + 2 > 3 + 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: gt.leo + path: test content: 1 + 2 > 3 + 4 op: Add span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: gt.leo + path: test content: 1 + 2 > 3 + 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: gt.leo + path: test content: 1 + 2 > 3 + 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: gt.leo + path: test content: 1 + 2 > 3 + 4 op: Add span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: gt.leo + path: test content: 1 + 2 > 3 + 4 op: Gt span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: gt.leo + path: test content: 1 + 2 > 3 + 4 - Binary: left: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: gt.leo + path: test content: 1 > 2 > 3 right: Value: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: gt.leo + path: test content: 1 > 2 > 3 op: Gt span: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: gt.leo + path: test content: 1 > 2 > 3 right: Value: @@ -217,7 +217,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: gt.leo + path: test content: 1 > 2 > 3 op: Gt span: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: gt.leo + path: test content: 1 > 2 > 3 - Binary: left: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: gt.leo + path: test content: 1 + 2 > 3 + 4 > 5 + 6 right: Value: @@ -250,7 +250,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: gt.leo + path: test 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: gt.leo + path: test content: 1 + 2 > 3 + 4 > 5 + 6 right: Binary: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: gt.leo + path: test content: 1 + 2 > 3 + 4 > 5 + 6 right: Value: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: gt.leo + path: test 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: gt.leo + path: test 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: gt.leo + path: test content: 1 + 2 > 3 + 4 > 5 + 6 right: Binary: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 17 col_stop: 18 - path: gt.leo + path: test content: 1 + 2 > 3 + 4 > 5 + 6 right: Value: @@ -318,7 +318,7 @@ outputs: line_stop: 1 col_start: 21 col_stop: 22 - path: gt.leo + path: test 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: gt.leo + path: test 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: gt.leo + path: test content: 1 + 2 > 3 + 4 > 5 + 6 diff --git a/tests/parser/expression/binary/gte.leo.out b/tests/expectations/parser/parser/expression/binary/gte.leo.out similarity index 88% rename from tests/parser/expression/binary/gte.leo.out rename to tests/expectations/parser/parser/expression/binary/gte.leo.out index ca598106e5..9ab526f71c 100644 --- a/tests/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: gte.leo + path: test content: 1 >= 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: gte.leo + path: test content: 1 >= 1 op: Ge span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: gte.leo + path: test content: 1 >= 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: gte.leo + path: test content: 2 >= 3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: gte.leo + path: test content: 2 >= 3 op: Ge span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: gte.leo + path: test content: 2 >= 3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: gte.leo + path: test content: 1 >= 2 >= 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: gte.leo + path: test content: 1 >= 2 >= 3 op: Ge span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: gte.leo + path: test content: 1 >= 2 >= 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: gte.leo + path: test content: 1 >= 2 >= 3 op: Ge span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: gte.leo + path: test content: 1 >= 2 >= 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: gte.leo + path: test content: 1 + 2 >= 3 + 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: gte.leo + path: test content: 1 + 2 >= 3 + 4 op: Add span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: gte.leo + path: test content: 1 + 2 >= 3 + 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: gte.leo + path: test content: 1 + 2 >= 3 + 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: gte.leo + path: test content: 1 + 2 >= 3 + 4 op: Add span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 15 - path: gte.leo + path: test content: 1 + 2 >= 3 + 4 op: Ge span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: gte.leo + path: test content: 1 + 2 >= 3 + 4 - Binary: left: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: gte.leo + path: test content: 1 >= 2 >= 3 right: Value: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: gte.leo + path: test content: 1 >= 2 >= 3 op: Ge span: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: gte.leo + path: test content: 1 >= 2 >= 3 right: Value: @@ -217,7 +217,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: gte.leo + path: test content: 1 >= 2 >= 3 op: Ge span: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: gte.leo + path: test content: 1 >= 2 >= 3 - Binary: left: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: gte.leo + path: test content: 1 + 2 >= 3 + 4 >= 5 + 6 right: Value: @@ -250,7 +250,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: gte.leo + path: test 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: gte.leo + path: test content: 1 + 2 >= 3 + 4 >= 5 + 6 right: Binary: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: gte.leo + path: test content: 1 + 2 >= 3 + 4 >= 5 + 6 right: Value: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: gte.leo + path: test 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: gte.leo + path: test 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: gte.leo + path: test content: 1 + 2 >= 3 + 4 >= 5 + 6 right: Binary: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 20 - path: gte.leo + path: test content: 1 + 2 >= 3 + 4 >= 5 + 6 right: Value: @@ -318,7 +318,7 @@ outputs: line_stop: 1 col_start: 23 col_stop: 24 - path: gte.leo + path: test 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: gte.leo + path: test 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: gte.leo + path: test content: 1 + 2 >= 3 + 4 >= 5 + 6 diff --git a/tests/parser/expression/binary/lt.leo.out b/tests/expectations/parser/parser/expression/binary/lt.leo.out similarity index 88% rename from tests/parser/expression/binary/lt.leo.out rename to tests/expectations/parser/parser/expression/binary/lt.leo.out index 692f6bba38..9879afc9d3 100644 --- a/tests/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: lt.leo + path: test content: 1 < 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: lt.leo + path: test content: 1 < 1 op: Lt span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: lt.leo + path: test content: 1 < 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: lt.leo + path: test content: 2<3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: lt.leo + path: test content: 2<3 op: Lt span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: lt.leo + path: test content: 2<3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: lt.leo + path: test content: 1 < 2 < 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: lt.leo + path: test content: 1 < 2 < 3 op: Lt span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: lt.leo + path: test content: 1 < 2 < 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: lt.leo + path: test content: 1 < 2 < 3 op: Lt span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: lt.leo + path: test content: 1 < 2 < 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: lt.leo + path: test content: 1 + 2 < 3 + 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: lt.leo + path: test content: 1 + 2 < 3 + 4 op: Add span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: lt.leo + path: test content: 1 + 2 < 3 + 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: lt.leo + path: test content: 1 + 2 < 3 + 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: lt.leo + path: test content: 1 + 2 < 3 + 4 op: Add span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: lt.leo + path: test content: 1 + 2 < 3 + 4 op: Lt span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: lt.leo + path: test content: 1 + 2 < 3 + 4 - Binary: left: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: lt.leo + path: test content: 1 < 2 < 3 right: Value: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: lt.leo + path: test content: 1 < 2 < 3 op: Lt span: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: lt.leo + path: test content: 1 < 2 < 3 right: Value: @@ -217,7 +217,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: lt.leo + path: test content: 1 < 2 < 3 op: Lt span: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: lt.leo + path: test content: 1 < 2 < 3 - Binary: left: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: lt.leo + path: test content: 1 + 2 < 3 + 4 < 5 + 6 right: Value: @@ -250,7 +250,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: lt.leo + path: test 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: lt.leo + path: test content: 1 + 2 < 3 + 4 < 5 + 6 right: Binary: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: lt.leo + path: test content: 1 + 2 < 3 + 4 < 5 + 6 right: Value: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: lt.leo + path: test 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: lt.leo + path: test 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: lt.leo + path: test content: 1 + 2 < 3 + 4 < 5 + 6 right: Binary: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 17 col_stop: 18 - path: lt.leo + path: test content: 1 + 2 < 3 + 4 < 5 + 6 right: Value: @@ -318,7 +318,7 @@ outputs: line_stop: 1 col_start: 21 col_stop: 22 - path: lt.leo + path: test 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: lt.leo + path: test 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: lt.leo + path: test content: 1 + 2 < 3 + 4 < 5 + 6 diff --git a/tests/parser/expression/binary/lte.leo.out b/tests/expectations/parser/parser/expression/binary/lte.leo.out similarity index 88% rename from tests/parser/expression/binary/lte.leo.out rename to tests/expectations/parser/parser/expression/binary/lte.leo.out index be62ef6e38..f40df4bddb 100644 --- a/tests/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: lte.leo + path: test content: 1 <= 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: lte.leo + path: test content: 1 <= 1 op: Le span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: lte.leo + path: test content: 1 <= 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: lte.leo + path: test content: 2 <= 3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: lte.leo + path: test content: 2 <= 3 op: Le span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: lte.leo + path: test content: 2 <= 3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: lte.leo + path: test content: 1 <= 2 <= 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: lte.leo + path: test content: 1 <= 2 <= 3 op: Le span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: lte.leo + path: test content: 1 <= 2 <= 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: lte.leo + path: test content: 1 <= 2 <= 3 op: Le span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: lte.leo + path: test content: 1 <= 2 <= 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: lte.leo + path: test content: 1 + 2 <= 3 + 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: lte.leo + path: test content: 1 + 2 <= 3 + 4 op: Add span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: lte.leo + path: test content: 1 + 2 <= 3 + 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: lte.leo + path: test content: 1 + 2 <= 3 + 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: lte.leo + path: test content: 1 + 2 <= 3 + 4 op: Add span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 15 - path: lte.leo + path: test content: 1 + 2 <= 3 + 4 op: Le span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: lte.leo + path: test content: 1 + 2 <= 3 + 4 - Binary: left: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: lte.leo + path: test content: 1 <= 2 <= 3 right: Value: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: lte.leo + path: test content: 1 <= 2 <= 3 op: Le span: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: lte.leo + path: test content: 1 <= 2 <= 3 right: Value: @@ -217,7 +217,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: lte.leo + path: test content: 1 <= 2 <= 3 op: Le span: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: lte.leo + path: test content: 1 <= 2 <= 3 - Binary: left: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: lte.leo + path: test content: 1 + 2 <= 3 + 4 <= 5 + 6 right: Value: @@ -250,7 +250,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: lte.leo + path: test 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: lte.leo + path: test content: 1 + 2 <= 3 + 4 <= 5 + 6 right: Binary: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: lte.leo + path: test content: 1 + 2 <= 3 + 4 <= 5 + 6 right: Value: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: lte.leo + path: test 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: lte.leo + path: test 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: lte.leo + path: test content: 1 + 2 <= 3 + 4 <= 5 + 6 right: Binary: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 20 - path: lte.leo + path: test content: 1 + 2 <= 3 + 4 <= 5 + 6 right: Value: @@ -318,7 +318,7 @@ outputs: line_stop: 1 col_start: 23 col_stop: 24 - path: lte.leo + path: test 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: lte.leo + path: test 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: lte.leo + path: test content: 1 + 2 <= 3 + 4 <= 5 + 6 diff --git a/tests/parser/expression/binary/mul.leo.out b/tests/expectations/parser/parser/expression/binary/mul.leo.out similarity index 88% rename from tests/parser/expression/binary/mul.leo.out rename to tests/expectations/parser/parser/expression/binary/mul.leo.out index 6fa4de11d3..c146eeee15 100644 --- a/tests/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: mul.leo + path: test content: 1 * 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: mul.leo + path: test content: 1 * 1 op: Mul span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: mul.leo + path: test content: 1 * 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: mul.leo + path: test content: 2*3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: mul.leo + path: test content: 2*3 op: Mul span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: mul.leo + path: test content: 2*3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: mul.leo + path: test content: 1 * 2 * 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: mul.leo + path: test content: 1 * 2 * 3 op: Mul span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: mul.leo + path: test content: 1 * 2 * 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: mul.leo + path: test content: 1 * 2 * 3 op: Mul span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: mul.leo + path: test content: 1 * 2 * 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: mul.leo + path: test content: 1 ** 2 * 3 ** 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: mul.leo + path: test content: 1 ** 2 * 3 ** 4 op: Pow span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: mul.leo + path: test content: 1 ** 2 * 3 ** 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: mul.leo + path: test content: 1 ** 2 * 3 ** 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 15 col_stop: 16 - path: mul.leo + path: test content: 1 ** 2 * 3 ** 4 op: Pow span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 16 - path: mul.leo + path: test content: 1 ** 2 * 3 ** 4 op: Mul span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 16 - path: mul.leo + path: test content: 1 ** 2 * 3 ** 4 - Binary: left: @@ -191,7 +191,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: mul.leo + path: test content: 1 ** 2 * 3 ** 4 / 5 ** 6 right: Value: @@ -201,7 +201,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: mul.leo + path: test 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: mul.leo + path: test content: 1 ** 2 * 3 ** 4 / 5 ** 6 right: Binary: @@ -221,7 +221,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: mul.leo + path: test content: 1 ** 2 * 3 ** 4 / 5 ** 6 right: Value: @@ -231,7 +231,7 @@ outputs: line_stop: 1 col_start: 15 col_stop: 16 - path: mul.leo + path: test 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: mul.leo + path: test 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: mul.leo + path: test content: 1 ** 2 * 3 ** 4 / 5 ** 6 right: Binary: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 20 - path: mul.leo + path: test content: 1 ** 2 * 3 ** 4 / 5 ** 6 right: Value: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 24 col_stop: 25 - path: mul.leo + path: test 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: mul.leo + path: test 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: mul.leo + path: test content: 1 ** 2 * 3 ** 4 / 5 ** 6 diff --git a/tests/parser/expression/binary/ne.leo.out b/tests/expectations/parser/parser/expression/binary/ne.leo.out similarity index 88% rename from tests/parser/expression/binary/ne.leo.out rename to tests/expectations/parser/parser/expression/binary/ne.leo.out index 952ee3254e..65fb6e2298 100644 --- a/tests/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: ne.leo + path: test content: 1 != 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: ne.leo + path: test content: 1 != 1 op: Ne span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: ne.leo + path: test content: 1 != 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: ne.leo + path: test content: 2!=3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 4 col_stop: 5 - path: ne.leo + path: test content: 2!=3 op: Ne span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: ne.leo + path: test content: 2!=3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: ne.leo + path: test content: 1 != 2 != 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: ne.leo + path: test content: 1 != 2 != 3 op: Ne span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: ne.leo + path: test content: 1 != 2 != 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: ne.leo + path: test content: 1 != 2 != 3 op: Ne span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: ne.leo + path: test content: 1 != 2 != 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 op: Lt span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 op: Lt span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 15 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 op: Ne span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 - Binary: left: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: ne.leo + path: test content: 1 != 2 != 3 right: Value: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: ne.leo + path: test content: 1 != 2 != 3 op: Ne span: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: ne.leo + path: test content: 1 != 2 != 3 right: Value: @@ -217,7 +217,7 @@ outputs: line_stop: 1 col_start: 11 col_stop: 12 - path: ne.leo + path: test content: 1 != 2 != 3 op: Ne span: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: ne.leo + path: test content: 1 != 2 != 3 - Binary: left: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 != 5 < 6 right: Value: @@ -250,7 +250,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 != 5 < 6 op: Lt span: @@ -258,7 +258,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 != 5 < 6 right: Binary: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 != 5 < 6 right: Value: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 14 col_stop: 15 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 != 5 < 6 op: Lt span: @@ -288,7 +288,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 15 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 != 5 < 6 op: Ne span: @@ -296,7 +296,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 != 5 < 6 right: Binary: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 20 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 != 5 < 6 right: Value: @@ -318,7 +318,7 @@ outputs: line_stop: 1 col_start: 23 col_stop: 24 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 != 5 < 6 op: Lt span: @@ -326,7 +326,7 @@ outputs: line_stop: 1 col_start: 19 col_stop: 24 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 != 5 < 6 op: Ne span: @@ -334,5 +334,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 24 - path: ne.leo + path: test content: 1 < 2 != 3 < 4 != 5 < 6 diff --git a/tests/parser/expression/binary/or.leo.out b/tests/expectations/parser/parser/expression/binary/or.leo.out similarity index 88% rename from tests/parser/expression/binary/or.leo.out rename to tests/expectations/parser/parser/expression/binary/or.leo.out index e66475de94..72d244dd8d 100644 --- a/tests/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: or.leo + path: test content: 1 + 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: or.leo + path: test content: 1 + 1 op: Add span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: or.leo + path: test content: 1 + 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: or.leo + path: test content: 2+3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: or.leo + path: test content: 2+3 op: Add span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: or.leo + path: test content: 2+3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: or.leo + path: test content: 1 + 2 + 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: or.leo + path: test content: 1 + 2 + 3 op: Add span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: or.leo + path: test content: 1 + 2 + 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: or.leo + path: test content: 1 + 2 + 3 op: Add span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: or.leo + path: test content: 1 + 2 + 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: or.leo + path: test content: 1 * 2 + 3 * 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: or.leo + path: test content: 1 * 2 + 3 * 4 op: Mul span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: or.leo + path: test content: 1 * 2 + 3 * 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: or.leo + path: test content: 1 * 2 + 3 * 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: or.leo + path: test content: 1 * 2 + 3 * 4 op: Mul span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: or.leo + path: test content: 1 * 2 + 3 * 4 op: Add span: @@ -176,7 +176,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: or.leo + path: test content: 1 * 2 + 3 * 4 - Binary: left: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: or.leo + path: test content: 1 + 2 - 3 right: Value: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: or.leo + path: test content: 1 + 2 - 3 op: Add span: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: or.leo + path: test content: 1 + 2 - 3 right: Value: @@ -217,7 +217,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: or.leo + path: test content: 1 + 2 - 3 op: Sub span: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: or.leo + path: test content: 1 + 2 - 3 - Binary: left: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: or.leo + path: test content: 1 * 2 + 3 * 4 - 5 * 6 right: Value: @@ -250,7 +250,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: or.leo + path: test 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: or.leo + path: test content: 1 * 2 + 3 * 4 - 5 * 6 right: Binary: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: or.leo + path: test content: 1 * 2 + 3 * 4 - 5 * 6 right: Value: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: or.leo + path: test 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: or.leo + path: test 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: or.leo + path: test content: 1 * 2 + 3 * 4 - 5 * 6 right: Binary: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 17 col_stop: 18 - path: or.leo + path: test content: 1 * 2 + 3 * 4 - 5 * 6 right: Value: @@ -318,7 +318,7 @@ outputs: line_stop: 1 col_start: 21 col_stop: 22 - path: or.leo + path: test 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: or.leo + path: test 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: or.leo + path: test content: 1 * 2 + 3 * 4 - 5 * 6 diff --git a/tests/parser/expression/binary/sub.leo.out b/tests/expectations/parser/parser/expression/binary/sub.leo.out similarity index 88% rename from tests/parser/expression/binary/sub.leo.out rename to tests/expectations/parser/parser/expression/binary/sub.leo.out index 4b9d325467..4e39639fe2 100644 --- a/tests/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: sub.leo + path: test content: 1 - 1 right: Value: @@ -21,7 +21,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: sub.leo + path: test content: 1 - 1 op: Sub span: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: sub.leo + path: test content: 1 - 1 - Binary: left: @@ -40,7 +40,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: sub.leo + path: test content: 2-3 right: Value: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: sub.leo + path: test content: 2-3 op: Sub span: @@ -58,7 +58,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: sub.leo + path: test content: 2-3 - Binary: left: @@ -71,7 +71,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: sub.leo + path: test content: 1 - 2 - 3 right: Value: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: sub.leo + path: test content: 1 - 2 - 3 op: Sub span: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: sub.leo + path: test content: 1 - 2 - 3 right: Value: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: sub.leo + path: test content: 1 - 2 - 3 op: Sub span: @@ -107,7 +107,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: sub.leo + path: test content: 1 - 2 - 3 - Binary: left: @@ -120,7 +120,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 2 - path: sub.leo + path: test content: 1 * 2 - 3 * 4 right: Value: @@ -130,7 +130,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: sub.leo + path: test content: 1 * 2 - 3 * 4 op: Mul span: @@ -138,7 +138,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: sub.leo + path: test content: 1 * 2 - 3 * 4 right: Binary: @@ -150,7 +150,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 10 - path: sub.leo + path: test content: 1 * 2 - 3 * 4 right: Value: @@ -160,7 +160,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: sub.leo + path: test content: 1 * 2 - 3 * 4 op: Mul span: @@ -168,7 +168,7 @@ outputs: line_stop: 1 col_start: 9 col_stop: 14 - path: sub.leo + path: test content: 1 * 2 - 3 * 4 op: Sub span: @@ -176,5 +176,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: sub.leo + path: test content: 1 * 2 - 3 * 4 diff --git a/tests/parser/expression/cast.leo.out b/tests/expectations/parser/parser/expression/cast.leo.out similarity index 78% rename from tests/parser/expression/cast.leo.out rename to tests/expectations/parser/parser/expression/cast.leo.out index 092a88bb7c..25ace32c14 100644 --- a/tests/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\\\":\\\"cast.leo\\\",\\\"content\\\":\\\"x as u8\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x as u8\\\"}\"}" target_type: IntegerType: U8 span: @@ -12,23 +12,23 @@ outputs: line_stop: 1 col_start: 1 col_stop: 8 - path: cast.leo + path: test content: x as u8 - Cast: inner: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"cast.leo\\\",\\\"content\\\":\\\"y as id\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"y as id\\\"}\"}" target_type: - Circuit: "{\"name\":\"id\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":8,\\\"path\\\":\\\"cast.leo\\\",\\\"content\\\":\\\"y as id\\\"}\"}" + Circuit: "{\"name\":\"id\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"y as id\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: cast.leo + path: test content: y as id - Cast: inner: - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"cast.leo\\\",\\\"content\\\":\\\"z as u32\\\"}\"}" + Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"z as u32\\\"}\"}" target_type: IntegerType: U32 span: @@ -36,11 +36,11 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: cast.leo + path: test content: z as u32 - Cast: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"cast.leo\\\",\\\"content\\\":\\\"x as i128\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x as i128\\\"}\"}" target_type: IntegerType: I128 span: @@ -48,13 +48,13 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: cast.leo + path: test 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\\\":\\\"cast.leo\\\",\\\"content\\\":\\\"x as u8 as u128\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"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: cast.leo + path: test 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: cast.leo + path: test 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\\\":\\\"cast.leo\\\",\\\"content\\\":\\\"x as field\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x as field\\\"}\"}" target_type: Field span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: cast.leo + path: test content: x as field - Cast: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"cast.leo\\\",\\\"content\\\":\\\"x as group\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x as group\\\"}\"}" target_type: Group span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: cast.leo + path: test content: x as group - Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"cast.leo\\\",\\\"content\\\":\\\"x ** y as u32 ** z\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"cast.leo\\\",\\\"content\\\":\\\"x ** y as u32 ** z\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"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: cast.leo + path: test content: x ** y as u32 ** z right: - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"cast.leo\\\",\\\"content\\\":\\\"x ** y as u32 ** z\\\"}\"}" + Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ** y as u32 ** z\\\"}\"}" op: Pow span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 19 - path: cast.leo + path: test content: x ** y as u32 ** z op: Pow span: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 19 - path: cast.leo + path: test 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\\\":\\\"cast.leo\\\",\\\"content\\\":\\\"!x as u32\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"!x as u32\\\"}\"}" op: Not span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 3 - path: cast.leo + path: test content: "!x as u32" target_type: IntegerType: U32 @@ -160,20 +160,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: cast.leo + path: test 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\\\":\\\"cast.leo\\\",\\\"content\\\":\\\"-x as u32\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"-x as u32\\\"}\"}" op: Negate span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 3 - path: cast.leo + path: test content: "-x as u32" target_type: IntegerType: U32 @@ -182,5 +182,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: cast.leo + path: test content: "-x as u32" diff --git a/tests/parser/expression/circuit_init.leo.out b/tests/expectations/parser/parser/expression/circuit_init.leo.out similarity index 70% rename from tests/parser/expression/circuit_init.leo.out rename to tests/expectations/parser/parser/expression/circuit_init.leo.out index de28a83b7f..4295420d95 100644 --- a/tests/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\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x {}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x {}\\\"}\"}" members: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: circuit_init.leo + path: test content: "x {}" - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x {y}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x {y}\\\"}\"}" members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x {y}\\\"}\"}" + - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x {y}\\\"}\"}" expression: ~ span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 6 - path: circuit_init.leo + path: test content: "x {y}" - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y}\\\"}\"}" members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y}\\\"}\"}" + - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y}\\\"}\"}" expression: ~ span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: circuit_init.leo + path: test content: "x{y}" - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{}\\\"}\"}" members: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: circuit_init.leo + path: test content: "x{}" - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y: y}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: y}\\\"}\"}" members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y: y}\\\"}\"}" + - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: y}\\\"}\"}" expression: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y: y}\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: y}\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: circuit_init.leo + path: test content: "x{y: y}" - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y: x}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: x}\\\"}\"}" members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y: x}\\\"}\"}" + - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: x}\\\"}\"}" expression: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y: x}\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: x}\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: circuit_init.leo + path: test content: "x{y: x}" - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y: x,}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: x,}\\\"}\"}" members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y: x,}\\\"}\"}" + - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: x,}\\\"}\"}" expression: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y: x,}\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y: x,}\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 9 - path: circuit_init.leo + path: test content: "x{y: x,}" - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" + name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" + - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" expression: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" - - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" + 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,}\\\"}\"}" expression: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 13 - path: circuit_init.leo + path: test content: "x{y:x, x:y,}" - CircuitInit: - name: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"circuit_init.leo\\\",\\\"content\\\":\\\"Self {}\\\"}\"}" + name: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"Self {}\\\"}\"}" members: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: circuit_init.leo + path: test content: "Self {}" diff --git a/tests/parser/expression/circuit_init_fail.leo.out b/tests/expectations/parser/parser/expression/circuit_init_fail.leo.out similarity index 100% rename from tests/parser/expression/circuit_init_fail.leo.out rename to tests/expectations/parser/parser/expression/circuit_init_fail.leo.out diff --git a/tests/parser/expression/ident.leo.out b/tests/expectations/parser/parser/expression/ident.leo.out similarity index 66% rename from tests/parser/expression/ident.leo.out rename to tests/expectations/parser/parser/expression/ident.leo.out index a3806d1694..a92fc0c1c8 100644 --- a/tests/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\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"x\\\"}\"}" - - Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"X\\\"}\"}" - - Identifier: "{\"name\":\"xxx\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"xxx\\\"}\"}" - - Identifier: "{\"name\":\"XXX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"XXX\\\"}\"}" - - Identifier: "{\"name\":\"x1\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"x1\\\"}\"}" - - Identifier: "{\"name\":\"xu32\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"xu32\\\"}\"}" - - Identifier: "{\"name\":\"testx\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"testx\\\"}\"}" - - Identifier: "{\"name\":\"truex\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"truex\\\"}\"}" - - Identifier: "{\"name\":\"TRUE\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"TRUE\\\"}\"}" - - Identifier: "{\"name\":\"testX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"testX\\\"}\"}" - - Identifier: "{\"name\":\"letX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"letX\\\"}\"}" - - Identifier: "{\"name\":\"constX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":7,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"constX\\\"}\"}" - - Identifier: "{\"name\":\"test_test\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":10,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"test_test\\\"}\"}" - - Identifier: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"self\\\"}\"}" - - Identifier: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"Self\\\"}\"}" - - Identifier: "{\"name\":\"input\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"input\\\"}\"}" - - Identifier: "{\"name\":\"selfX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"selfX\\\"}\"}" - - Identifier: "{\"name\":\"SelfX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"SelfX\\\"}\"}" - - Identifier: "{\"name\":\"inputX\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":7,\\\"path\\\":\\\"ident.leo\\\",\\\"content\\\":\\\"inputX\\\"}\"}" + - 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\\\"}\"}" diff --git a/tests/parser/expression/literal/address.leo.out b/tests/expectations/parser/parser/expression/literal/address.leo.out similarity index 100% rename from tests/parser/expression/literal/address.leo.out rename to tests/expectations/parser/parser/expression/literal/address.leo.out diff --git a/tests/parser/expression/literal/address_fail.leo.out b/tests/expectations/parser/parser/expression/literal/address_fail.leo.out similarity index 100% rename from tests/parser/expression/literal/address_fail.leo.out rename to tests/expectations/parser/parser/expression/literal/address_fail.leo.out diff --git a/tests/parser/expression/literal/address_parse.leo.out b/tests/expectations/parser/parser/expression/literal/address_parse.leo.out similarity index 89% rename from tests/parser/expression/literal/address_parse.leo.out rename to tests/expectations/parser/parser/expression/literal/address_parse.leo.out index fa74c96da2..ce2e019189 100644 --- a/tests/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: address_parse.leo + path: test content: aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 - Value: Address: @@ -18,7 +18,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 64 - path: address_parse.leo + path: test content: aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j9 - Value: Address: @@ -27,7 +27,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 64 - path: address_parse.leo + path: test content: aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d9 - Value: Address: @@ -36,5 +36,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 64 - path: address_parse.leo + path: test content: aleo1aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8st diff --git a/tests/parser/expression/literal/bool.leo.out b/tests/expectations/parser/parser/expression/literal/bool.leo.out similarity index 100% rename from tests/parser/expression/literal/bool.leo.out rename to tests/expectations/parser/parser/expression/literal/bool.leo.out diff --git a/tests/parser/expression/literal/bool_parse.leo.out b/tests/expectations/parser/parser/expression/literal/bool_parse.leo.out similarity index 86% rename from tests/parser/expression/literal/bool_parse.leo.out rename to tests/expectations/parser/parser/expression/literal/bool_parse.leo.out index e2ef21af52..85b9453e0b 100644 --- a/tests/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: bool_parse.leo + path: test content: "true" - Value: Boolean: @@ -18,5 +18,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: bool_parse.leo + path: test content: "false" diff --git a/tests/parser/expression/literal/comment.leo.out b/tests/expectations/parser/parser/expression/literal/comment.leo.out similarity index 100% rename from tests/parser/expression/literal/comment.leo.out rename to tests/expectations/parser/parser/expression/literal/comment.leo.out diff --git a/tests/parser/expression/literal/formatted_string.leo.out b/tests/expectations/parser/parser/expression/literal/formatted_string.leo.out similarity index 100% rename from tests/parser/expression/literal/formatted_string.leo.out rename to tests/expectations/parser/parser/expression/literal/formatted_string.leo.out diff --git a/tests/parser/expression/literal/group.leo.out b/tests/expectations/parser/parser/expression/literal/group.leo.out similarity index 87% rename from tests/parser/expression/literal/group.leo.out rename to tests/expectations/parser/parser/expression/literal/group.leo.out index 3c9383d10a..2a4389526e 100644 --- a/tests/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: group.leo + path: test content: "(+, _)group" - Value: Group: @@ -24,7 +24,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 12 - path: group.leo + path: test content: "(_, -)group" - Value: Group: @@ -36,7 +36,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 12 - path: group.leo + path: test content: "(+, -)group" - Value: Group: @@ -48,7 +48,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 12 - path: group.leo + path: test content: "(-, +)group" - Value: Group: @@ -60,7 +60,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 12 - path: group.leo + path: test content: "(+, +)group" - Value: Group: @@ -72,7 +72,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 12 - path: group.leo + path: test content: "(-, -)group" - Value: Group: @@ -84,7 +84,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 12 - path: group.leo + path: test content: "(_, _)group" - Value: Group: @@ -96,7 +96,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: group.leo + path: test content: "(123,-456)group" y: Number: @@ -105,14 +105,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: group.leo + path: test content: "(123,-456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: group.leo + path: test content: "(123,-456)group" - Value: Group: @@ -124,7 +124,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 6 - path: group.leo + path: test content: "(-123,456)group" y: Number: @@ -133,14 +133,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: group.leo + path: test content: "(-123,456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: group.leo + path: test content: "(-123,456)group" - Value: Group: @@ -152,7 +152,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 6 - path: group.leo + path: test content: "(-123,456)group" y: Number: @@ -161,14 +161,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: group.leo + path: test content: "(-123,456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: group.leo + path: test content: "(-123,456)group" - Value: Group: @@ -180,7 +180,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: group.leo + path: test content: "(123, _)group" y: Inferred span: @@ -188,7 +188,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 14 - path: group.leo + path: test content: "(123, _)group" - Value: Group: @@ -200,7 +200,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: group.leo + path: test content: "(123, -)group" y: SignLow span: @@ -208,7 +208,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 14 - path: group.leo + path: test content: "(123, -)group" - Value: Group: @@ -220,7 +220,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: group.leo + path: test content: "(123, -)group" y: SignLow span: @@ -228,7 +228,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 14 - path: group.leo + path: test content: "(123, -)group" - Value: Group: @@ -240,7 +240,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: group.leo + path: test content: "(123, +)group" y: SignHigh span: @@ -248,7 +248,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 14 - path: group.leo + path: test content: "(123, +)group" - Value: Group: @@ -260,7 +260,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: group.leo + path: test content: "(123, +)group" y: SignHigh span: @@ -268,7 +268,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 14 - path: group.leo + path: test content: "(123, +)group" - Value: Group: @@ -280,7 +280,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: group.leo + path: test content: "(123, -)group" y: SignLow span: @@ -288,7 +288,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 14 - path: group.leo + path: test content: "(123, -)group" - Value: Group: @@ -300,7 +300,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: group.leo + path: test content: "(123, _)group" y: Inferred span: @@ -308,7 +308,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 14 - path: group.leo + path: test content: "(123, _)group" - Value: Group: @@ -321,14 +321,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: group.leo + path: test content: "(+, 345)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 14 - path: group.leo + path: test content: "(+, 345)group" - Value: Group: @@ -341,14 +341,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: group.leo + path: test content: "(_, 345)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 14 - path: group.leo + path: test content: "(_, 345)group" - Value: Group: @@ -361,14 +361,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: group.leo + path: test content: "(+, 345)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 14 - path: group.leo + path: test content: "(+, 345)group" - Value: Group: @@ -381,14 +381,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: group.leo + path: test content: "(-, 345)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 14 - path: group.leo + path: test content: "(-, 345)group" - Value: Group: @@ -401,14 +401,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: group.leo + path: test content: "(+, 345)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 14 - path: group.leo + path: test content: "(+, 345)group" - Value: Group: @@ -421,14 +421,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: group.leo + path: test content: "(-, 345)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 14 - path: group.leo + path: test content: "(-, 345)group" - Value: Group: @@ -441,14 +441,14 @@ outputs: line_stop: 1 col_start: 5 col_stop: 8 - path: group.leo + path: test content: "(_, 345)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 14 - path: group.leo + path: test content: "(_, 345)group" - Value: Group: @@ -460,7 +460,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: group.leo + path: test content: "(123, 456)group" y: Number: @@ -469,14 +469,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: group.leo + path: test content: "(123, 456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: group.leo + path: test content: "(123, 456)group" - Value: Group: @@ -488,7 +488,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: group.leo + path: test content: "(123, 456)group" y: Number: @@ -497,14 +497,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: group.leo + path: test content: "(123, 456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: group.leo + path: test content: "(123, 456)group" - Value: Group: @@ -516,7 +516,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: group.leo + path: test content: "(123, 456)group" y: Number: @@ -525,14 +525,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: group.leo + path: test content: "(123, 456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: group.leo + path: test content: "(123, 456)group" - Value: Group: @@ -544,7 +544,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: group.leo + path: test content: "(123, 456)group" y: Number: @@ -553,14 +553,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: group.leo + path: test content: "(123, 456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: group.leo + path: test content: "(123, 456)group" - Value: Group: @@ -572,7 +572,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: group.leo + path: test content: "(123, 456)group" y: Number: @@ -581,14 +581,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: group.leo + path: test content: "(123, 456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: group.leo + path: test content: "(123, 456)group" - Value: Group: @@ -600,7 +600,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: group.leo + path: test content: "(123, 456)group" y: Number: @@ -609,14 +609,14 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: group.leo + path: test content: "(123, 456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: group.leo + path: test content: "(123, 456)group" - Value: Group: @@ -628,7 +628,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: group.leo + path: test content: "(123, 456)group" y: Number: @@ -637,12 +637,12 @@ outputs: line_stop: 1 col_start: 7 col_stop: 10 - path: group.leo + path: test content: "(123, 456)group" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 16 - path: group.leo + path: test content: "(123, 456)group" diff --git a/tests/parser/expression/literal/group_fail.leo.out b/tests/expectations/parser/parser/expression/literal/group_fail.leo.out similarity index 100% rename from tests/parser/expression/literal/group_fail.leo.out rename to tests/expectations/parser/parser/expression/literal/group_fail.leo.out diff --git a/tests/parser/expression/literal/int.leo.out b/tests/expectations/parser/parser/expression/literal/int.leo.out similarity index 100% rename from tests/parser/expression/literal/int.leo.out rename to tests/expectations/parser/parser/expression/literal/int.leo.out diff --git a/tests/parser/expression/literal/int_parse/field.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/field.leo.out similarity index 87% rename from tests/parser/expression/literal/int_parse/field.leo.out rename to tests/expectations/parser/parser/expression/literal/int_parse/field.leo.out index 63a5eb2315..c7f5f3576f 100644 --- a/tests/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: field.leo + path: test content: 123field - Value: Implicit: @@ -18,7 +18,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: field.leo + path: test content: "123" - Value: Field: @@ -27,7 +27,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: field.leo + path: test content: 456field - Value: Field: @@ -36,7 +36,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 86 - path: field.leo + path: test content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802field - Value: Field: @@ -45,7 +45,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 406 - path: field.leo + path: test content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802field - Value: Field: @@ -54,7 +54,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 340130024field - Value: Field: @@ -63,7 +63,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 158951116field - Value: Field: @@ -72,7 +72,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 155529659field - Value: Field: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 642023166field - Value: Field: @@ -90,7 +90,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 228481736field - Value: Field: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 469712960field - Value: Field: @@ -108,7 +108,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 929437719field - Value: Field: @@ -117,7 +117,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 721072814field - Value: Field: @@ -126,7 +126,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 363254789field - Value: Field: @@ -135,7 +135,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 906732565field - Value: Field: @@ -144,7 +144,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 288246391field - Value: Field: @@ -153,7 +153,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 724940549field - Value: Field: @@ -162,7 +162,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 487101620field - Value: Field: @@ -171,7 +171,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 261373583field - Value: Field: @@ -180,7 +180,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 891163927field - Value: Field: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 743967544field - Value: Field: @@ -198,7 +198,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: field.leo + path: test content: 8372586field - Value: Field: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 461793278field - Value: Field: @@ -216,7 +216,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 806307045field - Value: Field: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 122764546field - Value: Field: @@ -234,7 +234,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 356336181field - Value: Field: @@ -243,7 +243,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 158370903field - Value: Field: @@ -252,7 +252,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 774460877field - Value: Field: @@ -261,7 +261,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 557174131field - Value: Field: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 492401267field - Value: Field: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 893445620field - Value: Field: @@ -288,7 +288,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 957757048field - Value: Field: @@ -297,7 +297,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 721540649field - Value: Field: @@ -306,7 +306,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 390746493field - Value: Field: @@ -315,7 +315,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 211251725field - Value: Field: @@ -324,7 +324,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 938266114field - Value: Field: @@ -333,7 +333,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 156985870field - Value: Field: @@ -342,7 +342,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 703831126field - Value: Field: @@ -351,7 +351,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 729964155field - Value: Field: @@ -360,7 +360,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 988151305field - Value: Field: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 320872435field - Value: Field: @@ -378,7 +378,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 719287167field - Value: Field: @@ -387,7 +387,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 152289486field - Value: Field: @@ -396,7 +396,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 740067975field - Value: Field: @@ -405,7 +405,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 728627816field - Value: Field: @@ -414,7 +414,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 385008978field - Value: Field: @@ -423,7 +423,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 553967635field - Value: Field: @@ -432,7 +432,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: field.leo + path: test content: 71980713field - Value: Field: @@ -441,7 +441,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 519444716field - Value: Field: @@ -450,7 +450,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 116499965field - Value: Field: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 717422268field - Value: Field: @@ -468,7 +468,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: field.leo + path: test content: 18966279field - Value: Field: @@ -477,7 +477,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: field.leo + path: test content: 22458638field - Value: Field: @@ -486,7 +486,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 857282620field - Value: Field: @@ -495,7 +495,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 920675898field - Value: Field: @@ -504,7 +504,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 762235516field - Value: Field: @@ -513,7 +513,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 469018377field - Value: Field: @@ -522,7 +522,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 199986521field - Value: Field: @@ -531,7 +531,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 536679358field - Value: Field: @@ -540,7 +540,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 591399452field - Value: Field: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: field.leo + path: test content: 83083158field - Value: Field: @@ -558,7 +558,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 599449051field - Value: Field: @@ -567,7 +567,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 445442318field - Value: Field: @@ -576,7 +576,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 585486590field - Value: Field: @@ -585,7 +585,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 209278800field - Value: Field: @@ -594,7 +594,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 873568117field - Value: Field: @@ -603,7 +603,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 664470940field - Value: Field: @@ -612,7 +612,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 465262783field - Value: Field: @@ -621,7 +621,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 605652874field - Value: Field: @@ -630,7 +630,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 376803940field - Value: Field: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 965247040field - Value: Field: @@ -648,7 +648,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 598474509field - Value: Field: @@ -657,7 +657,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 845119918field - Value: Field: @@ -666,7 +666,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 648159133field - Value: Field: @@ -675,7 +675,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 669051032field - Value: Field: @@ -684,7 +684,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 800600261field - Value: Field: @@ -693,7 +693,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 434689764field - Value: Field: @@ -702,7 +702,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 520060080field - Value: Field: @@ -711,7 +711,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 804659385field - Value: Field: @@ -720,7 +720,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 537828058field - Value: Field: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 716600292field - Value: Field: @@ -738,7 +738,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 387020273field - Value: Field: @@ -747,7 +747,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 199375617field - Value: Field: @@ -756,7 +756,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 680337189field - Value: Field: @@ -765,7 +765,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 818479931field - Value: Field: @@ -774,7 +774,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 893693281field - Value: Field: @@ -783,7 +783,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: field.leo + path: test content: 87377802field - Value: Field: @@ -792,7 +792,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: field.leo + path: test content: 84699261field - Value: Field: @@ -801,7 +801,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 292826090field - Value: Field: @@ -810,7 +810,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 569171405field - Value: Field: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 387436237field - Value: Field: @@ -828,7 +828,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 150682190field - Value: Field: @@ -837,7 +837,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 888770419field - Value: Field: @@ -846,7 +846,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 824696431field - Value: Field: @@ -855,7 +855,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 765659803field - Value: Field: @@ -864,7 +864,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 270163693field - Value: Field: @@ -873,7 +873,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 427940240field - Value: Field: @@ -882,7 +882,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 504997332field - Value: Field: @@ -891,7 +891,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 337808338field - Value: Field: @@ -900,7 +900,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 907200008field - Value: Field: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 757177889field - Value: Field: @@ -918,7 +918,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 696697188field - Value: Field: @@ -927,7 +927,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: field.leo + path: test content: 41376051field - Value: Field: @@ -936,7 +936,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 496293518field - Value: Field: @@ -945,5 +945,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: field.leo + path: test content: 251218820field diff --git a/tests/parser/expression/literal/int_parse/i128.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/i128.leo.out similarity index 88% rename from tests/parser/expression/literal/int_parse/i128.leo.out rename to tests/expectations/parser/parser/expression/literal/int_parse/i128.leo.out index 085343a056..f0d886348f 100644 --- a/tests/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: i128.leo + path: test content: 123i128 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: i128.leo + path: test content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 8 - path: i128.leo + path: test content: 456i128 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 85 - path: i128.leo + path: test content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802i128 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 405 - path: i128.leo + path: test content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802i128 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 340130024i128 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 158951116i128 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 155529659i128 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 642023166i128 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 228481736i128 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 469712960i128 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 929437719i128 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 721072814i128 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 363254789i128 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 906732565i128 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 288246391i128 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 724940549i128 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 487101620i128 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 261373583i128 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 891163927i128 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 743967544i128 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i128.leo + path: test content: 8372586i128 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 461793278i128 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 806307045i128 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 122764546i128 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 356336181i128 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 158370903i128 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 774460877i128 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 557174131i128 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 492401267i128 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 893445620i128 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 957757048i128 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 721540649i128 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 390746493i128 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 211251725i128 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 938266114i128 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 156985870i128 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 703831126i128 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 729964155i128 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 988151305i128 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 320872435i128 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 719287167i128 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 152289486i128 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 740067975i128 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 728627816i128 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 385008978i128 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 553967635i128 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i128.leo + path: test content: 71980713i128 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 519444716i128 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 116499965i128 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 717422268i128 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i128.leo + path: test content: 18966279i128 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i128.leo + path: test content: 22458638i128 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 857282620i128 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 920675898i128 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 762235516i128 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 469018377i128 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 199986521i128 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 536679358i128 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 591399452i128 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i128.leo + path: test content: 83083158i128 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 599449051i128 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 445442318i128 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 585486590i128 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 209278800i128 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 873568117i128 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 664470940i128 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 465262783i128 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 605652874i128 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 376803940i128 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 965247040i128 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 598474509i128 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 845119918i128 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 648159133i128 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 669051032i128 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 800600261i128 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 434689764i128 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 520060080i128 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 804659385i128 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 537828058i128 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 716600292i128 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 387020273i128 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 199375617i128 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 680337189i128 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 818479931i128 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 893693281i128 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i128.leo + path: test content: 87377802i128 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i128.leo + path: test content: 84699261i128 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 292826090i128 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 569171405i128 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 387436237i128 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 150682190i128 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 888770419i128 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 824696431i128 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 765659803i128 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 270163693i128 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 427940240i128 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 504997332i128 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 337808338i128 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 907200008i128 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 757177889i128 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 696697188i128 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i128.leo + path: test content: 41376051i128 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 496293518i128 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: i128.leo + path: test content: 251218820i128 diff --git a/tests/parser/expression/literal/int_parse/i16.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/i16.leo.out similarity index 89% rename from tests/parser/expression/literal/int_parse/i16.leo.out rename to tests/expectations/parser/parser/expression/literal/int_parse/i16.leo.out index 7e0f93385a..82a8fc8b1b 100644 --- a/tests/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: i16.leo + path: test content: 123i16 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: i16.leo + path: test content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: i16.leo + path: test content: 456i16 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 84 - path: i16.leo + path: test content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802i16 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 404 - path: i16.leo + path: test content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802i16 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 340130024i16 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 158951116i16 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 155529659i16 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 642023166i16 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 228481736i16 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 469712960i16 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 929437719i16 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 721072814i16 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 363254789i16 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 906732565i16 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 288246391i16 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 724940549i16 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 487101620i16 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 261373583i16 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 891163927i16 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 743967544i16 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: i16.leo + path: test content: 8372586i16 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 461793278i16 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 806307045i16 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 122764546i16 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 356336181i16 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 158370903i16 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 774460877i16 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 557174131i16 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 492401267i16 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 893445620i16 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 957757048i16 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 721540649i16 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 390746493i16 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 211251725i16 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 938266114i16 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 156985870i16 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 703831126i16 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 729964155i16 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 988151305i16 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 320872435i16 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 719287167i16 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 152289486i16 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 740067975i16 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 728627816i16 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 385008978i16 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 553967635i16 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i16.leo + path: test content: 71980713i16 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 519444716i16 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 116499965i16 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 717422268i16 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i16.leo + path: test content: 18966279i16 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i16.leo + path: test content: 22458638i16 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 857282620i16 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 920675898i16 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 762235516i16 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 469018377i16 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 199986521i16 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 536679358i16 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 591399452i16 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i16.leo + path: test content: 83083158i16 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 599449051i16 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 445442318i16 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 585486590i16 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 209278800i16 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 873568117i16 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 664470940i16 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 465262783i16 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 605652874i16 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 376803940i16 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 965247040i16 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 598474509i16 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 845119918i16 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 648159133i16 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 669051032i16 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 800600261i16 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 434689764i16 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 520060080i16 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 804659385i16 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 537828058i16 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 716600292i16 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 387020273i16 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 199375617i16 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 680337189i16 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 818479931i16 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 893693281i16 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i16.leo + path: test content: 87377802i16 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i16.leo + path: test content: 84699261i16 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 292826090i16 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 569171405i16 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 387436237i16 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 150682190i16 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 888770419i16 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 824696431i16 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 765659803i16 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 270163693i16 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 427940240i16 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 504997332i16 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 337808338i16 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 907200008i16 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 757177889i16 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 696697188i16 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i16.leo + path: test content: 41376051i16 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 496293518i16 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i16.leo + path: test content: 251218820i16 diff --git a/tests/parser/expression/literal/int_parse/i32.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/i32.leo.out similarity index 89% rename from tests/parser/expression/literal/int_parse/i32.leo.out rename to tests/expectations/parser/parser/expression/literal/int_parse/i32.leo.out index 9384be3bc1..82d66bdbf5 100644 --- a/tests/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: i32.leo + path: test content: 123i32 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: i32.leo + path: test content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: i32.leo + path: test content: 456i32 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 84 - path: i32.leo + path: test content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802i32 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 404 - path: i32.leo + path: test content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802i32 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 340130024i32 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 158951116i32 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 155529659i32 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 642023166i32 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 228481736i32 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 469712960i32 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 929437719i32 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 721072814i32 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 363254789i32 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 906732565i32 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 288246391i32 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 724940549i32 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 487101620i32 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 261373583i32 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 891163927i32 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 743967544i32 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: i32.leo + path: test content: 8372586i32 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 461793278i32 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 806307045i32 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 122764546i32 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 356336181i32 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 158370903i32 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 774460877i32 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 557174131i32 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 492401267i32 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 893445620i32 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 957757048i32 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 721540649i32 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 390746493i32 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 211251725i32 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 938266114i32 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 156985870i32 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 703831126i32 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 729964155i32 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 988151305i32 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 320872435i32 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 719287167i32 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 152289486i32 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 740067975i32 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 728627816i32 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 385008978i32 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 553967635i32 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i32.leo + path: test content: 71980713i32 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 519444716i32 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 116499965i32 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 717422268i32 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i32.leo + path: test content: 18966279i32 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i32.leo + path: test content: 22458638i32 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 857282620i32 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 920675898i32 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 762235516i32 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 469018377i32 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 199986521i32 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 536679358i32 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 591399452i32 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i32.leo + path: test content: 83083158i32 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 599449051i32 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 445442318i32 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 585486590i32 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 209278800i32 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 873568117i32 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 664470940i32 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 465262783i32 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 605652874i32 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 376803940i32 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 965247040i32 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 598474509i32 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 845119918i32 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 648159133i32 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 669051032i32 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 800600261i32 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 434689764i32 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 520060080i32 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 804659385i32 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 537828058i32 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 716600292i32 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 387020273i32 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 199375617i32 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 680337189i32 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 818479931i32 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 893693281i32 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i32.leo + path: test content: 87377802i32 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i32.leo + path: test content: 84699261i32 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 292826090i32 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 569171405i32 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 387436237i32 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 150682190i32 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 888770419i32 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 824696431i32 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 765659803i32 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 270163693i32 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 427940240i32 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 504997332i32 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 337808338i32 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 907200008i32 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 757177889i32 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 696697188i32 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i32.leo + path: test content: 41376051i32 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 496293518i32 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i32.leo + path: test content: 251218820i32 diff --git a/tests/parser/expression/literal/int_parse/i64.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/i64.leo.out similarity index 89% rename from tests/parser/expression/literal/int_parse/i64.leo.out rename to tests/expectations/parser/parser/expression/literal/int_parse/i64.leo.out index a35baaac1c..24949c2f99 100644 --- a/tests/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: i64.leo + path: test content: 123i64 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: i64.leo + path: test content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: i64.leo + path: test content: 456i64 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 84 - path: i64.leo + path: test content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802i64 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 404 - path: i64.leo + path: test content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802i64 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 340130024i64 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 158951116i64 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 155529659i64 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 642023166i64 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 228481736i64 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 469712960i64 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 929437719i64 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 721072814i64 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 363254789i64 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 906732565i64 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 288246391i64 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 724940549i64 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 487101620i64 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 261373583i64 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 891163927i64 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 743967544i64 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: i64.leo + path: test content: 8372586i64 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 461793278i64 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 806307045i64 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 122764546i64 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 356336181i64 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 158370903i64 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 774460877i64 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 557174131i64 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 492401267i64 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 893445620i64 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 957757048i64 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 721540649i64 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 390746493i64 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 211251725i64 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 938266114i64 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 156985870i64 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 703831126i64 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 729964155i64 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 988151305i64 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 320872435i64 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 719287167i64 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 152289486i64 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 740067975i64 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 728627816i64 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 385008978i64 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 553967635i64 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i64.leo + path: test content: 71980713i64 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 519444716i64 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 116499965i64 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 717422268i64 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i64.leo + path: test content: 18966279i64 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i64.leo + path: test content: 22458638i64 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 857282620i64 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 920675898i64 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 762235516i64 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 469018377i64 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 199986521i64 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 536679358i64 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 591399452i64 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i64.leo + path: test content: 83083158i64 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 599449051i64 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 445442318i64 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 585486590i64 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 209278800i64 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 873568117i64 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 664470940i64 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 465262783i64 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 605652874i64 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 376803940i64 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 965247040i64 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 598474509i64 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 845119918i64 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 648159133i64 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 669051032i64 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 800600261i64 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 434689764i64 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 520060080i64 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 804659385i64 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 537828058i64 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 716600292i64 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 387020273i64 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 199375617i64 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 680337189i64 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 818479931i64 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 893693281i64 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i64.leo + path: test content: 87377802i64 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i64.leo + path: test content: 84699261i64 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 292826090i64 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 569171405i64 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 387436237i64 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 150682190i64 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 888770419i64 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 824696431i64 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 765659803i64 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 270163693i64 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 427940240i64 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 504997332i64 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 337808338i64 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 907200008i64 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 757177889i64 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 696697188i64 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i64.leo + path: test content: 41376051i64 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 496293518i64 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: i64.leo + path: test content: 251218820i64 diff --git a/tests/parser/expression/literal/int_parse/i8.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/i8.leo.out similarity index 89% rename from tests/parser/expression/literal/int_parse/i8.leo.out rename to tests/expectations/parser/parser/expression/literal/int_parse/i8.leo.out index f0946747a8..7b06304a6a 100644 --- a/tests/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: i8.leo + path: test content: 123i8 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: i8.leo + path: test content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: i8.leo + path: test content: 456i8 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 83 - path: i8.leo + path: test content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802i8 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 403 - path: i8.leo + path: test content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802i8 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 340130024i8 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 158951116i8 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 155529659i8 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 642023166i8 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 228481736i8 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 469712960i8 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 929437719i8 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 721072814i8 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 363254789i8 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 906732565i8 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 288246391i8 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 724940549i8 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 487101620i8 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 261373583i8 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 891163927i8 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 743967544i8 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: i8.leo + path: test content: 8372586i8 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 461793278i8 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 806307045i8 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 122764546i8 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 356336181i8 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 158370903i8 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 774460877i8 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 557174131i8 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 492401267i8 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 893445620i8 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 957757048i8 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 721540649i8 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 390746493i8 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 211251725i8 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 938266114i8 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 156985870i8 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 703831126i8 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 729964155i8 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 988151305i8 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 320872435i8 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 719287167i8 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 152289486i8 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 740067975i8 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 728627816i8 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 385008978i8 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 553967635i8 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: i8.leo + path: test content: 71980713i8 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 519444716i8 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 116499965i8 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 717422268i8 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: i8.leo + path: test content: 18966279i8 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: i8.leo + path: test content: 22458638i8 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 857282620i8 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 920675898i8 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 762235516i8 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 469018377i8 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 199986521i8 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 536679358i8 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 591399452i8 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: i8.leo + path: test content: 83083158i8 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 599449051i8 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 445442318i8 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 585486590i8 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 209278800i8 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 873568117i8 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 664470940i8 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 465262783i8 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 605652874i8 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 376803940i8 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 965247040i8 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 598474509i8 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 845119918i8 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 648159133i8 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 669051032i8 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 800600261i8 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 434689764i8 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 520060080i8 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 804659385i8 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 537828058i8 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 716600292i8 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 387020273i8 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 199375617i8 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 680337189i8 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 818479931i8 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 893693281i8 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: i8.leo + path: test content: 87377802i8 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: i8.leo + path: test content: 84699261i8 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 292826090i8 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 569171405i8 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 387436237i8 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 150682190i8 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 888770419i8 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 824696431i8 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 765659803i8 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 270163693i8 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 427940240i8 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 504997332i8 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 337808338i8 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 907200008i8 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 757177889i8 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 696697188i8 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: i8.leo + path: test content: 41376051i8 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 496293518i8 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: i8.leo + path: test content: 251218820i8 diff --git a/tests/parser/expression/literal/int_parse/implicit.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/implicit.leo.out similarity index 86% rename from tests/parser/expression/literal/int_parse/implicit.leo.out rename to tests/expectations/parser/parser/expression/literal/int_parse/implicit.leo.out index e4a4ad39f7..43e759dcc6 100644 --- a/tests/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: implicit.leo + path: test content: "123" - Value: Implicit: @@ -18,7 +18,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: implicit.leo + path: test content: "123" - Value: Implicit: @@ -27,7 +27,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: implicit.leo + path: test content: "456" - Value: Implicit: @@ -36,7 +36,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 81 - path: implicit.leo + path: test content: "87377802873778028737780287377802873778028737780287377802873778028737780287377802" - Value: Implicit: @@ -45,7 +45,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 401 - path: implicit.leo + path: test content: "8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802" - Value: Implicit: @@ -54,7 +54,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "340130024" - Value: Implicit: @@ -63,7 +63,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "158951116" - Value: Implicit: @@ -72,7 +72,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "155529659" - Value: Implicit: @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "642023166" - Value: Implicit: @@ -90,7 +90,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "228481736" - Value: Implicit: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "469712960" - Value: Implicit: @@ -108,7 +108,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "929437719" - Value: Implicit: @@ -117,7 +117,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "721072814" - Value: Implicit: @@ -126,7 +126,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "363254789" - Value: Implicit: @@ -135,7 +135,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "906732565" - Value: Implicit: @@ -144,7 +144,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "288246391" - Value: Implicit: @@ -153,7 +153,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "724940549" - Value: Implicit: @@ -162,7 +162,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "487101620" - Value: Implicit: @@ -171,7 +171,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "261373583" - Value: Implicit: @@ -180,7 +180,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "891163927" - Value: Implicit: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "743967544" - Value: Implicit: @@ -198,7 +198,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 8 - path: implicit.leo + path: test content: "8372586" - Value: Implicit: @@ -207,7 +207,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "461793278" - Value: Implicit: @@ -216,7 +216,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "806307045" - Value: Implicit: @@ -225,7 +225,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "122764546" - Value: Implicit: @@ -234,7 +234,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "356336181" - Value: Implicit: @@ -243,7 +243,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "158370903" - Value: Implicit: @@ -252,7 +252,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "774460877" - Value: Implicit: @@ -261,7 +261,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "557174131" - Value: Implicit: @@ -270,7 +270,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "492401267" - Value: Implicit: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "893445620" - Value: Implicit: @@ -288,7 +288,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "957757048" - Value: Implicit: @@ -297,7 +297,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "721540649" - Value: Implicit: @@ -306,7 +306,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "390746493" - Value: Implicit: @@ -315,7 +315,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "211251725" - Value: Implicit: @@ -324,7 +324,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "938266114" - Value: Implicit: @@ -333,7 +333,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "156985870" - Value: Implicit: @@ -342,7 +342,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "703831126" - Value: Implicit: @@ -351,7 +351,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "729964155" - Value: Implicit: @@ -360,7 +360,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "988151305" - Value: Implicit: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "320872435" - Value: Implicit: @@ -378,7 +378,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "719287167" - Value: Implicit: @@ -387,7 +387,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "152289486" - Value: Implicit: @@ -396,7 +396,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "740067975" - Value: Implicit: @@ -405,7 +405,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "728627816" - Value: Implicit: @@ -414,7 +414,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "385008978" - Value: Implicit: @@ -423,7 +423,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "553967635" - Value: Implicit: @@ -432,7 +432,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: implicit.leo + path: test content: "71980713" - Value: Implicit: @@ -441,7 +441,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "519444716" - Value: Implicit: @@ -450,7 +450,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "116499965" - Value: Implicit: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "717422268" - Value: Implicit: @@ -468,7 +468,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: implicit.leo + path: test content: "18966279" - Value: Implicit: @@ -477,7 +477,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: implicit.leo + path: test content: "22458638" - Value: Implicit: @@ -486,7 +486,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "857282620" - Value: Implicit: @@ -495,7 +495,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "920675898" - Value: Implicit: @@ -504,7 +504,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "762235516" - Value: Implicit: @@ -513,7 +513,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "469018377" - Value: Implicit: @@ -522,7 +522,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "199986521" - Value: Implicit: @@ -531,7 +531,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "536679358" - Value: Implicit: @@ -540,7 +540,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "591399452" - Value: Implicit: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: implicit.leo + path: test content: "83083158" - Value: Implicit: @@ -558,7 +558,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "599449051" - Value: Implicit: @@ -567,7 +567,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "445442318" - Value: Implicit: @@ -576,7 +576,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "585486590" - Value: Implicit: @@ -585,7 +585,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "209278800" - Value: Implicit: @@ -594,7 +594,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "873568117" - Value: Implicit: @@ -603,7 +603,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "664470940" - Value: Implicit: @@ -612,7 +612,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "465262783" - Value: Implicit: @@ -621,7 +621,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "605652874" - Value: Implicit: @@ -630,7 +630,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "376803940" - Value: Implicit: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "965247040" - Value: Implicit: @@ -648,7 +648,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "598474509" - Value: Implicit: @@ -657,7 +657,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "845119918" - Value: Implicit: @@ -666,7 +666,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "648159133" - Value: Implicit: @@ -675,7 +675,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "669051032" - Value: Implicit: @@ -684,7 +684,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "800600261" - Value: Implicit: @@ -693,7 +693,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "434689764" - Value: Implicit: @@ -702,7 +702,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "520060080" - Value: Implicit: @@ -711,7 +711,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "804659385" - Value: Implicit: @@ -720,7 +720,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "537828058" - Value: Implicit: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "716600292" - Value: Implicit: @@ -738,7 +738,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "387020273" - Value: Implicit: @@ -747,7 +747,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "199375617" - Value: Implicit: @@ -756,7 +756,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "680337189" - Value: Implicit: @@ -765,7 +765,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "818479931" - Value: Implicit: @@ -774,7 +774,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "893693281" - Value: Implicit: @@ -783,7 +783,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: implicit.leo + path: test content: "87377802" - Value: Implicit: @@ -792,7 +792,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: implicit.leo + path: test content: "84699261" - Value: Implicit: @@ -801,7 +801,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "292826090" - Value: Implicit: @@ -810,7 +810,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "569171405" - Value: Implicit: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "387436237" - Value: Implicit: @@ -828,7 +828,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "150682190" - Value: Implicit: @@ -837,7 +837,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "888770419" - Value: Implicit: @@ -846,7 +846,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "824696431" - Value: Implicit: @@ -855,7 +855,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "765659803" - Value: Implicit: @@ -864,7 +864,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "270163693" - Value: Implicit: @@ -873,7 +873,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "427940240" - Value: Implicit: @@ -882,7 +882,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "504997332" - Value: Implicit: @@ -891,7 +891,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "337808338" - Value: Implicit: @@ -900,7 +900,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "907200008" - Value: Implicit: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "757177889" - Value: Implicit: @@ -918,7 +918,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "696697188" - Value: Implicit: @@ -927,7 +927,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: implicit.leo + path: test content: "41376051" - Value: Implicit: @@ -936,7 +936,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "496293518" - Value: Implicit: @@ -945,5 +945,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: implicit.leo + path: test content: "251218820" diff --git a/tests/parser/expression/literal/int_parse/mono_group.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/mono_group.leo.out similarity index 86% rename from tests/parser/expression/literal/int_parse/mono_group.leo.out rename to tests/expectations/parser/parser/expression/literal/int_parse/mono_group.leo.out index 83eb831ffa..9e959269ac 100644 --- a/tests/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: mono_group.leo + path: test content: 123group - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: mono_group.leo + path: test content: "123" - Value: Group: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 9 - path: mono_group.leo + path: test content: 456group - Value: Group: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 86 - path: mono_group.leo + path: test content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802group - Value: Group: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 406 - path: mono_group.leo + path: test content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802group - Value: Group: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 340130024group - Value: Group: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 158951116group - Value: Group: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 155529659group - Value: Group: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 642023166group - Value: Group: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 228481736group - Value: Group: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 469712960group - Value: Group: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 929437719group - Value: Group: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 721072814group - Value: Group: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 363254789group - Value: Group: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 906732565group - Value: Group: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 288246391group - Value: Group: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 724940549group - Value: Group: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 487101620group - Value: Group: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 261373583group - Value: Group: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 891163927group - Value: Group: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 743967544group - Value: Group: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: mono_group.leo + path: test content: 8372586group - Value: Group: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 461793278group - Value: Group: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 806307045group - Value: Group: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 122764546group - Value: Group: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 356336181group - Value: Group: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 158370903group - Value: Group: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 774460877group - Value: Group: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 557174131group - Value: Group: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 492401267group - Value: Group: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 893445620group - Value: Group: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 957757048group - Value: Group: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 721540649group - Value: Group: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 390746493group - Value: Group: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 211251725group - Value: Group: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 938266114group - Value: Group: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 156985870group - Value: Group: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 703831126group - Value: Group: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 729964155group - Value: Group: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 988151305group - Value: Group: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 320872435group - Value: Group: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 719287167group - Value: Group: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 152289486group - Value: Group: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 740067975group - Value: Group: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 728627816group - Value: Group: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 385008978group - Value: Group: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 553967635group - Value: Group: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: mono_group.leo + path: test content: 71980713group - Value: Group: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 519444716group - Value: Group: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 116499965group - Value: Group: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 717422268group - Value: Group: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: mono_group.leo + path: test content: 18966279group - Value: Group: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: mono_group.leo + path: test content: 22458638group - Value: Group: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 857282620group - Value: Group: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 920675898group - Value: Group: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 762235516group - Value: Group: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 469018377group - Value: Group: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 199986521group - Value: Group: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 536679358group - Value: Group: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 591399452group - Value: Group: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: mono_group.leo + path: test content: 83083158group - Value: Group: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 599449051group - Value: Group: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 445442318group - Value: Group: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 585486590group - Value: Group: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 209278800group - Value: Group: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 873568117group - Value: Group: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 664470940group - Value: Group: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 465262783group - Value: Group: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 605652874group - Value: Group: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 376803940group - Value: Group: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 965247040group - Value: Group: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 598474509group - Value: Group: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 845119918group - Value: Group: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 648159133group - Value: Group: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 669051032group - Value: Group: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 800600261group - Value: Group: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 434689764group - Value: Group: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 520060080group - Value: Group: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 804659385group - Value: Group: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 537828058group - Value: Group: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 716600292group - Value: Group: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 387020273group - Value: Group: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 199375617group - Value: Group: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 680337189group - Value: Group: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 818479931group - Value: Group: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 893693281group - Value: Group: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: mono_group.leo + path: test content: 87377802group - Value: Group: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: mono_group.leo + path: test content: 84699261group - Value: Group: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 292826090group - Value: Group: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 569171405group - Value: Group: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 387436237group - Value: Group: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 150682190group - Value: Group: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 888770419group - Value: Group: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 824696431group - Value: Group: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 765659803group - Value: Group: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 270163693group - Value: Group: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 427940240group - Value: Group: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 504997332group - Value: Group: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 337808338group - Value: Group: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 907200008group - Value: Group: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 757177889group - Value: Group: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 696697188group - Value: Group: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: mono_group.leo + path: test content: 41376051group - Value: Group: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 496293518group - Value: Group: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 15 - path: mono_group.leo + path: test content: 251218820group diff --git a/tests/parser/expression/literal/int_parse/u128.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/u128.leo.out similarity index 88% rename from tests/parser/expression/literal/int_parse/u128.leo.out rename to tests/expectations/parser/parser/expression/literal/int_parse/u128.leo.out index 54e4ad03d6..f1048e6469 100644 --- a/tests/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: u128.leo + path: test content: 123u128 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: u128.leo + path: test content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 8 - path: u128.leo + path: test content: 456u128 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 85 - path: u128.leo + path: test content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802u128 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 405 - path: u128.leo + path: test content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802u128 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 340130024u128 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 158951116u128 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 155529659u128 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 642023166u128 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 228481736u128 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 469712960u128 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 929437719u128 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 721072814u128 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 363254789u128 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 906732565u128 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 288246391u128 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 724940549u128 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 487101620u128 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 261373583u128 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 891163927u128 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 743967544u128 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u128.leo + path: test content: 8372586u128 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 461793278u128 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 806307045u128 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 122764546u128 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 356336181u128 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 158370903u128 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 774460877u128 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 557174131u128 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 492401267u128 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 893445620u128 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 957757048u128 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 721540649u128 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 390746493u128 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 211251725u128 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 938266114u128 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 156985870u128 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 703831126u128 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 729964155u128 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 988151305u128 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 320872435u128 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 719287167u128 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 152289486u128 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 740067975u128 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 728627816u128 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 385008978u128 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 553967635u128 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u128.leo + path: test content: 71980713u128 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 519444716u128 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 116499965u128 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 717422268u128 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u128.leo + path: test content: 18966279u128 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u128.leo + path: test content: 22458638u128 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 857282620u128 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 920675898u128 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 762235516u128 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 469018377u128 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 199986521u128 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 536679358u128 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 591399452u128 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u128.leo + path: test content: 83083158u128 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 599449051u128 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 445442318u128 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 585486590u128 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 209278800u128 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 873568117u128 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 664470940u128 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 465262783u128 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 605652874u128 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 376803940u128 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 965247040u128 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 598474509u128 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 845119918u128 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 648159133u128 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 669051032u128 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 800600261u128 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 434689764u128 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 520060080u128 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 804659385u128 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 537828058u128 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 716600292u128 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 387020273u128 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 199375617u128 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 680337189u128 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 818479931u128 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 893693281u128 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u128.leo + path: test content: 87377802u128 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u128.leo + path: test content: 84699261u128 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 292826090u128 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 569171405u128 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 387436237u128 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 150682190u128 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 888770419u128 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 824696431u128 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 765659803u128 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 270163693u128 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 427940240u128 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 504997332u128 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 337808338u128 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 907200008u128 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 757177889u128 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 696697188u128 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u128.leo + path: test content: 41376051u128 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 496293518u128 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 14 - path: u128.leo + path: test content: 251218820u128 diff --git a/tests/parser/expression/literal/int_parse/u16.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/u16.leo.out similarity index 88% rename from tests/parser/expression/literal/int_parse/u16.leo.out rename to tests/expectations/parser/parser/expression/literal/int_parse/u16.leo.out index 8de9ea1235..324a0abcce 100644 --- a/tests/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: u16.leo + path: test content: 123u8 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: u16.leo + path: test content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: u16.leo + path: test content: 456u8 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 83 - path: u16.leo + path: test content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802u8 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 403 - path: u16.leo + path: test content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802u8 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 340130024u8 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 158951116u8 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 155529659u8 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 642023166u8 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 228481736u8 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 469712960u8 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 929437719u8 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 721072814u8 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 363254789u8 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 906732565u8 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 288246391u8 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 724940549u8 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 487101620u8 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 261373583u8 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 891163927u8 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 743967544u8 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: u16.leo + path: test content: 8372586u8 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 461793278u8 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 806307045u8 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 122764546u8 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 356336181u8 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 158370903u8 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 774460877u8 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 557174131u8 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 492401267u8 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 893445620u8 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 957757048u8 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 721540649u8 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 390746493u8 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 211251725u8 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 938266114u8 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 156985870u8 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 703831126u8 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 729964155u8 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 988151305u8 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 320872435u8 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 719287167u8 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 152289486u8 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 740067975u8 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 728627816u8 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 385008978u8 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 553967635u8 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u16.leo + path: test content: 71980713u8 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 519444716u8 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 116499965u8 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 717422268u8 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u16.leo + path: test content: 18966279u8 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u16.leo + path: test content: 22458638u8 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 857282620u8 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 920675898u8 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 762235516u8 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 469018377u8 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 199986521u8 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 536679358u8 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 591399452u8 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u16.leo + path: test content: 83083158u8 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 599449051u8 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 445442318u8 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 585486590u8 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 209278800u8 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 873568117u8 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 664470940u8 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 465262783u8 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 605652874u8 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 376803940u8 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 965247040u8 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 598474509u8 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 845119918u8 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 648159133u8 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 669051032u8 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 800600261u8 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 434689764u8 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 520060080u8 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 804659385u8 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 537828058u8 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 716600292u8 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 387020273u8 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 199375617u8 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 680337189u8 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 818479931u8 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 893693281u8 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u16.leo + path: test content: 87377802u8 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u16.leo + path: test content: 84699261u8 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 292826090u8 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 569171405u8 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 387436237u8 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 150682190u8 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 888770419u8 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 824696431u8 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 765659803u8 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 270163693u8 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 427940240u8 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 504997332u8 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 337808338u8 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 907200008u8 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 757177889u8 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 696697188u8 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u16.leo + path: test content: 41376051u8 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 496293518u8 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u16.leo + path: test content: 251218820u8 diff --git a/tests/parser/expression/literal/int_parse/u32.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/u32.leo.out similarity index 89% rename from tests/parser/expression/literal/int_parse/u32.leo.out rename to tests/expectations/parser/parser/expression/literal/int_parse/u32.leo.out index 5784cd908a..ba97127eac 100644 --- a/tests/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: u32.leo + path: test content: 123u32 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: u32.leo + path: test content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: u32.leo + path: test content: 456u32 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 84 - path: u32.leo + path: test content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802u32 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 404 - path: u32.leo + path: test content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802u32 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 340130024u32 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 158951116u32 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 155529659u32 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 642023166u32 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 228481736u32 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 469712960u32 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 929437719u32 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 721072814u32 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 363254789u32 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 906732565u32 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 288246391u32 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 724940549u32 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 487101620u32 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 261373583u32 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 891163927u32 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 743967544u32 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u32.leo + path: test content: 8372586u32 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 461793278u32 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 806307045u32 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 122764546u32 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 356336181u32 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 158370903u32 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 774460877u32 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 557174131u32 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 492401267u32 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 893445620u32 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 957757048u32 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 721540649u32 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 390746493u32 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 211251725u32 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 938266114u32 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 156985870u32 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 703831126u32 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 729964155u32 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 988151305u32 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 320872435u32 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 719287167u32 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 152289486u32 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 740067975u32 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 728627816u32 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 385008978u32 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 553967635u32 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u32.leo + path: test content: 71980713u32 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 519444716u32 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 116499965u32 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 717422268u32 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u32.leo + path: test content: 18966279u32 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u32.leo + path: test content: 22458638u32 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 857282620u32 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 920675898u32 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 762235516u32 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 469018377u32 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 199986521u32 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 536679358u32 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 591399452u32 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u32.leo + path: test content: 83083158u32 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 599449051u32 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 445442318u32 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 585486590u32 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 209278800u32 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 873568117u32 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 664470940u32 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 465262783u32 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 605652874u32 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 376803940u32 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 965247040u32 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 598474509u32 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 845119918u32 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 648159133u32 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 669051032u32 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 800600261u32 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 434689764u32 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 520060080u32 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 804659385u32 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 537828058u32 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 716600292u32 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 387020273u32 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 199375617u32 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 680337189u32 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 818479931u32 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 893693281u32 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u32.leo + path: test content: 87377802u32 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u32.leo + path: test content: 84699261u32 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 292826090u32 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 569171405u32 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 387436237u32 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 150682190u32 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 888770419u32 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 824696431u32 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 765659803u32 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 270163693u32 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 427940240u32 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 504997332u32 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 337808338u32 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 907200008u32 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 757177889u32 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 696697188u32 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u32.leo + path: test content: 41376051u32 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 496293518u32 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u32.leo + path: test content: 251218820u32 diff --git a/tests/parser/expression/literal/int_parse/u64.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/u64.leo.out similarity index 89% rename from tests/parser/expression/literal/int_parse/u64.leo.out rename to tests/expectations/parser/parser/expression/literal/int_parse/u64.leo.out index f16d164ad7..ba97127eac 100644 --- a/tests/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: u64.leo + path: test content: 123u32 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: u64.leo + path: test content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: u64.leo + path: test content: 456u32 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 84 - path: u64.leo + path: test content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802u32 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 404 - path: u64.leo + path: test content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802u32 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 340130024u32 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 158951116u32 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 155529659u32 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 642023166u32 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 228481736u32 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 469712960u32 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 929437719u32 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 721072814u32 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 363254789u32 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 906732565u32 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 288246391u32 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 724940549u32 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 487101620u32 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 261373583u32 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 891163927u32 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 743967544u32 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u64.leo + path: test content: 8372586u32 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 461793278u32 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 806307045u32 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 122764546u32 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 356336181u32 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 158370903u32 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 774460877u32 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 557174131u32 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 492401267u32 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 893445620u32 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 957757048u32 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 721540649u32 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 390746493u32 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 211251725u32 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 938266114u32 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 156985870u32 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 703831126u32 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 729964155u32 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 988151305u32 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 320872435u32 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 719287167u32 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 152289486u32 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 740067975u32 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 728627816u32 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 385008978u32 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 553967635u32 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u64.leo + path: test content: 71980713u32 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 519444716u32 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 116499965u32 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 717422268u32 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u64.leo + path: test content: 18966279u32 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u64.leo + path: test content: 22458638u32 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 857282620u32 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 920675898u32 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 762235516u32 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 469018377u32 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 199986521u32 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 536679358u32 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 591399452u32 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u64.leo + path: test content: 83083158u32 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 599449051u32 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 445442318u32 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 585486590u32 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 209278800u32 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 873568117u32 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 664470940u32 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 465262783u32 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 605652874u32 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 376803940u32 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 965247040u32 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 598474509u32 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 845119918u32 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 648159133u32 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 669051032u32 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 800600261u32 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 434689764u32 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 520060080u32 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 804659385u32 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 537828058u32 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 716600292u32 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 387020273u32 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 199375617u32 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 680337189u32 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 818479931u32 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 893693281u32 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u64.leo + path: test content: 87377802u32 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u64.leo + path: test content: 84699261u32 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 292826090u32 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 569171405u32 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 387436237u32 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 150682190u32 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 888770419u32 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 824696431u32 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 765659803u32 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 270163693u32 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 427940240u32 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 504997332u32 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 337808338u32 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 907200008u32 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 757177889u32 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 696697188u32 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u64.leo + path: test content: 41376051u32 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 496293518u32 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 13 - path: u64.leo + path: test content: 251218820u32 diff --git a/tests/parser/expression/literal/int_parse/u8.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/u8.leo.out similarity index 89% rename from tests/parser/expression/literal/int_parse/u8.leo.out rename to tests/expectations/parser/parser/expression/literal/int_parse/u8.leo.out index 0adb31b23e..324a0abcce 100644 --- a/tests/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: u8.leo + path: test content: 123u8 - Value: Implicit: @@ -19,7 +19,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: u8.leo + path: test content: "123" - Value: Integer: @@ -29,7 +29,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: u8.leo + path: test content: 456u8 - Value: Integer: @@ -39,7 +39,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 83 - path: u8.leo + path: test content: 87377802873778028737780287377802873778028737780287377802873778028737780287377802u8 - Value: Integer: @@ -49,7 +49,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 403 - path: u8.leo + path: test content: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802u8 - Value: Integer: @@ -59,7 +59,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 340130024u8 - Value: Integer: @@ -69,7 +69,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 158951116u8 - Value: Integer: @@ -79,7 +79,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 155529659u8 - Value: Integer: @@ -89,7 +89,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 642023166u8 - Value: Integer: @@ -99,7 +99,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 228481736u8 - Value: Integer: @@ -109,7 +109,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 469712960u8 - Value: Integer: @@ -119,7 +119,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 929437719u8 - Value: Integer: @@ -129,7 +129,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 721072814u8 - Value: Integer: @@ -139,7 +139,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 363254789u8 - Value: Integer: @@ -149,7 +149,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 906732565u8 - Value: Integer: @@ -159,7 +159,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 288246391u8 - Value: Integer: @@ -169,7 +169,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 724940549u8 - Value: Integer: @@ -179,7 +179,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 487101620u8 - Value: Integer: @@ -189,7 +189,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 261373583u8 - Value: Integer: @@ -199,7 +199,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 891163927u8 - Value: Integer: @@ -209,7 +209,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 743967544u8 - Value: Integer: @@ -219,7 +219,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: u8.leo + path: test content: 8372586u8 - Value: Integer: @@ -229,7 +229,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 461793278u8 - Value: Integer: @@ -239,7 +239,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 806307045u8 - Value: Integer: @@ -249,7 +249,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 122764546u8 - Value: Integer: @@ -259,7 +259,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 356336181u8 - Value: Integer: @@ -269,7 +269,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 158370903u8 - Value: Integer: @@ -279,7 +279,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 774460877u8 - Value: Integer: @@ -289,7 +289,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 557174131u8 - Value: Integer: @@ -299,7 +299,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 492401267u8 - Value: Integer: @@ -309,7 +309,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 893445620u8 - Value: Integer: @@ -319,7 +319,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 957757048u8 - Value: Integer: @@ -329,7 +329,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 721540649u8 - Value: Integer: @@ -339,7 +339,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 390746493u8 - Value: Integer: @@ -349,7 +349,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 211251725u8 - Value: Integer: @@ -359,7 +359,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 938266114u8 - Value: Integer: @@ -369,7 +369,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 156985870u8 - Value: Integer: @@ -379,7 +379,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 703831126u8 - Value: Integer: @@ -389,7 +389,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 729964155u8 - Value: Integer: @@ -399,7 +399,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 988151305u8 - Value: Integer: @@ -409,7 +409,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 320872435u8 - Value: Integer: @@ -419,7 +419,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 719287167u8 - Value: Integer: @@ -429,7 +429,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 152289486u8 - Value: Integer: @@ -439,7 +439,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 740067975u8 - Value: Integer: @@ -449,7 +449,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 728627816u8 - Value: Integer: @@ -459,7 +459,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 385008978u8 - Value: Integer: @@ -469,7 +469,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 553967635u8 - Value: Integer: @@ -479,7 +479,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u8.leo + path: test content: 71980713u8 - Value: Integer: @@ -489,7 +489,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 519444716u8 - Value: Integer: @@ -499,7 +499,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 116499965u8 - Value: Integer: @@ -509,7 +509,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 717422268u8 - Value: Integer: @@ -519,7 +519,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u8.leo + path: test content: 18966279u8 - Value: Integer: @@ -529,7 +529,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u8.leo + path: test content: 22458638u8 - Value: Integer: @@ -539,7 +539,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 857282620u8 - Value: Integer: @@ -549,7 +549,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 920675898u8 - Value: Integer: @@ -559,7 +559,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 762235516u8 - Value: Integer: @@ -569,7 +569,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 469018377u8 - Value: Integer: @@ -579,7 +579,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 199986521u8 - Value: Integer: @@ -589,7 +589,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 536679358u8 - Value: Integer: @@ -599,7 +599,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 591399452u8 - Value: Integer: @@ -609,7 +609,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u8.leo + path: test content: 83083158u8 - Value: Integer: @@ -619,7 +619,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 599449051u8 - Value: Integer: @@ -629,7 +629,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 445442318u8 - Value: Integer: @@ -639,7 +639,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 585486590u8 - Value: Integer: @@ -649,7 +649,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 209278800u8 - Value: Integer: @@ -659,7 +659,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 873568117u8 - Value: Integer: @@ -669,7 +669,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 664470940u8 - Value: Integer: @@ -679,7 +679,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 465262783u8 - Value: Integer: @@ -689,7 +689,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 605652874u8 - Value: Integer: @@ -699,7 +699,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 376803940u8 - Value: Integer: @@ -709,7 +709,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 965247040u8 - Value: Integer: @@ -719,7 +719,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 598474509u8 - Value: Integer: @@ -729,7 +729,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 845119918u8 - Value: Integer: @@ -739,7 +739,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 648159133u8 - Value: Integer: @@ -749,7 +749,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 669051032u8 - Value: Integer: @@ -759,7 +759,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 800600261u8 - Value: Integer: @@ -769,7 +769,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 434689764u8 - Value: Integer: @@ -779,7 +779,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 520060080u8 - Value: Integer: @@ -789,7 +789,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 804659385u8 - Value: Integer: @@ -799,7 +799,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 537828058u8 - Value: Integer: @@ -809,7 +809,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 716600292u8 - Value: Integer: @@ -819,7 +819,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 387020273u8 - Value: Integer: @@ -829,7 +829,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 199375617u8 - Value: Integer: @@ -839,7 +839,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 680337189u8 - Value: Integer: @@ -849,7 +849,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 818479931u8 - Value: Integer: @@ -859,7 +859,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 893693281u8 - Value: Integer: @@ -869,7 +869,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u8.leo + path: test content: 87377802u8 - Value: Integer: @@ -879,7 +879,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u8.leo + path: test content: 84699261u8 - Value: Integer: @@ -889,7 +889,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 292826090u8 - Value: Integer: @@ -899,7 +899,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 569171405u8 - Value: Integer: @@ -909,7 +909,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 387436237u8 - Value: Integer: @@ -919,7 +919,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 150682190u8 - Value: Integer: @@ -929,7 +929,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 888770419u8 - Value: Integer: @@ -939,7 +939,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 824696431u8 - Value: Integer: @@ -949,7 +949,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 765659803u8 - Value: Integer: @@ -959,7 +959,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 270163693u8 - Value: Integer: @@ -969,7 +969,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 427940240u8 - Value: Integer: @@ -979,7 +979,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 504997332u8 - Value: Integer: @@ -989,7 +989,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 337808338u8 - Value: Integer: @@ -999,7 +999,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 907200008u8 - Value: Integer: @@ -1009,7 +1009,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 757177889u8 - Value: Integer: @@ -1019,7 +1019,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 696697188u8 - Value: Integer: @@ -1029,7 +1029,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: u8.leo + path: test content: 41376051u8 - Value: Integer: @@ -1039,7 +1039,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 496293518u8 - Value: Integer: @@ -1049,5 +1049,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 12 - path: u8.leo + path: test content: 251218820u8 diff --git a/tests/parser/expression/literal/postfix_types.leo.out b/tests/expectations/parser/parser/expression/literal/postfix_types.leo.out similarity index 100% rename from tests/parser/expression/literal/postfix_types.leo.out rename to tests/expectations/parser/parser/expression/literal/postfix_types.leo.out diff --git a/tests/parser/expression/ternary.leo.out b/tests/expectations/parser/parser/expression/ternary.leo.out similarity index 69% rename from tests/parser/expression/ternary.leo.out rename to tests/expectations/parser/parser/expression/ternary.leo.out index 2416e81b87..0d672f23d9 100644 --- a/tests/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\\\":\\\"ternary.leo\\\",\\\"content\\\":\\\"x ? y : z\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? y : z\\\"}\"}" if_true: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"ternary.leo\\\",\\\"content\\\":\\\"x ? y : z\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? y : z\\\"}\"}" if_false: - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"ternary.leo\\\",\\\"content\\\":\\\"x ? y : z\\\"}\"}" + Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? y : z\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: ternary.leo + path: test content: "x ? y : z" - Ternary: condition: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"ternary.leo\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"ternary.leo\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" + Identifier: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"ternary.leo\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" + Identifier: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"ternary.leo\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" + Identifier: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 14 - path: ternary.leo + path: test 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\\\":\\\"ternary.leo\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" + Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? a ? b : c : z\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: ternary.leo + path: test 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\\\":\\\"ternary.leo\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"ternary.leo\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"ternary.leo\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" + Identifier: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"ternary.leo\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" + Identifier: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"ternary.leo\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" + Identifier: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x ? y : a ? b : c\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 18 - path: ternary.leo + path: test content: "x ? y : a ? b : c" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: ternary.leo + path: test content: "x ? y : a ? b : c" diff --git a/tests/parser/expression/tuple.leo.out b/tests/expectations/parser/parser/expression/tuple.leo.out similarity index 77% rename from tests/parser/expression/tuple.leo.out rename to tests/expectations/parser/parser/expression/tuple.leo.out index 8216835a52..f5ec2aa11b 100644 --- a/tests/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\\\":\\\"tuple.leo\\\",\\\"content\\\":\\\"(x)\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"tuple.leo\\\",\\\"content\\\":\\\"(y)\\\"}\"}" - - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"tuple.leo\\\",\\\"content\\\":\\\"(z)\\\"}\"}" + - 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)\\\"}\"}" - 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\\\":\\\"tuple.leo\\\",\\\"content\\\":\\\"(x,)\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"(x,)\\\"}\"}" - TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"tuple.leo\\\",\\\"content\\\":\\\"(x,y)\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"tuple.leo\\\",\\\"content\\\":\\\"(x,y)\\\"}\"}" + - 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)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 6 - path: tuple.leo + path: test content: "(x,y)" - TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"tuple.leo\\\",\\\"content\\\":\\\"(x,y,z)\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"tuple.leo\\\",\\\"content\\\":\\\"(x,y,z)\\\"}\"}" - - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"tuple.leo\\\",\\\"content\\\":\\\"(x,y,z)\\\"}\"}" + - 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)\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: tuple.leo + path: test content: "(x,y,z)" - TupleInit: elements: @@ -56,7 +56,7 @@ outputs: line_stop: 1 col_start: 2 col_stop: 5 - path: tuple.leo + path: test content: "(123,123)" - Value: Implicit: @@ -65,14 +65,14 @@ outputs: line_stop: 1 col_start: 6 col_stop: 9 - path: tuple.leo + path: test content: "(123,123)" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: tuple.leo + path: test content: "(123,123)" - TupleInit: elements: [] @@ -81,7 +81,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 3 - path: tuple.leo + path: test content: () - TupleInit: elements: [] @@ -90,5 +90,5 @@ outputs: line_stop: 1 col_start: 2 col_stop: 4 - path: tuple.leo + path: test content: (()) diff --git a/tests/parser/expression/unary/negate.leo.out b/tests/expectations/parser/parser/expression/unary/negate.leo.out similarity index 78% rename from tests/parser/expression/unary/negate.leo.out rename to tests/expectations/parser/parser/expression/unary/negate.leo.out index 901f4bdd6e..de785f2be6 100644 --- a/tests/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\\\":\\\"negate.leo\\\",\\\"content\\\":\\\"-x\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"-x\\\"}\"}" op: Negate span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 3 - path: negate.leo + path: test content: "-x" - Unary: inner: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"negate.leo\\\",\\\"content\\\":\\\"-x.y\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"negate.leo\\\",\\\"content\\\":\\\"-x.y\\\"}\"}" + 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\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 5 - path: negate.leo + path: test content: "-x.y" op: Negate span: @@ -32,20 +32,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: negate.leo + path: test content: "-x.y" - Unary: inner: CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"negate.leo\\\",\\\"content\\\":\\\"-x::y\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"negate.leo\\\",\\\"content\\\":\\\"-x::y\\\"}\"}" + 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\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 6 - path: negate.leo + path: test content: "-x::y" op: Negate span: @@ -53,20 +53,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: negate.leo + path: test content: "-x::y" - Unary: inner: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"negate.leo\\\",\\\"content\\\":\\\"-x()\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"-x()\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 5 - path: negate.leo + path: test content: "-x()" op: Negate span: @@ -74,20 +74,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: negate.leo + path: test content: "-x()" - Unary: inner: Unary: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"negate.leo\\\",\\\"content\\\":\\\"--x\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"--x\\\"}\"}" op: Negate span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 4 - path: negate.leo + path: test content: "--x" op: Negate span: @@ -95,20 +95,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: negate.leo + path: test content: "--x" - Unary: inner: Unary: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"negate.leo\\\",\\\"content\\\":\\\"-!x\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"-!x\\\"}\"}" op: Not span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 4 - path: negate.leo + path: test content: "-!x" op: Negate span: @@ -116,5 +116,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: negate.leo + path: test content: "-!x" diff --git a/tests/parser/expression/unary/not.leo.out b/tests/expectations/parser/parser/expression/unary/not.leo.out similarity index 79% rename from tests/parser/expression/unary/not.leo.out rename to tests/expectations/parser/parser/expression/unary/not.leo.out index c5fc843420..5c93154572 100644 --- a/tests/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\\\":\\\"not.leo\\\",\\\"content\\\":\\\"!x\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"!x\\\"}\"}" op: Not span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 3 - path: not.leo + path: test content: "!x" - Unary: inner: CircuitMemberAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"not.leo\\\",\\\"content\\\":\\\"!x.y\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"not.leo\\\",\\\"content\\\":\\\"!x.y\\\"}\"}" + 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\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 5 - path: not.leo + path: test content: "!x.y" op: Not span: @@ -32,20 +32,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: not.leo + path: test content: "!x.y" - Unary: inner: CircuitStaticFunctionAccess: circuit: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"not.leo\\\",\\\"content\\\":\\\"!x::y\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"not.leo\\\",\\\"content\\\":\\\"!x::y\\\"}\"}" + 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\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 6 - path: not.leo + path: test content: "!x::y" op: Not span: @@ -53,20 +53,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: not.leo + path: test content: "!x::y" - Unary: inner: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"not.leo\\\",\\\"content\\\":\\\"!x()\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"!x()\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 5 - path: not.leo + path: test content: "!x()" op: Not span: @@ -74,20 +74,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 5 - path: not.leo + path: test content: "!x()" - Unary: inner: Unary: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"not.leo\\\",\\\"content\\\":\\\"!!x\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"!!x\\\"}\"}" op: Not span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 4 - path: not.leo + path: test content: "!!x" op: Not span: @@ -95,20 +95,20 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: not.leo + path: test content: "!!x" - Unary: inner: Unary: inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"not.leo\\\",\\\"content\\\":\\\"!-x\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"!-x\\\"}\"}" op: Negate span: line_start: 1 line_stop: 1 col_start: 2 col_stop: 4 - path: not.leo + path: test content: "!-x" op: Not span: @@ -116,5 +116,5 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: not.leo + path: test content: "!-x" diff --git a/tests/parser/functions/annotated.leo.out b/tests/expectations/parser/parser/functions/annotated.leo.out similarity index 80% rename from tests/parser/functions/annotated.leo.out rename to tests/expectations/parser/parser/functions/annotated.leo.out index 8a6628a408..c0e6dab6fb 100644 --- a/tests/parser/functions/annotated.leo.out +++ b/tests/expectations/parser/parser/functions/annotated.leo.out @@ -7,18 +7,18 @@ outputs: imports: [] circuits: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"annotated.leo\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": annotations: - span: line_start: 3 line_stop: 3 col_start: 1 col_stop: 6 - path: annotated.leo + path: test content: "@test" - name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"annotated.leo\\\",\\\"content\\\":\\\"@test\\\"}\"}" + name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"@test\\\"}\"}" arguments: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"annotated.leo\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" input: [] output: ~ block: @@ -32,26 +32,26 @@ outputs: line_stop: 5 col_start: 12 col_stop: 14 - path: annotated.leo + path: test content: " return ();" span: line_start: 5 line_stop: 5 col_start: 5 col_stop: 14 - path: annotated.leo + path: test content: " return ();" span: line_start: 4 line_stop: 6 col_start: 14 col_stop: 2 - path: annotated.leo + path: test content: "function x() {\n...\n}" span: line_start: 4 line_stop: 6 col_start: 1 col_stop: 2 - path: annotated.leo + path: test content: "function x() {\n...\n}" diff --git a/tests/parser/functions/annotated_param.leo.out b/tests/expectations/parser/parser/functions/annotated_param.leo.out similarity index 78% rename from tests/parser/functions/annotated_param.leo.out rename to tests/expectations/parser/parser/functions/annotated_param.leo.out index 0114d271fe..99ca4119f9 100644 --- a/tests/parser/functions/annotated_param.leo.out +++ b/tests/expectations/parser/parser/functions/annotated_param.leo.out @@ -7,19 +7,19 @@ outputs: imports: [] circuits: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"annotated_param.leo\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": annotations: - span: line_start: 3 line_stop: 3 col_start: 1 col_stop: 12 - path: annotated_param.leo + path: test content: "@test(test)" - name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"annotated_param.leo\\\",\\\"content\\\":\\\"@test(test)\\\"}\"}" + name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"@test(test)\\\"}\"}" arguments: - test - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"annotated_param.leo\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" input: [] output: ~ block: @@ -33,26 +33,26 @@ outputs: line_stop: 5 col_start: 12 col_stop: 14 - path: annotated_param.leo + path: test content: " return ();" span: line_start: 5 line_stop: 5 col_start: 5 col_stop: 14 - path: annotated_param.leo + path: test content: " return ();" span: line_start: 4 line_stop: 6 col_start: 14 col_stop: 2 - path: annotated_param.leo + path: test content: "function x() {\n...\n}" span: line_start: 4 line_stop: 6 col_start: 1 col_stop: 2 - path: annotated_param.leo + path: test content: "function x() {\n...\n}" diff --git a/tests/parser/functions/annotated_twice.leo.out b/tests/expectations/parser/parser/functions/annotated_twice.leo.out similarity index 77% rename from tests/parser/functions/annotated_twice.leo.out rename to tests/expectations/parser/parser/functions/annotated_twice.leo.out index edfc43064f..2a4220983e 100644 --- a/tests/parser/functions/annotated_twice.leo.out +++ b/tests/expectations/parser/parser/functions/annotated_twice.leo.out @@ -7,27 +7,27 @@ outputs: imports: [] circuits: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"annotated_twice.leo\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": annotations: - span: line_start: 3 line_stop: 3 col_start: 1 col_stop: 6 - path: annotated_twice.leo + path: test content: "@test @test2" - name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"annotated_twice.leo\\\",\\\"content\\\":\\\"@test @test2\\\"}\"}" + name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"@test @test2\\\"}\"}" arguments: [] - span: line_start: 3 line_stop: 3 col_start: 7 col_stop: 13 - path: annotated_twice.leo + path: test content: "@test @test2" - name: "{\"name\":\"test2\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":13,\\\"path\\\":\\\"annotated_twice.leo\\\",\\\"content\\\":\\\"@test @test2\\\"}\"}" + name: "{\"name\":\"test2\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"@test @test2\\\"}\"}" arguments: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"annotated_twice.leo\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" input: [] output: ~ block: @@ -41,26 +41,26 @@ outputs: line_stop: 5 col_start: 12 col_stop: 14 - path: annotated_twice.leo + path: test content: " return ();" span: line_start: 5 line_stop: 5 col_start: 5 col_stop: 14 - path: annotated_twice.leo + path: test content: " return ();" span: line_start: 4 line_stop: 6 col_start: 14 col_stop: 2 - path: annotated_twice.leo + path: test content: "function x() {\n...\n}" span: line_start: 4 line_stop: 6 col_start: 1 col_stop: 2 - path: annotated_twice.leo + path: test content: "function x() {\n...\n}" diff --git a/tests/parser/functions/const_input_fail.leo.out b/tests/expectations/parser/parser/functions/const_input_fail.leo.out similarity index 100% rename from tests/parser/functions/const_input_fail.leo.out rename to tests/expectations/parser/parser/functions/const_input_fail.leo.out diff --git a/tests/parser/functions/const_param.leo.out b/tests/expectations/parser/parser/functions/const_param.leo.out similarity index 77% rename from tests/parser/functions/const_param.leo.out rename to tests/expectations/parser/parser/functions/const_param.leo.out index e481e3e18e..28916f76c8 100644 --- a/tests/parser/functions/const_param.leo.out +++ b/tests/expectations/parser/parser/functions/const_param.leo.out @@ -7,12 +7,12 @@ outputs: imports: [] circuits: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"const_param.leo\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}": + "{\"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) {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"const_param.leo\\\",\\\"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\\\":\\\"test\\\",\\\"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\\\":\\\"const_param.leo\\\",\\\"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\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}" const_: false mutable: true type_: @@ -22,10 +22,10 @@ outputs: line_stop: 3 col_start: 12 col_stop: 13 - path: const_param.leo + path: test 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\\\":\\\"const_param.leo\\\",\\\"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\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}" const_: true mutable: false type_: @@ -35,7 +35,7 @@ outputs: line_stop: 3 col_start: 26 col_stop: 27 - path: const_param.leo + path: test content: "function x(x: u32, const y: i32) {" output: ~ block: @@ -49,35 +49,35 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: const_param.leo + path: test content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: const_param.leo + path: test content: " return ();" span: line_start: 3 line_stop: 5 col_start: 34 col_stop: 2 - path: const_param.leo + path: test content: "function x(x: u32, const y: i32) {\n...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: const_param.leo + 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\\\":\\\"const_param.leo\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}": + "{\"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) {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"const_param.leo\\\",\\\"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\\\":\\\"test\\\",\\\"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\\\":\\\"const_param.leo\\\",\\\"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\\\":\\\"test\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}" const_: true mutable: false type_: @@ -87,10 +87,10 @@ outputs: line_stop: 7 col_start: 18 col_stop: 19 - path: const_param.leo + path: test 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\\\":\\\"const_param.leo\\\",\\\"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\\\":\\\"test\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}" const_: false mutable: true type_: @@ -100,7 +100,7 @@ outputs: line_stop: 7 col_start: 26 col_stop: 27 - path: const_param.leo + path: test content: "function x(const x: u32, y: i32) {" output: ~ block: @@ -114,26 +114,26 @@ outputs: line_stop: 8 col_start: 12 col_stop: 14 - path: const_param.leo + path: test content: " return ();" span: line_start: 8 line_stop: 8 col_start: 5 col_stop: 14 - path: const_param.leo + path: test content: " return ();" span: line_start: 7 line_stop: 9 col_start: 34 col_stop: 2 - path: const_param.leo + path: test content: "function x(const x: u32, y: i32) {\n...\n}" span: line_start: 7 line_stop: 9 col_start: 1 col_stop: 2 - path: const_param.leo + path: test content: "function x(const x: u32, y: i32) {\n...\n}" diff --git a/tests/parser/functions/const_self_bad.leo.out b/tests/expectations/parser/parser/functions/const_self_bad.leo.out similarity index 76% rename from tests/parser/functions/const_self_bad.leo.out rename to tests/expectations/parser/parser/functions/const_self_bad.leo.out index 21f6f82c17..68248c8693 100644 --- a/tests/parser/functions/const_self_bad.leo.out +++ b/tests/expectations/parser/parser/functions/const_self_bad.leo.out @@ -7,11 +7,11 @@ outputs: imports: [] circuits: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"const_self_bad.leo\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"const_self_bad.leo\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}" input: - - ConstSelfKeyword: "{\"name\":\"const self\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":22,\\\"path\\\":\\\"const_self_bad.leo\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}" + - ConstSelfKeyword: "{\"name\":\"const self\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":22,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}" output: ~ block: statements: @@ -24,26 +24,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: const_self_bad.leo + path: test content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: const_self_bad.leo + path: test content: " return ();" span: line_start: 3 line_stop: 5 col_start: 24 col_stop: 2 - path: const_self_bad.leo + path: test content: "function x(const self) {\n...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: const_self_bad.leo + path: test content: "function x(const self) {\n...\n}" diff --git a/tests/parser/functions/empty.leo.out b/tests/expectations/parser/parser/functions/empty.leo.out similarity index 83% rename from tests/parser/functions/empty.leo.out rename to tests/expectations/parser/parser/functions/empty.leo.out index 6ae9cc9f4f..03ff79d359 100644 --- a/tests/parser/functions/empty.leo.out +++ b/tests/expectations/parser/parser/functions/empty.leo.out @@ -7,9 +7,9 @@ outputs: imports: [] circuits: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"empty.leo\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"empty.leo\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" input: [] output: ~ block: @@ -23,26 +23,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: empty.leo + path: test content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: empty.leo + path: test content: " return ();" span: line_start: 3 line_stop: 5 col_start: 14 col_stop: 2 - path: empty.leo + path: test content: "function x() {\n...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: empty.leo + path: test content: "function x() {\n...\n}" diff --git a/tests/parser/functions/empty2.leo.out b/tests/expectations/parser/parser/functions/empty2.leo.out similarity index 79% rename from tests/parser/functions/empty2.leo.out rename to tests/expectations/parser/parser/functions/empty2.leo.out index f936d5a33c..ba7212db42 100644 --- a/tests/parser/functions/empty2.leo.out +++ b/tests/expectations/parser/parser/functions/empty2.leo.out @@ -7,9 +7,9 @@ outputs: imports: [] circuits: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"empty2.leo\\\",\\\"content\\\":\\\"function x() {}\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {}\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"empty2.leo\\\",\\\"content\\\":\\\"function x() {}\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() {}\\\"}\"}" input: [] output: ~ block: @@ -19,12 +19,12 @@ outputs: line_stop: 3 col_start: 14 col_stop: 16 - path: empty2.leo + path: test content: "function x() {}" span: line_start: 3 line_stop: 3 col_start: 1 col_stop: 16 - path: empty2.leo + path: test content: "function x() {}" diff --git a/tests/parser/functions/param_array.leo.out b/tests/expectations/parser/parser/functions/param_array.leo.out similarity index 79% rename from tests/parser/functions/param_array.leo.out rename to tests/expectations/parser/parser/functions/param_array.leo.out index 52de96606b..6854e088a5 100644 --- a/tests/parser/functions/param_array.leo.out +++ b/tests/expectations/parser/parser/functions/param_array.leo.out @@ -7,12 +7,12 @@ outputs: imports: [] circuits: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"param_array.leo\\\",\\\"content\\\":\\\"function x(x: [u8; 12]) {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: [u8; 12]) {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"param_array.leo\\\",\\\"content\\\":\\\"function x(x: [u8; 12]) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"param_array.leo\\\",\\\"content\\\":\\\"function x(x: [u8; 12]) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: [u8; 12]) {\\\"}\"}" const_: false mutable: true type_: @@ -24,7 +24,7 @@ outputs: line_stop: 3 col_start: 12 col_stop: 13 - path: param_array.leo + path: test content: "function x(x: [u8; 12]) {" output: ~ block: @@ -38,26 +38,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: param_array.leo + path: test content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: param_array.leo + path: test content: " return ();" span: line_start: 3 line_stop: 5 col_start: 25 col_stop: 2 - path: param_array.leo + path: test content: "function x(x: [u8; 12]) {\n...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: param_array.leo + path: test content: "function x(x: [u8; 12]) {\n...\n}" diff --git a/tests/parser/functions/param_circuit.leo.out b/tests/expectations/parser/parser/functions/param_circuit.leo.out similarity index 77% rename from tests/parser/functions/param_circuit.leo.out rename to tests/expectations/parser/parser/functions/param_circuit.leo.out index e0f96949b8..a43143a6cb 100644 --- a/tests/parser/functions/param_circuit.leo.out +++ b/tests/expectations/parser/parser/functions/param_circuit.leo.out @@ -7,22 +7,22 @@ outputs: imports: [] circuits: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"param_circuit.leo\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"param_circuit.leo\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}" input: - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"param_circuit.leo\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"param_circuit.leo\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}" + Circuit: "{\"name\":\"MyCircuit\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":15,\\\"col_stop\\\":24,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}" span: line_start: 3 line_stop: 3 col_start: 12 col_stop: 13 - path: param_circuit.leo + path: test content: "function x(x: MyCircuit) {" output: ~ block: @@ -36,26 +36,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: param_circuit.leo + path: test content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: param_circuit.leo + path: test content: " return ();" span: line_start: 3 line_stop: 5 col_start: 26 col_stop: 2 - path: param_circuit.leo + path: test content: "function x(x: MyCircuit) {\n...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: param_circuit.leo + path: test content: "function x(x: MyCircuit) {\n...\n}" diff --git a/tests/parser/functions/param_tuple.leo.out b/tests/expectations/parser/parser/functions/param_tuple.leo.out similarity index 79% rename from tests/parser/functions/param_tuple.leo.out rename to tests/expectations/parser/parser/functions/param_tuple.leo.out index 091eece348..520d664450 100644 --- a/tests/parser/functions/param_tuple.leo.out +++ b/tests/expectations/parser/parser/functions/param_tuple.leo.out @@ -7,12 +7,12 @@ outputs: imports: [] circuits: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"param_tuple.leo\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"param_tuple.leo\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"param_tuple.leo\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}" const_: false mutable: true type_: @@ -24,7 +24,7 @@ outputs: line_stop: 3 col_start: 12 col_stop: 13 - path: param_tuple.leo + path: test content: "function x(x: (u32, i32)) {" output: ~ block: @@ -38,26 +38,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: param_tuple.leo + path: test content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: param_tuple.leo + path: test content: " return ();" span: line_start: 3 line_stop: 5 col_start: 27 col_stop: 2 - path: param_tuple.leo + path: test content: "function x(x: (u32, i32)) {\n...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: param_tuple.leo + path: test content: "function x(x: (u32, i32)) {\n...\n}" diff --git a/tests/parser/functions/params.leo.out b/tests/expectations/parser/parser/functions/params.leo.out similarity index 80% rename from tests/parser/functions/params.leo.out rename to tests/expectations/parser/parser/functions/params.leo.out index 2dad0047ff..6549ea1ca2 100644 --- a/tests/parser/functions/params.leo.out +++ b/tests/expectations/parser/parser/functions/params.leo.out @@ -7,12 +7,12 @@ outputs: imports: [] circuits: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"params.leo\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"params.leo\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" + 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) {\\\"}\"}" input: - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"params.leo\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" + 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) {\\\"}\"}" const_: false mutable: true type_: @@ -22,10 +22,10 @@ outputs: line_stop: 3 col_start: 12 col_stop: 13 - path: params.leo + path: test 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\\\":\\\"params.leo\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" + 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) {\\\"}\"}" const_: false mutable: true type_: @@ -35,7 +35,7 @@ outputs: line_stop: 3 col_start: 20 col_stop: 21 - path: params.leo + path: test content: "function x(x: u32, y: i32) {" output: ~ block: @@ -49,26 +49,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: params.leo + path: test content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: params.leo + path: test content: " return ();" span: line_start: 3 line_stop: 5 col_start: 28 col_stop: 2 - path: params.leo + path: test content: "function x(x: u32, y: i32) {\n...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: params.leo + path: test content: "function x(x: u32, y: i32) {\n...\n}" diff --git a/tests/parser/functions/params_return.leo.out b/tests/expectations/parser/parser/functions/params_return.leo.out similarity index 77% rename from tests/parser/functions/params_return.leo.out rename to tests/expectations/parser/parser/functions/params_return.leo.out index bfa165324a..1ec8867568 100644 --- a/tests/parser/functions/params_return.leo.out +++ b/tests/expectations/parser/parser/functions/params_return.leo.out @@ -7,12 +7,12 @@ outputs: imports: [] circuits: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"params_return.leo\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}": + "{\"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 {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"params_return.leo\\\",\\\"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\\\":\\\"test\\\",\\\"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\\\":\\\"params_return.leo\\\",\\\"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\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}" const_: false mutable: true type_: @@ -22,10 +22,10 @@ outputs: line_stop: 3 col_start: 12 col_stop: 13 - path: params_return.leo + path: test 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\\\":\\\"params_return.leo\\\",\\\"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\\\":\\\"test\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}" const_: false mutable: true type_: @@ -35,7 +35,7 @@ outputs: line_stop: 3 col_start: 20 col_stop: 21 - path: params_return.leo + path: test content: "function x(x: u32, y: i32) -> u32 {" output: IntegerType: U32 @@ -50,26 +50,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: params_return.leo + path: test content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: params_return.leo + path: test content: " return ();" span: line_start: 3 line_stop: 5 col_start: 35 col_stop: 2 - path: params_return.leo + path: test content: "function x(x: u32, y: i32) -> u32 {\n...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: params_return.leo + path: test content: "function x(x: u32, y: i32) -> u32 {\n...\n}" diff --git a/tests/parser/functions/return.leo.out b/tests/expectations/parser/parser/functions/return.leo.out similarity index 82% rename from tests/parser/functions/return.leo.out rename to tests/expectations/parser/parser/functions/return.leo.out index f3306857c3..0f87e02968 100644 --- a/tests/parser/functions/return.leo.out +++ b/tests/expectations/parser/parser/functions/return.leo.out @@ -7,9 +7,9 @@ outputs: imports: [] circuits: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"return.leo\\\",\\\"content\\\":\\\"function x() -> u32 {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() -> u32 {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"return.leo\\\",\\\"content\\\":\\\"function x() -> u32 {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() -> u32 {\\\"}\"}" input: [] output: IntegerType: U32 @@ -24,26 +24,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: return.leo + path: test content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: return.leo + path: test content: " return ();" span: line_start: 3 line_stop: 5 col_start: 21 col_stop: 2 - path: return.leo + path: test content: "function x() -> u32 {\n...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: return.leo + path: test content: "function x() -> u32 {\n...\n}" diff --git a/tests/parser/functions/return_tuple.leo.out b/tests/expectations/parser/parser/functions/return_tuple.leo.out similarity index 80% rename from tests/parser/functions/return_tuple.leo.out rename to tests/expectations/parser/parser/functions/return_tuple.leo.out index 5aeb9e8ad1..16b4bd1c45 100644 --- a/tests/parser/functions/return_tuple.leo.out +++ b/tests/expectations/parser/parser/functions/return_tuple.leo.out @@ -7,9 +7,9 @@ outputs: imports: [] circuits: {} functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"return_tuple.leo\\\",\\\"content\\\":\\\"function x() -> (u32, u32) {\\\"}\"}": + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() -> (u32, u32) {\\\"}\"}": annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"return_tuple.leo\\\",\\\"content\\\":\\\"function x() -> (u32, u32) {\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"function x() -> (u32, u32) {\\\"}\"}" input: [] output: Tuple: @@ -26,26 +26,26 @@ outputs: line_stop: 4 col_start: 12 col_stop: 14 - path: return_tuple.leo + path: test content: " return ();" span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 14 - path: return_tuple.leo + path: test content: " return ();" span: line_start: 3 line_stop: 5 col_start: 28 col_stop: 2 - path: return_tuple.leo + path: test content: "function x() -> (u32, u32) {\n...\n}" span: line_start: 3 line_stop: 5 col_start: 1 col_stop: 2 - path: return_tuple.leo + path: test content: "function x() -> (u32, u32) {\n...\n}" diff --git a/tests/parser/import/alias.leo.out b/tests/expectations/parser/parser/import/alias.leo.out similarity index 76% rename from tests/parser/import/alias.leo.out rename to tests/expectations/parser/parser/import/alias.leo.out index 99b570888e..654fbcefc6 100644 --- a/tests/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\\\":\\\"alias.leo\\\",\\\"content\\\":\\\"import a.b as bar;\\\"}\"}" + name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"alias.leo\\\",\\\"content\\\":\\\"import a.b as bar;\\\"}\"}" - alias: "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":15,\\\"col_stop\\\":18,\\\"path\\\":\\\"alias.leo\\\",\\\"content\\\":\\\"import a.b as bar;\\\"}\"}" + 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;\\\"}\"}" span: line_start: 3 line_stop: 3 col_start: 10 col_stop: 18 - path: alias.leo + path: test content: import a.b as bar; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 18 - path: alias.leo + path: test content: import a.b as bar; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 18 - path: alias.leo + path: test content: import a.b as bar; circuits: {} functions: {} diff --git a/tests/parser/import/basic.leo.out b/tests/expectations/parser/parser/import/basic.leo.out similarity index 80% rename from tests/parser/import/basic.leo.out rename to tests/expectations/parser/parser/import/basic.leo.out index 7baa3ddd2a..6467c45999 100644 --- a/tests/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\\\":\\\"basic.leo\\\",\\\"content\\\":\\\"import a.b;\\\"}\"}" + name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import a.b;\\\"}\"}" access: Symbol: - symbol: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"basic.leo\\\",\\\"content\\\":\\\"import a.b;\\\"}\"}" + symbol: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import a.b;\\\"}\"}" alias: ~ span: line_start: 3 line_stop: 3 col_start: 10 col_stop: 11 - path: basic.leo + path: test content: import a.b; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 11 - path: basic.leo + path: test content: import a.b; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 11 - path: basic.leo + path: test content: import a.b; circuits: {} functions: {} diff --git a/tests/parser/import/many_import.leo.out b/tests/expectations/parser/parser/import/many_import.leo.out similarity index 75% rename from tests/parser/import/many_import.leo.out rename to tests/expectations/parser/parser/import/many_import.leo.out index 0354e06da1..27e4abedd1 100644 --- a/tests/parser/import/many_import.leo.out +++ b/tests/expectations/parser/parser/import/many_import.leo.out @@ -7,129 +7,129 @@ outputs: imports: - package_or_packages: Packages: - name: "{\"name\":\"test-import\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"many_import.leo\\\",\\\"content\\\":\\\"import test-import.( // local import\\\"}\"}" + 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\\\"}\"}" accesses: - Symbol: - symbol: "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":10,\\\"path\\\":\\\"many_import.leo\\\",\\\"content\\\":\\\" Point,\\\"}\"}" + symbol: "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" Point,\\\"}\"}" alias: ~ span: line_start: 4 line_stop: 4 col_start: 5 col_stop: 10 - path: many_import.leo + path: test content: " Point," - Symbol: - symbol: "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"many_import.leo\\\",\\\"content\\\":\\\" foo,\\\"}\"}" + symbol: "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" foo,\\\"}\"}" alias: ~ span: line_start: 5 line_stop: 5 col_start: 5 col_stop: 8 - path: many_import.leo + path: test content: " foo," span: line_start: 3 line_stop: 5 col_start: 8 col_stop: 8 - path: many_import.leo + path: test content: "import test-import.( // local import\n...\n foo," span: line_start: 3 line_stop: 5 col_start: 8 col_stop: 8 - path: many_import.leo + path: test 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\\\":\\\"many_import.leo\\\",\\\"content\\\":\\\"import bar.( // imports directory import\\\"}\"}" + name: "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"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\\\":\\\"many_import.leo\\\",\\\"content\\\":\\\" Bar,\\\"}\"}" + symbol: "{\"name\":\"Bar\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" Bar,\\\"}\"}" alias: ~ span: line_start: 9 line_stop: 9 col_start: 5 col_stop: 8 - path: many_import.leo + path: test content: " Bar," - Multiple: - name: "{\"name\":\"baz\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"many_import.leo\\\",\\\"content\\\":\\\" baz.(Baz, Bazzar),\\\"}\"}" + name: "{\"name\":\"baz\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" baz.(Baz, Bazzar),\\\"}\"}" accesses: - Symbol: - symbol: "{\"name\":\"Baz\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":10,\\\"col_stop\\\":13,\\\"path\\\":\\\"many_import.leo\\\",\\\"content\\\":\\\" baz.(Baz, Bazzar),\\\"}\"}" + symbol: "{\"name\":\"Baz\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":10,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" baz.(Baz, Bazzar),\\\"}\"}" alias: ~ span: line_start: 10 line_stop: 10 col_start: 10 col_stop: 13 - path: many_import.leo + path: test content: " baz.(Baz, Bazzar)," - Symbol: - symbol: "{\"name\":\"Bazzar\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":15,\\\"col_stop\\\":21,\\\"path\\\":\\\"many_import.leo\\\",\\\"content\\\":\\\" baz.(Baz, Bazzar),\\\"}\"}" + symbol: "{\"name\":\"Bazzar\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":15,\\\"col_stop\\\":21,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" baz.(Baz, Bazzar),\\\"}\"}" alias: ~ span: line_start: 10 line_stop: 10 col_start: 15 col_stop: 21 - path: many_import.leo + path: test content: " baz.(Baz, Bazzar)," span: line_start: 10 line_stop: 10 col_start: 5 col_stop: 21 - path: many_import.leo + path: test content: " baz.(Baz, Bazzar)," - SubPackage: - name: "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"many_import.leo\\\",\\\"content\\\":\\\" bat.bat.Bat,\\\"}\"}" + name: "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" bat.bat.Bat,\\\"}\"}" access: SubPackage: - name: "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":9,\\\"col_stop\\\":12,\\\"path\\\":\\\"many_import.leo\\\",\\\"content\\\":\\\" bat.bat.Bat,\\\"}\"}" + name: "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":9,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" bat.bat.Bat,\\\"}\"}" access: Symbol: - symbol: "{\"name\":\"Bat\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":13,\\\"col_stop\\\":16,\\\"path\\\":\\\"many_import.leo\\\",\\\"content\\\":\\\" bat.bat.Bat,\\\"}\"}" + symbol: "{\"name\":\"Bat\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":13,\\\"col_stop\\\":16,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\" bat.bat.Bat,\\\"}\"}" alias: ~ span: line_start: 11 line_stop: 11 col_start: 13 col_stop: 16 - path: many_import.leo + path: test content: " bat.bat.Bat," span: line_start: 11 line_stop: 11 col_start: 9 col_stop: 16 - path: many_import.leo + path: test content: " bat.bat.Bat," span: line_start: 11 line_stop: 11 col_start: 5 col_stop: 16 - path: many_import.leo + path: test content: " bat.bat.Bat," span: line_start: 8 line_stop: 11 col_start: 8 col_stop: 16 - path: many_import.leo + path: test content: "import bar.( // imports directory import\n...\n bat.bat.Bat," span: line_start: 8 line_stop: 11 col_start: 8 col_stop: 16 - path: many_import.leo + path: test content: "import bar.( // imports directory import\n...\n bat.bat.Bat," circuits: {} functions: {} diff --git a/tests/parser/import/many_import_star.leo.out b/tests/expectations/parser/parser/import/many_import_star.leo.out similarity index 75% rename from tests/parser/import/many_import_star.leo.out rename to tests/expectations/parser/parser/import/many_import_star.leo.out index 382c991c98..d72655988c 100644 --- a/tests/parser/import/many_import_star.leo.out +++ b/tests/expectations/parser/parser/import/many_import_star.leo.out @@ -7,158 +7,158 @@ outputs: imports: - package_or_packages: Package: - name: "{\"name\":\"test-import\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"many_import_star.leo\\\",\\\"content\\\":\\\"import test-import.*; // local import\\\"}\"}" + 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\\\"}\"}" access: Star: line_start: 3 line_stop: 3 col_start: 20 col_stop: 21 - path: many_import_star.leo + path: test content: import test-import.*; // local import span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 21 - path: many_import_star.leo + path: test content: import test-import.*; // local import span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 21 - path: many_import_star.leo + path: test 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\\\":\\\"many_import_star.leo\\\",\\\"content\\\":\\\"import bar.*; // imports directory import\\\"}\"}" + name: "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import bar.*; // imports directory import\\\"}\"}" access: Star: line_start: 5 line_stop: 5 col_start: 12 col_stop: 13 - path: many_import_star.leo + path: test content: import bar.*; // imports directory import span: line_start: 5 line_stop: 5 col_start: 8 col_stop: 13 - path: many_import_star.leo + path: test content: import bar.*; // imports directory import span: line_start: 5 line_stop: 5 col_start: 8 col_stop: 13 - path: many_import_star.leo + path: test 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\\\":\\\"many_import_star.leo\\\",\\\"content\\\":\\\"import bar.baz.*; // imports directory import\\\"}\"}" + 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\\\"}\"}" access: SubPackage: - name: "{\"name\":\"baz\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":12,\\\"col_stop\\\":15,\\\"path\\\":\\\"many_import_star.leo\\\",\\\"content\\\":\\\"import bar.baz.*; // imports directory import\\\"}\"}" + 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\\\"}\"}" access: Star: line_start: 6 line_stop: 6 col_start: 16 col_stop: 17 - path: many_import_star.leo + path: test content: import bar.baz.*; // imports directory import span: line_start: 6 line_stop: 6 col_start: 12 col_stop: 17 - path: many_import_star.leo + path: test content: import bar.baz.*; // imports directory import span: line_start: 6 line_stop: 6 col_start: 8 col_stop: 17 - path: many_import_star.leo + path: test content: import bar.baz.*; // imports directory import span: line_start: 6 line_stop: 6 col_start: 8 col_stop: 17 - path: many_import_star.leo + path: test 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\\\":\\\"many_import_star.leo\\\",\\\"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\\\":\\\"test\\\",\\\"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\\\":\\\"many_import_star.leo\\\",\\\"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\\\":\\\"test\\\",\\\"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\\\":\\\"many_import_star.leo\\\",\\\"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\\\":\\\"test\\\",\\\"content\\\":\\\"import bar.bat.bat.*; // imports directory import\\\"}\"}" access: Star: line_start: 7 line_stop: 7 col_start: 20 col_stop: 21 - path: many_import_star.leo + path: test content: import bar.bat.bat.*; // imports directory import span: line_start: 7 line_stop: 7 col_start: 16 col_stop: 21 - path: many_import_star.leo + path: test content: import bar.bat.bat.*; // imports directory import span: line_start: 7 line_stop: 7 col_start: 12 col_stop: 21 - path: many_import_star.leo + path: test content: import bar.bat.bat.*; // imports directory import span: line_start: 7 line_stop: 7 col_start: 8 col_stop: 21 - path: many_import_star.leo + path: test content: import bar.bat.bat.*; // imports directory import span: line_start: 7 line_stop: 7 col_start: 8 col_stop: 21 - path: many_import_star.leo + path: test 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\\\":\\\"many_import_star.leo\\\",\\\"content\\\":\\\"import car.*; // imports directory import\\\"}\"}" + name: "{\"name\":\"car\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import car.*; // imports directory import\\\"}\"}" access: Star: line_start: 8 line_stop: 8 col_start: 12 col_stop: 13 - path: many_import_star.leo + path: test content: import car.*; // imports directory import span: line_start: 8 line_stop: 8 col_start: 8 col_stop: 13 - path: many_import_star.leo + path: test content: import car.*; // imports directory import span: line_start: 8 line_stop: 8 col_start: 8 col_stop: 13 - path: many_import_star.leo + path: test content: import car.*; // imports directory import circuits: {} functions: {} diff --git a/tests/parser/import/names.leo.out b/tests/expectations/parser/parser/import/names.leo.out similarity index 77% rename from tests/parser/import/names.leo.out rename to tests/expectations/parser/parser/import/names.leo.out index 3c6e589857..0ea33ddad3 100644 --- a/tests/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\\\":\\\"names.leo\\\",\\\"content\\\":\\\"import a0-f.foo;\\\"}\"}" + name: "{\"name\":\"a0-f\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import a0-f.foo;\\\"}\"}" access: Symbol: - symbol: "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":13,\\\"col_stop\\\":16,\\\"path\\\":\\\"names.leo\\\",\\\"content\\\":\\\"import a0-f.foo;\\\"}\"}" + symbol: "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":13,\\\"col_stop\\\":16,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import a0-f.foo;\\\"}\"}" alias: ~ span: line_start: 3 line_stop: 3 col_start: 13 col_stop: 16 - path: names.leo + path: test content: import a0-f.foo; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 16 - path: names.leo + path: test content: import a0-f.foo; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 16 - path: names.leo + path: test 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\\\":\\\"names.leo\\\",\\\"content\\\":\\\"import a-9.bar;\\\"}\"}" + name: "{\"name\":\"a-9\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import a-9.bar;\\\"}\"}" access: Symbol: - symbol: "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":12,\\\"col_stop\\\":15,\\\"path\\\":\\\"names.leo\\\",\\\"content\\\":\\\"import a-9.bar;\\\"}\"}" + symbol: "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":12,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import a-9.bar;\\\"}\"}" alias: ~ span: line_start: 4 line_stop: 4 col_start: 12 col_stop: 15 - path: names.leo + path: test content: import a-9.bar; span: line_start: 4 line_stop: 4 col_start: 8 col_stop: 15 - path: names.leo + path: test content: import a-9.bar; span: line_start: 4 line_stop: 4 col_start: 8 col_stop: 15 - path: names.leo + path: test 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\\\":\\\"names.leo\\\",\\\"content\\\":\\\"import hello-world.hello;\\\"}\"}" + name: "{\"name\":\"hello-world\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import hello-world.hello;\\\"}\"}" access: Symbol: - symbol: "{\"name\":\"hello\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":20,\\\"col_stop\\\":25,\\\"path\\\":\\\"names.leo\\\",\\\"content\\\":\\\"import hello-world.hello;\\\"}\"}" + symbol: "{\"name\":\"hello\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":20,\\\"col_stop\\\":25,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import hello-world.hello;\\\"}\"}" alias: ~ span: line_start: 5 line_stop: 5 col_start: 20 col_stop: 25 - path: names.leo + path: test content: import hello-world.hello; span: line_start: 5 line_stop: 5 col_start: 8 col_stop: 25 - path: names.leo + path: test content: import hello-world.hello; span: line_start: 5 line_stop: 5 col_start: 8 col_stop: 25 - path: names.leo + path: test content: import hello-world.hello; circuits: {} functions: {} diff --git a/tests/parser/import/names_underscore.leo.out b/tests/expectations/parser/parser/import/names_underscore.leo.out similarity index 75% rename from tests/parser/import/names_underscore.leo.out rename to tests/expectations/parser/parser/import/names_underscore.leo.out index 78a13fb354..1dcd68015c 100644 --- a/tests/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\\\":\\\"names_underscore.leo\\\",\\\"content\\\":\\\"import hello_world.foo;\\\"}\"}" + name: "{\"name\":\"hello_world\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import hello_world.foo;\\\"}\"}" access: Symbol: - symbol: "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":20,\\\"col_stop\\\":23,\\\"path\\\":\\\"names_underscore.leo\\\",\\\"content\\\":\\\"import hello_world.foo;\\\"}\"}" + symbol: "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":20,\\\"col_stop\\\":23,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import hello_world.foo;\\\"}\"}" alias: ~ span: line_start: 3 line_stop: 3 col_start: 20 col_stop: 23 - path: names_underscore.leo + path: test content: import hello_world.foo; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 23 - path: names_underscore.leo + path: test content: import hello_world.foo; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 23 - path: names_underscore.leo + path: test content: import hello_world.foo; circuits: {} functions: {} diff --git a/tests/parser/import/star.leo.out b/tests/expectations/parser/parser/import/star.leo.out similarity index 82% rename from tests/parser/import/star.leo.out rename to tests/expectations/parser/parser/import/star.leo.out index 3435817ea3..59d6e5c5b9 100644 --- a/tests/parser/import/star.leo.out +++ b/tests/expectations/parser/parser/import/star.leo.out @@ -7,28 +7,28 @@ outputs: imports: - package_or_packages: Package: - name: "{\"name\":\"test-import\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"star.leo\\\",\\\"content\\\":\\\"import test-import.*;\\\"}\"}" + name: "{\"name\":\"test-import\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"import test-import.*;\\\"}\"}" access: Star: line_start: 3 line_stop: 3 col_start: 20 col_stop: 21 - path: star.leo + path: test content: import test-import.*; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 21 - path: star.leo + path: test content: import test-import.*; span: line_start: 3 line_stop: 3 col_start: 8 col_stop: 21 - path: star.leo + path: test content: import test-import.*; circuits: {} functions: {} diff --git a/tests/parser/statement/assign.leo.out b/tests/expectations/parser/parser/statement/assign.leo.out similarity index 78% rename from tests/parser/statement/assign.leo.out rename to tests/expectations/parser/parser/statement/assign.leo.out index 44340f79ff..d992c636a2 100644 --- a/tests/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\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = expr;\\\"}\"}" accesses: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 2 - path: assign.leo + path: test content: x = expr; value: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":9,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 9 - path: assign.leo + path: test content: x = expr; - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = ();\\\"}\"}" accesses: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 2 - path: assign.leo + path: test content: x = (); value: TupleInit: @@ -43,114 +43,114 @@ outputs: line_stop: 1 col_start: 5 col_stop: 7 - path: assign.leo + path: test content: x = (); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: assign.leo + path: test content: x = (); - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = x+y;\\\"}\"}" accesses: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 2 - path: assign.leo + path: test content: x = x+y; value: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 8 - path: assign.leo + path: test content: x = x+y; span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: assign.leo + path: test 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\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = (x,y);\\\"}\"}" accesses: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 2 - path: assign.leo + path: test content: "x = (x,y);" value: TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x = (x,y);\\\"}\"}" + - 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 10 - path: assign.leo + path: test content: "x = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: assign.leo + path: test 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\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = x();\\\"}\"}" accesses: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 2 - path: assign.leo + path: test content: x = x(); value: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 8 - path: assign.leo + path: test content: x = x(); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: assign.leo + path: test content: x = x(); - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x[0] = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0] = y;\\\"}\"}" accesses: - ArrayIndex: Value: @@ -160,28 +160,28 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: assign.leo + path: test content: "x[0] = y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: assign.leo + path: test content: "x[0] = y;" value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x[0] = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0] = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 9 - path: assign.leo + path: test 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\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x[0u32] = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0u32] = y;\\\"}\"}" accesses: - ArrayIndex: Value: @@ -192,28 +192,28 @@ outputs: line_stop: 1 col_start: 3 col_stop: 7 - path: assign.leo + path: test content: "x[0u32] = y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: assign.leo + path: test content: "x[0u32] = y;" value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x[0u32] = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[0u32] = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: assign.leo + path: test 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\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x.0 = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0 = y;\\\"}\"}" accesses: - Tuple: - value: "0" @@ -221,28 +221,28 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: assign.leo + path: test content: x.0 = y; span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: assign.leo + path: test content: x.0 = y; value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x.0 = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0 = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: assign.leo + path: test 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\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x[1..2] = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[1..2] = y;\\\"}\"}" accesses: - ArrayRange: - Value: @@ -252,7 +252,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: assign.leo + path: test content: "x[1..2] = y;" - Value: Implicit: @@ -261,28 +261,28 @@ outputs: line_stop: 1 col_start: 6 col_stop: 7 - path: assign.leo + path: test content: "x[1..2] = y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 8 - path: assign.leo + path: test content: "x[1..2] = y;" value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x[1..2] = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[1..2] = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: assign.leo + path: test 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\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x[..2] = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..2] = y;\\\"}\"}" accesses: - ArrayRange: - ~ @@ -293,28 +293,28 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: assign.leo + path: test content: "x[..2] = y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 7 - path: assign.leo + path: test content: "x[..2] = y;" value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x[..2] = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..2] = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: assign.leo + path: test 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\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x[2..] = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[2..] = y;\\\"}\"}" accesses: - ArrayRange: - Value: @@ -324,7 +324,7 @@ outputs: line_stop: 1 col_start: 3 col_stop: 4 - path: assign.leo + path: test content: "x[2..] = y;" - ~ span: @@ -332,21 +332,21 @@ outputs: line_stop: 1 col_start: 1 col_stop: 7 - path: assign.leo + path: test content: "x[2..] = y;" value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x[2..] = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[2..] = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: assign.leo + path: test 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\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x[..] = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..] = y;\\\"}\"}" accesses: - ArrayRange: - ~ @@ -356,21 +356,21 @@ outputs: line_stop: 1 col_start: 1 col_stop: 6 - path: assign.leo + path: test content: "x[..] = y;" value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x[..] = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x[..] = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: assign.leo + path: test content: "x[..] = y;" - Assign: operation: Assign assignee: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x.0[0][..] = y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0[0][..] = y;\\\"}\"}" accesses: - Tuple: - value: "0" @@ -378,7 +378,7 @@ outputs: line_stop: 1 col_start: 1 col_stop: 4 - path: assign.leo + path: test content: "x.0[0][..] = y;" - ArrayIndex: Value: @@ -388,7 +388,7 @@ outputs: line_stop: 1 col_start: 5 col_stop: 6 - path: assign.leo + path: test content: "x.0[0][..] = y;" - ArrayRange: - ~ @@ -398,14 +398,14 @@ outputs: line_stop: 1 col_start: 1 col_stop: 11 - path: assign.leo + path: test content: "x.0[0][..] = y;" value: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"assign.leo\\\",\\\"content\\\":\\\"x.0[0][..] = y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x.0[0][..] = y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 15 - path: assign.leo + path: test content: "x.0[0][..] = y;" diff --git a/tests/parser/statement/block.leo.out b/tests/expectations/parser/parser/statement/block.leo.out similarity index 86% rename from tests/parser/statement/block.leo.out rename to tests/expectations/parser/parser/statement/block.leo.out index 48ecc83a99..6e40c82b0f 100644 --- a/tests/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: block.leo + path: test content: "{}" - Block: statements: @@ -22,21 +22,21 @@ outputs: line_stop: 2 col_start: 8 col_stop: 10 - path: block.leo + path: test content: return (); span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 10 - path: block.leo + path: test content: return (); span: line_start: 1 line_stop: 3 col_start: 1 col_stop: 2 - path: block.leo + path: test content: "{\n...\n}" - Block: statements: @@ -47,14 +47,14 @@ outputs: line_stop: 1 col_start: 2 col_stop: 4 - path: block.leo + path: test content: "{{}}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: block.leo + path: test content: "{{}}" - Block: statements: @@ -69,34 +69,34 @@ outputs: line_stop: 3 col_start: 8 col_stop: 10 - path: block.leo + path: test content: return (); span: line_start: 3 line_stop: 3 col_start: 1 col_stop: 10 - path: block.leo + path: test content: return (); span: line_start: 2 line_stop: 4 col_start: 1 col_stop: 2 - path: block.leo + path: test content: "{\n...\n}" span: line_start: 1 line_stop: 5 col_start: 1 col_stop: 2 - path: block.leo + path: test content: "{\n...\n}" - Block: statements: - Conditional: condition: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"block.leo\\\",\\\"content\\\":\\\"if x {\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if x {\\\"}\"}" block: statements: - Return: @@ -108,21 +108,21 @@ outputs: line_stop: 3 col_start: 8 col_stop: 10 - path: block.leo + path: test content: return (); span: line_start: 3 line_stop: 3 col_start: 1 col_stop: 10 - path: block.leo + path: test content: return (); span: line_start: 2 line_stop: 4 col_start: 6 col_stop: 2 - path: block.leo + path: test content: "if x {\n...\n}" next: ~ span: @@ -130,12 +130,12 @@ outputs: line_stop: 4 col_start: 1 col_stop: 2 - path: block.leo + path: test content: "if x {\n...\n}" span: line_start: 1 line_stop: 5 col_start: 1 col_stop: 2 - path: block.leo + path: test content: "{\n...\n}" diff --git a/tests/parser/statement/conditional.leo.out b/tests/expectations/parser/parser/statement/conditional.leo.out similarity index 79% rename from tests/parser/statement/conditional.leo.out rename to tests/expectations/parser/parser/statement/conditional.leo.out index 2e654ee511..337dcace01 100644 --- a/tests/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\\\":\\\"conditional.leo\\\",\\\"content\\\":\\\"if x {\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if x {\\\"}\"}" block: statements: - Return: @@ -16,21 +16,21 @@ outputs: line_stop: 2 col_start: 8 col_stop: 10 - path: conditional.leo + path: test content: return (); span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 10 - path: conditional.leo + path: test content: return (); span: line_start: 1 line_stop: 3 col_start: 6 col_stop: 2 - path: conditional.leo + path: test content: "if x {\n...\n}" next: ~ span: @@ -38,11 +38,11 @@ outputs: line_stop: 3 col_start: 1 col_stop: 2 - path: conditional.leo + path: test content: "if x {\n...\n}" - Conditional: condition: - Identifier: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":8,\\\"path\\\":\\\"conditional.leo\\\",\\\"content\\\":\\\"if Self {\\\"}\"}" + Identifier: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if Self {\\\"}\"}" block: statements: - Return: @@ -54,21 +54,21 @@ outputs: line_stop: 2 col_start: 8 col_stop: 10 - path: conditional.leo + path: test content: return (); span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 10 - path: conditional.leo + path: test content: return (); span: line_start: 1 line_stop: 3 col_start: 9 col_stop: 2 - path: conditional.leo + path: test content: "if Self {\n...\n}" next: ~ span: @@ -76,11 +76,11 @@ outputs: line_stop: 3 col_start: 1 col_stop: 2 - path: conditional.leo + path: test content: "if Self {\n...\n}" - Conditional: condition: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"conditional.leo\\\",\\\"content\\\":\\\"if (x) {\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if (x) {\\\"}\"}" block: statements: - Return: @@ -92,21 +92,21 @@ outputs: line_stop: 2 col_start: 8 col_stop: 10 - path: conditional.leo + path: test content: return (); span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 10 - path: conditional.leo + path: test content: return (); span: line_start: 1 line_stop: 3 col_start: 8 col_stop: 2 - path: conditional.leo + path: test content: "if (x) {\n...\n}" next: ~ span: @@ -114,11 +114,11 @@ outputs: line_stop: 3 col_start: 1 col_stop: 2 - path: conditional.leo + path: test content: "if (x) {\n...\n}" - Conditional: condition: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"conditional.leo\\\",\\\"content\\\":\\\"if (x) {}\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if (x) {}\\\"}\"}" block: statements: [] span: @@ -126,7 +126,7 @@ outputs: line_stop: 1 col_start: 8 col_stop: 10 - path: conditional.leo + path: test content: "if (x) {}" next: ~ span: @@ -134,22 +134,22 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: conditional.leo + path: test content: "if (x) {}" - Conditional: condition: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"conditional.leo\\\",\\\"content\\\":\\\"if x+y {}\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if x+y {}\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"conditional.leo\\\",\\\"content\\\":\\\"if x+y {}\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if x+y {}\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 4 col_stop: 7 - path: conditional.leo + path: test content: "if x+y {}" block: statements: [] @@ -158,7 +158,7 @@ outputs: line_stop: 1 col_start: 8 col_stop: 10 - path: conditional.leo + path: test content: "if x+y {}" next: ~ span: @@ -166,34 +166,34 @@ outputs: line_stop: 1 col_start: 1 col_stop: 10 - path: conditional.leo + path: test content: "if x+y {}" - Conditional: condition: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"conditional.leo\\\",\\\"content\\\":\\\"if x+y {\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if x+y {\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"conditional.leo\\\",\\\"content\\\":\\\"if x+y {\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"if x+y {\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 4 col_stop: 7 - path: conditional.leo + path: test 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\\\":\\\"conditional.leo\\\",\\\"content\\\":\\\"expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"expr;\\\"}\"}" span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 5 - path: conditional.leo + path: test content: expr; - Return: expression: @@ -204,21 +204,21 @@ outputs: line_stop: 3 col_start: 8 col_stop: 10 - path: conditional.leo + path: test content: return (); span: line_start: 3 line_stop: 3 col_start: 1 col_stop: 10 - path: conditional.leo + path: test content: return (); span: line_start: 1 line_stop: 4 col_start: 8 col_stop: 2 - path: conditional.leo + path: test content: "if x+y {\n...\n}" next: ~ span: @@ -226,5 +226,5 @@ outputs: line_stop: 4 col_start: 1 col_stop: 2 - path: conditional.leo + path: test content: "if x+y {\n...\n}\n" diff --git a/tests/parser/statement/console.leo.out b/tests/expectations/parser/parser/statement/console.leo.out similarity index 76% rename from tests/parser/statement/console.leo.out rename to tests/expectations/parser/parser/statement/console.leo.out index 28b33ecb2e..2ebba05261 100644 --- a/tests/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\\\":\\\"console.leo\\\",\\\"content\\\":\\\"console.assert(x);\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.assert(x);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 17 - path: console.leo + path: test content: console.assert(x); - Console: function: @@ -19,20 +19,20 @@ outputs: parts: - Container parameters: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"console.leo\\\",\\\"content\\\":\\\"console.error(\\\\\\\"{}\\\\\\\", x);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.error(\\\\\\\"{}\\\\\\\", x);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 15 col_stop: 22 - path: console.leo + path: test content: "console.error(\"{}\", x);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 22 - path: console.leo + path: test content: "console.error(\"{}\", x);" - Console: function: @@ -41,21 +41,21 @@ outputs: - Container - Container parameters: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"console.leo\\\",\\\"content\\\":\\\"console.error(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"console.leo\\\",\\\"content\\\":\\\"console.error(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" + - 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 15 col_stop: 27 - path: console.leo + path: test content: "console.error(\"{}{}\", x, y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 27 - path: console.leo + path: test content: "console.error(\"{}{}\", x, y);" - Console: function: @@ -68,14 +68,14 @@ outputs: line_stop: 1 col_start: 15 col_stop: 18 - path: console.leo + path: test content: "console.error(\"x\");" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: console.leo + path: test content: "console.error(\"x\");" - Console: function: @@ -83,20 +83,20 @@ outputs: parts: - Container parameters: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"console.leo\\\",\\\"content\\\":\\\"console.debug(\\\\\\\"{}\\\\\\\", x);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.debug(\\\\\\\"{}\\\\\\\", x);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 15 col_stop: 22 - path: console.leo + path: test content: "console.debug(\"{}\", x);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 22 - path: console.leo + path: test content: "console.debug(\"{}\", x);" - Console: function: @@ -105,21 +105,21 @@ outputs: - Container - Container parameters: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"console.leo\\\",\\\"content\\\":\\\"console.debug(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"console.leo\\\",\\\"content\\\":\\\"console.debug(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.debug(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" + - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.debug(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 15 col_stop: 27 - path: console.leo + path: test content: "console.debug(\"{}{}\", x, y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 27 - path: console.leo + path: test content: "console.debug(\"{}{}\", x, y);" - Console: function: @@ -132,14 +132,14 @@ outputs: line_stop: 1 col_start: 15 col_stop: 18 - path: console.leo + path: test content: "console.debug(\"x\");" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: console.leo + path: test content: "console.debug(\"x\");" - Console: function: @@ -147,20 +147,20 @@ outputs: parts: - Container parameters: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"console.leo\\\",\\\"content\\\":\\\"console.log(\\\\\\\"{}\\\\\\\", x);\\\"}\"}" + - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"console.log(\\\\\\\"{}\\\\\\\", x);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 13 col_stop: 20 - path: console.leo + path: test content: "console.log(\"{}\", x);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 20 - path: console.leo + path: test content: "console.log(\"{}\", x);" - Console: function: @@ -169,21 +169,21 @@ outputs: - Container - Container parameters: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"console.leo\\\",\\\"content\\\":\\\"console.log(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":24,\\\"col_stop\\\":25,\\\"path\\\":\\\"console.leo\\\",\\\"content\\\":\\\"console.log(\\\\\\\"{}{}\\\\\\\", x, y);\\\"}\"}" + - 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 13 col_stop: 25 - path: console.leo + path: test content: "console.log(\"{}{}\", x, y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 25 - path: console.leo + path: test content: "console.log(\"{}{}\", x, y);" - Console: function: @@ -196,12 +196,12 @@ outputs: line_stop: 1 col_start: 13 col_stop: 16 - path: console.leo + path: test content: "console.log(\"x\");" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 16 - path: console.leo + path: test content: "console.log(\"x\");" diff --git a/tests/parser/statement/definition.leo.out b/tests/expectations/parser/parser/statement/definition.leo.out similarity index 75% rename from tests/parser/statement/definition.leo.out rename to tests/expectations/parser/parser/statement/definition.leo.out index 19d050a717..fa12ad7cea 100644 --- a/tests/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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: definition.leo + path: test content: let x = expr; type_: ~ value: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":13,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":13,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 13 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: definition.leo + path: test content: let x = (); type_: ~ value: @@ -45,146 +45,146 @@ outputs: line_stop: 1 col_start: 9 col_stop: 11 - path: definition.leo + path: test content: let x = (); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 12 - path: definition.leo + path: test content: let x = x+y; span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x = (x,y);\\\"}\"}" + - 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 14 - path: definition.leo + path: test content: "let x = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 14 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 12 - path: definition.leo + path: test content: let x = x(); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: definition.leo + path: test content: const x = expr; type_: ~ value: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":15,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 15 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: definition.leo + path: test content: const x = (); type_: ~ value: @@ -195,147 +195,147 @@ outputs: line_stop: 1 col_start: 11 col_stop: 13 - path: definition.leo + path: test content: const x = (); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 13 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 14 - path: definition.leo + path: test content: const x = x+y; span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 14 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x = (x,y);\\\"}\"}" + - 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 16 - path: definition.leo + path: test content: "const x = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 16 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 14 - path: definition.leo + path: test content: const x = x(); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 14 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x: u32 = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x: u32 = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":18,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x: u32 = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: definition.leo + path: test content: "let x: u32 = ();" type_: IntegerType: U32 @@ -347,150 +347,150 @@ outputs: line_stop: 1 col_start: 14 col_stop: 16 - path: definition.leo + path: test content: "let x: u32 = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 16 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x: u32 = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x: u32 = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x: u32 = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 14 col_stop: 17 - path: definition.leo + path: test content: "let x: u32 = x+y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 17 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x: u32 = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x: u32 = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x: u32 = (x,y);\\\"}\"}" + - 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 14 col_stop: 19 - path: definition.leo + path: test content: "let x: u32 = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 19 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x: u32 = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 5 col_stop: 6 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let x: u32 = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let x: u32 = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 14 col_stop: 17 - path: definition.leo + path: test content: "let x: u32 = x();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 17 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x: u32 = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x: u32 = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 20 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x: u32 = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: definition.leo + path: test content: "const x: u32 = ();" type_: IntegerType: U32 @@ -502,167 +502,167 @@ outputs: line_stop: 1 col_start: 16 col_stop: 18 - path: definition.leo + path: test content: "const x: u32 = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x: u32 = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x: u32 = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x: u32 = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 16 col_stop: 19 - path: definition.leo + path: test content: "const x: u32 = x+y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 19 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x: u32 = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x: u32 = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x: u32 = (x,y);\\\"}\"}" + - 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 16 col_stop: 21 - path: definition.leo + path: test content: "const x: u32 = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 21 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x: u32 = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 7 col_stop: 8 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const x: u32 = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const x: u32 = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 16 col_stop: 19 - path: definition.leo + path: test content: "const x: u32 = x();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 19 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: definition.leo + path: test content: "let (x, y) = expr;" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = expr;\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: definition.leo + path: test content: "let (x, y) = expr;" type_: ~ value: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":18,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":18,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: definition.leo + path: test content: "let (x, y) = ();" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = ();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: definition.leo + path: test content: "let (x, y) = ();" type_: ~ value: @@ -673,191 +673,191 @@ outputs: line_stop: 1 col_start: 14 col_stop: 16 - path: definition.leo + path: test content: "let (x, y) = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 16 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 14 col_stop: 17 - path: definition.leo + path: test content: "let (x, y) = x+y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 17 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = (x,y);\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":17,\\\"col_stop\\\":18,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = (x,y);\\\"}\"}" + - 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 14 col_stop: 19 - path: definition.leo + path: test content: "let (x, y) = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 19 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: definition.leo + path: test content: "let (x, y) = x();" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = x();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y) = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y) = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 14 col_stop: 17 - path: definition.leo + path: test content: "let (x, y) = x();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 17 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: definition.leo + path: test content: "const (x, y) = expr;" - mutable: false - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = expr;\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: definition.leo + path: test content: "const (x, y) = expr;" type_: ~ value: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 20 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: definition.leo + path: test content: "const (x, y) = ();" - mutable: false - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = ();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: definition.leo + path: test content: "const (x, y) = ();" type_: ~ value: @@ -868,192 +868,192 @@ outputs: line_stop: 1 col_start: 16 col_stop: 18 - path: definition.leo + path: test content: "const (x, y) = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 18 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 16 col_stop: 19 - path: definition.leo + path: test content: "const (x, y) = x+y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 19 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = (x,y);\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = (x,y);\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = (x,y);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = (x,y);\\\"}\"}" + - 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 16 col_stop: 21 - path: definition.leo + path: test content: "const (x, y) = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 21 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: definition.leo + path: test content: "const (x, y) = x();" - mutable: false - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = x();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y) = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y) = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 16 col_stop: 19 - path: definition.leo + path: test content: "const (x, y) = x();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 19 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = expr;\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":23,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 23 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: definition.leo + path: test content: "let (x, y): u32 = ();" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = ();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: definition.leo + path: test content: "let (x, y): u32 = ();" type_: IntegerType: U32 @@ -1065,195 +1065,195 @@ outputs: line_stop: 1 col_start: 19 col_stop: 21 - path: definition.leo + path: test content: "let (x, y): u32 = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 21 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = x+y;\\\"}\"}" + 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;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = x+y;\\\"}\"}" + 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;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = x+y;\\\"}\"}" + 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;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = x+y;\\\"}\"}" + 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;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 19 col_stop: 22 - path: definition.leo + path: test content: "let (x, y): u32 = x+y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 22 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = (x,y);\\\"}\"}" + 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = (x,y);\\\"}\"}" + 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":22,\\\"col_stop\\\":23,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = (x,y);\\\"}\"}" + - 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 19 col_stop: 24 - path: definition.leo + path: test content: "let (x, y): u32 = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 24 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = x();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 9 col_stop: 10 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x, y): u32 = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x, y): u32 = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 19 col_stop: 22 - path: definition.leo + path: test content: "let (x, y): u32 = x();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 22 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = expr;\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = expr;\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":25,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 25 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: definition.leo + path: test content: "const (x, y): u32 = ();" - mutable: false - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = ();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: definition.leo + path: test content: "const (x, y): u32 = ();" type_: IntegerType: U32 @@ -1265,163 +1265,163 @@ outputs: line_stop: 1 col_start: 21 col_stop: 23 - path: definition.leo + path: test content: "const (x, y): u32 = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 23 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = x+y;\\\"}\"}" + 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;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = x+y;\\\"}\"}" + 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;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = x+y;\\\"}\"}" + 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;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = x+y;\\\"}\"}" + 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;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 21 col_stop: 24 - path: definition.leo + path: test content: "const (x, y): u32 = x+y;" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 24 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = (x,y);\\\"}\"}" + 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = (x,y);\\\"}\"}" + 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":24,\\\"col_stop\\\":25,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = (x,y);\\\"}\"}" + - 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 21 col_stop: 26 - path: definition.leo + path: test content: "const (x, y): u32 = (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 26 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = x();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = x();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = x();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 11 col_stop: 12 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"const (x, y): u32 = x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"const (x, y): u32 = x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 21 col_stop: 24 - path: definition.leo + path: test content: "const (x, y): u32 = x();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 24 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x,y,) = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x,y,) = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: definition.leo + path: test content: "let (x,y,) = ();" - mutable: true - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x,y,) = ();\\\"}\"}" + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x,y,) = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 9 - path: definition.leo + path: test content: "let (x,y,) = ();" type_: ~ value: @@ -1432,26 +1432,26 @@ outputs: line_stop: 1 col_start: 14 col_stop: 16 - path: definition.leo + path: test content: "let (x,y,) = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 16 - path: definition.leo + path: test 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\\\":\\\"definition.leo\\\",\\\"content\\\":\\\"let (x,) = ();\\\"}\"}" + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"let (x,) = ();\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 6 col_stop: 7 - path: definition.leo + path: test content: "let (x,) = ();" type_: ~ value: @@ -1462,12 +1462,12 @@ outputs: line_stop: 1 col_start: 12 col_stop: 14 - path: definition.leo + path: test content: "let (x,) = ();" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 14 - path: definition.leo + path: test content: "let (x,) = ();" diff --git a/tests/parser/statement/definition_fail.leo.out b/tests/expectations/parser/parser/statement/definition_fail.leo.out similarity index 100% rename from tests/parser/statement/definition_fail.leo.out rename to tests/expectations/parser/parser/statement/definition_fail.leo.out diff --git a/tests/parser/statement/expression.leo.out b/tests/expectations/parser/parser/statement/expression.leo.out similarity index 76% rename from tests/parser/statement/expression.leo.out rename to tests/expectations/parser/parser/statement/expression.leo.out index ae6e6e6d61..f9542ff844 100644 --- a/tests/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\\\":\\\"expression.leo\\\",\\\"content\\\":\\\"expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 5 - path: expression.leo + path: test content: expr; - Expression: expression: @@ -21,74 +21,74 @@ outputs: line_stop: 1 col_start: 1 col_stop: 3 - path: expression.leo + path: test content: (); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 3 - path: expression.leo + path: test content: (); - Expression: expression: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"expression.leo\\\",\\\"content\\\":\\\"x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"expression.leo\\\",\\\"content\\\":\\\"x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: expression.leo + path: test content: x+y; span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: expression.leo + path: test content: x+y; - Expression: expression: TupleInit: elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"expression.leo\\\",\\\"content\\\":\\\"(x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"expression.leo\\\",\\\"content\\\":\\\"(x,y);\\\"}\"}" + - 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 6 - path: expression.leo + path: test content: "(x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 6 - path: expression.leo + path: test content: "(x,y);" - Expression: expression: Call: function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"expression.leo\\\",\\\"content\\\":\\\"x();\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"x();\\\"}\"}" arguments: [] span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: expression.leo + path: test content: x(); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 4 - path: expression.leo + path: test content: x(); diff --git a/tests/parser/statement/iteration.leo.out b/tests/expectations/parser/parser/statement/iteration.leo.out similarity index 82% rename from tests/parser/statement/iteration.leo.out rename to tests/expectations/parser/parser/statement/iteration.leo.out index eea0bb43a6..4fa2b3b899 100644 --- a/tests/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\\\":\\\"iteration.leo\\\",\\\"content\\\":\\\"for x in 0..7 {}\\\"}\"}" + variable: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"for x in 0..7 {}\\\"}\"}" start: Value: Implicit: @@ -12,7 +12,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: iteration.leo + path: test content: "for x in 0..7 {}" stop: Value: @@ -22,7 +22,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: iteration.leo + path: test content: "for x in 0..7 {}" block: statements: [] @@ -31,17 +31,17 @@ outputs: line_stop: 1 col_start: 15 col_stop: 17 - path: iteration.leo + path: test content: "for x in 0..7 {}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 17 - path: iteration.leo + path: test content: "for x in 0..7 {}" - Iteration: - variable: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"iteration.leo\\\",\\\"content\\\":\\\"for x in 0..7 {\\\"}\"}" + variable: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"for x in 0..7 {\\\"}\"}" start: Value: Implicit: @@ -50,7 +50,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: iteration.leo + path: test content: "for x in 0..7 {" stop: Value: @@ -60,7 +60,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 14 - path: iteration.leo + path: test content: "for x in 0..7 {" block: statements: @@ -73,31 +73,31 @@ outputs: line_stop: 2 col_start: 8 col_stop: 10 - path: iteration.leo + path: test content: return (); span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 10 - path: iteration.leo + path: test content: return (); span: line_start: 1 line_stop: 3 col_start: 15 col_stop: 2 - path: iteration.leo + path: test content: "for x in 0..7 {\n...\n}" span: line_start: 1 line_stop: 3 col_start: 1 col_stop: 2 - path: iteration.leo + path: test 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\\\":\\\"iteration.leo\\\",\\\"content\\\":\\\"for x in 0..99u8 {\\\"}\"}" + variable: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"for x in 0..99u8 {\\\"}\"}" start: Value: Implicit: @@ -106,7 +106,7 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: iteration.leo + path: test content: "for x in 0..99u8 {" stop: Value: @@ -117,7 +117,7 @@ outputs: line_stop: 1 col_start: 13 col_stop: 17 - path: iteration.leo + path: test content: "for x in 0..99u8 {" block: statements: @@ -130,31 +130,31 @@ outputs: line_stop: 2 col_start: 8 col_stop: 10 - path: iteration.leo + path: test content: return (); span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 10 - path: iteration.leo + path: test content: return (); span: line_start: 1 line_stop: 3 col_start: 18 col_stop: 2 - path: iteration.leo + path: test content: "for x in 0..99u8 {\n...\n}" span: line_start: 1 line_stop: 3 col_start: 1 col_stop: 2 - path: iteration.leo + path: test 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\\\":\\\"iteration.leo\\\",\\\"content\\\":\\\"for x in 0..Self {\\\"}\"}" + variable: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"for x in 0..Self {\\\"}\"}" start: Value: Implicit: @@ -163,10 +163,10 @@ outputs: line_stop: 1 col_start: 10 col_stop: 11 - path: iteration.leo + path: test content: "for x in 0..Self {" stop: - Identifier: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":17,\\\"path\\\":\\\"iteration.leo\\\",\\\"content\\\":\\\"for x in 0..Self {\\\"}\"}" + Identifier: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":17,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"for x in 0..Self {\\\"}\"}" block: statements: - Return: @@ -178,26 +178,26 @@ outputs: line_stop: 2 col_start: 8 col_stop: 10 - path: iteration.leo + path: test content: return (); span: line_start: 2 line_stop: 2 col_start: 1 col_stop: 10 - path: iteration.leo + path: test content: return (); span: line_start: 1 line_stop: 3 col_start: 18 col_stop: 2 - path: iteration.leo + path: test content: "for x in 0..Self {\n...\n}" span: line_start: 1 line_stop: 3 col_start: 1 col_stop: 2 - path: iteration.leo + path: test content: "for x in 0..Self {\n...\n}" diff --git a/tests/parser/statement/return.leo.out b/tests/expectations/parser/parser/statement/return.leo.out similarity index 78% rename from tests/parser/statement/return.leo.out rename to tests/expectations/parser/parser/statement/return.leo.out index fdd4add85e..938e0d0efe 100644 --- a/tests/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\\\":\\\"return.leo\\\",\\\"content\\\":\\\"return expr;\\\"}\"}" + Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":12,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"return expr;\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 12 - path: return.leo + path: test content: return expr; - Return: expression: @@ -21,14 +21,14 @@ outputs: line_stop: 1 col_start: 8 col_stop: 10 - path: return.leo + path: test content: return (); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: return.leo + path: test content: return (); - Return: expression: @@ -39,56 +39,56 @@ outputs: line_stop: 1 col_start: 8 col_stop: 10 - path: return.leo + path: test content: return (); span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 10 - path: return.leo + path: test content: return (); - Return: expression: Binary: left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"return.leo\\\",\\\"content\\\":\\\"return x+y;\\\"}\"}" + Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"return x+y;\\\"}\"}" right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"return.leo\\\",\\\"content\\\":\\\"return x+y;\\\"}\"}" + Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"test\\\",\\\"content\\\":\\\"return x+y;\\\"}\"}" op: Add span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 11 - path: return.leo + path: test content: return x+y; span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 11 - path: return.leo + path: test 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\\\":\\\"return.leo\\\",\\\"content\\\":\\\"return (x,y);\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"return.leo\\\",\\\"content\\\":\\\"return (x,y);\\\"}\"}" + - 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);\\\"}\"}" span: line_start: 1 line_stop: 1 col_start: 8 col_stop: 13 - path: return.leo + path: test content: "return (x,y);" span: line_start: 1 line_stop: 1 col_start: 1 col_stop: 13 - path: return.leo + path: test content: "return (x,y);" - Return: expression: @@ -99,12 +99,12 @@ outputs: line_stop: 2 col_start: 1 col_stop: 2 - path: return.leo + path: test content: 5; span: line_start: 1 line_stop: 2 col_start: 1 col_stop: 2 - path: return.leo + path: test content: "return\n5;" diff --git a/tests/parser/statement/return_fail.leo.out b/tests/expectations/parser/parser/statement/return_fail.leo.out similarity index 100% rename from tests/parser/statement/return_fail.leo.out rename to tests/expectations/parser/parser/statement/return_fail.leo.out diff --git a/tests/old/fail/address/empty.leo b/tests/old/fail/address/empty.leo deleted file mode 100644 index 305a77de5b..0000000000 --- a/tests/old/fail/address/empty.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const owner = address(); -} \ No newline at end of file diff --git a/tests/old/fail/address/invalid_length.leo b/tests/old/fail/address/invalid_length.leo deleted file mode 100644 index 42692ded3f..0000000000 --- a/tests/old/fail/address/invalid_length.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const public_key_string = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j88; -} \ No newline at end of file diff --git a/tests/old/fail/address/invalid_prefix.leo b/tests/old/fail/address/invalid_prefix.leo deleted file mode 100644 index cd87e404a4..0000000000 --- a/tests/old/fail/address/invalid_prefix.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const public_key_string = address(zleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8); -} \ No newline at end of file diff --git a/tests/old/fail/array/initializer_fail.leo b/tests/old/fail/array/initializer_fail.leo deleted file mode 100644 index 3b2e7785cc..0000000000 --- a/tests/old/fail/array/initializer_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: [u8; 3]) { - console.assert(a == [1u8; -3]); -} \ No newline at end of file diff --git a/tests/old/fail/array/type_fail.leo b/tests/old/fail/array/type_fail.leo deleted file mode 100644 index 356bba976a..0000000000 --- a/tests/old/fail/array/type_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: [u8; -2] = [0u32; 2]; -} \ No newline at end of file diff --git a/tests/old/fail/circuits/self_circuit.leo b/tests/old/fail/circuits/self_circuit.leo deleted file mode 100644 index 6faa42278b..0000000000 --- a/tests/old/fail/circuits/self_circuit.leo +++ /dev/null @@ -1,9 +0,0 @@ -circuit Foo { - static function new() -> Self { - return Self { }; - } -} - -function main() { - const a = Foo::new(); -} \ No newline at end of file diff --git a/tests/old/fail/console/log_fail.leo b/tests/old/fail/console/log_fail.leo deleted file mode 100644 index dafa6bea8e..0000000000 --- a/tests/old/fail/console/log_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - console.log( hello ); -} \ No newline at end of file diff --git a/tests/old/fail/import/names_a_dash.leo b/tests/old/fail/import/names_a_dash.leo deleted file mode 100644 index ec136176b2..0000000000 --- a/tests/old/fail/import/names_a_dash.leo +++ /dev/null @@ -1,3 +0,0 @@ -import a-.foo; - -function main() {} \ No newline at end of file diff --git a/tests/old/fail/import/names_dash_a.leo b/tests/old/fail/import/names_dash_a.leo deleted file mode 100644 index 95ccb7e4a5..0000000000 --- a/tests/old/fail/import/names_dash_a.leo +++ /dev/null @@ -1,3 +0,0 @@ -import -a.foo; - -function main() {} \ No newline at end of file diff --git a/tests/old/fail/import/names_dollar.leo b/tests/old/fail/import/names_dollar.leo deleted file mode 100644 index e4eaec3719..0000000000 --- a/tests/old/fail/import/names_dollar.leo +++ /dev/null @@ -1,3 +0,0 @@ -import money$.foo; - -function main() {} \ No newline at end of file diff --git a/tests/old/fail/syntax/address_fail.leo b/tests/old/fail/syntax/address_fail.leo deleted file mode 100644 index b39ea75df6..0000000000 --- a/tests/old/fail/syntax/address_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const address = 0u32; -} \ No newline at end of file diff --git a/tests/old/fail/syntax/console_fail.leo b/tests/old/fail/syntax/console_fail.leo deleted file mode 100644 index c0229dd624..0000000000 --- a/tests/old/fail/syntax/console_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const console = 0u32; -} \ No newline at end of file diff --git a/tests/old/fail/syntax/field_fail.leo b/tests/old/fail/syntax/field_fail.leo deleted file mode 100644 index 33bb3118d8..0000000000 --- a/tests/old/fail/syntax/field_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const field = 0u32; -} \ No newline at end of file diff --git a/tests/old/fail/syntax/group_fail.leo b/tests/old/fail/syntax/group_fail.leo deleted file mode 100644 index db71c8a792..0000000000 --- a/tests/old/fail/syntax/group_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const group = 0u32; -} \ No newline at end of file diff --git a/tests/old/fail/syntax/i8_fail.leo b/tests/old/fail/syntax/i8_fail.leo deleted file mode 100644 index a2d868f9f5..0000000000 --- a/tests/old/fail/syntax/i8_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const i8 = 0u32; -} \ No newline at end of file diff --git a/tests/old/fail/syntax/input_fail.leo b/tests/old/fail/syntax/input_fail.leo deleted file mode 100644 index 0053565a6f..0000000000 --- a/tests/old/fail/syntax/input_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const input = 0u32; -} \ No newline at end of file diff --git a/tests/old/fail/syntax/self_keyword_fail.leo b/tests/old/fail/syntax/self_keyword_fail.leo deleted file mode 100644 index 79bc4d6e96..0000000000 --- a/tests/old/fail/syntax/self_keyword_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const Self = 0u32; -} \ No newline at end of file diff --git a/tests/old/fail/syntax/self_type_fail.leo b/tests/old/fail/syntax/self_type_fail.leo deleted file mode 100644 index 79bc4d6e96..0000000000 --- a/tests/old/fail/syntax/self_type_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const Self = 0u32; -} \ No newline at end of file diff --git a/tests/old/fail/syntax/semicolon.leo b/tests/old/fail/syntax/semicolon.leo deleted file mode 100644 index f1deb29e37..0000000000 --- a/tests/old/fail/syntax/semicolon.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a = 0 -} \ No newline at end of file diff --git a/tests/old/fail/syntax/true_fail.leo b/tests/old/fail/syntax/true_fail.leo deleted file mode 100644 index b39ea75df6..0000000000 --- a/tests/old/fail/syntax/true_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const address = 0u32; -} \ No newline at end of file diff --git a/tests/old/fail/syntax/u8_fail.leo b/tests/old/fail/syntax/u8_fail.leo deleted file mode 100644 index 4a48780a29..0000000000 --- a/tests/old/fail/syntax/u8_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const u8 = 0u32; -} \ No newline at end of file diff --git a/tests/old/pass/address/console_assert_fail.leo b/tests/old/pass/address/console_assert_fail.leo deleted file mode 100644 index e8b9099843..0000000000 --- a/tests/old/pass/address/console_assert_fail.leo +++ /dev/null @@ -1,6 +0,0 @@ -function main() { - const address_1 = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; - const address_2 = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j9; - - console.assert(address_1 == address_2); -} \ No newline at end of file diff --git a/tests/old/pass/address/console_assert_pass.leo b/tests/old/pass/address/console_assert_pass.leo deleted file mode 100644 index 214d01c4a8..0000000000 --- a/tests/old/pass/address/console_assert_pass.leo +++ /dev/null @@ -1,6 +0,0 @@ -function main() { - const address_1 = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; - const address_2 = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; - - console.assert(address_1 == address_2); -} \ No newline at end of file diff --git a/tests/old/pass/address/equal.leo b/tests/old/pass/address/equal.leo deleted file mode 100644 index 9012a8c49d..0000000000 --- a/tests/old/pass/address/equal.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: address, b: address, c: bool) { - console.assert(a == b == c); -} \ No newline at end of file diff --git a/tests/old/pass/address/implicit_invalid.leo b/tests/old/pass/address/implicit_invalid.leo deleted file mode 100644 index aadc38a6d8..0000000000 --- a/tests/old/pass/address/implicit_invalid.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const public_key_string: address = zleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; -} \ No newline at end of file diff --git a/tests/old/pass/address/implicit_valid.leo b/tests/old/pass/address/implicit_valid.leo deleted file mode 100644 index 75bcbaa8a1..0000000000 --- a/tests/old/pass/address/implicit_valid.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const public_key_string: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; -} \ No newline at end of file diff --git a/tests/old/pass/address/input.leo b/tests/old/pass/address/input.leo deleted file mode 100644 index 506abb0fff..0000000000 --- a/tests/old/pass/address/input.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main(owner: address) { - const sender = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; - - console.assert(owner == sender); -} \ No newline at end of file diff --git a/tests/old/pass/address/ternary.leo b/tests/old/pass/address/ternary.leo deleted file mode 100644 index f29e13ab5d..0000000000 --- a/tests/old/pass/address/ternary.leo +++ /dev/null @@ -1,8 +0,0 @@ -function main(s: bool, c: address) { - const a = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; - const b = aleo18qgam03qe483tdrcc3fkqwpp38ehff4a2xma6lu7hams6lfpgcpq3dq05r; - - const r = s? a: b; - - console.assert(r == c); -} \ No newline at end of file diff --git a/tests/old/pass/address/valid.leo b/tests/old/pass/address/valid.leo deleted file mode 100644 index 6d693efe78..0000000000 --- a/tests/old/pass/address/valid.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const public_key_string = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; -} \ No newline at end of file diff --git a/tests/old/pass/array/initializer.leo b/tests/old/pass/array/initializer.leo deleted file mode 100644 index 51ac19f68f..0000000000 --- a/tests/old/pass/array/initializer.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: [u8; 3]) { - console.assert(a == [1u8; 3]); -} \ No newline at end of file diff --git a/tests/old/pass/array/initializer_input.leo b/tests/old/pass/array/initializer_input.leo deleted file mode 100644 index 4b886159dc..0000000000 --- a/tests/old/pass/array/initializer_input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: [u8; (3, 2)]) { - console.assert(a == [0u8; (3, 2)]); -} \ No newline at end of file diff --git a/tests/old/pass/array/inline.leo b/tests/old/pass/array/inline.leo deleted file mode 100644 index 8c5c98ae50..0000000000 --- a/tests/old/pass/array/inline.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: [u8; 3]) { - console.assert(a == [1u8, 1u8, 1u8]); -} \ No newline at end of file diff --git a/tests/old/pass/array/input_nested_3x2.leo b/tests/old/pass/array/input_nested_3x2.leo deleted file mode 100644 index b7e59a5dc0..0000000000 --- a/tests/old/pass/array/input_nested_3x2.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: [u8; (3, 2)]) { - console.assert(a == [[0u8; 2]; 3]); -} diff --git a/tests/old/pass/array/input_tuple_3x2.leo b/tests/old/pass/array/input_tuple_3x2.leo deleted file mode 100644 index 4c3c001f41..0000000000 --- a/tests/old/pass/array/input_tuple_3x2.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: [u8; (3, 2)]) { - console.assert(a == [0u8; (3, 2)]); -} diff --git a/tests/old/pass/array/input_tuple_3x2_fail.leo b/tests/old/pass/array/input_tuple_3x2_fail.leo deleted file mode 100644 index 4c3c001f41..0000000000 --- a/tests/old/pass/array/input_tuple_3x2_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: [u8; (3, 2)]) { - console.assert(a == [0u8; (3, 2)]); -} diff --git a/tests/old/pass/array/multi_fail_initializer.leo b/tests/old/pass/array/multi_fail_initializer.leo deleted file mode 100644 index be1ab315bd..0000000000 --- a/tests/old/pass/array/multi_fail_initializer.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const arr: [u8; (2, 2)] = [[1u8; 2]; 1]; // incorrect dimensions -} \ No newline at end of file diff --git a/tests/old/pass/array/multi_fail_inline.leo b/tests/old/pass/array/multi_fail_inline.leo deleted file mode 100644 index 49c9296798..0000000000 --- a/tests/old/pass/array/multi_fail_inline.leo +++ /dev/null @@ -1,4 +0,0 @@ -function main() { - const arr: [u8; (2, 2)] = [[1u8, 1u8], - [1u8]]; // incorrect dimensions -} \ No newline at end of file diff --git a/tests/old/pass/array/multi_initializer.leo b/tests/old/pass/array/multi_initializer.leo deleted file mode 100644 index 6133542ef0..0000000000 --- a/tests/old/pass/array/multi_initializer.leo +++ /dev/null @@ -1,7 +0,0 @@ -function main() { - const a: [u8; (2, 2, 2)] = [1u8; (2, 2, 2)]; - - const b: [u8; (2, 2, 2)] = [[[1u8; 2]; 2]; 2]; - - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/array/multi_initializer_fail.leo b/tests/old/pass/array/multi_initializer_fail.leo deleted file mode 100644 index e38a8fdaee..0000000000 --- a/tests/old/pass/array/multi_initializer_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const arr: [u8; (2, 2)] = [1u8; (2, 1)]; // incorrect dimensions -} \ No newline at end of file diff --git a/tests/old/pass/array/nested.leo b/tests/old/pass/array/nested.leo deleted file mode 100644 index 80fc5511bf..0000000000 --- a/tests/old/pass/array/nested.leo +++ /dev/null @@ -1,4 +0,0 @@ -function main () { - const x = [false; (2, 2)]; - const y: bool = x[0][0]; -} diff --git a/tests/old/pass/array/nested_3x2_value.leo b/tests/old/pass/array/nested_3x2_value.leo deleted file mode 100644 index c5f64c997e..0000000000 --- a/tests/old/pass/array/nested_3x2_value.leo +++ /dev/null @@ -1,8 +0,0 @@ -// Multidimensional array syntax in leo -function main() { - const a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline - - const b: [u32; (3, 2)] = [[0; 2]; 3]; // initializer - - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/array/nested_3x2_value_fail.leo b/tests/old/pass/array/nested_3x2_value_fail.leo deleted file mode 100644 index a187a51991..0000000000 --- a/tests/old/pass/array/nested_3x2_value_fail.leo +++ /dev/null @@ -1,4 +0,0 @@ -// Multidimensional array syntax in leo -function main() { - const a: [u32; (3, 2)] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering) -} diff --git a/tests/old/pass/array/registers.leo b/tests/old/pass/array/registers.leo deleted file mode 100644 index 98d129207f..0000000000 --- a/tests/old/pass/array/registers.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() -> [u8; 3] { - return input.registers.r; -} diff --git a/tests/old/pass/array/slice.leo b/tests/old/pass/array/slice.leo deleted file mode 100644 index 9ff83dbbb8..0000000000 --- a/tests/old/pass/array/slice.leo +++ /dev/null @@ -1,6 +0,0 @@ -// `{from}..{to}` copies the elements of one array into another exclusively -function main(a: [u8; 3]) { - const b = [1u8; 4]; - - console.assert(a == b[0..3]); -} diff --git a/tests/old/pass/array/slice_lower.leo b/tests/old/pass/array/slice_lower.leo deleted file mode 100644 index 0af6fbd937..0000000000 --- a/tests/old/pass/array/slice_lower.leo +++ /dev/null @@ -1,8 +0,0 @@ -function main() { - const arr: [u32; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8]; - const expected: [u32; 2] = [0, 1]; - - const actual = arr[..2]; // Should produce [0, 1] - - console.assert(expected == actual); -} \ No newline at end of file diff --git a/tests/old/pass/array/spread.leo b/tests/old/pass/array/spread.leo deleted file mode 100644 index 8bd2861aae..0000000000 --- a/tests/old/pass/array/spread.leo +++ /dev/null @@ -1,7 +0,0 @@ -// A spread operator `...` copies the elements of one array into another -function main(a: [u8; 3]) { - const b = [1u8, 1u8]; - const c = [1u8, ...b]; - - console.assert(a == c); -} \ No newline at end of file diff --git a/tests/old/pass/array/tuple_3x2_value.leo b/tests/old/pass/array/tuple_3x2_value.leo deleted file mode 100644 index b6659539d5..0000000000 --- a/tests/old/pass/array/tuple_3x2_value.leo +++ /dev/null @@ -1,8 +0,0 @@ -// Multidimensional array syntax in leo -function main() { - const a = [[0u32, 0u32], [0u32, 0u32], [0u32, 0u32]]; // inline - - const b: [u32; (3, 2)] = [0; (3, 2)]; // initializer - - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/array/tuple_3x2_value_fail.leo b/tests/old/pass/array/tuple_3x2_value_fail.leo deleted file mode 100644 index 78593ab696..0000000000 --- a/tests/old/pass/array/tuple_3x2_value_fail.leo +++ /dev/null @@ -1,4 +0,0 @@ -// Multidimensional array syntax in leo -function main() { - const a: [u32; (3, 2)] = [0; (2, 3)]; // initializer (incorrectly reversed ordering) -} diff --git a/tests/old/pass/array/type_input_3x2.leo b/tests/old/pass/array/type_input_3x2.leo deleted file mode 100644 index ea60a0cc24..0000000000 --- a/tests/old/pass/array/type_input_3x2.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main(a: [[u8; 2]; 3]) { - const b = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/array/type_input_4x3x2.leo b/tests/old/pass/array/type_input_4x3x2.leo deleted file mode 100644 index 2d9c4cff22..0000000000 --- a/tests/old/pass/array/type_input_4x3x2.leo +++ /dev/null @@ -1,8 +0,0 @@ -function main(a: [[[u8; 2]; 3]; 4]) { - const b = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], - [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], - [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], - [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/array/type_nested_value_nested_3x2.leo b/tests/old/pass/array/type_nested_value_nested_3x2.leo deleted file mode 100644 index bcf5bae674..0000000000 --- a/tests/old/pass/array/type_nested_value_nested_3x2.leo +++ /dev/null @@ -1,7 +0,0 @@ -function main() { - const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - - const b: [[u8; 2]; 3] = [[0; 2]; 3]; // initializer - - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/array/type_nested_value_nested_3x2_fail.leo b/tests/old/pass/array/type_nested_value_nested_3x2_fail.leo deleted file mode 100644 index 56c8916fb0..0000000000 --- a/tests/old/pass/array/type_nested_value_nested_3x2_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const b: [[u8; 2]; 3] = [[0; 3]; 2]; // initializer (incorrectly reversed ordering) -} \ No newline at end of file diff --git a/tests/old/pass/array/type_nested_value_nested_4x3x2.leo b/tests/old/pass/array/type_nested_value_nested_4x3x2.leo deleted file mode 100644 index 1691fa26c7..0000000000 --- a/tests/old/pass/array/type_nested_value_nested_4x3x2.leo +++ /dev/null @@ -1,10 +0,0 @@ -function main() { - const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], - [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], - [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], - [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - - const b: [[[u8; 2]; 3]; 4] = [[[0; 2]; 3]; 4]; // initializer - - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/array/type_nested_value_nested_4x3x2_fail.leo b/tests/old/pass/array/type_nested_value_nested_4x3x2_fail.leo deleted file mode 100644 index 480327a91d..0000000000 --- a/tests/old/pass/array/type_nested_value_nested_4x3x2_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const b: [[[u8; 2]; 3]; 4] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering) -} \ No newline at end of file diff --git a/tests/old/pass/array/type_nested_value_tuple_3x2.leo b/tests/old/pass/array/type_nested_value_tuple_3x2.leo deleted file mode 100644 index 5f14084d55..0000000000 --- a/tests/old/pass/array/type_nested_value_tuple_3x2.leo +++ /dev/null @@ -1,7 +0,0 @@ -function main() { - const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - - const b: [[u8; 2]; 3] = [0; (3, 2)]; // initializer - - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/array/type_nested_value_tuple_3x2_fail.leo b/tests/old/pass/array/type_nested_value_tuple_3x2_fail.leo deleted file mode 100644 index 3bfb559615..0000000000 --- a/tests/old/pass/array/type_nested_value_tuple_3x2_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const b: [[u8; 2]; 3] = [0; (2, 3)]; // initializer (incorrectly reversed ordering) -} \ No newline at end of file diff --git a/tests/old/pass/array/type_nested_value_tuple_4x3x2.leo b/tests/old/pass/array/type_nested_value_tuple_4x3x2.leo deleted file mode 100644 index 88a5143bd2..0000000000 --- a/tests/old/pass/array/type_nested_value_tuple_4x3x2.leo +++ /dev/null @@ -1,10 +0,0 @@ -function main() { - const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], - [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], - [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], - [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - - const b: [[[u8; 2]; 3]; 4] = [0; (4, 3, 2)]; // initializer - - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/array/type_nested_value_tuple_4x3x2_fail.leo b/tests/old/pass/array/type_nested_value_tuple_4x3x2_fail.leo deleted file mode 100644 index ce1219a37b..0000000000 --- a/tests/old/pass/array/type_nested_value_tuple_4x3x2_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const b: [[[u8; 2]; 3]; 4] = [0; (2, 3, 4)]; // initializer (incorrectly reversed ordering) -} \ No newline at end of file diff --git a/tests/old/pass/array/type_tuple_value_nested_3x2.leo b/tests/old/pass/array/type_tuple_value_nested_3x2.leo deleted file mode 100644 index 81195e03a1..0000000000 --- a/tests/old/pass/array/type_tuple_value_nested_3x2.leo +++ /dev/null @@ -1,7 +0,0 @@ -function main() { - const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - - const b: [u8; (3, 2)] = [[0; 2]; 3]; // initializer - - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/array/type_tuple_value_nested_3x2_fail.leo b/tests/old/pass/array/type_tuple_value_nested_3x2_fail.leo deleted file mode 100644 index e84f025a9f..0000000000 --- a/tests/old/pass/array/type_tuple_value_nested_3x2_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const b: [u8; (2, 3)] = [[0; 2]; 3]; // initializer (incorrectly reversed ordering) -} \ No newline at end of file diff --git a/tests/old/pass/array/type_tuple_value_nested_4x3x2.leo b/tests/old/pass/array/type_tuple_value_nested_4x3x2.leo deleted file mode 100644 index 322a6f7601..0000000000 --- a/tests/old/pass/array/type_tuple_value_nested_4x3x2.leo +++ /dev/null @@ -1,10 +0,0 @@ -function main() { - const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], - [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], - [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], - [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - - const b: [u8; (4, 3, 2)] = [[[0; 2]; 3]; 4]; // initializer - - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/array/type_tuple_value_nested_4x3x2_fail.leo b/tests/old/pass/array/type_tuple_value_nested_4x3x2_fail.leo deleted file mode 100644 index cbb7ccbf76..0000000000 --- a/tests/old/pass/array/type_tuple_value_nested_4x3x2_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const b: [u8; (4, 3, 2)] = [[[0; 4]; 3]; 2]; // initializer (incorrectly reversed ordering) -} \ No newline at end of file diff --git a/tests/old/pass/array/type_tuple_value_tuple_3x2.leo b/tests/old/pass/array/type_tuple_value_tuple_3x2.leo deleted file mode 100644 index d451a9c1a8..0000000000 --- a/tests/old/pass/array/type_tuple_value_tuple_3x2.leo +++ /dev/null @@ -1,7 +0,0 @@ -function main() { - const a = [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]; // inline - - const b: [u8; (3, 2)] = [0; (3, 2)]; // initializer - - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/array/type_tuple_value_tuple_3x2_fail.leo b/tests/old/pass/array/type_tuple_value_tuple_3x2_fail.leo deleted file mode 100644 index 884a75db9d..0000000000 --- a/tests/old/pass/array/type_tuple_value_tuple_3x2_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const b: [u8; (2, 3)] = [0; (3, 2)]; // initializer (incorrectly reversed ordering) -} \ No newline at end of file diff --git a/tests/old/pass/array/type_tuple_value_tuple_4x3x2.leo b/tests/old/pass/array/type_tuple_value_tuple_4x3x2.leo deleted file mode 100644 index 1205b1dc9c..0000000000 --- a/tests/old/pass/array/type_tuple_value_tuple_4x3x2.leo +++ /dev/null @@ -1,10 +0,0 @@ -function main() { - const a = [[[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], - [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], - [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]], - [[0u8, 0u8], [0u8, 0u8], [0u8, 0u8]]]; // inline - - const b: [u8; (4, 3, 2)] = [0; (4, 3, 2)]; // initializer - - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/array/type_tuple_value_tuple_4x3x2_fail.leo b/tests/old/pass/array/type_tuple_value_tuple_4x3x2_fail.leo deleted file mode 100644 index 31e2a5e552..0000000000 --- a/tests/old/pass/array/type_tuple_value_tuple_4x3x2_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const b: [u8; (4, 3, 2)] = [0; (2, 3, 4)]; // initializer (incorrectly reversed order) -} \ No newline at end of file diff --git a/tests/old/pass/array/variable_slice_fail.leo b/tests/old/pass/array/variable_slice_fail.leo deleted file mode 100644 index e79d64112f..0000000000 --- a/tests/old/pass/array/variable_slice_fail.leo +++ /dev/null @@ -1,7 +0,0 @@ -function main() { - const a = [1u8; 10]; - for i in 0..10 { - const x = a[i..10]; - console.debug("{}", x); - } -} \ No newline at end of file diff --git a/tests/old/pass/boolean/all.leo b/tests/old/pass/boolean/all.leo deleted file mode 100644 index 64fe8a795a..0000000000 --- a/tests/old/pass/boolean/all.leo +++ /dev/null @@ -1,8 +0,0 @@ -// !(true && (false || true)) -function main() { - const a = true; - const b = false || a; - const c = !(true && b); - - console.assert(c == false); -} \ No newline at end of file diff --git a/tests/old/pass/boolean/assert_eq_input.leo b/tests/old/pass/boolean/assert_eq_input.leo deleted file mode 100644 index 8a796e5bbd..0000000000 --- a/tests/old/pass/boolean/assert_eq_input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: bool, b: bool) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/boolean/conditional_mut.leo b/tests/old/pass/boolean/conditional_mut.leo deleted file mode 100644 index cebf82ab00..0000000000 --- a/tests/old/pass/boolean/conditional_mut.leo +++ /dev/null @@ -1,6 +0,0 @@ -function main () { - let x = true; - if x { - const y = 0u8; - } -} \ No newline at end of file diff --git a/tests/old/pass/boolean/false_and_false.leo b/tests/old/pass/boolean/false_and_false.leo deleted file mode 100644 index 03dfabab4d..0000000000 --- a/tests/old/pass/boolean/false_and_false.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main() { - const a = false && false; - - console.assert(a == false); -} \ No newline at end of file diff --git a/tests/old/pass/boolean/false_or_false.leo b/tests/old/pass/boolean/false_or_false.leo deleted file mode 100644 index 7ea710802c..0000000000 --- a/tests/old/pass/boolean/false_or_false.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main() { - const a = false || false; - - console.assert(a == false); -} \ No newline at end of file diff --git a/tests/old/pass/boolean/not_false.leo b/tests/old/pass/boolean/not_false.leo deleted file mode 100644 index 796b616871..0000000000 --- a/tests/old/pass/boolean/not_false.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - console.assert(!false == true); -} \ No newline at end of file diff --git a/tests/old/pass/boolean/not_mutable.leo b/tests/old/pass/boolean/not_mutable.leo deleted file mode 100644 index c621647ff9..0000000000 --- a/tests/old/pass/boolean/not_mutable.leo +++ /dev/null @@ -1,4 +0,0 @@ -function main () { - let b = false; - const a = !b; -} \ No newline at end of file diff --git a/tests/old/pass/boolean/not_true.leo b/tests/old/pass/boolean/not_true.leo deleted file mode 100644 index 8c87dffabb..0000000000 --- a/tests/old/pass/boolean/not_true.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - console.assert(!true == false); -} \ No newline at end of file diff --git a/tests/old/pass/boolean/not_u32.leo b/tests/old/pass/boolean/not_u32.leo deleted file mode 100644 index 44491d785b..0000000000 --- a/tests/old/pass/boolean/not_u32.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() -> bool { - console.assert(!1u32 == 0u32); -} \ No newline at end of file diff --git a/tests/old/pass/boolean/output_register.leo b/tests/old/pass/boolean/output_register.leo deleted file mode 100644 index 6273b0a1df..0000000000 --- a/tests/old/pass/boolean/output_register.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() -> bool { - return input.registers.r; -} diff --git a/tests/old/pass/boolean/true_and_false.leo b/tests/old/pass/boolean/true_and_false.leo deleted file mode 100644 index 336dde7558..0000000000 --- a/tests/old/pass/boolean/true_and_false.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main() { - const a = true && false; - - console.assert(a == false); -} \ No newline at end of file diff --git a/tests/old/pass/boolean/true_and_true.leo b/tests/old/pass/boolean/true_and_true.leo deleted file mode 100644 index dae445dcf8..0000000000 --- a/tests/old/pass/boolean/true_and_true.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main() { - const a = true && true; - - console.assert(a == true); -} \ No newline at end of file diff --git a/tests/old/pass/boolean/true_and_u32.leo b/tests/old/pass/boolean/true_and_u32.leo deleted file mode 100644 index ad3ead9040..0000000000 --- a/tests/old/pass/boolean/true_and_u32.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a = true && 1u32; -} \ No newline at end of file diff --git a/tests/old/pass/boolean/true_or_false.leo b/tests/old/pass/boolean/true_or_false.leo deleted file mode 100644 index 216e473cdb..0000000000 --- a/tests/old/pass/boolean/true_or_false.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main() { - const a = true || false; - - console.assert(a == true); -} \ No newline at end of file diff --git a/tests/old/pass/boolean/true_or_true.leo b/tests/old/pass/boolean/true_or_true.leo deleted file mode 100644 index fea8628b9f..0000000000 --- a/tests/old/pass/boolean/true_or_true.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main() { - const a = true || true; - - console.assert(a == true); -} \ No newline at end of file diff --git a/tests/old/pass/boolean/true_or_u32.leo b/tests/old/pass/boolean/true_or_u32.leo deleted file mode 100644 index 38dab727b9..0000000000 --- a/tests/old/pass/boolean/true_or_u32.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a = true || 1u32; -} \ No newline at end of file diff --git a/tests/old/pass/circuits/define_circuit_inside_circuit_function.leo b/tests/old/pass/circuits/define_circuit_inside_circuit_function.leo deleted file mode 100644 index cedabf2185..0000000000 --- a/tests/old/pass/circuits/define_circuit_inside_circuit_function.leo +++ /dev/null @@ -1,13 +0,0 @@ -circuit Foo { - a: u32, -} - -circuit Bar { - function bar() { - const f = Foo { a: 0u32 }; - } -} - -function main() { - const b = Bar::bar(); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/duplicate_name_context.leo b/tests/old/pass/circuits/duplicate_name_context.leo deleted file mode 100644 index 8644d27fcb..0000000000 --- a/tests/old/pass/circuits/duplicate_name_context.leo +++ /dev/null @@ -1,13 +0,0 @@ -circuit Bar { - b2: u32 - - function add_five(z:u32) -> u32 { - return z+5u32; - } -} - -function main () { - const Bar = 66u32; - const k1 = Bar{ b2: 30u32 }; - const k2 = Bar::add_five(55u32); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/inline.leo b/tests/old/pass/circuits/inline.leo deleted file mode 100644 index 9ba06f4191..0000000000 --- a/tests/old/pass/circuits/inline.leo +++ /dev/null @@ -1,7 +0,0 @@ -circuit Foo { - x: u32 -} - -function main() { - const a = Foo { x: 1u32 }; -} \ No newline at end of file diff --git a/tests/old/pass/circuits/inline_fail.leo b/tests/old/pass/circuits/inline_fail.leo deleted file mode 100644 index 01597005fb..0000000000 --- a/tests/old/pass/circuits/inline_fail.leo +++ /dev/null @@ -1,7 +0,0 @@ -circuit Foo { - x: u32 -} - -function main() { - const a = Foo { y: 0u32 }; -} \ No newline at end of file diff --git a/tests/old/pass/circuits/inline_member_fail.leo b/tests/old/pass/circuits/inline_member_fail.leo deleted file mode 100644 index 59f6d7992b..0000000000 --- a/tests/old/pass/circuits/inline_member_fail.leo +++ /dev/null @@ -1,8 +0,0 @@ -circuit Foo { - x: u8 -} - -function main() { - const y: u8 = 1; - const a = Foo { y }; -} \ No newline at end of file diff --git a/tests/old/pass/circuits/inline_member_pass.leo b/tests/old/pass/circuits/inline_member_pass.leo deleted file mode 100644 index 6fd7f7dff7..0000000000 --- a/tests/old/pass/circuits/inline_member_pass.leo +++ /dev/null @@ -1,13 +0,0 @@ -circuit Foo { - x: u8 - - function new(x: u8) -> Self { - return Self { x }; - } -} - -function main() { - const x: u8 = 1; - const a = Foo { x }; - const b = Foo::new(x); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/inline_undefined.leo b/tests/old/pass/circuits/inline_undefined.leo deleted file mode 100644 index 40c4cf722c..0000000000 --- a/tests/old/pass/circuits/inline_undefined.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a = Foo { }; -} \ No newline at end of file diff --git a/tests/old/pass/circuits/member_function.leo b/tests/old/pass/circuits/member_function.leo deleted file mode 100644 index eee44be448..0000000000 --- a/tests/old/pass/circuits/member_function.leo +++ /dev/null @@ -1,13 +0,0 @@ -circuit Foo { - x: u32, - - function echo(self) -> u32 { - return self.x; - } -} - -function main() { - const a = Foo { x: 1u32 }; - - console.assert(a.echo() == 1u32); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/member_function_fail.leo b/tests/old/pass/circuits/member_function_fail.leo deleted file mode 100644 index 57b15383a3..0000000000 --- a/tests/old/pass/circuits/member_function_fail.leo +++ /dev/null @@ -1,10 +0,0 @@ -circuit Foo { - function echo(x: u32) -> u32 { - return x; - } -} - -function main() { - const a = Foo { }; - const err = a.echoed(1u32); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/member_function_invalid.leo b/tests/old/pass/circuits/member_function_invalid.leo deleted file mode 100644 index 7283cf144d..0000000000 --- a/tests/old/pass/circuits/member_function_invalid.leo +++ /dev/null @@ -1,10 +0,0 @@ -circuit Foo { - function echo(x: u32) -> u32 { - return x; - } -} - -function main() { - const a = Foo { }; - const err = a.echo(1u32); // echo is a static function and must be accessed using `::` -} \ No newline at end of file diff --git a/tests/old/pass/circuits/member_function_nested.leo b/tests/old/pass/circuits/member_function_nested.leo deleted file mode 100644 index b8bf172947..0000000000 --- a/tests/old/pass/circuits/member_function_nested.leo +++ /dev/null @@ -1,18 +0,0 @@ -circuit Foo { - x: u32, - - function add_x(self, y: u32) -> u32 { - return self.x + y; - } - - function call_add_x(self, y: u32) -> u32 { - return self.add_x(y); - } -} - -function main() { - const a = Foo { x: 1u32 }; - const b = a.add_x(1u32); - - console.assert(b == 2u32); -} diff --git a/tests/old/pass/circuits/member_static_function.leo b/tests/old/pass/circuits/member_static_function.leo deleted file mode 100644 index 68f6065754..0000000000 --- a/tests/old/pass/circuits/member_static_function.leo +++ /dev/null @@ -1,11 +0,0 @@ -circuit Foo { - function echo(x: u32) -> u32 { - return x; - } -} - -function main() { - const a = Foo::echo(1u32); - - console.assert(a == 1u32); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/member_static_function_invalid.leo b/tests/old/pass/circuits/member_static_function_invalid.leo deleted file mode 100644 index b886cff8fa..0000000000 --- a/tests/old/pass/circuits/member_static_function_invalid.leo +++ /dev/null @@ -1,9 +0,0 @@ -circuit Foo { - function echo(x: u32) -> u32 { - return x; - } -} - -function main() { - const err = Foo.echo(1u32); // Invalid, echo is a static function and must be accessed using `::` -} \ No newline at end of file diff --git a/tests/old/pass/circuits/member_static_function_nested.leo b/tests/old/pass/circuits/member_static_function_nested.leo deleted file mode 100644 index ef536e3f6e..0000000000 --- a/tests/old/pass/circuits/member_static_function_nested.leo +++ /dev/null @@ -1,15 +0,0 @@ -circuit Foo { - function qux() {} - - function bar() { - Self::qux(); - } - - function baz() { - Self::bar(); - } -} - -function main() { - Foo::baz(); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/member_static_function_undefined.leo b/tests/old/pass/circuits/member_static_function_undefined.leo deleted file mode 100644 index 121c80e34c..0000000000 --- a/tests/old/pass/circuits/member_static_function_undefined.leo +++ /dev/null @@ -1,9 +0,0 @@ -circuit Foo { - function echo(x: u32) -> u32 { - return x; - } -} - -function main() { - const err = Foo::echoed(1u32); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/member_variable.leo b/tests/old/pass/circuits/member_variable.leo deleted file mode 100644 index a3f3fbe7e6..0000000000 --- a/tests/old/pass/circuits/member_variable.leo +++ /dev/null @@ -1,9 +0,0 @@ -circuit Foo { - x: u32, -} - -function main() { - const a = Foo { x: 1u32 }; - - console.assert(a.x == 1u32); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/member_variable_and_function.leo b/tests/old/pass/circuits/member_variable_and_function.leo deleted file mode 100644 index f90cdca072..0000000000 --- a/tests/old/pass/circuits/member_variable_and_function.leo +++ /dev/null @@ -1,15 +0,0 @@ -circuit Foo { - foo: u32, - - function bar() -> u32 { - return 1u32; - } -} - -function main() { - const a = Foo { foo: 1 }; - - const b = a.foo + Foo::bar(); - - console.assert(b == 2u32); -} diff --git a/tests/old/pass/circuits/member_variable_fail.leo b/tests/old/pass/circuits/member_variable_fail.leo deleted file mode 100644 index fdf42068d5..0000000000 --- a/tests/old/pass/circuits/member_variable_fail.leo +++ /dev/null @@ -1,9 +0,0 @@ -circuit Foo { - x: u32 -} - -function main() { - const a = Foo { x: 1u32 }; - - const err = a.y; -} \ No newline at end of file diff --git a/tests/old/pass/circuits/mut_function_fail.leo b/tests/old/pass/circuits/mut_function_fail.leo deleted file mode 100644 index 1b87e2bfb1..0000000000 --- a/tests/old/pass/circuits/mut_function_fail.leo +++ /dev/null @@ -1,11 +0,0 @@ -circuit Foo { - a: u8, - - function bar() {} -} - -function main() { - let f = Foo { a: 0u8 }; - - f.bar = 1u8; -} \ No newline at end of file diff --git a/tests/old/pass/circuits/mut_self_function_fail.leo b/tests/old/pass/circuits/mut_self_function_fail.leo deleted file mode 100644 index 58c8088ba1..0000000000 --- a/tests/old/pass/circuits/mut_self_function_fail.leo +++ /dev/null @@ -1,15 +0,0 @@ -circuit Foo { - a: u8, - - function bar() {} - - function set_a(mut self, new: u8) { - self.bar = new; - } -} - -function main() { - let f = Foo { a: 0u8 }; - - f.set_a(1u8); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/mut_self_static_function_fail.leo b/tests/old/pass/circuits/mut_self_static_function_fail.leo deleted file mode 100644 index 58c8088ba1..0000000000 --- a/tests/old/pass/circuits/mut_self_static_function_fail.leo +++ /dev/null @@ -1,15 +0,0 @@ -circuit Foo { - a: u8, - - function bar() {} - - function set_a(mut self, new: u8) { - self.bar = new; - } -} - -function main() { - let f = Foo { a: 0u8 }; - - f.set_a(1u8); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/mut_self_variable.leo b/tests/old/pass/circuits/mut_self_variable.leo deleted file mode 100644 index 92bcca0050..0000000000 --- a/tests/old/pass/circuits/mut_self_variable.leo +++ /dev/null @@ -1,22 +0,0 @@ -circuit Foo { - a: u8, - - function set_a(mut self, new: u8) { - self.a = new; - console.assert(self.a == new); - } -} - -function main() { - let f = Foo { a: 0u8 }; - - console.assert(f.a == 0u8); - - f.set_a(1u8); - - console.assert(f.a == 1u8); - - f.set_a(2u8); - - console.assert(f.a == 2u8); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/mut_self_variable_branch.leo b/tests/old/pass/circuits/mut_self_variable_branch.leo deleted file mode 100644 index 0c5b8f40a4..0000000000 --- a/tests/old/pass/circuits/mut_self_variable_branch.leo +++ /dev/null @@ -1,32 +0,0 @@ -circuit Foo { - a: u8, - - function set_a(mut self, condition: bool, new: u8) { - if condition { - self.a = new; - console.assert(self.a == new); - } - } -} - -function main() { - let f = Foo { a: 0u8 }; - - console.assert(f.a == 0u8); - - f.set_a(false, 1u8); - - console.assert(f.a == 0u8); - - f.set_a(true, 1u8); - - console.assert(f.a == 1u8); - - f.set_a(false, 2u8); - - console.assert(f.a == 1u8); - - f.set_a(true, 2u8); - - console.assert(f.a == 2u8); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/mut_self_variable_conditional.leo b/tests/old/pass/circuits/mut_self_variable_conditional.leo deleted file mode 100644 index 61a5e354dc..0000000000 --- a/tests/old/pass/circuits/mut_self_variable_conditional.leo +++ /dev/null @@ -1,15 +0,0 @@ -function main() { - let f = Foo { a: 0u32 }; - - f.bar(); -} - -circuit Foo { - a: u32 - - function bar(mut self) { - if true { - self.a = 5u32; // Mutating a variable inside a conditional statement should work. - } - } -} \ No newline at end of file diff --git a/tests/old/pass/circuits/mut_self_variable_fail.leo b/tests/old/pass/circuits/mut_self_variable_fail.leo deleted file mode 100644 index 4db62a4d3e..0000000000 --- a/tests/old/pass/circuits/mut_self_variable_fail.leo +++ /dev/null @@ -1,13 +0,0 @@ -circuit Foo { - a: u8, - - function set_a(self, new: u8) { - self.a = new; - } -} - -function main() { - let f = Foo { a: 0u8 }; - - f.set_a(1u8); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/mut_static_function_fail.leo b/tests/old/pass/circuits/mut_static_function_fail.leo deleted file mode 100644 index fd873bd17b..0000000000 --- a/tests/old/pass/circuits/mut_static_function_fail.leo +++ /dev/null @@ -1,9 +0,0 @@ -circuit Foo { - function bar() {} -} - -function main() { - let f = Foo { a: 0u8 }; - - f.bar = 1u8; -} \ No newline at end of file diff --git a/tests/old/pass/circuits/mut_variable.leo b/tests/old/pass/circuits/mut_variable.leo deleted file mode 100644 index 151babb1cd..0000000000 --- a/tests/old/pass/circuits/mut_variable.leo +++ /dev/null @@ -1,17 +0,0 @@ -circuit Foo { - a: u8, -} - -function main() { - let f = Foo { a: 0u8 }; - - console.assert(f.a == 0u8); - - f.a = 1u8; - - console.assert(f.a == 1u8); - - f.a = 2u8; - - console.assert(f.a == 2u8); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/mut_variable_fail.leo b/tests/old/pass/circuits/mut_variable_fail.leo deleted file mode 100644 index 7ba4193074..0000000000 --- a/tests/old/pass/circuits/mut_variable_fail.leo +++ /dev/null @@ -1,9 +0,0 @@ -circuit Foo { - a: u8, -} - -function main() { - const f = Foo { a: 0u8 }; - - f.a = 1u8; -} \ No newline at end of file diff --git a/tests/old/pass/circuits/pedersen_mock.leo b/tests/old/pass/circuits/pedersen_mock.leo deleted file mode 100644 index 0fc6752f2f..0000000000 --- a/tests/old/pass/circuits/pedersen_mock.leo +++ /dev/null @@ -1,27 +0,0 @@ -circuit PedersenHash { - parameters: [u32; 512] - - function new(parameters: [u32; 512]) -> Self { - return Self { parameters: parameters }; - } - - function hash(self, bits: [bool; 512]) -> u32 { - let digest: u32 = 0; - for i in 0..512 { - const base = bits[i] ? self.parameters[i] : 0u32; - digest += base; - } - return digest; - } -} - -// The 'pedersen_hash' main function. -function main() { - const parameters = [0u32; 512]; - const pedersen = PedersenHash::new(parameters); - const hash_input: [bool; 512] = [true; 512]; - - const res = pedersen.hash(hash_input); - - console.assert(res == 0u32); -} diff --git a/tests/old/pass/circuits/self_fail.leo b/tests/old/pass/circuits/self_fail.leo deleted file mode 100644 index e4e878dc89..0000000000 --- a/tests/old/pass/circuits/self_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - Self::main(); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/self_member.leo b/tests/old/pass/circuits/self_member.leo deleted file mode 100644 index 237baac9de..0000000000 --- a/tests/old/pass/circuits/self_member.leo +++ /dev/null @@ -1,14 +0,0 @@ -circuit Foo { - f: u32, - - function bar(self) -> u32 { - return self.f; - } -} - -function main() { - const a = Foo { f: 1u32 }; - const b = a.bar(); - - console.assert(b == 1u32); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/self_member_invalid.leo b/tests/old/pass/circuits/self_member_invalid.leo deleted file mode 100644 index 7283b3260a..0000000000 --- a/tests/old/pass/circuits/self_member_invalid.leo +++ /dev/null @@ -1,12 +0,0 @@ -circuit Foo { - f: u32, - - function bar() -> u32 { - return f; - } -} - -function main() -> u32 { - const foo = Foo { f: 1u32 }; - const err = foo.bar(); -} \ No newline at end of file diff --git a/tests/old/pass/circuits/self_member_undefined.leo b/tests/old/pass/circuits/self_member_undefined.leo deleted file mode 100644 index 8b52d305a3..0000000000 --- a/tests/old/pass/circuits/self_member_undefined.leo +++ /dev/null @@ -1,10 +0,0 @@ -circuit Foo { - function bar() -> u32 { - return self.f; - } -} - -function main() { - const foo = Foo { }; - const err = foo.bar(); -} \ No newline at end of file diff --git a/tests/old/pass/compiler/main.leo b/tests/old/pass/compiler/main.leo deleted file mode 100644 index ed25576751..0000000000 --- a/tests/old/pass/compiler/main.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u32 = 1 + 2; -} \ No newline at end of file diff --git a/tests/old/pass/console/assert.leo b/tests/old/pass/console/assert.leo deleted file mode 100644 index ba6be77256..0000000000 --- a/tests/old/pass/console/assert.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: bool) { - console.assert(a == true); -} \ No newline at end of file diff --git a/tests/old/pass/console/conditional_assert.leo b/tests/old/pass/console/conditional_assert.leo deleted file mode 100644 index f2c1591e9c..0000000000 --- a/tests/old/pass/console/conditional_assert.leo +++ /dev/null @@ -1,7 +0,0 @@ -function main(a: bool) { - if a { - console.assert(a == true); - } else { - console.assert(a == false); - } -} \ No newline at end of file diff --git a/tests/old/pass/console/debug.leo b/tests/old/pass/console/debug.leo deleted file mode 100644 index 54e6eb539f..0000000000 --- a/tests/old/pass/console/debug.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - console.debug("hello debug"); -} \ No newline at end of file diff --git a/tests/old/pass/console/error.leo b/tests/old/pass/console/error.leo deleted file mode 100644 index 86d13f8cee..0000000000 --- a/tests/old/pass/console/error.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - console.error("hello error"); -} \ No newline at end of file diff --git a/tests/old/pass/console/log.leo b/tests/old/pass/console/log.leo deleted file mode 100644 index a190ca4ba9..0000000000 --- a/tests/old/pass/console/log.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - console.log("hello world"); -} \ No newline at end of file diff --git a/tests/old/pass/console/log_conditional.leo b/tests/old/pass/console/log_conditional.leo deleted file mode 100644 index a9fdb6e698..0000000000 --- a/tests/old/pass/console/log_conditional.leo +++ /dev/null @@ -1,6 +0,0 @@ -// Conditionally add two u32 integers and log the result to the console. -function main(a: u32, b: u32) { - if a == b { - console.log("{}=={}",a,b); // This line should not fail. - } -} \ No newline at end of file diff --git a/tests/old/pass/console/log_input.leo b/tests/old/pass/console/log_input.leo deleted file mode 100644 index c4fd0a8b12..0000000000 --- a/tests/old/pass/console/log_input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: bool) { - console.log("a = {}", a); -} \ No newline at end of file diff --git a/tests/old/pass/console/log_parameter.leo b/tests/old/pass/console/log_parameter.leo deleted file mode 100644 index ebcb931a2b..0000000000 --- a/tests/old/pass/console/log_parameter.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - console.log("{}", 1u32); -} \ No newline at end of file diff --git a/tests/old/pass/console/log_parameter_fail_empty.leo b/tests/old/pass/console/log_parameter_fail_empty.leo deleted file mode 100644 index 81b42c0919..0000000000 --- a/tests/old/pass/console/log_parameter_fail_empty.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - console.log("{}"); -} \ No newline at end of file diff --git a/tests/old/pass/console/log_parameter_fail_none.leo b/tests/old/pass/console/log_parameter_fail_none.leo deleted file mode 100644 index c92fdfbb2d..0000000000 --- a/tests/old/pass/console/log_parameter_fail_none.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - console.log("", 1u32); -} \ No newline at end of file diff --git a/tests/old/pass/console/log_parameter_fail_unknown.leo b/tests/old/pass/console/log_parameter_fail_unknown.leo deleted file mode 100644 index 757f4c27c3..0000000000 --- a/tests/old/pass/console/log_parameter_fail_unknown.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - console.log("{}", a); -} \ No newline at end of file diff --git a/tests/old/pass/console/log_parameter_many.leo b/tests/old/pass/console/log_parameter_many.leo deleted file mode 100644 index 60455ebbb0..0000000000 --- a/tests/old/pass/console/log_parameter_many.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - console.log("{} {}", 1u32, true); -} \ No newline at end of file diff --git a/tests/old/pass/core/arguments_length_fail.leo b/tests/old/pass/core/arguments_length_fail.leo deleted file mode 100644 index 614490432d..0000000000 --- a/tests/old/pass/core/arguments_length_fail.leo +++ /dev/null @@ -1,9 +0,0 @@ -import core.unstable.blake2s.Blake2s; - -function main() { - const seed: [u8; 32] = [0; 32]; - - const result = Blake2s::hash(seed); // function `hash` takes 2 arguments - - console.log("Result: {}", result); -} diff --git a/tests/old/pass/core/arguments_type_fail.leo b/tests/old/pass/core/arguments_type_fail.leo deleted file mode 100644 index f80e7b0205..0000000000 --- a/tests/old/pass/core/arguments_type_fail.leo +++ /dev/null @@ -1,10 +0,0 @@ -import core.unstable.blake2s.Blake2s; - -function main() { - const seed: [u8; 32] = [0; 32]; - const message: [u16; 32] = [0; 32]; // message should be type [u8; 32] - - const result = Blake2s::hash(seed, message); - - console.log("Result: {}", result); -} diff --git a/tests/old/pass/core/blake2s_input.leo b/tests/old/pass/core/blake2s_input.leo deleted file mode 100644 index 51de777341..0000000000 --- a/tests/old/pass/core/blake2s_input.leo +++ /dev/null @@ -1,5 +0,0 @@ -import core.unstable.blake2s.Blake2s; - -function main(seed: [u8; 32], message: [u8; 32]) -> [u8; 32] { - return Blake2s::hash(seed, message); -} diff --git a/tests/old/pass/core/blake2s_random.leo b/tests/old/pass/core/blake2s_random.leo deleted file mode 100644 index c9592fcbf8..0000000000 --- a/tests/old/pass/core/blake2s_random.leo +++ /dev/null @@ -1,7 +0,0 @@ -import core.unstable.blake2s.Blake2s; - -function main(seed: [u8; 32], message: [u8; 32], expected: [u8; 32]) { - const actual = Blake2s::hash(seed, message); - - console.assert(expected == actual); -} diff --git a/tests/old/pass/core/core_circuit_invalid.leo b/tests/old/pass/core/core_circuit_invalid.leo deleted file mode 100644 index 4a42bda032..0000000000 --- a/tests/old/pass/core/core_circuit_invalid.leo +++ /dev/null @@ -1,3 +0,0 @@ -import core.unstable.blake2s.BadCircuit; // `BadCircuit` is not included in the blake2s package - -function main() {} diff --git a/tests/old/pass/core/core_circuit_star_fail.leo b/tests/old/pass/core/core_circuit_star_fail.leo deleted file mode 100644 index 14b54b0d69..0000000000 --- a/tests/old/pass/core/core_circuit_star_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -import core.*; // You cannot import all dependencies from core at once - -function main() {} diff --git a/tests/old/pass/core/core_package_invalid.leo b/tests/old/pass/core/core_package_invalid.leo deleted file mode 100644 index 7cbcf93ecc..0000000000 --- a/tests/old/pass/core/core_package_invalid.leo +++ /dev/null @@ -1,3 +0,0 @@ -import core.bad_circuit; // `bad_circuit` is not a core package - -function main() {} diff --git a/tests/old/pass/core/core_unstable_package_invalid.leo b/tests/old/pass/core/core_unstable_package_invalid.leo deleted file mode 100644 index 35e6c0d1ba..0000000000 --- a/tests/old/pass/core/core_unstable_package_invalid.leo +++ /dev/null @@ -1,3 +0,0 @@ -import core.unstable.bad_circuit; // `bad_circuit` is not a core unstable package - -function main() {} diff --git a/tests/old/pass/core/unstable_blake2s.leo b/tests/old/pass/core/unstable_blake2s.leo deleted file mode 100644 index c430d9a837..0000000000 --- a/tests/old/pass/core/unstable_blake2s.leo +++ /dev/null @@ -1,10 +0,0 @@ -import core.unstable.blake2s.Blake2s; - -function main() { - const seed: [u8; 32] = [0; 32]; - const message: [u8; 32] = [0; 32]; - - const result = Blake2s::hash(seed, message); - - console.log("Result: {}", result); -} diff --git a/tests/old/pass/definition/out_of_order.leo b/tests/old/pass/definition/out_of_order.leo deleted file mode 100644 index 69d46d0e74..0000000000 --- a/tests/old/pass/definition/out_of_order.leo +++ /dev/null @@ -1,6 +0,0 @@ -@test -function fake_test() {} - -function main() {} - -circuit Foo {} \ No newline at end of file diff --git a/tests/old/pass/definition/out_of_order_with_import.leo b/tests/old/pass/definition/out_of_order_with_import.leo deleted file mode 100644 index daf92fdecb..0000000000 --- a/tests/old/pass/definition/out_of_order_with_import.leo +++ /dev/null @@ -1,7 +0,0 @@ -@test function fake_test() {} - -function main() {} - -import test_import.foo; - -circuit Foo {} \ No newline at end of file diff --git a/tests/old/pass/field/add.leo b/tests/old/pass/field/add.leo deleted file mode 100644 index 8dc2c7df4e..0000000000 --- a/tests/old/pass/field/add.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: field, b: field, c: field) { - console.assert(a + b == c); -} \ No newline at end of file diff --git a/tests/old/pass/field/console_assert.leo b/tests/old/pass/field/console_assert.leo deleted file mode 100644 index c7224bcea5..0000000000 --- a/tests/old/pass/field/console_assert.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: field, b: field) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/field/div.leo b/tests/old/pass/field/div.leo deleted file mode 100644 index 028b06fad2..0000000000 --- a/tests/old/pass/field/div.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: field, b: field, c: field) { - console.assert(a / b == c); -} \ No newline at end of file diff --git a/tests/old/pass/field/eq.leo b/tests/old/pass/field/eq.leo deleted file mode 100644 index e64307d8de..0000000000 --- a/tests/old/pass/field/eq.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: field, b: field, c: bool) { - console.assert(a == b == c); -} \ No newline at end of file diff --git a/tests/old/pass/field/field.leo b/tests/old/pass/field/field.leo deleted file mode 100644 index 5d5732e906..0000000000 --- a/tests/old/pass/field/field.leo +++ /dev/null @@ -1,4 +0,0 @@ -function main() { - const negOneField: field = -1field; - const oneField = 1field; -} \ No newline at end of file diff --git a/tests/old/pass/field/mul.leo b/tests/old/pass/field/mul.leo deleted file mode 100644 index 7df7c83830..0000000000 --- a/tests/old/pass/field/mul.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: field, b: field, c: field) { - console.assert(a * b == c); -} \ No newline at end of file diff --git a/tests/old/pass/field/negate.leo b/tests/old/pass/field/negate.leo deleted file mode 100644 index 94c730207a..0000000000 --- a/tests/old/pass/field/negate.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: field, b: field) { - console.assert(-a == b); -} \ No newline at end of file diff --git a/tests/old/pass/field/sub.leo b/tests/old/pass/field/sub.leo deleted file mode 100644 index 2c84b24647..0000000000 --- a/tests/old/pass/field/sub.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: field, b: field, c: field) { - console.assert(a - b == c); -} \ No newline at end of file diff --git a/tests/old/pass/field/ternary.leo b/tests/old/pass/field/ternary.leo deleted file mode 100644 index 05cb161b46..0000000000 --- a/tests/old/pass/field/ternary.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main(s: bool, a: field, b: field, c: field) { - const r = s ? a : b; - - console.assert(r == c); -} \ No newline at end of file diff --git a/tests/old/pass/function/array_input.leo b/tests/old/pass/function/array_input.leo deleted file mode 100644 index 899c0e4af6..0000000000 --- a/tests/old/pass/function/array_input.leo +++ /dev/null @@ -1,6 +0,0 @@ -function foo(a: [u8; 1]) {} - -function main() { - const a: [u16; 1] = [1; 1]; - foo(a); -} \ No newline at end of file diff --git a/tests/old/pass/function/array_params_direct_call.leo b/tests/old/pass/function/array_params_direct_call.leo deleted file mode 100644 index 8ded724bc4..0000000000 --- a/tests/old/pass/function/array_params_direct_call.leo +++ /dev/null @@ -1,9 +0,0 @@ -function do_nothing(arr: [u32; 2]) {} - -function main() { - const arr: [u32; 2] = [0; 2]; - - do_nothing(arr); - do_nothing([...arr]); - do_nothing(arr[1u32..]); -} \ No newline at end of file diff --git a/tests/old/pass/function/conditional_return.leo b/tests/old/pass/function/conditional_return.leo deleted file mode 100644 index e27dd7aea5..0000000000 --- a/tests/old/pass/function/conditional_return.leo +++ /dev/null @@ -1,7 +0,0 @@ -function main(x: u8) -> u8 { - if x == 2u8 { - return 3u8; - } else { - return 4u8; - } -} \ No newline at end of file diff --git a/tests/old/pass/function/empty.leo b/tests/old/pass/function/empty.leo deleted file mode 100644 index f06c976158..0000000000 --- a/tests/old/pass/function/empty.leo +++ /dev/null @@ -1,5 +0,0 @@ -function empty() { } - -function main() { - empty(); -} \ No newline at end of file diff --git a/tests/old/pass/function/iteration.leo b/tests/old/pass/function/iteration.leo deleted file mode 100644 index 9be86b5a7c..0000000000 --- a/tests/old/pass/function/iteration.leo +++ /dev/null @@ -1,13 +0,0 @@ -function one() -> u32 { - return 1u32; -} - -function main() { - let a = 0u32; - - for i in 0..10 { - a += one(); - } - - console.assert(a == 10u32); -} \ No newline at end of file diff --git a/tests/old/pass/function/iteration_repeated.leo b/tests/old/pass/function/iteration_repeated.leo deleted file mode 100644 index ef4f992d96..0000000000 --- a/tests/old/pass/function/iteration_repeated.leo +++ /dev/null @@ -1,15 +0,0 @@ -function iteration() -> u32 { - let a = 0u32; - - for i in 0..10 { - a += 1; - } - - return a; -} - -function main() { - const total = iteration() + iteration(); - - console.assert(total == 20); -} \ No newline at end of file diff --git a/tests/old/pass/function/multiple_returns.leo b/tests/old/pass/function/multiple_returns.leo deleted file mode 100644 index 73797c6ca3..0000000000 --- a/tests/old/pass/function/multiple_returns.leo +++ /dev/null @@ -1,10 +0,0 @@ -function tuple() -> (bool, bool) { - return (true, false); -} - -function main() { - const (a, b) = tuple(); - - console.assert(a == true); - console.assert(b == false); -} \ No newline at end of file diff --git a/tests/old/pass/function/multiple_returns_fail.leo b/tests/old/pass/function/multiple_returns_fail.leo deleted file mode 100644 index daa773f2e8..0000000000 --- a/tests/old/pass/function/multiple_returns_fail.leo +++ /dev/null @@ -1,7 +0,0 @@ -function main () -> i8 { - if true { - return 1i8; //ignored - } - return 2i8; //ignored - return 3i8; //returns -} \ No newline at end of file diff --git a/tests/old/pass/function/multiple_returns_fail_conditional.leo b/tests/old/pass/function/multiple_returns_fail_conditional.leo deleted file mode 100644 index ded39534a4..0000000000 --- a/tests/old/pass/function/multiple_returns_fail_conditional.leo +++ /dev/null @@ -1,9 +0,0 @@ -function main () -> u16 { - if false { - const a = 1u16; - const b = a + 1u16; - return b; - } else if false { - return 0u16; - } -} \ No newline at end of file diff --git a/tests/old/pass/function/multiple_returns_main.leo b/tests/old/pass/function/multiple_returns_main.leo deleted file mode 100644 index 8590cdd71e..0000000000 --- a/tests/old/pass/function/multiple_returns_main.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() -> (bool, bool) { - return (input.registers.a, input.registers.b); -} diff --git a/tests/old/pass/function/newlines.leo b/tests/old/pass/function/newlines.leo deleted file mode 100644 index e0b10dead1..0000000000 --- a/tests/old/pass/function/newlines.leo +++ /dev/null @@ -1,9 +0,0 @@ -function main( - a: u32, - b: u32, -) -> ( - u32, - u32, -) { - return (a, b); -} \ No newline at end of file diff --git a/tests/old/pass/function/repeated.leo b/tests/old/pass/function/repeated.leo deleted file mode 100644 index 2f9bc43d77..0000000000 --- a/tests/old/pass/function/repeated.leo +++ /dev/null @@ -1,9 +0,0 @@ -function one() -> bool { - return true; -} - -function main() { - const a = one() && one(); - - console.assert(a == true); -} \ No newline at end of file diff --git a/tests/old/pass/function/return.leo b/tests/old/pass/function/return.leo deleted file mode 100644 index e839700ee3..0000000000 --- a/tests/old/pass/function/return.leo +++ /dev/null @@ -1,7 +0,0 @@ -function one() -> u32 { - return 1u32; -} - -function main() { - console.assert(one() == 1u32); -} \ No newline at end of file diff --git a/tests/old/pass/function/return_array_nested_fail.leo b/tests/old/pass/function/return_array_nested_fail.leo deleted file mode 100644 index 0db89a09e3..0000000000 --- a/tests/old/pass/function/return_array_nested_fail.leo +++ /dev/null @@ -1,7 +0,0 @@ -function array_3x2_tuple() -> [[u8; 2]; 3] { - return [0u8; (2, 3)]; // The correct 3x2 array tuple is `[0u8; (3, 2)]` -} - -function main() { - const b = array_3x2_tuple(); -} \ No newline at end of file diff --git a/tests/old/pass/function/return_array_nested_pass.leo b/tests/old/pass/function/return_array_nested_pass.leo deleted file mode 100644 index c7586f3f08..0000000000 --- a/tests/old/pass/function/return_array_nested_pass.leo +++ /dev/null @@ -1,12 +0,0 @@ -function array_3x2_nested() -> [[u8; 2]; 3] { - return [[0u8; 2]; 3]; -} - -function array_3x2_tuple() -> [[u8; 2]; 3] { - return [0u8; (3, 2)]; -} - -function main() { - const a = array_3x2_nested(); - const b = array_3x2_tuple(); -} \ No newline at end of file diff --git a/tests/old/pass/function/return_array_tuple_fail.leo b/tests/old/pass/function/return_array_tuple_fail.leo deleted file mode 100644 index d2afcd2790..0000000000 --- a/tests/old/pass/function/return_array_tuple_fail.leo +++ /dev/null @@ -1,7 +0,0 @@ -function array_3x2_nested() -> [u8; (3, 2)] { - return [[0u8; 3]; 2]; // The correct 3x2 nested array is `[0u8; 2]; 3]` -} - -function main() { - const a = array_3x2_nested(); -} \ No newline at end of file diff --git a/tests/old/pass/function/return_array_tuple_pass.leo b/tests/old/pass/function/return_array_tuple_pass.leo deleted file mode 100644 index 6f5a63e806..0000000000 --- a/tests/old/pass/function/return_array_tuple_pass.leo +++ /dev/null @@ -1,12 +0,0 @@ -function array_3x2_nested() -> [u8; (3, 2)] { - return [[0u8; 2]; 3]; -} - -function array_3x2_tuple() -> [u8; (3, 2)] { - return [0u8; (3, 2)]; -} - -function main() { - const a = array_3x2_nested(); - const b = array_3x2_tuple(); -} \ No newline at end of file diff --git a/tests/old/pass/function/return_tuple.leo b/tests/old/pass/function/return_tuple.leo deleted file mode 100644 index 24328aeaaa..0000000000 --- a/tests/old/pass/function/return_tuple.leo +++ /dev/null @@ -1,11 +0,0 @@ -// Returns a tuple of tuples. -function tuples() -> ((u8, u8), u32) { - const a: (u8, u8) = (1, 2); - const b: u32 = 3; - - return (a, b); -} - -function main() { - const t = tuples(); -} \ No newline at end of file diff --git a/tests/old/pass/function/return_tuple_conditional.leo b/tests/old/pass/function/return_tuple_conditional.leo deleted file mode 100644 index b8040d47ec..0000000000 --- a/tests/old/pass/function/return_tuple_conditional.leo +++ /dev/null @@ -1,15 +0,0 @@ -// Returns a tuple using a conditional "if" statement. -function tuple_conditional () -> ( - i64, - i64 -) { - if true { - return (1, 1); - } else { - return (2, 2); - } -} - -function main() { - const t = tuple_conditional(); -} \ No newline at end of file diff --git a/tests/old/pass/function/scope_fail.leo b/tests/old/pass/function/scope_fail.leo deleted file mode 100644 index 693682d297..0000000000 --- a/tests/old/pass/function/scope_fail.leo +++ /dev/null @@ -1,8 +0,0 @@ -function foo() -> field { - return myGlobal; -} - -function main() { - const myGlobal = 42field; - const err = foo(); -} \ No newline at end of file diff --git a/tests/old/pass/function/undefined.leo b/tests/old/pass/function/undefined.leo deleted file mode 100644 index e1db3b9f09..0000000000 --- a/tests/old/pass/function/undefined.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - my_function(); -} \ No newline at end of file diff --git a/tests/old/pass/function/value_unchanged.leo b/tests/old/pass/function/value_unchanged.leo deleted file mode 100644 index e116736316..0000000000 --- a/tests/old/pass/function/value_unchanged.leo +++ /dev/null @@ -1,19 +0,0 @@ -// Functions input in leo are pass-by-value. -// -// Program execution: -// line 15: variable `a` is defined with value `1`. -// line 16: value `1` is copied and passed into function `bad_mutate()`. -// line 10: variable `x` is defined with value `1`. -// line 11: variable `x` is set to value `0`. -// line 18: program returns the value of `a`. - -function bad_mutate(x: u32) { - x = 0; // <- does not change `a` -} - -function main() { - const a = 1u32; - bad_mutate(a); - - console.assert(a == 1u32); // <- value `a` is still `1u32` -} \ No newline at end of file diff --git a/tests/old/pass/group/add.leo b/tests/old/pass/group/add.leo deleted file mode 100644 index bb84df2d6c..0000000000 --- a/tests/old/pass/group/add.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: group, b: group, c: group) { - console.assert(a + b == c); -} \ No newline at end of file diff --git a/tests/old/pass/group/assert_eq.leo b/tests/old/pass/group/assert_eq.leo deleted file mode 100644 index 3886a07bbf..0000000000 --- a/tests/old/pass/group/assert_eq.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: group, b: group) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/group/both_sign_high.leo b/tests/old/pass/group/both_sign_high.leo deleted file mode 100644 index 4c93573e1e..0000000000 --- a/tests/old/pass/group/both_sign_high.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const element = (+, +)group; -} \ No newline at end of file diff --git a/tests/old/pass/group/both_sign_inferred.leo b/tests/old/pass/group/both_sign_inferred.leo deleted file mode 100644 index 0bbd360ba0..0000000000 --- a/tests/old/pass/group/both_sign_inferred.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const element = (_, _)group; -} \ No newline at end of file diff --git a/tests/old/pass/group/both_sign_low.leo b/tests/old/pass/group/both_sign_low.leo deleted file mode 100644 index 1cb4f46c55..0000000000 --- a/tests/old/pass/group/both_sign_low.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const element = (-, -)group; -} \ No newline at end of file diff --git a/tests/old/pass/group/eq.leo b/tests/old/pass/group/eq.leo deleted file mode 100644 index 89701d9c99..0000000000 --- a/tests/old/pass/group/eq.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: group, b: group, c: bool) { - console.assert(a == b == c); -} \ No newline at end of file diff --git a/tests/old/pass/group/input.leo b/tests/old/pass/group/input.leo deleted file mode 100644 index 3886a07bbf..0000000000 --- a/tests/old/pass/group/input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: group, b: group) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/group/negate.leo b/tests/old/pass/group/negate.leo deleted file mode 100644 index 506d8d73ce..0000000000 --- a/tests/old/pass/group/negate.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: group, b: group) { - console.assert(-a == b); -} \ No newline at end of file diff --git a/tests/old/pass/group/one.leo b/tests/old/pass/group/one.leo deleted file mode 100644 index 510110150b..0000000000 --- a/tests/old/pass/group/one.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const element = 1group; -} \ No newline at end of file diff --git a/tests/old/pass/group/point.leo b/tests/old/pass/group/point.leo deleted file mode 100644 index 5e68415a0d..0000000000 --- a/tests/old/pass/group/point.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const point = (7374112779530666882856915975292384652154477718021969292781165691637980424078, 3435195339177955418892975564890903138308061187980579490487898366607011481796)group; -} \ No newline at end of file diff --git a/tests/old/pass/group/point_input.leo b/tests/old/pass/group/point_input.leo deleted file mode 100644 index a3a8e63bd3..0000000000 --- a/tests/old/pass/group/point_input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: group) { - const b = a; -} \ No newline at end of file diff --git a/tests/old/pass/group/positive_and_negative.leo b/tests/old/pass/group/positive_and_negative.leo deleted file mode 100644 index 5d29e36ef2..0000000000 --- a/tests/old/pass/group/positive_and_negative.leo +++ /dev/null @@ -1,10 +0,0 @@ -function main() { - const pos_element = 1group; - const neg_element = -1group; - - const pair_x_pos = (1, _)group; - const pair_x_neg = (-1, _)group; - - const pair_y_pos = (_, 1)group; - const pair_y_neg = (_, -1)group; -} \ No newline at end of file diff --git a/tests/old/pass/group/sub.leo b/tests/old/pass/group/sub.leo deleted file mode 100644 index dfe82d8e31..0000000000 --- a/tests/old/pass/group/sub.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: group, b: group, c: group) { - console.assert(a - b == c); -} \ No newline at end of file diff --git a/tests/old/pass/group/ternary.leo b/tests/old/pass/group/ternary.leo deleted file mode 100644 index 97fba1f5b6..0000000000 --- a/tests/old/pass/group/ternary.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main(s: bool, a: group, b: group, c: group) { - const r = s ? a : b; - - console.assert(r == c); -} \ No newline at end of file diff --git a/tests/old/pass/group/x_and_y.leo b/tests/old/pass/group/x_and_y.leo deleted file mode 100644 index a350a7ad6b..0000000000 --- a/tests/old/pass/group/x_and_y.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(element: group) { - const b = element; -} \ No newline at end of file diff --git a/tests/old/pass/group/x_sign_high.leo b/tests/old/pass/group/x_sign_high.leo deleted file mode 100644 index f38b54ad9a..0000000000 --- a/tests/old/pass/group/x_sign_high.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const element = (0, +)group; -} \ No newline at end of file diff --git a/tests/old/pass/group/x_sign_inferred.leo b/tests/old/pass/group/x_sign_inferred.leo deleted file mode 100644 index 02c5ac988b..0000000000 --- a/tests/old/pass/group/x_sign_inferred.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const element = (0, _)group; -} \ No newline at end of file diff --git a/tests/old/pass/group/x_sign_low.leo b/tests/old/pass/group/x_sign_low.leo deleted file mode 100644 index ad74d18b64..0000000000 --- a/tests/old/pass/group/x_sign_low.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const element = (0, -)group; -} \ No newline at end of file diff --git a/tests/old/pass/group/y_sign_high.leo b/tests/old/pass/group/y_sign_high.leo deleted file mode 100644 index af2a20149d..0000000000 --- a/tests/old/pass/group/y_sign_high.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const element = (+, 1)group; -} \ No newline at end of file diff --git a/tests/old/pass/group/y_sign_inferred.leo b/tests/old/pass/group/y_sign_inferred.leo deleted file mode 100644 index a4efa6a982..0000000000 --- a/tests/old/pass/group/y_sign_inferred.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const element = (_, 1)group; -} \ No newline at end of file diff --git a/tests/old/pass/group/y_sign_low.leo b/tests/old/pass/group/y_sign_low.leo deleted file mode 100644 index f557ed0d35..0000000000 --- a/tests/old/pass/group/y_sign_low.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const element = (-, 1)group; -} \ No newline at end of file diff --git a/tests/old/pass/group/zero.leo b/tests/old/pass/group/zero.leo deleted file mode 100644 index 6cdd4c960e..0000000000 --- a/tests/old/pass/group/zero.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const element = 0group; -} \ No newline at end of file diff --git a/tests/old/pass/import/a-9.leo b/tests/old/pass/import/a-9.leo deleted file mode 100644 index 8cd9f87f14..0000000000 --- a/tests/old/pass/import/a-9.leo +++ /dev/null @@ -1 +0,0 @@ -function bar() {} \ No newline at end of file diff --git a/tests/old/pass/import/a0-f.leo b/tests/old/pass/import/a0-f.leo deleted file mode 100644 index c99ad3b713..0000000000 --- a/tests/old/pass/import/a0-f.leo +++ /dev/null @@ -1 +0,0 @@ -function foo() {} \ No newline at end of file diff --git a/tests/old/pass/import/alias.leo b/tests/old/pass/import/alias.leo deleted file mode 100644 index f153b5a128..0000000000 --- a/tests/old/pass/import/alias.leo +++ /dev/null @@ -1,5 +0,0 @@ -import test-import.foo as bar; - -function main() { - console.assert(bar() == 1u32); -} \ No newline at end of file diff --git a/tests/old/pass/import/basic.leo b/tests/old/pass/import/basic.leo deleted file mode 100644 index 53d243efaa..0000000000 --- a/tests/old/pass/import/basic.leo +++ /dev/null @@ -1,5 +0,0 @@ -import test-import.foo; - -function main() { - console.assert(foo() == 1u32); -} \ No newline at end of file diff --git a/tests/old/pass/import/bat.leo b/tests/old/pass/import/bat.leo deleted file mode 100755 index a7d2fc83d4..0000000000 --- a/tests/old/pass/import/bat.leo +++ /dev/null @@ -1,3 +0,0 @@ -circuit Bat { - t: u32 -} \ No newline at end of file diff --git a/tests/old/pass/import/baz.leo b/tests/old/pass/import/baz.leo deleted file mode 100755 index 1bb268a84c..0000000000 --- a/tests/old/pass/import/baz.leo +++ /dev/null @@ -1,7 +0,0 @@ -circuit Baz { - z: u32 -} - -circuit Bazzar { - a: u32 -} \ No newline at end of file diff --git a/tests/old/pass/import/hello-world.leo b/tests/old/pass/import/hello-world.leo deleted file mode 100644 index 2d96e74c4c..0000000000 --- a/tests/old/pass/import/hello-world.leo +++ /dev/null @@ -1 +0,0 @@ -function hello() {} \ No newline at end of file diff --git a/tests/old/pass/import/lib.leo b/tests/old/pass/import/lib.leo deleted file mode 100755 index c169f5935e..0000000000 --- a/tests/old/pass/import/lib.leo +++ /dev/null @@ -1,3 +0,0 @@ -circuit Bar { - r: u32 -} \ No newline at end of file diff --git a/tests/old/pass/import/many_import.leo b/tests/old/pass/import/many_import.leo deleted file mode 100644 index 08ae494c4f..0000000000 --- a/tests/old/pass/import/many_import.leo +++ /dev/null @@ -1,26 +0,0 @@ -import test-import.( // local import - Point, - foo, -); - -import bar.( // imports directory import - Bar, - baz.(Baz, Bazzar), - bat.bat.Bat, -); - -import car.Car; // imports directory import - -function main() { - const point = Point { x: 1u32, y: 1u32 }; - const foo = foo(); - - const bar = Bar { r: 1u32 }; - const baz = Baz { z: 1u32 }; - const bazzar = Bazzar { a: 1u32 }; - const bat = Bat { t: 1u32 }; - - const car = Car { c: 1u32 }; - - console.assert(car.c == 1u32); -} \ No newline at end of file diff --git a/tests/old/pass/import/many_import_star.leo b/tests/old/pass/import/many_import_star.leo deleted file mode 100644 index 575487a929..0000000000 --- a/tests/old/pass/import/many_import_star.leo +++ /dev/null @@ -1,19 +0,0 @@ -import test-import.*; // local import - -import bar.*; // imports directory import -import bar.baz.*; // imports directory import -import bar.bat.bat.*; // imports directory import -import car.*; // imports directory import - -function main() { - const point = Point { x: 1u32, y: 1u32 }; - const foo = foo(); - - const bar = Bar { r: 1u32 }; - const bat = Bat { t: 1u32 }; - const baz = Baz { z: 1u32 }; - - const car = Car { c: 1u32 }; - - console.assert(car.c == 1u32); -} \ No newline at end of file diff --git a/tests/old/pass/import/multiple.leo b/tests/old/pass/import/multiple.leo deleted file mode 100644 index 4bd181c02d..0000000000 --- a/tests/old/pass/import/multiple.leo +++ /dev/null @@ -1,10 +0,0 @@ -import test-import.( - Point, - foo -); - -function main() { - const a = Point { x: 1u32, y: 0u32 }; - - console.assert(a.x == 1u32); -} \ No newline at end of file diff --git a/tests/old/pass/import/names.leo b/tests/old/pass/import/names.leo deleted file mode 100644 index d3ce50829a..0000000000 --- a/tests/old/pass/import/names.leo +++ /dev/null @@ -1,5 +0,0 @@ -import a0-f.foo; -import a-9.bar; -import hello-world.hello; - -function main() {} \ No newline at end of file diff --git a/tests/old/pass/import/names_underscore.leo b/tests/old/pass/import/names_underscore.leo deleted file mode 100644 index c5822ebadd..0000000000 --- a/tests/old/pass/import/names_underscore.leo +++ /dev/null @@ -1,3 +0,0 @@ -import hello_world.foo; - -function main() {} \ No newline at end of file diff --git a/tests/old/pass/import/star.leo b/tests/old/pass/import/star.leo deleted file mode 100644 index 69d0791627..0000000000 --- a/tests/old/pass/import/star.leo +++ /dev/null @@ -1,7 +0,0 @@ -import test-import.*; - -function main() { - const a = Point { x: 1u32, y: 0u32 }; - - console.assert(foo() == 1u32); -} \ No newline at end of file diff --git a/tests/old/pass/import/star_fail.leo b/tests/old/pass/import/star_fail.leo deleted file mode 100644 index 47f2efeda7..0000000000 --- a/tests/old/pass/import/star_fail.leo +++ /dev/null @@ -1,4 +0,0 @@ -// importing `*` from a directory is illegal -import bar.bat.*; - -function main() {} \ No newline at end of file diff --git a/tests/old/pass/import/test-import.leo b/tests/old/pass/import/test-import.leo deleted file mode 100644 index 9a57d433f4..0000000000 --- a/tests/old/pass/import/test-import.leo +++ /dev/null @@ -1,8 +0,0 @@ -circuit Point { - x: u32 - y: u32 -} - -function foo() -> u32 { - return 1u32; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/add.leo b/tests/old/pass/integers/i128/add.leo deleted file mode 100644 index e35648f545..0000000000 --- a/tests/old/pass/integers/i128/add.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i128, b: i128, c: i128) { - console.assert(a + b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/console_assert.leo b/tests/old/pass/integers/i128/console_assert.leo deleted file mode 100644 index c89021f609..0000000000 --- a/tests/old/pass/integers/i128/console_assert.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i128, b: i128) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/div.leo b/tests/old/pass/integers/i128/div.leo deleted file mode 100644 index ffaeae19a8..0000000000 --- a/tests/old/pass/integers/i128/div.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i128, b: i128, c: i128) { - console.assert(a / b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/eq.leo b/tests/old/pass/integers/i128/eq.leo deleted file mode 100644 index f4beddc8fc..0000000000 --- a/tests/old/pass/integers/i128/eq.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i128, b: i128, c: bool) { - console.assert(a == b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/ge.leo b/tests/old/pass/integers/i128/ge.leo deleted file mode 100644 index 1fbbd68073..0000000000 --- a/tests/old/pass/integers/i128/ge.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i128, b: i128, c: bool) { - console.assert(a >= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/gt.leo b/tests/old/pass/integers/i128/gt.leo deleted file mode 100644 index 27849afbe8..0000000000 --- a/tests/old/pass/integers/i128/gt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i128, b: i128, c: bool) { - console.assert(a > b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/input.leo b/tests/old/pass/integers/i128/input.leo deleted file mode 100644 index c89021f609..0000000000 --- a/tests/old/pass/integers/i128/input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i128, b: i128) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/le.leo b/tests/old/pass/integers/i128/le.leo deleted file mode 100644 index ea0c3c9e1d..0000000000 --- a/tests/old/pass/integers/i128/le.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i128, b: i128, c: bool) { - console.assert(a <= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/lt.leo b/tests/old/pass/integers/i128/lt.leo deleted file mode 100644 index bde4def85c..0000000000 --- a/tests/old/pass/integers/i128/lt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i128, b: i128, c: bool) { - console.assert(a < b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/max.leo b/tests/old/pass/integers/i128/max.leo deleted file mode 100644 index 5ba44213e1..0000000000 --- a/tests/old/pass/integers/i128/max.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i128 = 170141183460469231731687303715884105727; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/max_fail.leo b/tests/old/pass/integers/i128/max_fail.leo deleted file mode 100644 index a9a46afd7f..0000000000 --- a/tests/old/pass/integers/i128/max_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i128 = 170141183460469231731687303715884105728; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/min.leo b/tests/old/pass/integers/i128/min.leo deleted file mode 100644 index 19509a3fb0..0000000000 --- a/tests/old/pass/integers/i128/min.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i128 = -170141183460469231731687303715884105728; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/min_fail.leo b/tests/old/pass/integers/i128/min_fail.leo deleted file mode 100644 index 918f0e439d..0000000000 --- a/tests/old/pass/integers/i128/min_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i128 = -170141183460469231731687303715884105729; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/mod.rs b/tests/old/pass/integers/i128/mod.rs deleted file mode 100644 index e62e07260e..0000000000 --- a/tests/old/pass/integers/i128/mod.rs +++ /dev/null @@ -1,134 +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::{ - assert_satisfied, - expect_asg_error, - expect_compiler_error, - generate_main_input, - integers::{expect_computation_error, IntegerTester}, - parse_program, -}; -use leo_ast::InputValue; -use leo_input::types::{I128Type, IntegerType, SignedIntegerType}; - -test_int!( - TestI128, - i128, - IntegerType::Signed(SignedIntegerType::I128Type(I128Type {})), - Int128 -); - -#[test] -fn test_i128_min() { - TestI128::test_min(); -} - -#[test] -fn test_i128_min_fail() { - TestI128::test_min_fail(); -} - -#[test] -fn test_i128_max() { - TestI128::test_max(); -} - -#[test] -fn test_i128_max_fail() { - TestI128::test_max_fail(); -} - -#[test] -fn test_i128_neg() { - TestI128::test_negate(); -} - -#[test] -fn test_i128_neg_max_fail() { - TestI128::test_negate_min_fail(); -} - -#[test] -fn test_i128_neg_zero() { - TestI128::test_negate_zero(); -} - -#[test] -fn test_i128_add() { - TestI128::test_add(); -} - -#[test] -fn test_i128_sub() { - TestI128::test_sub(); -} - -#[test] -fn test_i128_mul() { - TestI128::test_mul(); -} - -#[test] -#[ignore] // takes several minutes -fn test_i128_div() { - TestI128::test_div(); -} - -#[test] -fn test_i128_pow() { - TestI128::test_pow(); -} - -#[test] -fn test_i128_eq() { - TestI128::test_eq(); -} - -#[test] -fn test_i128_ne() { - TestI128::test_ne(); -} - -#[test] -fn test_i128_ge() { - TestI128::test_ge(); -} - -#[test] -fn test_i128_gt() { - TestI128::test_gt(); -} - -#[test] -fn test_i128_le() { - TestI128::test_le(); -} - -#[test] -fn test_i128_lt() { - TestI128::test_lt(); -} - -#[test] -fn test_i128_assert_eq() { - TestI128::test_console_assert(); -} - -#[test] -fn test_i128_ternary() { - TestI128::test_ternary(); -} diff --git a/tests/old/pass/integers/i128/mul.leo b/tests/old/pass/integers/i128/mul.leo deleted file mode 100644 index 25b902d53c..0000000000 --- a/tests/old/pass/integers/i128/mul.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i128, b: i128, c: i128) { - console.assert(a * b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/ne.leo b/tests/old/pass/integers/i128/ne.leo deleted file mode 100644 index dae148b49c..0000000000 --- a/tests/old/pass/integers/i128/ne.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i128, b: i128, c: bool) { - console.assert(a != b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/negate.leo b/tests/old/pass/integers/i128/negate.leo deleted file mode 100644 index 437ee06390..0000000000 --- a/tests/old/pass/integers/i128/negate.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i128, b: i128) { - console.assert(-a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/negate_min.leo b/tests/old/pass/integers/i128/negate_min.leo deleted file mode 100644 index c9de272960..0000000000 --- a/tests/old/pass/integers/i128/negate_min.leo +++ /dev/null @@ -1,4 +0,0 @@ -function main() { - const a: i128 = -170141183460469231731687303715884105728; - const b = -a; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/negate_zero.leo b/tests/old/pass/integers/i128/negate_zero.leo deleted file mode 100644 index e079baf393..0000000000 --- a/tests/old/pass/integers/i128/negate_zero.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main() { - const a = 0i128; - - console.assert(-a == 0i128); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/pow.leo b/tests/old/pass/integers/i128/pow.leo deleted file mode 100644 index 05536aad51..0000000000 --- a/tests/old/pass/integers/i128/pow.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i128, b: i128, c: i128) { - console.assert(a ** b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/sub.leo b/tests/old/pass/integers/i128/sub.leo deleted file mode 100644 index 3a723eec49..0000000000 --- a/tests/old/pass/integers/i128/sub.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i128, b: i128, c: i128) { - console.assert(a - b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i128/ternary.leo b/tests/old/pass/integers/i128/ternary.leo deleted file mode 100644 index 3783463b22..0000000000 --- a/tests/old/pass/integers/i128/ternary.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main(s: bool, a: i128, b: i128, c: i128) { - const r = s ? a : b; - - console.assert(r == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/add.leo b/tests/old/pass/integers/i16/add.leo deleted file mode 100644 index 556ae65c3a..0000000000 --- a/tests/old/pass/integers/i16/add.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i16, b: i16, c: i16) { - console.assert(a + b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/console_assert.leo b/tests/old/pass/integers/i16/console_assert.leo deleted file mode 100644 index 3afb25b207..0000000000 --- a/tests/old/pass/integers/i16/console_assert.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i16, b: i16) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/div.leo b/tests/old/pass/integers/i16/div.leo deleted file mode 100644 index 6d0c8f4614..0000000000 --- a/tests/old/pass/integers/i16/div.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i16, b: i16, c: i16) { - console.assert(a / b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/eq.leo b/tests/old/pass/integers/i16/eq.leo deleted file mode 100644 index 338e3e50f6..0000000000 --- a/tests/old/pass/integers/i16/eq.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i16, b: i16, c: bool) { - console.assert(a == b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/ge.leo b/tests/old/pass/integers/i16/ge.leo deleted file mode 100644 index 68a4d40bf8..0000000000 --- a/tests/old/pass/integers/i16/ge.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i16, b: i16, c: bool) { - console.assert(a >= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/gt.leo b/tests/old/pass/integers/i16/gt.leo deleted file mode 100644 index 75d9bfb612..0000000000 --- a/tests/old/pass/integers/i16/gt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i16, b: i16, c: bool) { - console.assert(a > b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/input.leo b/tests/old/pass/integers/i16/input.leo deleted file mode 100644 index 3afb25b207..0000000000 --- a/tests/old/pass/integers/i16/input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i16, b: i16) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/le.leo b/tests/old/pass/integers/i16/le.leo deleted file mode 100644 index ff112c7fbc..0000000000 --- a/tests/old/pass/integers/i16/le.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i16, b: i16, c: bool) { - console.assert(a <= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/lt.leo b/tests/old/pass/integers/i16/lt.leo deleted file mode 100644 index 46c57aabe6..0000000000 --- a/tests/old/pass/integers/i16/lt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i16, b: i16, c: bool) { - console.assert(a < b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/max.leo b/tests/old/pass/integers/i16/max.leo deleted file mode 100644 index 2b70b3cc56..0000000000 --- a/tests/old/pass/integers/i16/max.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i16 = 32767; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/max_fail.leo b/tests/old/pass/integers/i16/max_fail.leo deleted file mode 100644 index 209bcc6518..0000000000 --- a/tests/old/pass/integers/i16/max_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i16 = 32768; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/min.leo b/tests/old/pass/integers/i16/min.leo deleted file mode 100644 index 3d05bef95a..0000000000 --- a/tests/old/pass/integers/i16/min.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i16 = -32768; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/min_fail.leo b/tests/old/pass/integers/i16/min_fail.leo deleted file mode 100644 index 13d7c8b7f2..0000000000 --- a/tests/old/pass/integers/i16/min_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i16 = -32769; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/mod.rs b/tests/old/pass/integers/i16/mod.rs deleted file mode 100644 index 49b45f5b3e..0000000000 --- a/tests/old/pass/integers/i16/mod.rs +++ /dev/null @@ -1,133 +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::{ - assert_satisfied, - expect_asg_error, - expect_compiler_error, - generate_main_input, - integers::{expect_computation_error, IntegerTester}, - parse_program, -}; -use leo_ast::InputValue; -use leo_input::types::{I16Type, IntegerType, SignedIntegerType}; - -test_int!( - TestI16, - i16, - IntegerType::Signed(SignedIntegerType::I16Type(I16Type {})), - Int16 -); - -#[test] -fn test_i16_min() { - TestI16::test_min(); -} - -#[test] -fn test_i16_min_fail() { - TestI16::test_min_fail(); -} - -#[test] -fn test_i16_max() { - TestI16::test_max(); -} - -#[test] -fn test_i16_max_fail() { - TestI16::test_max_fail(); -} - -#[test] -fn test_i16_neg() { - TestI16::test_negate(); -} - -#[test] -fn test_i16_neg_max_fail() { - TestI16::test_negate_min_fail(); -} - -#[test] -fn test_i16_neg_zero() { - TestI16::test_negate_zero(); -} - -#[test] -fn test_i16_add() { - TestI16::test_add(); -} - -#[test] -fn test_i16_sub() { - TestI16::test_sub(); -} - -#[test] -fn test_i16_mul() { - TestI16::test_mul(); -} - -#[test] -fn test_i16_div() { - TestI16::test_div(); -} - -#[test] -fn test_i16_pow() { - TestI16::test_pow(); -} - -#[test] -fn test_i16_eq() { - TestI16::test_eq(); -} - -#[test] -fn test_i16_ne() { - TestI16::test_ne(); -} - -#[test] -fn test_i16_ge() { - TestI16::test_ge(); -} - -#[test] -fn test_i16_gt() { - TestI16::test_gt(); -} - -#[test] -fn test_i16_le() { - TestI16::test_le(); -} - -#[test] -fn test_i16_lt() { - TestI16::test_lt(); -} - -#[test] -fn test_i16_console_assert() { - TestI16::test_console_assert(); -} - -#[test] -fn test_i16_ternary() { - TestI16::test_ternary(); -} diff --git a/tests/old/pass/integers/i16/mul.leo b/tests/old/pass/integers/i16/mul.leo deleted file mode 100644 index 6fd19b703a..0000000000 --- a/tests/old/pass/integers/i16/mul.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i16, b: i16, c: i16) { - console.assert(a * b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/ne.leo b/tests/old/pass/integers/i16/ne.leo deleted file mode 100644 index f0a9472678..0000000000 --- a/tests/old/pass/integers/i16/ne.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i16, b: i16, c: bool) { - console.assert(a != b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/negate.leo b/tests/old/pass/integers/i16/negate.leo deleted file mode 100644 index 1d2644dce7..0000000000 --- a/tests/old/pass/integers/i16/negate.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i16, b: i16) { - console.assert(-a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/negate_min.leo b/tests/old/pass/integers/i16/negate_min.leo deleted file mode 100644 index d52a356396..0000000000 --- a/tests/old/pass/integers/i16/negate_min.leo +++ /dev/null @@ -1,4 +0,0 @@ -function main() { - const a = -32768i16; - const b = -a; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/negate_zero.leo b/tests/old/pass/integers/i16/negate_zero.leo deleted file mode 100644 index 20f8a4fba7..0000000000 --- a/tests/old/pass/integers/i16/negate_zero.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main() { - const a = 0i16; - - console.assert(-a == 0i16); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/pow.leo b/tests/old/pass/integers/i16/pow.leo deleted file mode 100644 index 769d2d2fbb..0000000000 --- a/tests/old/pass/integers/i16/pow.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i16, b: i16, c: i16) { - console.assert(a ** b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/sub.leo b/tests/old/pass/integers/i16/sub.leo deleted file mode 100644 index e935935187..0000000000 --- a/tests/old/pass/integers/i16/sub.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i16, b: i16, c: i16) { - console.assert(a - b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i16/ternary.leo b/tests/old/pass/integers/i16/ternary.leo deleted file mode 100644 index d66c73cb93..0000000000 --- a/tests/old/pass/integers/i16/ternary.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main(s: bool, a: i16, b: i16, c: i16) { - const r = s ? a : b; - - console.assert(r == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/add.leo b/tests/old/pass/integers/i32/add.leo deleted file mode 100644 index 3d8fb1b1d2..0000000000 --- a/tests/old/pass/integers/i32/add.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i32, b: i32, c: i32) { - console.assert(a + b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/console_assert.leo b/tests/old/pass/integers/i32/console_assert.leo deleted file mode 100644 index a2d6980e9a..0000000000 --- a/tests/old/pass/integers/i32/console_assert.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i32, b: i32) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/div.leo b/tests/old/pass/integers/i32/div.leo deleted file mode 100644 index 3189a354f0..0000000000 --- a/tests/old/pass/integers/i32/div.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i32, b: i32, c: i32) { - console.assert(a / b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/eq.leo b/tests/old/pass/integers/i32/eq.leo deleted file mode 100644 index bac7af0be0..0000000000 --- a/tests/old/pass/integers/i32/eq.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i32, b: i32, c: bool) { - console.assert(a == b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/ge.leo b/tests/old/pass/integers/i32/ge.leo deleted file mode 100644 index 362521fc82..0000000000 --- a/tests/old/pass/integers/i32/ge.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i32, b: i32, c: bool) { - console.assert(a >= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/gt.leo b/tests/old/pass/integers/i32/gt.leo deleted file mode 100644 index 63ddcaa85c..0000000000 --- a/tests/old/pass/integers/i32/gt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i32, b: i32, c: bool) { - console.assert(a > b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/input.leo b/tests/old/pass/integers/i32/input.leo deleted file mode 100644 index a2d6980e9a..0000000000 --- a/tests/old/pass/integers/i32/input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i32, b: i32) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/le.leo b/tests/old/pass/integers/i32/le.leo deleted file mode 100644 index 948c66b1fc..0000000000 --- a/tests/old/pass/integers/i32/le.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i32, b: i32, c: bool) { - console.assert(a <= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/lt.leo b/tests/old/pass/integers/i32/lt.leo deleted file mode 100644 index 72a8fb0d53..0000000000 --- a/tests/old/pass/integers/i32/lt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i32, b: i32, c: bool) { - console.assert(a < b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/max.leo b/tests/old/pass/integers/i32/max.leo deleted file mode 100644 index 074c75f1a6..0000000000 --- a/tests/old/pass/integers/i32/max.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i32 = 2147483647; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/max_fail.leo b/tests/old/pass/integers/i32/max_fail.leo deleted file mode 100644 index af2877ff5e..0000000000 --- a/tests/old/pass/integers/i32/max_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i32 = 2147483648; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/min.leo b/tests/old/pass/integers/i32/min.leo deleted file mode 100644 index 8436268ce6..0000000000 --- a/tests/old/pass/integers/i32/min.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i32 = -2147483648; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/min_fail.leo b/tests/old/pass/integers/i32/min_fail.leo deleted file mode 100644 index 11a683b087..0000000000 --- a/tests/old/pass/integers/i32/min_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i32 = -2147483649; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/mod.rs b/tests/old/pass/integers/i32/mod.rs deleted file mode 100644 index ee9e25701a..0000000000 --- a/tests/old/pass/integers/i32/mod.rs +++ /dev/null @@ -1,133 +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::{ - assert_satisfied, - expect_asg_error, - expect_compiler_error, - generate_main_input, - integers::{expect_computation_error, IntegerTester}, - parse_program, -}; -use leo_ast::InputValue; -use leo_input::types::{I32Type, IntegerType, SignedIntegerType}; - -test_int!( - TestI32, - i32, - IntegerType::Signed(SignedIntegerType::I32Type(I32Type {})), - Int32 -); - -#[test] -fn test_i32_min() { - TestI32::test_min(); -} - -#[test] -fn test_i32_min_fail() { - TestI32::test_min_fail(); -} - -#[test] -fn test_i32_max() { - TestI32::test_max(); -} - -#[test] -fn test_i32_max_fail() { - TestI32::test_max_fail(); -} - -#[test] -fn test_i32_neg() { - TestI32::test_negate(); -} - -#[test] -fn test_i32_neg_max_fail() { - TestI32::test_negate_min_fail(); -} - -#[test] -fn test_i32_neg_zero() { - TestI32::test_negate_zero(); -} - -#[test] -fn test_i32_add() { - TestI32::test_add(); -} - -#[test] -fn test_i32_sub() { - TestI32::test_sub(); -} - -#[test] -fn test_i32_mul() { - TestI32::test_mul(); -} - -#[test] -fn test_i32_div() { - TestI32::test_div(); -} - -#[test] -fn test_i32_pow() { - TestI32::test_pow(); -} - -#[test] -fn test_i32_eq() { - TestI32::test_eq(); -} - -#[test] -fn test_i32_ne() { - TestI32::test_ne(); -} - -#[test] -fn test_i32_ge() { - TestI32::test_ge(); -} - -#[test] -fn test_i32_gt() { - TestI32::test_gt(); -} - -#[test] -fn test_i32_le() { - TestI32::test_le(); -} - -#[test] -fn test_i32_lt() { - TestI32::test_lt(); -} - -#[test] -fn test_i32_console_assert() { - TestI32::test_console_assert(); -} - -#[test] -fn test_i32_ternary() { - TestI32::test_ternary(); -} diff --git a/tests/old/pass/integers/i32/mul.leo b/tests/old/pass/integers/i32/mul.leo deleted file mode 100644 index 50ba5b4128..0000000000 --- a/tests/old/pass/integers/i32/mul.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i32, b: i32, c: i32) { - console.assert(a * b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/ne.leo b/tests/old/pass/integers/i32/ne.leo deleted file mode 100644 index dcc1a185d1..0000000000 --- a/tests/old/pass/integers/i32/ne.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i32, b: i32, c: bool) { - console.assert(a != b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/negate.leo b/tests/old/pass/integers/i32/negate.leo deleted file mode 100644 index eef94c934f..0000000000 --- a/tests/old/pass/integers/i32/negate.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i32, b: i32) { - console.assert(-a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/negate_min.leo b/tests/old/pass/integers/i32/negate_min.leo deleted file mode 100644 index a96455d57a..0000000000 --- a/tests/old/pass/integers/i32/negate_min.leo +++ /dev/null @@ -1,4 +0,0 @@ -function main() { - const a = -2147483648i32; - const b = -a; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/negate_zero.leo b/tests/old/pass/integers/i32/negate_zero.leo deleted file mode 100644 index a3807b1f8a..0000000000 --- a/tests/old/pass/integers/i32/negate_zero.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main() { - const a = 0i32; - - console.assert(-a == 0i32); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/pow.leo b/tests/old/pass/integers/i32/pow.leo deleted file mode 100644 index ebb131e30b..0000000000 --- a/tests/old/pass/integers/i32/pow.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i32, b: i32, c: i32) { - console.assert(a ** b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/sub.leo b/tests/old/pass/integers/i32/sub.leo deleted file mode 100644 index 1f054a5ddf..0000000000 --- a/tests/old/pass/integers/i32/sub.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i32, b: i32, c: i32) { - console.assert(a - b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i32/ternary.leo b/tests/old/pass/integers/i32/ternary.leo deleted file mode 100644 index 790769d62f..0000000000 --- a/tests/old/pass/integers/i32/ternary.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main(s: bool, a: i32, b: i32, c: i32) { - const r = s ? a : b; - - console.assert(r == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/add.leo b/tests/old/pass/integers/i64/add.leo deleted file mode 100644 index aefdbb178f..0000000000 --- a/tests/old/pass/integers/i64/add.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i64, b: i64, c: i64) { - console.assert(a + b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/console_assert.leo b/tests/old/pass/integers/i64/console_assert.leo deleted file mode 100644 index ab9a5d6e91..0000000000 --- a/tests/old/pass/integers/i64/console_assert.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i64, b: i64) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/div.leo b/tests/old/pass/integers/i64/div.leo deleted file mode 100644 index 142e4ab801..0000000000 --- a/tests/old/pass/integers/i64/div.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i64, b: i64, c: i64) { - console.assert(a / b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/eq.leo b/tests/old/pass/integers/i64/eq.leo deleted file mode 100644 index 86a234c834..0000000000 --- a/tests/old/pass/integers/i64/eq.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i64, b: i64, c: bool) { - console.assert(a == b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/ge.leo b/tests/old/pass/integers/i64/ge.leo deleted file mode 100644 index e7b453c5dc..0000000000 --- a/tests/old/pass/integers/i64/ge.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i64, b: i64, c: bool) { - console.assert(a >= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/gt.leo b/tests/old/pass/integers/i64/gt.leo deleted file mode 100644 index 9709bad012..0000000000 --- a/tests/old/pass/integers/i64/gt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i64, b: i64, c: bool) { - console.assert(a > b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/input.leo b/tests/old/pass/integers/i64/input.leo deleted file mode 100644 index ab9a5d6e91..0000000000 --- a/tests/old/pass/integers/i64/input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i64, b: i64) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/le.leo b/tests/old/pass/integers/i64/le.leo deleted file mode 100644 index 3e2cfcb711..0000000000 --- a/tests/old/pass/integers/i64/le.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i64, b: i64, c: bool) { - console.assert(a <= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/lt.leo b/tests/old/pass/integers/i64/lt.leo deleted file mode 100644 index ef4e38eb76..0000000000 --- a/tests/old/pass/integers/i64/lt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i64, b: i64, c: bool) { - console.assert(a < b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/max.leo b/tests/old/pass/integers/i64/max.leo deleted file mode 100644 index 593f91e110..0000000000 --- a/tests/old/pass/integers/i64/max.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i64 = 9223372036854775807; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/max_fail.leo b/tests/old/pass/integers/i64/max_fail.leo deleted file mode 100644 index 362b794a2c..0000000000 --- a/tests/old/pass/integers/i64/max_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i64 = 9223372036854775808; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/min.leo b/tests/old/pass/integers/i64/min.leo deleted file mode 100644 index 794d8fbfac..0000000000 --- a/tests/old/pass/integers/i64/min.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i64 = -9223372036854775808; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/min_fail.leo b/tests/old/pass/integers/i64/min_fail.leo deleted file mode 100644 index bb260ecc3f..0000000000 --- a/tests/old/pass/integers/i64/min_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i64 = -9223372036854775809; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/mod.rs b/tests/old/pass/integers/i64/mod.rs deleted file mode 100644 index 066ac9956f..0000000000 --- a/tests/old/pass/integers/i64/mod.rs +++ /dev/null @@ -1,134 +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::{ - assert_satisfied, - expect_asg_error, - expect_compiler_error, - generate_main_input, - integers::{expect_computation_error, IntegerTester}, - parse_program, -}; -use leo_ast::InputValue; -use leo_input::types::{I64Type, IntegerType, SignedIntegerType}; - -test_int!( - TestI64, - i64, - IntegerType::Signed(SignedIntegerType::I64Type(I64Type {})), - Int64 -); - -#[test] -fn test_i64_min() { - TestI64::test_min(); -} - -#[test] -fn test_i64_min_fail() { - TestI64::test_min_fail(); -} - -#[test] -fn test_i64_max() { - TestI64::test_max(); -} - -#[test] -fn test_i64_max_fail() { - TestI64::test_max_fail(); -} - -#[test] -fn test_i64_neg() { - TestI64::test_negate(); -} - -#[test] -fn test_i64_neg_max_fail() { - TestI64::test_negate_min_fail(); -} - -#[test] -fn test_i64_neg_zero() { - TestI64::test_negate_zero(); -} - -#[test] -fn test_i64_add() { - TestI64::test_add(); -} - -#[test] -fn test_i64_sub() { - TestI64::test_sub(); -} - -#[test] -fn test_i64_mul() { - TestI64::test_mul(); -} - -#[test] -#[ignore] // takes 2 minutes -fn test_i64_div() { - TestI64::test_div(); -} - -#[test] -fn test_i64_pow() { - TestI64::test_pow(); -} - -#[test] -fn test_i64_eq() { - TestI64::test_eq(); -} - -#[test] -fn test_i64_ne() { - TestI64::test_ne(); -} - -#[test] -fn test_i64_ge() { - TestI64::test_ge(); -} - -#[test] -fn test_i64_gt() { - TestI64::test_gt(); -} - -#[test] -fn test_i64_le() { - TestI64::test_le(); -} - -#[test] -fn test_i64_lt() { - TestI64::test_lt(); -} - -#[test] -fn test_i64_console_assert() { - TestI64::test_console_assert(); -} - -#[test] -fn test_i64_ternary() { - TestI64::test_ternary(); -} diff --git a/tests/old/pass/integers/i64/mul.leo b/tests/old/pass/integers/i64/mul.leo deleted file mode 100644 index a3b8bd1da5..0000000000 --- a/tests/old/pass/integers/i64/mul.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i64, b: i64, c: i64) { - console.assert(a * b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/ne.leo b/tests/old/pass/integers/i64/ne.leo deleted file mode 100644 index a2642bb479..0000000000 --- a/tests/old/pass/integers/i64/ne.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i64, b: i64, c: bool) { - console.assert(a != b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/negate.leo b/tests/old/pass/integers/i64/negate.leo deleted file mode 100644 index fe0cdc4d97..0000000000 --- a/tests/old/pass/integers/i64/negate.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i64, b: i64) { - console.assert(-a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/negate_min.leo b/tests/old/pass/integers/i64/negate_min.leo deleted file mode 100644 index daf694491b..0000000000 --- a/tests/old/pass/integers/i64/negate_min.leo +++ /dev/null @@ -1,4 +0,0 @@ -function main() { - const a: i64 = -9223372036854775808; - const b = -a; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/negate_zero.leo b/tests/old/pass/integers/i64/negate_zero.leo deleted file mode 100644 index 81f09c19a3..0000000000 --- a/tests/old/pass/integers/i64/negate_zero.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main() { - const a = 0i64; - - console.assert(-a == 0i64); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/pow.leo b/tests/old/pass/integers/i64/pow.leo deleted file mode 100644 index dca2dace74..0000000000 --- a/tests/old/pass/integers/i64/pow.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i64, b: i64, c: i64) { - console.assert(a ** b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/sub.leo b/tests/old/pass/integers/i64/sub.leo deleted file mode 100644 index 4d335e504b..0000000000 --- a/tests/old/pass/integers/i64/sub.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i64, b: i64, c: i64) { - console.assert(a - b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i64/ternary.leo b/tests/old/pass/integers/i64/ternary.leo deleted file mode 100644 index df63b3ad6a..0000000000 --- a/tests/old/pass/integers/i64/ternary.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main(s: bool, a: i64, b: i64, c: i64) { - const r = s ? a : b; - - console.assert(r == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/add.leo b/tests/old/pass/integers/i8/add.leo deleted file mode 100644 index dd71bc7f53..0000000000 --- a/tests/old/pass/integers/i8/add.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i8, b: i8, c: i8) { - console.assert(a + b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/console_assert.leo b/tests/old/pass/integers/i8/console_assert.leo deleted file mode 100644 index 1fc09cb57d..0000000000 --- a/tests/old/pass/integers/i8/console_assert.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i8, b: i8) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/div.leo b/tests/old/pass/integers/i8/div.leo deleted file mode 100644 index a80d8e6319..0000000000 --- a/tests/old/pass/integers/i8/div.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i8, b: i8, c: i8) { - console.assert(a / b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/eq.leo b/tests/old/pass/integers/i8/eq.leo deleted file mode 100644 index 130cc64b89..0000000000 --- a/tests/old/pass/integers/i8/eq.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i8, b: i8, c: bool) { - console.assert(a == b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/ge.leo b/tests/old/pass/integers/i8/ge.leo deleted file mode 100644 index 3084692c0c..0000000000 --- a/tests/old/pass/integers/i8/ge.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i8, b: i8, c: bool) { - console.assert(a >= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/gt.leo b/tests/old/pass/integers/i8/gt.leo deleted file mode 100644 index d3913b8b24..0000000000 --- a/tests/old/pass/integers/i8/gt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i8, b: i8, c: bool) { - console.assert(a > b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/input.leo b/tests/old/pass/integers/i8/input.leo deleted file mode 100644 index 1fc09cb57d..0000000000 --- a/tests/old/pass/integers/i8/input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i8, b: i8) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/le.leo b/tests/old/pass/integers/i8/le.leo deleted file mode 100644 index 92e011f206..0000000000 --- a/tests/old/pass/integers/i8/le.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i8, b: i8, c: bool) { - console.assert(a <= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/lt.leo b/tests/old/pass/integers/i8/lt.leo deleted file mode 100644 index eb34b7148e..0000000000 --- a/tests/old/pass/integers/i8/lt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i8, b: i8, c: bool) { - console.assert(a < b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/max.leo b/tests/old/pass/integers/i8/max.leo deleted file mode 100644 index f20d59ddf4..0000000000 --- a/tests/old/pass/integers/i8/max.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i8 = 127; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/max_fail.leo b/tests/old/pass/integers/i8/max_fail.leo deleted file mode 100644 index 9e1956024a..0000000000 --- a/tests/old/pass/integers/i8/max_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i8 = 128; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/min.leo b/tests/old/pass/integers/i8/min.leo deleted file mode 100644 index 7b6db025ea..0000000000 --- a/tests/old/pass/integers/i8/min.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i8 = -128; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/min_fail.leo b/tests/old/pass/integers/i8/min_fail.leo deleted file mode 100644 index 41170e9b93..0000000000 --- a/tests/old/pass/integers/i8/min_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: i8 = -129; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/mod.rs b/tests/old/pass/integers/i8/mod.rs deleted file mode 100644 index 9133a72248..0000000000 --- a/tests/old/pass/integers/i8/mod.rs +++ /dev/null @@ -1,133 +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::{ - assert_satisfied, - expect_asg_error, - expect_compiler_error, - generate_main_input, - integers::{expect_computation_error, IntegerTester}, - parse_program, -}; -use leo_ast::InputValue; -use leo_input::types::{I8Type, IntegerType, SignedIntegerType}; - -test_int!( - TestI8, - i8, - IntegerType::Signed(SignedIntegerType::I8Type(I8Type {})), - Int8 -); - -#[test] -fn test_i8_min() { - TestI8::test_min(); -} - -#[test] -fn test_i8_min_fail() { - TestI8::test_min_fail(); -} - -#[test] -fn test_i8_max() { - TestI8::test_max(); -} - -#[test] -fn test_i8_max_fail() { - TestI8::test_max_fail(); -} - -#[test] -fn test_i8_neg() { - TestI8::test_negate(); -} - -#[test] -fn test_i8_neg_max_fail() { - TestI8::test_negate_min_fail(); -} - -#[test] -fn test_i8_neg_zero() { - TestI8::test_negate_zero(); -} - -#[test] -fn test_i8_add() { - TestI8::test_add(); -} - -#[test] -fn test_i8_sub() { - TestI8::test_sub(); -} - -#[test] -fn test_i8_mul() { - TestI8::test_mul(); -} - -#[test] -fn test_i8_div() { - TestI8::test_div(); -} - -#[test] -fn test_i8_pow() { - TestI8::test_pow(); -} - -#[test] -fn test_i8_eq() { - TestI8::test_eq(); -} - -#[test] -fn test_i8_ne() { - TestI8::test_ne(); -} - -#[test] -fn test_i8_ge() { - TestI8::test_ge(); -} - -#[test] -fn test_i8_gt() { - TestI8::test_gt(); -} - -#[test] -fn test_i8_le() { - TestI8::test_le(); -} - -#[test] -fn test_i8_lt() { - TestI8::test_lt(); -} - -#[test] -fn test_i8_console_assert() { - TestI8::test_console_assert(); -} - -#[test] -fn test_i8_ternary() { - TestI8::test_ternary(); -} diff --git a/tests/old/pass/integers/i8/mul.leo b/tests/old/pass/integers/i8/mul.leo deleted file mode 100644 index 34726fff92..0000000000 --- a/tests/old/pass/integers/i8/mul.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i8, b: i8, c: i8) { - console.assert(a * b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/ne.leo b/tests/old/pass/integers/i8/ne.leo deleted file mode 100644 index e5028d404a..0000000000 --- a/tests/old/pass/integers/i8/ne.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i8, b: i8, c: bool) { - console.assert(a != b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/negate.leo b/tests/old/pass/integers/i8/negate.leo deleted file mode 100644 index 2a2266bc56..0000000000 --- a/tests/old/pass/integers/i8/negate.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i8, b: i8) { - console.assert(-a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/negate_min.leo b/tests/old/pass/integers/i8/negate_min.leo deleted file mode 100644 index 7f664a1b78..0000000000 --- a/tests/old/pass/integers/i8/negate_min.leo +++ /dev/null @@ -1,4 +0,0 @@ -function main() { - const a = -128i8; - const b = -a; -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/negate_zero.leo b/tests/old/pass/integers/i8/negate_zero.leo deleted file mode 100644 index cc3f4a0828..0000000000 --- a/tests/old/pass/integers/i8/negate_zero.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main() { - const a = 0i8; - - console.assert(-a == 0i8); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/pow.leo b/tests/old/pass/integers/i8/pow.leo deleted file mode 100644 index 18aeb44b46..0000000000 --- a/tests/old/pass/integers/i8/pow.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i8, b: i8, c: i8) { - console.assert(a ** b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/sub.leo b/tests/old/pass/integers/i8/sub.leo deleted file mode 100644 index a795bed153..0000000000 --- a/tests/old/pass/integers/i8/sub.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i8, b: i8, c: i8) { - console.assert(a - b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/i8/ternary.leo b/tests/old/pass/integers/i8/ternary.leo deleted file mode 100644 index 0956a9cd39..0000000000 --- a/tests/old/pass/integers/i8/ternary.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main(s: bool, a: i8, b: i8, c: i8) { - const r = s ? a : b; - - console.assert(r == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/add.leo b/tests/old/pass/integers/u128/add.leo deleted file mode 100644 index 6b32042fd5..0000000000 --- a/tests/old/pass/integers/u128/add.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u128, b: u128, c: u128) { - console.assert(a + b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/console_assert.leo b/tests/old/pass/integers/u128/console_assert.leo deleted file mode 100644 index adab295385..0000000000 --- a/tests/old/pass/integers/u128/console_assert.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u128, b: u128) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/div.leo b/tests/old/pass/integers/u128/div.leo deleted file mode 100644 index 0d62054eca..0000000000 --- a/tests/old/pass/integers/u128/div.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u128, b: u128, c: u128) { - console.assert(a / b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/eq.leo b/tests/old/pass/integers/u128/eq.leo deleted file mode 100644 index 2c2acd923a..0000000000 --- a/tests/old/pass/integers/u128/eq.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u128, b: u128, c: bool) { - console.assert(a == b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/ge.leo b/tests/old/pass/integers/u128/ge.leo deleted file mode 100644 index bff7cd321b..0000000000 --- a/tests/old/pass/integers/u128/ge.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u128, b: u128, c: bool) { - console.assert(a >= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/gt.leo b/tests/old/pass/integers/u128/gt.leo deleted file mode 100644 index e8aec0faf2..0000000000 --- a/tests/old/pass/integers/u128/gt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u128, b: u128, c: bool) { - console.assert(a > b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/input.leo b/tests/old/pass/integers/u128/input.leo deleted file mode 100644 index adab295385..0000000000 --- a/tests/old/pass/integers/u128/input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u128, b: u128) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/le.leo b/tests/old/pass/integers/u128/le.leo deleted file mode 100644 index c9e4609136..0000000000 --- a/tests/old/pass/integers/u128/le.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u128, b: u128, c: bool) { - console.assert(a <= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/lt.leo b/tests/old/pass/integers/u128/lt.leo deleted file mode 100644 index b37057c895..0000000000 --- a/tests/old/pass/integers/u128/lt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u128, b: u128, c: bool) { - console.assert(a < b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/max.leo b/tests/old/pass/integers/u128/max.leo deleted file mode 100644 index b166ede06b..0000000000 --- a/tests/old/pass/integers/u128/max.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u128 = 340282366920938463463374607431768211455; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/max_fail.leo b/tests/old/pass/integers/u128/max_fail.leo deleted file mode 100644 index f51c967925..0000000000 --- a/tests/old/pass/integers/u128/max_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u128 = 340282366920938463463374607431768211456; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/min.leo b/tests/old/pass/integers/u128/min.leo deleted file mode 100644 index 41fbf1a2fe..0000000000 --- a/tests/old/pass/integers/u128/min.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u128 = 0; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/min_fail.leo b/tests/old/pass/integers/u128/min_fail.leo deleted file mode 100644 index b0d17191ff..0000000000 --- a/tests/old/pass/integers/u128/min_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u128 = -1; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/mod.rs b/tests/old/pass/integers/u128/mod.rs deleted file mode 100644 index 2c110af0a5..0000000000 --- a/tests/old/pass/integers/u128/mod.rs +++ /dev/null @@ -1,118 +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::{ - assert_satisfied, - expect_asg_error, - expect_compiler_error, - generate_main_input, - integers::IntegerTester, - parse_program, -}; -use leo_ast::InputValue; -use leo_input::types::{IntegerType, U128Type, UnsignedIntegerType}; - -test_uint!( - TestU128, - u128, - IntegerType::Unsigned(UnsignedIntegerType::U128Type(U128Type {})), - UInt128 -); - -#[test] -fn test_u128_min() { - TestU128::test_min(); -} - -#[test] -fn test_u128_min_fail() { - TestU128::test_min_fail(); -} - -#[test] -fn test_u128_max() { - TestU128::test_max(); -} - -#[test] -fn test_u128_max_fail() { - TestU128::test_max_fail(); -} - -#[test] -fn test_u128_add() { - TestU128::test_add(); -} - -#[test] -fn test_u128_sub() { - TestU128::test_sub(); -} - -#[test] -fn test_u128_mul() { - TestU128::test_mul(); -} - -#[test] -fn test_u128_div() { - TestU128::test_div(); -} - -#[test] -fn test_u128_pow() { - TestU128::test_pow(); -} - -#[test] -fn test_u128_eq() { - TestU128::test_eq(); -} - -#[test] -fn test_u128_ne() { - TestU128::test_ne(); -} - -#[test] -fn test_u128_ge() { - TestU128::test_ge(); -} - -#[test] -fn test_u128_gt() { - TestU128::test_gt(); -} - -#[test] -fn test_u128_le() { - TestU128::test_le(); -} - -#[test] -fn test_u128_lt() { - TestU128::test_lt(); -} - -#[test] -fn test_u128_console_assert() { - TestU128::test_console_assert(); -} - -#[test] -fn test_u128_ternary() { - TestU128::test_ternary(); -} diff --git a/tests/old/pass/integers/u128/mul.leo b/tests/old/pass/integers/u128/mul.leo deleted file mode 100644 index c7fdc1530c..0000000000 --- a/tests/old/pass/integers/u128/mul.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u128, b: u128, c: u128) { - console.assert(a * b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/ne.leo b/tests/old/pass/integers/u128/ne.leo deleted file mode 100644 index da3467d01e..0000000000 --- a/tests/old/pass/integers/u128/ne.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u128, b: u128, c: bool) { - console.assert(a != b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/pow.leo b/tests/old/pass/integers/u128/pow.leo deleted file mode 100644 index 27614bfa56..0000000000 --- a/tests/old/pass/integers/u128/pow.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u128, b: u128, c: u128) { - console.assert(a ** b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/sub.leo b/tests/old/pass/integers/u128/sub.leo deleted file mode 100644 index 2374413505..0000000000 --- a/tests/old/pass/integers/u128/sub.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u128, b: u128, c: u128) { - console.assert(a - b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u128/ternary.leo b/tests/old/pass/integers/u128/ternary.leo deleted file mode 100644 index 99a6b997e0..0000000000 --- a/tests/old/pass/integers/u128/ternary.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main(s: bool, a: u128, b: u128, c: u128) { - const r = s ? a : b; - - console.assert(r == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/add.leo b/tests/old/pass/integers/u16/add.leo deleted file mode 100644 index f00701181b..0000000000 --- a/tests/old/pass/integers/u16/add.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u16, b: u16, c: u16) { - console.assert(a + b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/console_assert.leo b/tests/old/pass/integers/u16/console_assert.leo deleted file mode 100644 index 761f0639d0..0000000000 --- a/tests/old/pass/integers/u16/console_assert.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u16, b: u16) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/div.leo b/tests/old/pass/integers/u16/div.leo deleted file mode 100644 index f1dd3fa463..0000000000 --- a/tests/old/pass/integers/u16/div.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u16, b: u16, c: u16) { - console.assert(a / b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/eq.leo b/tests/old/pass/integers/u16/eq.leo deleted file mode 100644 index a4b4e78b49..0000000000 --- a/tests/old/pass/integers/u16/eq.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u16, b: u16, c: bool) { - console.assert(a == b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/ge.leo b/tests/old/pass/integers/u16/ge.leo deleted file mode 100644 index 4b1da1b27b..0000000000 --- a/tests/old/pass/integers/u16/ge.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u16, b: u16, c: bool) { - console.assert(a >= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/gt.leo b/tests/old/pass/integers/u16/gt.leo deleted file mode 100644 index 2c5ffbe8eb..0000000000 --- a/tests/old/pass/integers/u16/gt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u16, b: u16, c: bool) { - console.assert(a > b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/input.leo b/tests/old/pass/integers/u16/input.leo deleted file mode 100644 index 761f0639d0..0000000000 --- a/tests/old/pass/integers/u16/input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u16, b: u16) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/le.leo b/tests/old/pass/integers/u16/le.leo deleted file mode 100644 index 49713482d0..0000000000 --- a/tests/old/pass/integers/u16/le.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u16, b: u16, c: bool) { - console.assert(a <= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/lt.leo b/tests/old/pass/integers/u16/lt.leo deleted file mode 100644 index dae1951231..0000000000 --- a/tests/old/pass/integers/u16/lt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u16, b: u16, c: bool) { - console.assert(a < b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/max.leo b/tests/old/pass/integers/u16/max.leo deleted file mode 100644 index 56cb2af18d..0000000000 --- a/tests/old/pass/integers/u16/max.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u16 = 65535; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/max_fail.leo b/tests/old/pass/integers/u16/max_fail.leo deleted file mode 100644 index bb703210e3..0000000000 --- a/tests/old/pass/integers/u16/max_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u16 = 65536; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/min.leo b/tests/old/pass/integers/u16/min.leo deleted file mode 100644 index 4dee94a1a4..0000000000 --- a/tests/old/pass/integers/u16/min.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u16 = 0; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/min_fail.leo b/tests/old/pass/integers/u16/min_fail.leo deleted file mode 100644 index 0c61dd7ddf..0000000000 --- a/tests/old/pass/integers/u16/min_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u16 = -1; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/mod.rs b/tests/old/pass/integers/u16/mod.rs deleted file mode 100644 index b4b202b9da..0000000000 --- a/tests/old/pass/integers/u16/mod.rs +++ /dev/null @@ -1,118 +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::{ - assert_satisfied, - expect_asg_error, - expect_compiler_error, - generate_main_input, - integers::IntegerTester, - parse_program, -}; -use leo_ast::InputValue; -use leo_input::types::{IntegerType, U16Type, UnsignedIntegerType}; - -test_uint!( - TestU16, - u16, - IntegerType::Unsigned(UnsignedIntegerType::U16Type(U16Type {})), - UInt16 -); - -#[test] -fn test_u16_min() { - TestU16::test_min(); -} - -#[test] -fn test_u16_min_fail() { - TestU16::test_min_fail(); -} - -#[test] -fn test_u16_max() { - TestU16::test_max(); -} - -#[test] -fn test_u16_max_fail() { - TestU16::test_max_fail(); -} - -#[test] -fn test_u16_add() { - TestU16::test_add(); -} - -#[test] -fn test_u16_sub() { - TestU16::test_sub(); -} - -#[test] -fn test_u16_mul() { - TestU16::test_mul(); -} - -#[test] -fn test_u16_div() { - TestU16::test_div(); -} - -#[test] -fn test_u16_pow() { - TestU16::test_pow(); -} - -#[test] -fn test_u16_eq() { - TestU16::test_eq(); -} - -#[test] -fn test_u16_ne() { - TestU16::test_ne(); -} - -#[test] -fn test_u16_ge() { - TestU16::test_ge(); -} - -#[test] -fn test_u16_gt() { - TestU16::test_gt(); -} - -#[test] -fn test_u16_le() { - TestU16::test_le(); -} - -#[test] -fn test_u16_lt() { - TestU16::test_lt(); -} - -#[test] -fn test_u16_console_assert() { - TestU16::test_console_assert(); -} - -#[test] -fn test_u16_ternary() { - TestU16::test_ternary(); -} diff --git a/tests/old/pass/integers/u16/mul.leo b/tests/old/pass/integers/u16/mul.leo deleted file mode 100644 index f2c6f0aac8..0000000000 --- a/tests/old/pass/integers/u16/mul.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u16, b: u16, c: u16) { - console.assert(a * b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/ne.leo b/tests/old/pass/integers/u16/ne.leo deleted file mode 100644 index e90a304cfe..0000000000 --- a/tests/old/pass/integers/u16/ne.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u16, b: u16, c: bool) { - console.assert(a != b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/pow.leo b/tests/old/pass/integers/u16/pow.leo deleted file mode 100644 index 564c1c51fe..0000000000 --- a/tests/old/pass/integers/u16/pow.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u16, b: u16, c: u16) { - console.assert(a ** b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/sub.leo b/tests/old/pass/integers/u16/sub.leo deleted file mode 100644 index 92aae9ac2c..0000000000 --- a/tests/old/pass/integers/u16/sub.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u16, b: u16, c: u16) { - console.assert(a - b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u16/ternary.leo b/tests/old/pass/integers/u16/ternary.leo deleted file mode 100644 index d6131f9f4f..0000000000 --- a/tests/old/pass/integers/u16/ternary.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main(s: bool, a: u16, b: u16, c: u16) { - const r = s ? a : b; - - console.assert(r == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/add.leo b/tests/old/pass/integers/u32/add.leo deleted file mode 100644 index 6f6a2454b4..0000000000 --- a/tests/old/pass/integers/u32/add.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u32, b: u32, c: u32) { - console.assert(a + b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/console_assert.leo b/tests/old/pass/integers/u32/console_assert.leo deleted file mode 100644 index 32604eb3b8..0000000000 --- a/tests/old/pass/integers/u32/console_assert.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u32, b: u32) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/div.leo b/tests/old/pass/integers/u32/div.leo deleted file mode 100644 index ed689bd408..0000000000 --- a/tests/old/pass/integers/u32/div.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u32, b: u32, c: u32) { - console.assert(a / b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/eq.leo b/tests/old/pass/integers/u32/eq.leo deleted file mode 100644 index ca427b3c42..0000000000 --- a/tests/old/pass/integers/u32/eq.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u32, b: u32, c: bool) { - console.assert(a == b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/ge.leo b/tests/old/pass/integers/u32/ge.leo deleted file mode 100644 index 35c1c71829..0000000000 --- a/tests/old/pass/integers/u32/ge.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u32, b: u32, c: bool) { - console.assert(a >= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/gt.leo b/tests/old/pass/integers/u32/gt.leo deleted file mode 100644 index f76df415c4..0000000000 --- a/tests/old/pass/integers/u32/gt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u32, b: u32, c: bool) { - console.assert(a > b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/input.leo b/tests/old/pass/integers/u32/input.leo deleted file mode 100644 index 32604eb3b8..0000000000 --- a/tests/old/pass/integers/u32/input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u32, b: u32) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/le.leo b/tests/old/pass/integers/u32/le.leo deleted file mode 100644 index 9a802f896d..0000000000 --- a/tests/old/pass/integers/u32/le.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u32, b: u32, c: bool) { - console.assert(a <= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/lt.leo b/tests/old/pass/integers/u32/lt.leo deleted file mode 100644 index 73e5654470..0000000000 --- a/tests/old/pass/integers/u32/lt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u32, b: u32, c: bool) { - console.assert(a < b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/max.leo b/tests/old/pass/integers/u32/max.leo deleted file mode 100644 index 4a07281b5d..0000000000 --- a/tests/old/pass/integers/u32/max.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u32 = 4294967295; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/max_fail.leo b/tests/old/pass/integers/u32/max_fail.leo deleted file mode 100644 index 6b1631876e..0000000000 --- a/tests/old/pass/integers/u32/max_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u32 = 4294967296; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/min.leo b/tests/old/pass/integers/u32/min.leo deleted file mode 100644 index 8077e0ec02..0000000000 --- a/tests/old/pass/integers/u32/min.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u32 = 0; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/min_fail.leo b/tests/old/pass/integers/u32/min_fail.leo deleted file mode 100644 index c3e3f33225..0000000000 --- a/tests/old/pass/integers/u32/min_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u32 = -1; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/mod.rs b/tests/old/pass/integers/u32/mod.rs deleted file mode 100644 index 920fc6ed5b..0000000000 --- a/tests/old/pass/integers/u32/mod.rs +++ /dev/null @@ -1,118 +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::{ - assert_satisfied, - expect_asg_error, - expect_compiler_error, - generate_main_input, - integers::IntegerTester, - parse_program, -}; -use leo_ast::InputValue; -use leo_input::types::{IntegerType, U32Type, UnsignedIntegerType}; - -test_uint!( - TestU32, - u32, - IntegerType::Unsigned(UnsignedIntegerType::U32Type(U32Type {})), - UInt32 -); - -#[test] -fn test_u32_min() { - TestU32::test_min(); -} - -#[test] -fn test_u32_min_fail() { - TestU32::test_min_fail(); -} - -#[test] -fn test_u32_max() { - TestU32::test_max(); -} - -#[test] -fn test_u32_max_fail() { - TestU32::test_max_fail(); -} - -#[test] -fn test_u32_add() { - TestU32::test_add(); -} - -#[test] -fn test_u32_sub() { - TestU32::test_sub(); -} - -#[test] -fn test_u32_mul() { - TestU32::test_mul(); -} - -#[test] -fn test_u32_div() { - TestU32::test_div(); -} - -#[test] -fn test_u32_pow() { - TestU32::test_pow(); -} - -#[test] -fn test_u32_eq() { - TestU32::test_eq(); -} - -#[test] -fn test_u32_ne() { - TestU32::test_ne(); -} - -#[test] -fn test_u32_ge() { - TestU32::test_ge(); -} - -#[test] -fn test_u32_gt() { - TestU32::test_gt(); -} - -#[test] -fn test_u32_le() { - TestU32::test_le(); -} - -#[test] -fn test_u32_lt() { - TestU32::test_lt(); -} - -#[test] -fn test_u32_console_assert() { - TestU32::test_console_assert(); -} - -#[test] -fn test_u32_ternary() { - TestU32::test_ternary(); -} diff --git a/tests/old/pass/integers/u32/mul.leo b/tests/old/pass/integers/u32/mul.leo deleted file mode 100644 index a77a85477b..0000000000 --- a/tests/old/pass/integers/u32/mul.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u32, b: u32, c: u32) { - console.assert(a * b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/ne.leo b/tests/old/pass/integers/u32/ne.leo deleted file mode 100644 index 00ee1a9989..0000000000 --- a/tests/old/pass/integers/u32/ne.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u32, b: u32, c: bool) { - console.assert(a != b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/pow.leo b/tests/old/pass/integers/u32/pow.leo deleted file mode 100644 index b82496ff77..0000000000 --- a/tests/old/pass/integers/u32/pow.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u32, b: u32, c: u32) { - console.assert(a ** b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/sub.leo b/tests/old/pass/integers/u32/sub.leo deleted file mode 100644 index 54480bd4bc..0000000000 --- a/tests/old/pass/integers/u32/sub.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u32, b: u32, c: u32) { - console.assert(a - b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u32/ternary.leo b/tests/old/pass/integers/u32/ternary.leo deleted file mode 100644 index f32ffc29fe..0000000000 --- a/tests/old/pass/integers/u32/ternary.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main(s: bool, a: u32, b: u32, c: u32) { - const r = s ? a : b; - - console.assert(r == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/add.leo b/tests/old/pass/integers/u64/add.leo deleted file mode 100644 index 28abe51201..0000000000 --- a/tests/old/pass/integers/u64/add.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u64, b: u64, c: u64) { - console.assert(a + b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/console_assert.leo b/tests/old/pass/integers/u64/console_assert.leo deleted file mode 100644 index ac1d6d40c3..0000000000 --- a/tests/old/pass/integers/u64/console_assert.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u64, b: u64) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/div.leo b/tests/old/pass/integers/u64/div.leo deleted file mode 100644 index 059da236bb..0000000000 --- a/tests/old/pass/integers/u64/div.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u64, b: u64, c: u64) { - console.assert(a / b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/eq.leo b/tests/old/pass/integers/u64/eq.leo deleted file mode 100644 index 990b2dad2d..0000000000 --- a/tests/old/pass/integers/u64/eq.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u64, b: u64, c: bool) { - console.assert(a == b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/ge.leo b/tests/old/pass/integers/u64/ge.leo deleted file mode 100644 index 46ba36ceff..0000000000 --- a/tests/old/pass/integers/u64/ge.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u64, b: u64, c: bool) { - console.assert(a >= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/gt.leo b/tests/old/pass/integers/u64/gt.leo deleted file mode 100644 index 7d3032c7f5..0000000000 --- a/tests/old/pass/integers/u64/gt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u64, b: u64, c: bool) { - console.assert(a > b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/input.leo b/tests/old/pass/integers/u64/input.leo deleted file mode 100644 index ac1d6d40c3..0000000000 --- a/tests/old/pass/integers/u64/input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u64, b: u64) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/le.leo b/tests/old/pass/integers/u64/le.leo deleted file mode 100644 index 625b38d2d9..0000000000 --- a/tests/old/pass/integers/u64/le.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u64, b: u64, c: bool) { - console.assert(a <= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/lt.leo b/tests/old/pass/integers/u64/lt.leo deleted file mode 100644 index ed379f7341..0000000000 --- a/tests/old/pass/integers/u64/lt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u64, b: u64, c: bool) { - console.assert(a < b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/max.leo b/tests/old/pass/integers/u64/max.leo deleted file mode 100644 index f14ac7ce64..0000000000 --- a/tests/old/pass/integers/u64/max.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u64 = 18446744073709551615; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/max_fail.leo b/tests/old/pass/integers/u64/max_fail.leo deleted file mode 100644 index d606c83585..0000000000 --- a/tests/old/pass/integers/u64/max_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u64 = 18446744073709551616; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/min.leo b/tests/old/pass/integers/u64/min.leo deleted file mode 100644 index b1da40b14c..0000000000 --- a/tests/old/pass/integers/u64/min.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u64 = 0; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/min_fail.leo b/tests/old/pass/integers/u64/min_fail.leo deleted file mode 100644 index e58f1897e6..0000000000 --- a/tests/old/pass/integers/u64/min_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u64 = -1; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/mod.rs b/tests/old/pass/integers/u64/mod.rs deleted file mode 100644 index ec86c868f1..0000000000 --- a/tests/old/pass/integers/u64/mod.rs +++ /dev/null @@ -1,118 +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::{ - assert_satisfied, - expect_asg_error, - expect_compiler_error, - generate_main_input, - integers::IntegerTester, - parse_program, -}; -use leo_ast::InputValue; -use leo_input::types::{IntegerType, U64Type, UnsignedIntegerType}; - -test_uint!( - TestU64, - u64, - IntegerType::Unsigned(UnsignedIntegerType::U64Type(U64Type {})), - UInt64 -); - -#[test] -fn test_u64_min() { - TestU64::test_min(); -} - -#[test] -fn test_u64_min_fail() { - TestU64::test_min_fail(); -} - -#[test] -fn test_u64_max() { - TestU64::test_max(); -} - -#[test] -fn test_u64_max_fail() { - TestU64::test_max_fail(); -} - -#[test] -fn test_u64_add() { - TestU64::test_add(); -} - -#[test] -fn test_u64_sub() { - TestU64::test_sub(); -} - -#[test] -fn test_u64_mul() { - TestU64::test_mul(); -} - -#[test] -fn test_u64_div() { - TestU64::test_div(); -} - -#[test] -fn test_u64_pow() { - TestU64::test_pow(); -} - -#[test] -fn test_u64_eq() { - TestU64::test_eq(); -} - -#[test] -fn test_u64_ne() { - TestU64::test_ne(); -} - -#[test] -fn test_u64_ge() { - TestU64::test_ge(); -} - -#[test] -fn test_u64_gt() { - TestU64::test_gt(); -} - -#[test] -fn test_u64_le() { - TestU64::test_le(); -} - -#[test] -fn test_u64_lt() { - TestU64::test_lt(); -} - -#[test] -fn test_u64_console_assert() { - TestU64::test_console_assert(); -} - -#[test] -fn test_u64_ternary() { - TestU64::test_ternary(); -} diff --git a/tests/old/pass/integers/u64/mul.leo b/tests/old/pass/integers/u64/mul.leo deleted file mode 100644 index 2633e6780c..0000000000 --- a/tests/old/pass/integers/u64/mul.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u64, b: u64, c: u64) { - console.assert(a * b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/ne.leo b/tests/old/pass/integers/u64/ne.leo deleted file mode 100644 index e47acbb1de..0000000000 --- a/tests/old/pass/integers/u64/ne.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u64, b: u64, c: bool) { - console.assert(a != b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/pow.leo b/tests/old/pass/integers/u64/pow.leo deleted file mode 100644 index 64f0694ed1..0000000000 --- a/tests/old/pass/integers/u64/pow.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u64, b: u64, c: u64) { - console.assert(a ** b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/sub.leo b/tests/old/pass/integers/u64/sub.leo deleted file mode 100644 index 9961f0f7b7..0000000000 --- a/tests/old/pass/integers/u64/sub.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u64, b: u64, c: u64) { - console.assert(a - b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u64/ternary.leo b/tests/old/pass/integers/u64/ternary.leo deleted file mode 100644 index 4427cd0466..0000000000 --- a/tests/old/pass/integers/u64/ternary.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main(s: bool, a: u64, b: u64, c: u64) { - const r = s ? a : b; - - console.assert(r == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/add.leo b/tests/old/pass/integers/u8/add.leo deleted file mode 100644 index 1b40e304d2..0000000000 --- a/tests/old/pass/integers/u8/add.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u8, b: u8, c: u8) { - console.assert(a + b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/console_assert.leo b/tests/old/pass/integers/u8/console_assert.leo deleted file mode 100644 index 4d99dc106c..0000000000 --- a/tests/old/pass/integers/u8/console_assert.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u8, b: u8) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/div.leo b/tests/old/pass/integers/u8/div.leo deleted file mode 100644 index 945aa94c30..0000000000 --- a/tests/old/pass/integers/u8/div.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u8, b: u8, c: u8) { - console.assert(a / b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/eq.leo b/tests/old/pass/integers/u8/eq.leo deleted file mode 100644 index c2a487b0e7..0000000000 --- a/tests/old/pass/integers/u8/eq.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u8, b: u8, c: bool) { - console.assert(a == b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/ge.leo b/tests/old/pass/integers/u8/ge.leo deleted file mode 100644 index d819422276..0000000000 --- a/tests/old/pass/integers/u8/ge.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u8, b: u8, c: bool) { - console.assert(a >= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/gt.leo b/tests/old/pass/integers/u8/gt.leo deleted file mode 100644 index 87843f575f..0000000000 --- a/tests/old/pass/integers/u8/gt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u8, b: u8, c: bool) { - console.assert(a > b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/input.leo b/tests/old/pass/integers/u8/input.leo deleted file mode 100644 index 4d99dc106c..0000000000 --- a/tests/old/pass/integers/u8/input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u8, b: u8) { - console.assert(a == b); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/le.leo b/tests/old/pass/integers/u8/le.leo deleted file mode 100644 index 2607b7f3d1..0000000000 --- a/tests/old/pass/integers/u8/le.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u8, b: u8, c: bool) { - console.assert(a <= b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/lt.leo b/tests/old/pass/integers/u8/lt.leo deleted file mode 100644 index 7495d0fe37..0000000000 --- a/tests/old/pass/integers/u8/lt.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u8, b: u8, c: bool) { - console.assert(a < b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/max.leo b/tests/old/pass/integers/u8/max.leo deleted file mode 100644 index 03e82c9a5e..0000000000 --- a/tests/old/pass/integers/u8/max.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u8 = 255; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/max_fail.leo b/tests/old/pass/integers/u8/max_fail.leo deleted file mode 100644 index 01bb544601..0000000000 --- a/tests/old/pass/integers/u8/max_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u8 = 256; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/min.leo b/tests/old/pass/integers/u8/min.leo deleted file mode 100644 index 1db08a07b5..0000000000 --- a/tests/old/pass/integers/u8/min.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u8 = 0; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/min_fail.leo b/tests/old/pass/integers/u8/min_fail.leo deleted file mode 100644 index 3cd8d46de7..0000000000 --- a/tests/old/pass/integers/u8/min_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: u8 = -1; -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/mod.rs b/tests/old/pass/integers/u8/mod.rs deleted file mode 100644 index a61e28246d..0000000000 --- a/tests/old/pass/integers/u8/mod.rs +++ /dev/null @@ -1,118 +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::{ - assert_satisfied, - expect_asg_error, - expect_compiler_error, - generate_main_input, - integers::IntegerTester, - parse_program, -}; -use leo_ast::InputValue; -use leo_input::types::{IntegerType, U8Type, UnsignedIntegerType}; - -test_uint!( - TestU8, - u8, - IntegerType::Unsigned(UnsignedIntegerType::U8Type(U8Type {})), - UInt8 -); - -#[test] -fn test_u8_min() { - TestU8::test_min(); -} - -#[test] -fn test_u8_min_fail() { - TestU8::test_min_fail(); -} - -#[test] -fn test_u8_max() { - TestU8::test_max(); -} - -#[test] -fn test_u8_max_fail() { - TestU8::test_max_fail(); -} - -#[test] -fn test_u8_add() { - TestU8::test_add(); -} - -#[test] -fn test_u8_sub() { - TestU8::test_sub(); -} - -#[test] -fn test_u8_mul() { - TestU8::test_mul(); -} - -#[test] -fn test_u8_div() { - TestU8::test_div(); -} - -#[test] -fn test_u8_pow() { - TestU8::test_pow(); -} - -#[test] -fn test_u8_eq() { - TestU8::test_eq(); -} - -#[test] -fn test_u8_ne() { - TestU8::test_ne(); -} - -#[test] -fn test_u8_ge() { - TestU8::test_ge(); -} - -#[test] -fn test_u8_gt() { - TestU8::test_gt(); -} - -#[test] -fn test_u8_le() { - TestU8::test_le(); -} - -#[test] -fn test_u8_lt() { - TestU8::test_lt(); -} - -#[test] -fn test_u8_console_assert() { - TestU8::test_console_assert(); -} - -#[test] -fn test_u8_ternary() { - TestU8::test_ternary(); -} diff --git a/tests/old/pass/integers/u8/mul.leo b/tests/old/pass/integers/u8/mul.leo deleted file mode 100644 index 11acf4688b..0000000000 --- a/tests/old/pass/integers/u8/mul.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u8, b: u8, c: u8) { - console.assert(a * b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/ne.leo b/tests/old/pass/integers/u8/ne.leo deleted file mode 100644 index e75194a2f2..0000000000 --- a/tests/old/pass/integers/u8/ne.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u8, b: u8, c: bool) { - console.assert(a != b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/pow.leo b/tests/old/pass/integers/u8/pow.leo deleted file mode 100644 index 928ab73b0d..0000000000 --- a/tests/old/pass/integers/u8/pow.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u8, b: u8, c: u8) { - console.assert(a ** b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/sub.leo b/tests/old/pass/integers/u8/sub.leo deleted file mode 100644 index 1335409c29..0000000000 --- a/tests/old/pass/integers/u8/sub.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: u8, b: u8, c: u8) { - console.assert(a - b == c); -} \ No newline at end of file diff --git a/tests/old/pass/integers/u8/ternary.leo b/tests/old/pass/integers/u8/ternary.leo deleted file mode 100644 index 5123a511cd..0000000000 --- a/tests/old/pass/integers/u8/ternary.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main(s: bool, a: u8, b: u8, c: u8) { - const r = s ? a : b; - - console.assert(r == c); -} \ No newline at end of file diff --git a/tests/old/pass/mutability/array.leo b/tests/old/pass/mutability/array.leo deleted file mode 100644 index ea63baaad2..0000000000 --- a/tests/old/pass/mutability/array.leo +++ /dev/null @@ -1,5 +0,0 @@ -// Arrays are immutable by default. -function main() { - const a = [1u32]; - a[0] = 0; -} \ No newline at end of file diff --git a/tests/old/pass/mutability/array_mut.leo b/tests/old/pass/mutability/array_mut.leo deleted file mode 100644 index 5d4db3b68a..0000000000 --- a/tests/old/pass/mutability/array_mut.leo +++ /dev/null @@ -1,7 +0,0 @@ -// Adding the `mut` keyword makes an array variable mutable. -function main() { - let a = [1u32]; - a[0] = 0; - - console.assert(a[0] == 0u32); -} \ No newline at end of file diff --git a/tests/old/pass/mutability/array_splice_mut.leo b/tests/old/pass/mutability/array_splice_mut.leo deleted file mode 100644 index d13216600a..0000000000 --- a/tests/old/pass/mutability/array_splice_mut.leo +++ /dev/null @@ -1,9 +0,0 @@ -// Adding the `mut` keyword makes an array variable mutable. -function main() { - let a = [1u32, 2u32, 3u32]; - a[0u32..2u32] = [4u32, 5u32]; - - console.assert(a[0] == 4u32); - console.assert(a[1] == 5u32); - console.assert(a[2] == 3u32); -} \ No newline at end of file diff --git a/tests/old/pass/mutability/array_tuple_mut.leo b/tests/old/pass/mutability/array_tuple_mut.leo deleted file mode 100644 index ed323d46da..0000000000 --- a/tests/old/pass/mutability/array_tuple_mut.leo +++ /dev/null @@ -1,8 +0,0 @@ -// Adding the `mut` keyword makes an array variable mutable. -function main() { - let a = [(1u32, 2u32)]; - a[0u32].1 = 3u32; - - console.assert(a[0u32].0 == 1u32); - console.assert(a[0u32].1 == 3u32); -} \ No newline at end of file diff --git a/tests/old/pass/mutability/circuit.leo b/tests/old/pass/mutability/circuit.leo deleted file mode 100644 index 508595ef16..0000000000 --- a/tests/old/pass/mutability/circuit.leo +++ /dev/null @@ -1,9 +0,0 @@ -// Circuits are immutable by default. -circuit Foo { - x: u32 -} - -function main() { - const a = Foo { x: 1 }; - a.x = 0; -} \ No newline at end of file diff --git a/tests/old/pass/mutability/circuit_function_mut.leo b/tests/old/pass/mutability/circuit_function_mut.leo deleted file mode 100644 index c1bc941c94..0000000000 --- a/tests/old/pass/mutability/circuit_function_mut.leo +++ /dev/null @@ -1,9 +0,0 @@ -// Adding the `mut` keyword makes a circuit variable mutable. -circuit Foo { - function bar() {} -} - -function main() { - let a = Foo { x: 1 }; - a.bar = 0; -} \ No newline at end of file diff --git a/tests/old/pass/mutability/circuit_mut.leo b/tests/old/pass/mutability/circuit_mut.leo deleted file mode 100644 index f7067db11e..0000000000 --- a/tests/old/pass/mutability/circuit_mut.leo +++ /dev/null @@ -1,11 +0,0 @@ -// Adding the `mut` keyword makes a circuit variable mutable. -circuit Foo { - x: u32 -} - -function main() { - let a = Foo { x: 1 }; - a.x = 0; - - console.assert(a.x == 0u32); -} \ No newline at end of file diff --git a/tests/old/pass/mutability/circuit_static_function_mut.leo b/tests/old/pass/mutability/circuit_static_function_mut.leo deleted file mode 100644 index c1bc941c94..0000000000 --- a/tests/old/pass/mutability/circuit_static_function_mut.leo +++ /dev/null @@ -1,9 +0,0 @@ -// Adding the `mut` keyword makes a circuit variable mutable. -circuit Foo { - function bar() {} -} - -function main() { - let a = Foo { x: 1 }; - a.bar = 0; -} \ No newline at end of file diff --git a/tests/old/pass/mutability/circuit_variable_mut.leo b/tests/old/pass/mutability/circuit_variable_mut.leo deleted file mode 100644 index f7067db11e..0000000000 --- a/tests/old/pass/mutability/circuit_variable_mut.leo +++ /dev/null @@ -1,11 +0,0 @@ -// Adding the `mut` keyword makes a circuit variable mutable. -circuit Foo { - x: u32 -} - -function main() { - let a = Foo { x: 1 }; - a.x = 0; - - console.assert(a.x == 0u32); -} \ No newline at end of file diff --git a/tests/old/pass/mutability/const.leo b/tests/old/pass/mutability/const.leo deleted file mode 100644 index 6201e7c5af..0000000000 --- a/tests/old/pass/mutability/const.leo +++ /dev/null @@ -1,5 +0,0 @@ -// Let variables are immutable by default. -function main() { - const a = 1u32; - a = 0; -} \ No newline at end of file diff --git a/tests/old/pass/mutability/function_input.leo b/tests/old/pass/mutability/function_input.leo deleted file mode 100644 index 1ef3ce1f02..0000000000 --- a/tests/old/pass/mutability/function_input.leo +++ /dev/null @@ -1,4 +0,0 @@ -// Function input are immutable by default. -function main(a: bool) { - a = false; -} \ No newline at end of file diff --git a/tests/old/pass/mutability/function_input_mut.leo b/tests/old/pass/mutability/function_input_mut.leo deleted file mode 100644 index 98739d78c7..0000000000 --- a/tests/old/pass/mutability/function_input_mut.leo +++ /dev/null @@ -1,6 +0,0 @@ -// Function input are mutable by default. -function main(a: bool) { - a = true; - - console.assert(a == true); -} \ No newline at end of file diff --git a/tests/old/pass/mutability/let.leo b/tests/old/pass/mutability/let.leo deleted file mode 100644 index 105730adb7..0000000000 --- a/tests/old/pass/mutability/let.leo +++ /dev/null @@ -1,5 +0,0 @@ -// Variables are immutable by default. -function main() { - const a = 1u32; - a = 0; -} \ No newline at end of file diff --git a/tests/old/pass/mutability/let_mut.leo b/tests/old/pass/mutability/let_mut.leo deleted file mode 100644 index cd1060d0d2..0000000000 --- a/tests/old/pass/mutability/let_mut.leo +++ /dev/null @@ -1,7 +0,0 @@ -// Adding the `mut` keyword makes a variable mutable. -function main() { - let a = 1u32; - a = 0; - - console.assert(a == 0u32); -} \ No newline at end of file diff --git a/tests/old/pass/mutability/let_mut_nested.leo b/tests/old/pass/mutability/let_mut_nested.leo deleted file mode 100644 index 93236ef4c6..0000000000 --- a/tests/old/pass/mutability/let_mut_nested.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main () { - let x = 2u8; - let y = x; - const z = y / 2u8; -} \ No newline at end of file diff --git a/tests/old/pass/mutability/swap.leo b/tests/old/pass/mutability/swap.leo deleted file mode 100644 index d0d663ea1a..0000000000 --- a/tests/old/pass/mutability/swap.leo +++ /dev/null @@ -1,20 +0,0 @@ -// Swap two elements of an array. -function swap(a: [u32; 2], const i: u32, const j: u32) -> [u32; 2] { - const t = a[i]; - a[i] = a[j]; - a[j] = t; - return a; -} - -function main() { - let arr: [u32; 2] = [0, 1]; - const expected: [u32; 2] = [1, 0]; - - // Do swap. - const actual = swap(arr, 0, 1); - - // Check result. - for i in 0..2 { - console.assert(expected[i] == actual[i]); - } -} \ No newline at end of file diff --git a/tests/old/pass/statements/assert.leo b/tests/old/pass/statements/assert.leo deleted file mode 100644 index f3d20b461d..0000000000 --- a/tests/old/pass/statements/assert.leo +++ /dev/null @@ -1,7 +0,0 @@ -function main(a: u32) { - if a == 1 { - console.assert(a == 1); - } else { - console.assert(a == 0); - } -} diff --git a/tests/old/pass/statements/block.leo b/tests/old/pass/statements/block.leo deleted file mode 100644 index ca8da645ec..0000000000 --- a/tests/old/pass/statements/block.leo +++ /dev/null @@ -1,9 +0,0 @@ -function main() { - let x = 4u32; - - { - x = 5u32; - } - - console.assert(x == 5u32); -} \ No newline at end of file diff --git a/tests/old/pass/statements/chain.leo b/tests/old/pass/statements/chain.leo deleted file mode 100644 index 44d4e86243..0000000000 --- a/tests/old/pass/statements/chain.leo +++ /dev/null @@ -1,13 +0,0 @@ -function main(a: u32, b: u32) { - let c = 0u32; - - if a == 1 { - c = 1; - } else if a == 2 { - c = 2; - } else { - c = 3; - } - - console.assert(c == b); -} \ No newline at end of file diff --git a/tests/old/pass/statements/for_loop.leo b/tests/old/pass/statements/for_loop.leo deleted file mode 100644 index db307f3c36..0000000000 --- a/tests/old/pass/statements/for_loop.leo +++ /dev/null @@ -1,13 +0,0 @@ -function main(a: bool) { - let b = 0u32; - - if a { - for i in 0..4 { - b += i; - } - } - - const r: u32 = a ? 6 : 0; - - console.assert(r == b); -} diff --git a/tests/old/pass/statements/iteration_basic.leo b/tests/old/pass/statements/iteration_basic.leo deleted file mode 100644 index 5d74e69a1f..0000000000 --- a/tests/old/pass/statements/iteration_basic.leo +++ /dev/null @@ -1,8 +0,0 @@ -function main() { - let x = 4u32; - for i in 0..3 { - x -= 1; - } - - console.assert(x == 1u32); -} \ No newline at end of file diff --git a/tests/old/pass/statements/multiple_returns.leo b/tests/old/pass/statements/multiple_returns.leo deleted file mode 100644 index f2b9e499c2..0000000000 --- a/tests/old/pass/statements/multiple_returns.leo +++ /dev/null @@ -1,7 +0,0 @@ -function main() -> u32 { - if input.registers.a == 0u32 { - return 0u32; - } else { - return 1u32; - } -} \ No newline at end of file diff --git a/tests/old/pass/statements/mutate.leo b/tests/old/pass/statements/mutate.leo deleted file mode 100644 index 9bb124eefd..0000000000 --- a/tests/old/pass/statements/mutate.leo +++ /dev/null @@ -1,15 +0,0 @@ -function main(a: u32) { - let b = 5u32; - - if a == 1 { - b = 1; - } else { - b = 0; - } - - if a == 1 { - console.assert(b == 1); - } else { - console.assert(b == 0); - } -} diff --git a/tests/old/pass/statements/nested.leo b/tests/old/pass/statements/nested.leo deleted file mode 100644 index 1849c2a339..0000000000 --- a/tests/old/pass/statements/nested.leo +++ /dev/null @@ -1,12 +0,0 @@ -function main(a: bool, b: bool, c: u32) { - let d = 0u32; - - if a { - d += 1; - if b { - d += 2; - } - } - - console.assert(d == c); -} \ No newline at end of file diff --git a/tests/old/pass/statements/num_returns_fail.leo b/tests/old/pass/statements/num_returns_fail.leo deleted file mode 100644 index e8d491caed..0000000000 --- a/tests/old/pass/statements/num_returns_fail.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() -> (bool, bool) { - return true; -} \ No newline at end of file diff --git a/tests/old/pass/statements/ternary_basic.leo b/tests/old/pass/statements/ternary_basic.leo deleted file mode 100644 index 38359004a9..0000000000 --- a/tests/old/pass/statements/ternary_basic.leo +++ /dev/null @@ -1,5 +0,0 @@ -function main(a: bool, b: bool) { - const c = a ? true : false; - - const d = c == b; -} \ No newline at end of file diff --git a/tests/old/pass/syntax/compare_mismatched_types.leo b/tests/old/pass/syntax/compare_mismatched_types.leo deleted file mode 100644 index 1ac81ab098..0000000000 --- a/tests/old/pass/syntax/compare_mismatched_types.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a = -5i8 > 342u32; -} \ No newline at end of file diff --git a/tests/old/pass/syntax/undefined.leo b/tests/old/pass/syntax/undefined.leo deleted file mode 100644 index 0ab97f6cb0..0000000000 --- a/tests/old/pass/syntax/undefined.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() -> bool { - return a; -} \ No newline at end of file diff --git a/tests/old/pass/tuples/access.leo b/tests/old/pass/tuples/access.leo deleted file mode 100644 index 9277f4ecc5..0000000000 --- a/tests/old/pass/tuples/access.leo +++ /dev/null @@ -1,6 +0,0 @@ -function main() { - const a = (true, false); - - console.assert(a.0 == true); - console.assert(a.1 == false); -} \ No newline at end of file diff --git a/tests/old/pass/tuples/basic.leo b/tests/old/pass/tuples/basic.leo deleted file mode 100644 index 2e777f2797..0000000000 --- a/tests/old/pass/tuples/basic.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a = (true, false); -} \ No newline at end of file diff --git a/tests/old/pass/tuples/function.leo b/tests/old/pass/tuples/function.leo deleted file mode 100644 index a5a0dda085..0000000000 --- a/tests/old/pass/tuples/function.leo +++ /dev/null @@ -1,10 +0,0 @@ -function foo() -> (bool, bool) { - return (true, false); -} - -function main() { - const a = foo(); - - console.assert(a.0 == true); - console.assert(a.1 == false); -} \ No newline at end of file diff --git a/tests/old/pass/tuples/function_multiple.leo b/tests/old/pass/tuples/function_multiple.leo deleted file mode 100644 index 09688207cd..0000000000 --- a/tests/old/pass/tuples/function_multiple.leo +++ /dev/null @@ -1,10 +0,0 @@ -function foo() -> (bool, bool) { - return (true, false); -} - -function main() { - const (a, b) = foo(); - - console.assert(a == true); - console.assert(b == false); -} \ No newline at end of file diff --git a/tests/old/pass/tuples/function_typed.leo b/tests/old/pass/tuples/function_typed.leo deleted file mode 100644 index ebd2e1201d..0000000000 --- a/tests/old/pass/tuples/function_typed.leo +++ /dev/null @@ -1,10 +0,0 @@ -function foo() -> (bool, bool) { - return (true, false); -} - -function main() { - const a: (bool, bool) = foo(); - - console.assert(a.0 == true); - console.assert(a.1 == false); -} \ No newline at end of file diff --git a/tests/old/pass/tuples/input.leo b/tests/old/pass/tuples/input.leo deleted file mode 100644 index f7672a3b03..0000000000 --- a/tests/old/pass/tuples/input.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: (bool, bool)) { - -} \ No newline at end of file diff --git a/tests/old/pass/tuples/multiple.leo b/tests/old/pass/tuples/multiple.leo deleted file mode 100644 index 2cb003b0e1..0000000000 --- a/tests/old/pass/tuples/multiple.leo +++ /dev/null @@ -1,6 +0,0 @@ -function main() { - const (a, b) = (true, false); - - console.assert(a == true); - console.assert(b == false); -} \ No newline at end of file diff --git a/tests/old/pass/tuples/multiple_typed.leo b/tests/old/pass/tuples/multiple_typed.leo deleted file mode 100644 index bbe4a01858..0000000000 --- a/tests/old/pass/tuples/multiple_typed.leo +++ /dev/null @@ -1,6 +0,0 @@ -function main() { - const (a, b): (bool, bool) = (true, false); - - console.assert(a == true); - console.assert(b == false); -} \ No newline at end of file diff --git a/tests/old/pass/tuples/nested.leo b/tests/old/pass/tuples/nested.leo deleted file mode 100644 index bbdb2394a8..0000000000 --- a/tests/old/pass/tuples/nested.leo +++ /dev/null @@ -1,4 +0,0 @@ -function main() { - const a = (true, false); - const b = (true, a); -} \ No newline at end of file diff --git a/tests/old/pass/tuples/nested_access.leo b/tests/old/pass/tuples/nested_access.leo deleted file mode 100644 index f21fa59bba..0000000000 --- a/tests/old/pass/tuples/nested_access.leo +++ /dev/null @@ -1,8 +0,0 @@ -function main() { - const a = (true, false); - const b = (true, a); - - console.assert(b.0 == true); - console.assert(b.1.0 == true); - console.assert(b.1.1 == false); -} \ No newline at end of file diff --git a/tests/old/pass/tuples/nested_typed.leo b/tests/old/pass/tuples/nested_typed.leo deleted file mode 100644 index 44a10b2a3e..0000000000 --- a/tests/old/pass/tuples/nested_typed.leo +++ /dev/null @@ -1,4 +0,0 @@ -function main() { - const a = (true, false); - const b: (bool, (bool, bool)) = (true, a); -} \ No newline at end of file diff --git a/tests/old/pass/tuples/typed.leo b/tests/old/pass/tuples/typed.leo deleted file mode 100644 index 8f623fc148..0000000000 --- a/tests/old/pass/tuples/typed.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const a: (bool, bool) = (true, false); -} \ No newline at end of file diff --git a/tests/parser/functions/input_typed_fail.leo.out b/tests/parser/functions/input_typed_fail.leo.out deleted file mode 100644 index c35229cc21..0000000000 --- a/tests/parser/functions/input_typed_fail.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - " --> test:3:17\n |\n 3 | function x(input: u32) {\n | ^\n |\n = expected ')' -- got ':'" From 8c497f0b7ad84daf061ef299ee53741c1bd946a9 Mon Sep 17 00:00:00 2001 From: gluax Date: Mon, 19 Apr 2021 13:53:49 -0400 Subject: [PATCH 25/41] more test coverage --- ast/src/errors/combiner.rs | 8 +------- ast/src/reducer/canonicalization.rs | 9 ++++----- .../tests/canonicalization/illegal_array_range_fail.leo | 4 ++++ compiler/tests/canonicalization/mod.rs | 8 ++++++++ 4 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 compiler/tests/canonicalization/illegal_array_range_fail.leo diff --git a/ast/src/errors/combiner.rs b/ast/src/errors/combiner.rs index 7c8aa72375..5a1022db27 100644 --- a/ast/src/errors/combiner.rs +++ b/ast/src/errors/combiner.rs @@ -35,15 +35,9 @@ impl CombinerError { Self::new_from_span(message, span) } - pub fn illegal_compound_array_access(span: &Span) -> Self { + pub fn illegal_compound_array_range(span: &Span) -> Self { let message = "Illegal compound assignement with array range".to_string(); Self::new_from_span(message, span) } - - pub fn illegal_compound_operation(span: &Span) -> Self { - let message = "Illegal compound assignment operator =".to_string(); - - Self::new_from_span(message, span) - } } diff --git a/ast/src/reducer/canonicalization.rs b/ast/src/reducer/canonicalization.rs index bdba3ab7f8..7237d88d69 100644 --- a/ast/src/reducer/canonicalization.rs +++ b/ast/src/reducer/canonicalization.rs @@ -69,7 +69,7 @@ impl Canonicalizer { span: span.clone(), })); } - _ => return Err(ReducerError::from(CombinerError::illegal_compound_array_access(&span))), + _ => return Err(ReducerError::from(CombinerError::illegal_compound_array_range(&span))), } } @@ -79,10 +79,9 @@ impl Canonicalizer { pub fn compound_operation_converstion( &mut self, operation: &AssignOperation, - span: &Span, ) -> Result { match operation { - AssignOperation::Assign => Err(ReducerError::from(CombinerError::illegal_compound_operation(&span))), + AssignOperation::Assign => unreachable!(), AssignOperation::Add => Ok(BinaryOperation::Add), AssignOperation::Sub => Ok(BinaryOperation::Sub), AssignOperation::Mul => Ok(BinaryOperation::Mul), @@ -550,7 +549,7 @@ impl ReconstructingReducer for Canonicalizer { &assign.span, )?; let right = Box::new(Expression::Binary(binary_expr)); - let op = self.compound_operation_converstion(&assign.operation, &assign.span)?; + let op = self.compound_operation_converstion(&assign.operation)?; let new_value = Expression::Binary(BinaryExpression { left, @@ -573,7 +572,7 @@ impl ReconstructingReducer for Canonicalizer { &assign.span, )?; let right = Box::new(Expression::Value(value_expr)); - let op = self.compound_operation_converstion(&assign.operation, &assign.span)?; + let op = self.compound_operation_converstion(&assign.operation)?; let new_value = Expression::Binary(BinaryExpression { left, diff --git a/compiler/tests/canonicalization/illegal_array_range_fail.leo b/compiler/tests/canonicalization/illegal_array_range_fail.leo new file mode 100644 index 0000000000..af14957712 --- /dev/null +++ b/compiler/tests/canonicalization/illegal_array_range_fail.leo @@ -0,0 +1,4 @@ +function main () { + let x = [1u32; 5]; + x[..2] += 1; +} \ No newline at end of file diff --git a/compiler/tests/canonicalization/mod.rs b/compiler/tests/canonicalization/mod.rs index fd2db5da3f..f420b2370c 100644 --- a/compiler/tests/canonicalization/mod.rs +++ b/compiler/tests/canonicalization/mod.rs @@ -87,3 +87,11 @@ fn test_compound_assignment() { assert_eq!(expected_ast, ast); } + +#[test] +fn test_illegal_array_range_fail() { + // Check program is invalid. + let program_string = include_str!("illegal_array_range_fail.leo"); + let program = parse_program(program_string); + assert!(program.is_err()); +} From 7031923921d086e49b77199e3c0c3d47160a350d Mon Sep 17 00:00:00 2001 From: gluax Date: Mon, 19 Apr 2021 14:36:56 -0400 Subject: [PATCH 26/41] clean up comments --- compiler/tests/type_inference/mod.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/compiler/tests/type_inference/mod.rs b/compiler/tests/type_inference/mod.rs index 8544b51d4e..a294b2500d 100644 --- a/compiler/tests/type_inference/mod.rs +++ b/compiler/tests/type_inference/mod.rs @@ -83,11 +83,3 @@ fn test_for_loop_and_compound() { assert_eq!(expected_ast, ast); } - -// #[test] -// fn test_big_self_outside_circuit_fail() { -// // Check program is invalid. -// let program_string = include_str!("big_self_outside_circuit_fail.leo"); -// let program = parse_program(program_string); -// assert!(program.is_err()); -// } From 6a6e8d536d16e799c3592d65dfc825bc7aa88b55 Mon Sep 17 00:00:00 2001 From: Protryon Date: Mon, 19 Apr 2021 18:16:13 -0700 Subject: [PATCH 27/41] fix package --- leo/api.rs | 4 ++++ leo/commands/package/publish.rs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/leo/api.rs b/leo/api.rs index 0087ebf35d..3843a6663f 100644 --- a/leo/api.rs +++ b/leo/api.rs @@ -70,6 +70,10 @@ impl Api { } } + pub fn host(&self) -> &str { + &*self.host + } + /// Get token for bearer auth, should be passed into Api through Context pub fn auth_token(&self) -> Option { self.auth_token.clone() diff --git a/leo/commands/package/publish.rs b/leo/commands/package/publish.rs index acfe69912f..b90efccb46 100644 --- a/leo/commands/package/publish.rs +++ b/leo/commands/package/publish.rs @@ -17,7 +17,7 @@ use super::build::Build; use crate::{ commands::Command, - context::{Context, PACKAGE_MANAGER_URL}, + context::{Context}, }; use leo_package::{ outputs::OutputsDirectory, @@ -118,7 +118,7 @@ impl Command for Publish { // Make a request to publish a package let response = client - .post(format!("{}{}", PACKAGE_MANAGER_URL, PUBLISH_URL).as_str()) + .post(format!("{}{}", context.api.host(), PUBLISH_URL).as_str()) .headers(headers) .multipart(form_data) .send(); From 62932ceef274519f7a00895550ff9b79878f1a6e Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Mon, 19 Apr 2021 23:24:43 -0700 Subject: [PATCH 28/41] [ABNF] Update documentation of format strings. The documentation comments were out of date. --- grammar/README.md | 101 ++++++++++++--------------------------- grammar/abnf-grammar.txt | 23 --------- 2 files changed, 30 insertions(+), 94 deletions(-) diff --git a/grammar/README.md b/grammar/README.md index 3a970eeafb..8672e92515 100644 --- a/grammar/README.md +++ b/grammar/README.md @@ -475,7 +475,7 @@ Line terminators form whitespace, along with spaces and horizontal tabs. whitespace = space / horizontal-tab / newline ``` -Go to: _[newline](#user-content-newline), [space](#user-content-space), [horizontal-tab](#user-content-horizontal-tab)_; +Go to: _[newline](#user-content-newline), [horizontal-tab](#user-content-horizontal-tab), [space](#user-content-space)_; There are two kinds of comments in Leo, as in other languages. @@ -520,7 +520,7 @@ rest-of-block-comment-after-star = "/" / not-star-or-slash rest-of-block-comment ``` -Go to: _[rest-of-block-comment-after-star](#user-content-rest-of-block-comment-after-star), [not-star-or-slash](#user-content-not-star-or-slash), [rest-of-block-comment](#user-content-rest-of-block-comment)_; +Go to: _[rest-of-block-comment](#user-content-rest-of-block-comment), [not-star-or-slash](#user-content-not-star-or-slash), [rest-of-block-comment-after-star](#user-content-rest-of-block-comment-after-star)_; @@ -625,11 +625,6 @@ Within a format string, sub-strings '{}' are distinguished as containers (these are the ones that may be matched with values whose textual representation replaces the containers in the printed string). -There is an implicit extra-grammatical requirements that -the explicit 'format-string-container' instances include -all the occurrences of '{}' in the parsed character sequence: -that is, there may not be two contiguous 'not-double-quote' instances -that are '{' and '}'. ```abnf @@ -653,7 +648,7 @@ format-string-element = not-double-quote-or-open-brace / format-string-container ``` -Go to: _[not-double-quote-or-open-brace](#user-content-not-double-quote-or-open-brace), [format-string-container](#user-content-format-string-container), [not-double-quote-or-close-brace](#user-content-not-double-quote-or-close-brace)_; +Go to: _[format-string-container](#user-content-format-string-container), [not-double-quote-or-open-brace](#user-content-not-double-quote-or-open-brace), [not-double-quote-or-close-brace](#user-content-not-double-quote-or-close-brace)_; @@ -664,42 +659,6 @@ format-string = double-quote *format-string-element double-quote Go to: _[double-quote](#user-content-double-quote)_; -Here is (part of this ABNF comment), -an alternative way to specify format strings, -which captures the extra-grammatical requirement above in the grammar, -but is more complicated: - - - -``` -not-double-quote-or-open-brace = %x0-22 / %x24-7A / %x7C-10FFFF -``` - - - -``` -not-double-quote-or-close-brace = %x0-22 / %x24-7C / %x7E-10FFFF -``` - - - -``` -format-string-element = not-double-quote-or-open-brace - / "{" not-double-quote-or-close-brace - / format-string-container -``` - - - -``` -format-string = double-quote *format-string-element double-quote -``` - - - -It is not immediately clear which approach is better; there are tradeoffs. -We may choose to adopt this one in future revisions of the grammar. - Annotations have names, which are identifiers immediately preceded by '@'. @@ -814,7 +773,7 @@ atomic-literal = untyped-literal / address-literal ``` -Go to: _[product-group-literal](#user-content-product-group-literal), [untyped-literal](#user-content-untyped-literal), [signed-literal](#user-content-signed-literal), [field-literal](#user-content-field-literal), [boolean-literal](#user-content-boolean-literal), [address-literal](#user-content-address-literal), [unsigned-literal](#user-content-unsigned-literal)_; +Go to: _[untyped-literal](#user-content-untyped-literal), [field-literal](#user-content-field-literal), [product-group-literal](#user-content-product-group-literal), [signed-literal](#user-content-signed-literal), [boolean-literal](#user-content-boolean-literal), [unsigned-literal](#user-content-unsigned-literal), [address-literal](#user-content-address-literal)_; After defining the (mostly) alphanumeric tokens above, @@ -887,7 +846,7 @@ token = keyword / symbol ``` -Go to: _[package-name](#user-content-package-name), [annotation-name](#user-content-annotation-name), [atomic-literal](#user-content-atomic-literal), [format-string](#user-content-format-string), [keyword](#user-content-keyword), [symbol](#user-content-symbol), [identifier](#user-content-identifier)_; +Go to: _[identifier](#user-content-identifier), [atomic-literal](#user-content-atomic-literal), [annotation-name](#user-content-annotation-name), [symbol](#user-content-symbol), [keyword](#user-content-keyword), [package-name](#user-content-package-name), [format-string](#user-content-format-string)_; @@ -923,7 +882,7 @@ signed-type = %s"i8" / %s"i16" / %s"i32" / %s"i64" / %s"i128" integer-type = unsigned-type / signed-type ``` -Go to: _[unsigned-type](#user-content-unsigned-type), [signed-type](#user-content-signed-type)_; +Go to: _[signed-type](#user-content-signed-type), [unsigned-type](#user-content-unsigned-type)_; The integer types, along with the field and group types, @@ -944,7 +903,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: _[group-type](#user-content-group-type), [integer-type](#user-content-integer-type), [field-type](#user-content-field-type)_; The arithmetic types, along with the boolean and address types, @@ -965,7 +924,7 @@ address-type = %s"address" scalar-type = boolean-type / arithmetic-type / address-type ``` -Go to: _[address-type](#user-content-address-type), [boolean-type](#user-content-boolean-type), [arithmetic-type](#user-content-arithmetic-type)_; +Go to: _[arithmetic-type](#user-content-arithmetic-type), [address-type](#user-content-address-type), [boolean-type](#user-content-boolean-type)_; Circuit types are denoted by identifiers and the keyword 'Self'. @@ -1005,7 +964,7 @@ or a tuple of one or more dimensions. array-type = "[" type ";" array-dimensions "]" ``` -Go to: _[array-dimensions](#user-content-array-dimensions), [type](#user-content-type)_; +Go to: _[type](#user-content-type), [array-dimensions](#user-content-array-dimensions)_; @@ -1026,7 +985,7 @@ i.e. types whose values contain (sub-)values aggregate-type = tuple-type / array-type / circuit-type ``` -Go to: _[array-type](#user-content-array-type), [circuit-type](#user-content-circuit-type), [tuple-type](#user-content-tuple-type)_; +Go to: _[circuit-type](#user-content-circuit-type), [tuple-type](#user-content-tuple-type), [array-type](#user-content-array-type)_; Scalar and aggregate types form all the types. @@ -1036,7 +995,7 @@ Scalar and aggregate types form all the types. type = scalar-type / aggregate-type ``` -Go to: _[scalar-type](#user-content-scalar-type), [aggregate-type](#user-content-aggregate-type)_; +Go to: _[aggregate-type](#user-content-aggregate-type), [scalar-type](#user-content-scalar-type)_; The lexical grammar given earlier defines product group literals. @@ -1114,7 +1073,7 @@ primary-expression = identifier / circuit-expression ``` -Go to: _[identifier](#user-content-identifier), [literal](#user-content-literal), [array-expression](#user-content-array-expression), [expression](#user-content-expression), [tuple-expression](#user-content-tuple-expression), [circuit-expression](#user-content-circuit-expression)_; +Go to: _[tuple-expression](#user-content-tuple-expression), [array-expression](#user-content-array-expression), [circuit-expression](#user-content-circuit-expression), [identifier](#user-content-identifier), [literal](#user-content-literal), [expression](#user-content-expression)_; Tuple expressions construct tuples. @@ -1202,7 +1161,7 @@ circuit-construction = circuit-type "{" "}" ``` -Go to: _[circuit-type](#user-content-circuit-type), [circuit-inline-element](#user-content-circuit-inline-element)_; +Go to: _[circuit-inline-element](#user-content-circuit-inline-element), [circuit-type](#user-content-circuit-type)_; @@ -1210,7 +1169,7 @@ Go to: _[circuit-type](#user-content-circuit-type), [circuit-inline-element](#us circuit-inline-element = identifier ":" expression / identifier ``` -Go to: _[identifier](#user-content-identifier), [expression](#user-content-expression)_; +Go to: _[expression](#user-content-expression), [identifier](#user-content-identifier)_; @@ -1261,7 +1220,7 @@ postfix-expression = primary-expression / postfix-expression "[" [expression] ".." [expression] "]" ``` -Go to: _[circuit-type](#user-content-circuit-type), [natural](#user-content-natural), [postfix-expression](#user-content-postfix-expression), [primary-expression](#user-content-primary-expression), [identifier](#user-content-identifier), [function-arguments](#user-content-function-arguments), [expression](#user-content-expression)_; +Go to: _[natural](#user-content-natural), [function-arguments](#user-content-function-arguments), [identifier](#user-content-identifier), [primary-expression](#user-content-primary-expression), [circuit-type](#user-content-circuit-type), [postfix-expression](#user-content-postfix-expression), [expression](#user-content-expression)_; Unary operators have the highest operator precedence. @@ -1289,7 +1248,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. @@ -1313,7 +1272,7 @@ additive-expression = multiplicative-expression / additive-expression "-" multiplicative-expression ``` -Go to: _[multiplicative-expression](#user-content-multiplicative-expression), [additive-expression](#user-content-additive-expression)_; +Go to: _[additive-expression](#user-content-additive-expression), [multiplicative-expression](#user-content-multiplicative-expression)_; Next in the precedence order are ordering relations. @@ -1363,7 +1322,7 @@ disjunctive-expression = conjunctive-expression / disjunctive-expression "||" conjunctive-expression ``` -Go to: _[disjunctive-expression](#user-content-disjunctive-expression), [conjunctive-expression](#user-content-conjunctive-expression)_; +Go to: _[conjunctive-expression](#user-content-conjunctive-expression), [disjunctive-expression](#user-content-disjunctive-expression)_; Finally we have conditional expressions. @@ -1376,7 +1335,7 @@ conditional-expression = disjunctive-expression ":" conditional-expression ``` -Go to: _[conditional-expression](#user-content-conditional-expression), [expression](#user-content-expression), [disjunctive-expression](#user-content-disjunctive-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. @@ -1408,7 +1367,7 @@ statement = expression-statement / block ``` -Go to: _[return-statement](#user-content-return-statement), [variable-definition-statement](#user-content-variable-definition-statement), [assignment-statement](#user-content-assignment-statement), [console-statement](#user-content-console-statement), [expression-statement](#user-content-expression-statement), [loop-statement](#user-content-loop-statement), [conditional-statement](#user-content-conditional-statement), [block](#user-content-block)_; +Go to: _[expression-statement](#user-content-expression-statement), [block](#user-content-block), [variable-definition-statement](#user-content-variable-definition-statement), [conditional-statement](#user-content-conditional-statement), [assignment-statement](#user-content-assignment-statement), [return-statement](#user-content-return-statement), [loop-statement](#user-content-loop-statement), [console-statement](#user-content-console-statement)_; @@ -1451,7 +1410,7 @@ variable-definition-statement = ( %s"let" / %s"const" ) [ ":" 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), [type](#user-content-type), [expression](#user-content-expression)_; @@ -1484,7 +1443,7 @@ conditional-statement = branch / branch %s"else" conditional-statement ``` -Go to: _[branch](#user-content-branch), [conditional-statement](#user-content-conditional-statement), [block](#user-content-block)_; +Go to: _[block](#user-content-block), [branch](#user-content-branch), [conditional-statement](#user-content-conditional-statement)_; A loop statement implicitly defines a loop variable @@ -1540,7 +1499,7 @@ console-call = assert-call / print-call ``` -Go to: _[assert-call](#user-content-assert-call), [print-call](#user-content-print-call)_; +Go to: _[print-call](#user-content-print-call), [assert-call](#user-content-assert-call)_; @@ -1582,7 +1541,7 @@ annotation = annotation-name [ "(" identifier *( "," identifier ) ")" ] ``` -Go to: _[identifier](#user-content-identifier), [annotation-name](#user-content-annotation-name)_; +Go to: _[annotation-name](#user-content-annotation-name), [identifier](#user-content-identifier)_; A function declaration defines a function. @@ -1600,7 +1559,7 @@ function-declaration = *annotation %s"function" identifier block ``` -Go to: _[function-parameters](#user-content-function-parameters), [block](#user-content-block), [type](#user-content-type), [identifier](#user-content-identifier)_; +Go to: _[type](#user-content-type), [block](#user-content-block), [function-parameters](#user-content-function-parameters), [identifier](#user-content-identifier)_; @@ -1610,7 +1569,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)_; @@ -1631,7 +1590,7 @@ Go to: _[function-input](#user-content-function-input)_; function-input = [ %s"const" ] identifier ":" type ``` -Go to: _[identifier](#user-content-identifier), [type](#user-content-type)_; +Go to: _[type](#user-content-type), [identifier](#user-content-identifier)_; @@ -1648,7 +1607,7 @@ member-declaration = member-variable-declaration / member-function-declaration ``` -Go to: _[member-variable-declaration](#user-content-member-variable-declaration), [member-function-declaration](#user-content-member-function-declaration)_; +Go to: _[member-function-declaration](#user-content-member-function-declaration), [member-variable-declaration](#user-content-member-variable-declaration)_; @@ -1705,7 +1664,7 @@ package-path = "*" / "(" package-path *( "," package-path ) [","] ")" ``` -Go to: _[package-path](#user-content-package-path), [identifier](#user-content-identifier), [package-name](#user-content-package-name)_; +Go to: _[package-name](#user-content-package-name), [package-path](#user-content-package-path), [identifier](#user-content-identifier)_; Finally, we define a file as a sequence of zero or more declarations. @@ -1717,7 +1676,7 @@ declaration = import-declaration / circuit-declaration ``` -Go to: _[import-declaration](#user-content-import-declaration), [circuit-declaration](#user-content-circuit-declaration), [function-declaration](#user-content-function-declaration)_; +Go to: _[circuit-declaration](#user-content-circuit-declaration), [import-declaration](#user-content-import-declaration), [function-declaration](#user-content-function-declaration)_; diff --git a/grammar/abnf-grammar.txt b/grammar/abnf-grammar.txt index 8879db4002..3aa8519798 100644 --- a/grammar/abnf-grammar.txt +++ b/grammar/abnf-grammar.txt @@ -452,11 +452,6 @@ package-name = 1*( lowercase-letter / digit ) ; (these are the ones that may be matched with values ; whose textual representation replaces the containers ; in the printed string). -; There is an implicit extra-grammatical requirements that -; the explicit 'format-string-container' instances include -; all the occurrences of '{}' in the parsed character sequence: -; that is, there may not be two contiguous 'not-double-quote' instances -; that are '{' and '}'. format-string-container = "{}" @@ -470,24 +465,6 @@ format-string-element = not-double-quote-or-open-brace format-string = double-quote *format-string-element double-quote -; Here is (part of this ABNF comment), -; an alternative way to specify format strings, -; which captures the extra-grammatical requirement above in the grammar, -; but is more complicated: -; -; not-double-quote-or-open-brace = %x0-22 / %x24-7A / %x7C-10FFFF -; -; not-double-quote-or-close-brace = %x0-22 / %x24-7C / %x7E-10FFFF -; -; format-string-element = not-double-quote-or-open-brace -; / "{" not-double-quote-or-close-brace -; / format-string-container -; -; format-string = double-quote *format-string-element double-quote -; -; It is not immediately clear which approach is better; there are tradeoffs. -; We may choose to adopt this one in future revisions of the grammar. - ; Annotations have names, which are identifiers immediately preceded by '@'. annotation-name = "@" identifier From 53e83eaa41fa371bef9e34a6130ed2212368dbce Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 20 Apr 2021 10:31:55 +0000 Subject: [PATCH 29/41] Bump zip from 0.5.10 to 0.5.12 Bumps [zip](https://github.com/zip-rs/zip) from 0.5.10 to 0.5.12. - [Release notes](https://github.com/zip-rs/zip/releases) - [Commits](https://github.com/zip-rs/zip/commits/v0.5.12) Signed-off-by: dependabot-preview[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a5661976ca..7f1a678193 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3457,9 +3457,9 @@ dependencies = [ [[package]] name = "zip" -version = "0.5.10" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a8977234acab718eb2820494b2f96cbb16004c19dddf88b7445b27381450997" +checksum = "9c83dc9b784d252127720168abd71ea82bf8c3d96b17dc565b5e2a02854f2b27" dependencies = [ "byteorder", "bzip2", From d5783bb0e0f996dc84873ff0c7d1a51dc1add120 Mon Sep 17 00:00:00 2001 From: collin Date: Tue, 20 Apr 2021 14:33:05 -0700 Subject: [PATCH 30/41] fix license --- grammar/README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/grammar/README.md b/grammar/README.md index 62cc0f5c06..391125b8d4 100644 --- a/grammar/README.md +++ b/grammar/README.md @@ -1,18 +1,18 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. +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 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. +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 . +You should have received a copy of the GNU General Public License +along with the Leo library. If not, see . -------- From 89978512af5781eef04da95b81a76066a52b4c0d Mon Sep 17 00:00:00 2001 From: damirka Date: Wed, 21 Apr 2021 19:01:29 +0300 Subject: [PATCH 31/41] fixes clippy and tests --- leo/api.rs | 4 +++- leo/commands/package/publish.rs | 5 +---- leo/context.rs | 4 ++-- leo/main.rs | 6 +----- leo/tests/mod.rs | 2 +- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/leo/api.rs b/leo/api.rs index 3843a6663f..5ef55124a6 100644 --- a/leo/api.rs +++ b/leo/api.rs @@ -104,7 +104,9 @@ impl Api { }; // only one error is possible here - let res = res.send().map_err(|_| anyhow!("Unable to connect to Aleo PM. Check URL if you specified custom API endpoint"))?; + let res = res + .send() + .map_err(|_| anyhow!("Unable to connect to Aleo PM. Check URL if you specified custom API endpoint"))?; // where magic begins route.process(res) diff --git a/leo/commands/package/publish.rs b/leo/commands/package/publish.rs index b90efccb46..cf0971283f 100644 --- a/leo/commands/package/publish.rs +++ b/leo/commands/package/publish.rs @@ -15,10 +15,7 @@ // along with the Leo library. If not, see . use super::build::Build; -use crate::{ - commands::Command, - context::{Context}, -}; +use crate::{commands::Command, context::Context}; use leo_package::{ outputs::OutputsDirectory, root::{ZipFile, AUTHOR_PLACEHOLDER}, diff --git a/leo/context.rs b/leo/context.rs index f0314939ac..0fb96f0a11 100644 --- a/leo/context.rs +++ b/leo/context.rs @@ -51,7 +51,7 @@ impl Context { pub fn create_context(path: PathBuf, api_url: Option) -> Result { let token = config::read_token().ok(); - let api = Api::new(api_url.unwrap_or(PACKAGE_MANAGER_URL.to_string()), token); + let api = Api::new(api_url.unwrap_or_else(|| PACKAGE_MANAGER_URL.to_string()), token); Ok(Context { api, path: Some(path) }) } @@ -60,7 +60,7 @@ pub fn create_context(path: PathBuf, api_url: Option) -> Result pub fn get_context(api_url: Option) -> Result { let token = config::read_token().ok(); - let api = Api::new(api_url.unwrap_or(PACKAGE_MANAGER_URL.to_string()), token); + let api = Api::new(api_url.unwrap_or_else(|| PACKAGE_MANAGER_URL.to_string()), token); Ok(Context { api, path: None }) } diff --git a/leo/main.rs b/leo/main.rs index afd0bee32d..c0bd4bbc76 100644 --- a/leo/main.rs +++ b/leo/main.rs @@ -55,11 +55,7 @@ struct Opt { #[structopt(subcommand)] command: CommandOpts, - #[structopt( - long, - global = true, - help = "Aleo PM API Url" - )] + #[structopt(long, global = true, help = "Aleo PM API Url")] api: Option, #[structopt( diff --git a/leo/tests/mod.rs b/leo/tests/mod.rs index 7bc611f49d..27d310d8ae 100644 --- a/leo/tests/mod.rs +++ b/leo/tests/mod.rs @@ -152,7 +152,7 @@ pub fn leo_update_and_update_automatic() -> Result<()> { /// Create context for Pedersen Hash example fn context() -> Result { let path = PathBuf::from(&PEDERSEN_HASH_PATH); - let context = create_context(path)?; + let context = create_context(path, None)?; Ok(context) } From e08d1f7f3617fd2ed5228aa30e842c2247e41521 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Wed, 21 Apr 2021 10:39:37 -0700 Subject: [PATCH 32/41] [ABNF] Move two rules and add some comments. This does not change the grammar, just its presentation in the file. --- grammar/abnf-grammar.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/grammar/abnf-grammar.txt b/grammar/abnf-grammar.txt index b7aaf08b07..ec983aef9a 100644 --- a/grammar/abnf-grammar.txt +++ b/grammar/abnf-grammar.txt @@ -338,7 +338,14 @@ not-star = %x0-29 / %x2B-10FFFF ; anything but * not-line-feed-or-carriage-return = %x0-9 / %xB-C / %xE-10FFFF ; anything but LF or CR -not-star-or-slash = %x0-29 / %x2B-2E / %x30-10FFFF ; anything but * or / +not-double-quote-or-open-brace = %x0-22 / %x24-7A / %x7C-10FFFF + ; anything but " or { + +not-double-quote-or-close-brace = %x0-22 / %x24-7C / %x7E-10FFFF + ; anything but " or } + +not-star-or-slash = %x0-29 / %x2B-2E / %x30-10FFFF + ; anything but * or / ; Lines in Leo may be terminated via ; a single carriage return, @@ -447,10 +454,6 @@ package-name = 1*( lowercase-letter / digit ) format-string-container = "{}" -not-double-quote-or-open-brace = %x0-22 / %x24-7A / %x7C-10FFFF - -not-double-quote-or-close-brace = %x0-22 / %x24-7C / %x7E-10FFFF - format-string-element = not-double-quote-or-open-brace / "{" not-double-quote-or-close-brace / format-string-container From ac5ca5058a36aba0e3d66147f808c5f11500fac9 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Wed, 21 Apr 2021 10:44:40 -0700 Subject: [PATCH 33/41] [ABNF] Edit some doc comments for consistency. No change to the grammar, just some edits in comments. --- grammar/abnf-grammar.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/grammar/abnf-grammar.txt b/grammar/abnf-grammar.txt index ec983aef9a..b986c6bef7 100644 --- a/grammar/abnf-grammar.txt +++ b/grammar/abnf-grammar.txt @@ -336,7 +336,7 @@ not-double-quote = %x0-22 / %x24-10FFFF ; anything but " not-star = %x0-29 / %x2B-10FFFF ; anything but * not-line-feed-or-carriage-return = %x0-9 / %xB-C / %xE-10FFFF - ; anything but LF or CR + ; anything but or not-double-quote-or-open-brace = %x0-22 / %x24-7A / %x7C-10FFFF ; anything but " or { @@ -999,16 +999,17 @@ file = *declaration ; Format Note ; ----------- -; The ABNF standard requires grammars to consist of lines terminated by CR LF +; The ABNF standard requires grammars to consist of lines terminated by ; (i.e. carriage return followed by line feed, DOS/Windows-style), ; as explained in the background on ABNF earlier in this file. -; This file's lines are therefore terminated by CR LF. +; This file's lines are therefore terminated by . ; To avoid losing this requirement across systems, ; this file is marked as 'text eol=crlf' in .gitattributes: ; this means that the file is textual, enabling visual diffs, -; but its lines will always be terminated by CR LF on any system. +; but its lines will always be terminated by on any system. -; Note that this CR LF requirement only applies to the grammar files themselves. +; Note that this requirement only applies +; to the grammar files themselves. ; It does not apply to the lines of the languages described by the grammar. ; ABNF grammars may describe any kind of languages, ; with any kind of line terminators, From d1c9f0e99cc73e5656cef00dd42cc879388fc966 Mon Sep 17 00:00:00 2001 From: collin Date: Wed, 21 Apr 2021 14:09:15 -0700 Subject: [PATCH 34/41] enable leo clone test --- .circleci/config.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2d9092acee..4dc51b709b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -171,18 +171,18 @@ jobs: export LEO=/home/circleci/project/project/bin/leo ./project/.circleci/leo-login-logout.sh -# leo-clone: -# docker: -# - image: cimg/rust:1.51.0 -# resource_class: xlarge -# steps: -# - attach_workspace: -# at: /home/circleci/project/ -# - run: -# name: leo clone -# command: | -# export LEO=/home/circleci/project/project/bin/leo -# ./project/.circleci/leo-clone.sh + leo-clone: + docker: + - image: cimg/rust:1.51.0 + resource_class: xlarge + steps: + - attach_workspace: + at: /home/circleci/project/ + - run: + name: leo clone + command: | + export LEO=/home/circleci/project/project/bin/leo + ./project/.circleci/leo-clone.sh leo-publish: docker: @@ -222,9 +222,9 @@ workflows: - leo-login-logout: requires: - leo-executable -# - leo-clone: -# requires: -# - leo-executable + - leo-clone: + requires: + - leo-executable - leo-publish: requires: - leo-executable From 0cbea10ed010461eb285de592deef4cbd9071739 Mon Sep 17 00:00:00 2001 From: Collin Chin Date: Wed, 21 Apr 2021 14:54:51 -0700 Subject: [PATCH 35/41] Add test-framework comment --- test-framework/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test-framework/src/lib.rs b/test-framework/src/lib.rs index b8d82df266..48860f2f56 100644 --- a/test-framework/src/lib.rs +++ b/test-framework/src/lib.rs @@ -14,6 +14,14 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . +//! The test framework to run integration tests with Leo code text. +//! +//! This module contains the [`run_tests()`] method which runs all integration tests in the +//! root [`tests/`] directory. +//! +//! 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`]. + pub mod error; pub mod fetch; From de685928e2f76f981e6c1670bbc004410a72f9b0 Mon Sep 17 00:00:00 2001 From: collin Date: Wed, 21 Apr 2021 15:20:22 -0700 Subject: [PATCH 36/41] rename stage -> phase --- compiler/src/lib.rs | 8 ++++---- compiler/src/{stage.rs => phase.rs} | 2 +- compiler/src/{stages => phases}/mod.rs | 4 ++-- .../src/{stages/stage.rs => phases/phase.rs} | 18 +++++++++--------- .../{stages => phases}/reducing_director.rs | 0 compiler/tests/type_inference/mod.rs | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) rename compiler/src/{stage.rs => phase.rs} (97%) rename compiler/src/{stages => phases}/mod.rs (96%) rename compiler/src/{stages/stage.rs => phases/phase.rs} (84%) rename compiler/src/{stages => phases}/reducing_director.rs (100%) diff --git a/compiler/src/lib.rs b/compiler/src/lib.rs index 7e871e49ab..8676703570 100644 --- a/compiler/src/lib.rs +++ b/compiler/src/lib.rs @@ -57,11 +57,11 @@ pub use prelude::*; pub mod value; pub use value::*; -pub mod stage; -pub use stage::*; +pub mod phase; +pub use phase::*; -pub mod stages; -pub use stages::*; +pub mod phases; +pub use phases::*; pub mod option; pub use option::*; diff --git a/compiler/src/stage.rs b/compiler/src/phase.rs similarity index 97% rename from compiler/src/stage.rs rename to compiler/src/phase.rs index ec96dac0fd..7f8d5dcbbd 100644 --- a/compiler/src/stage.rs +++ b/compiler/src/phase.rs @@ -16,6 +16,6 @@ use leo_asg::Program; -pub trait ASGStage { +pub trait ASGPhase { fn apply(asg: &mut Program); } diff --git a/compiler/src/stages/mod.rs b/compiler/src/phases/mod.rs similarity index 96% rename from compiler/src/stages/mod.rs rename to compiler/src/phases/mod.rs index 41658f96af..c409e2f4d5 100644 --- a/compiler/src/stages/mod.rs +++ b/compiler/src/phases/mod.rs @@ -19,5 +19,5 @@ pub mod reducing_director; pub use reducing_director::*; -pub mod stage; -pub use stage::*; +pub mod phase; +pub use phase::*; diff --git a/compiler/src/stages/stage.rs b/compiler/src/phases/phase.rs similarity index 84% rename from compiler/src/stages/stage.rs rename to compiler/src/phases/phase.rs index d388d5b19c..1423fa47fa 100644 --- a/compiler/src/stages/stage.rs +++ b/compiler/src/phases/phase.rs @@ -20,9 +20,9 @@ use crate::{CombineAstAsgDirector, CombinerOptions}; use leo_asg::Program as AsgProgram; use leo_ast::{Ast, Program as AstProgram, ReconstructingReducer, ReducerError}; -macro_rules! stage { - ($stage_name:ident, $function:item) => { - pub struct $stage_name { +macro_rules! phase { + ($phase_name:ident, $function:item) => { + pub struct $phase_name { in_circuit: bool, } @@ -32,7 +32,7 @@ macro_rules! stage { $function } - impl ReconstructingReducer for $stage_name { + impl ReconstructingReducer for $phase_name { fn in_circuit(&self) -> bool { self.in_circuit } @@ -42,14 +42,14 @@ macro_rules! stage { } } - impl Default for $stage_name { + impl Default for $phase_name { fn default() -> Self { Self { in_circuit: false } } } - impl $stage_name { - pub fn stage_ast(&self, ast: &AstProgram, asg: &AsgProgram) -> Result { + impl $phase_name { + pub fn phase_ast(&self, ast: &AstProgram, asg: &AsgProgram) -> Result { Ok(Ast::new(CombineAstAsgDirector::new(Self::default(), Options{}) .reduce_program(ast, asg)?)) } @@ -57,8 +57,8 @@ macro_rules! stage { }; } -stage!( - TypeInferenceStage, +phase!( + TypeInferencePhase, fn type_inference_enabled(&self) -> bool { true } diff --git a/compiler/src/stages/reducing_director.rs b/compiler/src/phases/reducing_director.rs similarity index 100% rename from compiler/src/stages/reducing_director.rs rename to compiler/src/phases/reducing_director.rs diff --git a/compiler/tests/type_inference/mod.rs b/compiler/tests/type_inference/mod.rs index a294b2500d..30f859b099 100644 --- a/compiler/tests/type_inference/mod.rs +++ b/compiler/tests/type_inference/mod.rs @@ -18,7 +18,7 @@ use crate::{assert_satisfied, parse_program}; #[allow(unused)] use leo_asg::{new_context, Asg, AsgContext}; use leo_ast::Ast; -use leo_compiler::TypeInferenceStage; +use leo_compiler::TypeInferencePhase; use leo_imports::ImportParser; use leo_parser::parser; @@ -47,8 +47,8 @@ pub fn parse_program_ast(file_string: &str) -> Ast { let asg = Asg::new(thread_leaked_context(), &program, &mut ImportParser::default()) .expect("Failed to create ASG from AST"); - let new_ast = TypeInferenceStage::default() - .stage_ast(&program, &asg.into_repr()) + let new_ast = TypeInferencePhase::default() + .phase_ast(&program, &asg.into_repr()) .expect("Failed to produce type inference ast."); new_ast From 02f8736d030917de6cc580508e9d2c8180da57fa Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Wed, 21 Apr 2021 21:56:27 -0700 Subject: [PATCH 37/41] [ABNF] Add some documentation. For both uniformity and clarity of reference from other documentation comments, add some documentation comments next to every single character definition. No change to the grammar itself. --- grammar/README.md | 122 +++++++++++++++++++-------------------- grammar/abnf-grammar.txt | 10 ++-- 2 files changed, 66 insertions(+), 66 deletions(-) diff --git a/grammar/README.md b/grammar/README.md index 96f1ea005c..e5f30b6bd0 100644 --- a/grammar/README.md +++ b/grammar/README.md @@ -14,6 +14,7 @@ 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 . + -------- @@ -392,27 +393,27 @@ We give names to certain ASCII characters. ```abnf -horizontal-tab = %x9 +horizontal-tab = %x9 ; ``` ```abnf -line-feed = %xA +line-feed = %xA ; ``` ```abnf -carriage-return = %xD +carriage-return = %xD ; ``` ```abnf -space = %x20 +space = %x20 ; ``` ```abnf -double-quote = %x22 +double-quote = %x22 ; " ``` We give names to complements of certain ASCII characters. @@ -431,12 +432,25 @@ not-star = %x0-29 / %x2B-10FFFF ; anything but * ```abnf not-line-feed-or-carriage-return = %x0-9 / %xB-C / %xE-10FFFF - ; anything but LF or CR + ; anything but or +``` + + +```abnf +not-double-quote-or-open-brace = %x0-22 / %x24-7A / %x7C-10FFFF + ; anything but " or { +``` + + +```abnf +not-double-quote-or-close-brace = %x0-22 / %x24-7C / %x7E-10FFFF + ; anything but " or } ``` ```abnf -not-star-or-slash = %x0-29 / %x2B-2E / %x30-10FFFF ; anything but * or / +not-star-or-slash = %x0-29 / %x2B-2E / %x30-10FFFF + ; anything but * or / ``` Lines in Leo may be terminated via @@ -452,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. @@ -462,7 +476,7 @@ Line terminators form whitespace, along with spaces and horizontal tabs. whitespace = space / horizontal-tab / newline ``` -Go to: _[newline](#user-content-newline), [horizontal-tab](#user-content-horizontal-tab), [space](#user-content-space)_; +Go to: _[horizontal-tab](#user-content-horizontal-tab), [space](#user-content-space), [newline](#user-content-newline)_; There are two kinds of comments in Leo, as in other languages. @@ -480,7 +494,7 @@ the ones used in the Java language reference. comment = block-comment / end-of-line-comment ``` -Go to: _[block-comment](#user-content-block-comment), [end-of-line-comment](#user-content-end-of-line-comment)_; +Go to: _[end-of-line-comment](#user-content-end-of-line-comment), [block-comment](#user-content-block-comment)_; @@ -497,7 +511,7 @@ rest-of-block-comment = "*" rest-of-block-comment-after-star / not-star rest-of-block-comment ``` -Go to: _[rest-of-block-comment-after-star](#user-content-rest-of-block-comment-after-star), [not-star](#user-content-not-star), [rest-of-block-comment](#user-content-rest-of-block-comment)_; +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](#user-content-not-star)_; @@ -507,7 +521,7 @@ rest-of-block-comment-after-star = "/" / not-star-or-slash rest-of-block-comment ``` -Go to: _[rest-of-block-comment](#user-content-rest-of-block-comment), [not-star-or-slash](#user-content-not-star-or-slash), [rest-of-block-comment-after-star](#user-content-rest-of-block-comment-after-star)_; +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)_; @@ -582,7 +596,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)_; An identifier is a non-empty sequence of letters, digits, and underscores, @@ -618,16 +632,6 @@ in the printed string). format-string-container = "{}" ``` - -```abnf -not-double-quote-or-open-brace = %x0-22 / %x24-7A / %x7C-10FFFF -``` - - -```abnf -not-double-quote-or-close-brace = %x0-22 / %x24-7C / %x7E-10FFFF -``` - ```abnf format-string-element = not-double-quote-or-open-brace @@ -635,8 +639,7 @@ format-string-element = not-double-quote-or-open-brace / format-string-container ``` - -Go to: _[format-string-container](#user-content-format-string-container), [not-double-quote-or-open-brace](#user-content-not-double-quote-or-open-brace), [not-double-quote-or-close-brace](#user-content-not-double-quote-or-close-brace)_; +Go to: _[format-string-container](#user-content-format-string-container), [not-double-quote-or-close-brace](#user-content-not-double-quote-or-close-brace), [not-double-quote-or-open-brace](#user-content-not-double-quote-or-open-brace)_; @@ -761,8 +764,7 @@ atomic-literal = untyped-literal / address-literal ``` - -Go to: _[untyped-literal](#user-content-untyped-literal), [field-literal](#user-content-field-literal), [product-group-literal](#user-content-product-group-literal), [signed-literal](#user-content-signed-literal), [boolean-literal](#user-content-boolean-literal), [unsigned-literal](#user-content-unsigned-literal), [address-literal](#user-content-address-literal)_; +Go to: _[field-literal](#user-content-field-literal), [signed-literal](#user-content-signed-literal), [unsigned-literal](#user-content-unsigned-literal), [product-group-literal](#user-content-product-group-literal), [untyped-literal](#user-content-untyped-literal), [boolean-literal](#user-content-boolean-literal), [address-literal](#user-content-address-literal)_; After defining the (mostly) alphanumeric tokens above, @@ -835,8 +837,7 @@ token = keyword / symbol ``` - -Go to: _[identifier](#user-content-identifier), [atomic-literal](#user-content-atomic-literal), [annotation-name](#user-content-annotation-name), [symbol](#user-content-symbol), [keyword](#user-content-keyword), [package-name](#user-content-package-name), [format-string](#user-content-format-string)_; +Go to: _[annotation-name](#user-content-annotation-name), [package-name](#user-content-package-name), [identifier](#user-content-identifier), [format-string](#user-content-format-string), [keyword](#user-content-keyword), [atomic-literal](#user-content-atomic-literal), [symbol](#user-content-symbol)_; @@ -872,7 +873,7 @@ signed-type = %s"i8" / %s"i16" / %s"i32" / %s"i64" / %s"i128" integer-type = unsigned-type / signed-type ``` -Go to: _[signed-type](#user-content-signed-type), [unsigned-type](#user-content-unsigned-type)_; +Go to: _[unsigned-type](#user-content-unsigned-type), [signed-type](#user-content-signed-type)_; The integer types, along with the field and group types, @@ -893,7 +894,7 @@ group-type = %s"group" arithmetic-type = integer-type / field-type / group-type ``` -Go to: _[group-type](#user-content-group-type), [integer-type](#user-content-integer-type), [field-type](#user-content-field-type)_; +Go to: _[integer-type](#user-content-integer-type), [field-type](#user-content-field-type), [group-type](#user-content-group-type)_; The arithmetic types, along with the boolean and address types, @@ -914,7 +915,7 @@ address-type = %s"address" scalar-type = boolean-type / arithmetic-type / address-type ``` -Go to: _[arithmetic-type](#user-content-arithmetic-type), [address-type](#user-content-address-type), [boolean-type](#user-content-boolean-type)_; +Go to: _[boolean-type](#user-content-boolean-type), [address-type](#user-content-address-type), [arithmetic-type](#user-content-arithmetic-type)_; Circuit types are denoted by identifiers and the keyword 'Self'. @@ -975,7 +976,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: _[tuple-type](#user-content-tuple-type), [array-type](#user-content-array-type), [circuit-type](#user-content-circuit-type)_; Scalar and aggregate types form all the types. @@ -1021,7 +1022,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 @@ -1063,8 +1064,7 @@ primary-expression = identifier / circuit-expression ``` - -Go to: _[tuple-expression](#user-content-tuple-expression), [array-expression](#user-content-array-expression), [circuit-expression](#user-content-circuit-expression), [identifier](#user-content-identifier), [literal](#user-content-literal), [expression](#user-content-expression)_; +Go to: _[array-expression](#user-content-array-expression), [literal](#user-content-literal), [circuit-expression](#user-content-circuit-expression), [expression](#user-content-expression), [identifier](#user-content-identifier), [tuple-expression](#user-content-tuple-expression)_; Tuple expressions construct tuples. @@ -1117,7 +1117,7 @@ Go to: _[expression](#user-content-expression)_; array-repeat-construction = "[" expression ";" array-dimensions "]" ``` -Go to: _[array-dimensions](#user-content-array-dimensions), [expression](#user-content-expression)_; +Go to: _[expression](#user-content-expression), [array-dimensions](#user-content-array-dimensions)_; @@ -1160,7 +1160,7 @@ Go to: _[circuit-inline-element](#user-content-circuit-inline-element), [circuit circuit-inline-element = identifier ":" expression / identifier ``` -Go to: _[expression](#user-content-expression), [identifier](#user-content-identifier)_; +Go to: _[identifier](#user-content-identifier), [expression](#user-content-expression)_; @@ -1211,8 +1211,7 @@ postfix-expression = primary-expression / postfix-expression "[" [expression] ".." [expression] "]" ``` - -Go to: _[natural](#user-content-natural), [function-arguments](#user-content-function-arguments), [identifier](#user-content-identifier), [primary-expression](#user-content-primary-expression), [circuit-type](#user-content-circuit-type), [postfix-expression](#user-content-postfix-expression), [expression](#user-content-expression)_; +Go to: _[function-arguments](#user-content-function-arguments), [natural](#user-content-natural), [postfix-expression](#user-content-postfix-expression), [identifier](#user-content-identifier), [primary-expression](#user-content-primary-expression), [expression](#user-content-expression), [circuit-type](#user-content-circuit-type)_; Unary operators have the highest operator precedence. @@ -1226,7 +1225,7 @@ unary-expression = postfix-expression / "-" unary-expression ``` -Go to: _[unary-expression](#user-content-unary-expression), [postfix-expression](#user-content-postfix-expression)_; +Go to: _[postfix-expression](#user-content-postfix-expression), [unary-expression](#user-content-unary-expression)_; Next in the operator precedence is exponentiation, @@ -1240,7 +1239,7 @@ exponential-expression = unary-expression / unary-expression "**" exponential-expression ``` -Go to: _[exponential-expression](#user-content-exponential-expression), [unary-expression](#user-content-unary-expression)_; +Go to: _[unary-expression](#user-content-unary-expression), [exponential-expression](#user-content-exponential-expression)_; Next in precedence come multiplication and division, both left-associative. @@ -1292,7 +1291,7 @@ equality-expression = ordering-expression / equality-expression "!=" ordering-expression ``` -Go to: _[ordering-expression](#user-content-ordering-expression), [equality-expression](#user-content-equality-expression)_; +Go to: _[equality-expression](#user-content-equality-expression), [ordering-expression](#user-content-ordering-expression)_; Next come conjunctive expressions, left-associative. @@ -1314,7 +1313,7 @@ disjunctive-expression = conjunctive-expression / disjunctive-expression "||" conjunctive-expression ``` -Go to: _[conjunctive-expression](#user-content-conjunctive-expression), [disjunctive-expression](#user-content-disjunctive-expression)_; +Go to: _[disjunctive-expression](#user-content-disjunctive-expression), [conjunctive-expression](#user-content-conjunctive-expression)_; Finally we have conditional expressions. @@ -1327,7 +1326,7 @@ conditional-expression = disjunctive-expression ":" conditional-expression ``` -Go to: _[conditional-expression](#user-content-conditional-expression), [disjunctive-expression](#user-content-disjunctive-expression), [expression](#user-content-expression)_; +Go to: _[disjunctive-expression](#user-content-disjunctive-expression), [conditional-expression](#user-content-conditional-expression), [expression](#user-content-expression)_; Those above are all the expressions. @@ -1359,7 +1358,7 @@ statement = expression-statement / block ``` -Go to: _[expression-statement](#user-content-expression-statement), [block](#user-content-block), [variable-definition-statement](#user-content-variable-definition-statement), [conditional-statement](#user-content-conditional-statement), [assignment-statement](#user-content-assignment-statement), [return-statement](#user-content-return-statement), [loop-statement](#user-content-loop-statement), [console-statement](#user-content-console-statement)_; +Go to: _[loop-statement](#user-content-loop-statement), [expression-statement](#user-content-expression-statement), [block](#user-content-block), [return-statement](#user-content-return-statement), [conditional-statement](#user-content-conditional-statement), [console-statement](#user-content-console-statement), [assignment-statement](#user-content-assignment-statement), [variable-definition-statement](#user-content-variable-definition-statement)_; @@ -1402,7 +1401,7 @@ variable-definition-statement = ( %s"let" / %s"const" ) [ ":" type ] "=" expression ";" ``` -Go to: _[identifier-or-identifiers](#user-content-identifier-or-identifiers), [type](#user-content-type), [expression](#user-content-expression)_; +Go to: _[identifier-or-identifiers](#user-content-identifier-or-identifiers), [expression](#user-content-expression), [type](#user-content-type)_; @@ -1435,7 +1434,7 @@ conditional-statement = branch / branch %s"else" conditional-statement ``` -Go to: _[block](#user-content-block), [branch](#user-content-branch), [conditional-statement](#user-content-conditional-statement)_; +Go to: _[branch](#user-content-branch), [conditional-statement](#user-content-conditional-statement), [block](#user-content-block)_; A loop statement implicitly defines a loop variable @@ -1447,7 +1446,7 @@ The body is a block. loop-statement = %s"for" identifier %s"in" expression ".." expression block ``` -Go to: _[block](#user-content-block), [identifier](#user-content-identifier), [expression](#user-content-expression)_; +Go to: _[expression](#user-content-expression), [identifier](#user-content-identifier), [block](#user-content-block)_; An assignment statement is straightforward. @@ -1464,7 +1463,7 @@ assignment-operator = "=" / "+=" / "-=" / "*=" / "/=" / "**=" assignment-statement = expression assignment-operator expression ";" ``` -Go to: _[expression](#user-content-expression), [assignment-operator](#user-content-assignment-operator)_; +Go to: _[assignment-operator](#user-content-assignment-operator), [expression](#user-content-expression)_; Console statements start with the 'console' keyword, @@ -1533,7 +1532,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. @@ -1551,7 +1550,7 @@ function-declaration = *annotation %s"function" identifier block ``` -Go to: _[type](#user-content-type), [block](#user-content-block), [function-parameters](#user-content-function-parameters), [identifier](#user-content-identifier)_; +Go to: _[function-parameters](#user-content-function-parameters), [identifier](#user-content-identifier), [type](#user-content-type), [block](#user-content-block)_; @@ -1561,7 +1560,7 @@ function-parameters = self-parameter / function-inputs ``` -Go to: _[function-inputs](#user-content-function-inputs), [self-parameter](#user-content-self-parameter)_; +Go to: _[self-parameter](#user-content-self-parameter), [function-inputs](#user-content-function-inputs)_; @@ -1582,7 +1581,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)_; @@ -1627,7 +1626,7 @@ circuit-declaration = *annotation %s"circuit" identifier "{" member-declaration *( "," member-declaration ) "}" ``` -Go to: _[identifier](#user-content-identifier), [member-declaration](#user-content-member-declaration)_; +Go to: _[member-declaration](#user-content-member-declaration), [identifier](#user-content-identifier)_; An import declaration consists of the 'import' keyword @@ -1656,7 +1655,7 @@ package-path = "*" / "(" package-path *( "," package-path ) [","] ")" ``` -Go to: _[package-name](#user-content-package-name), [package-path](#user-content-package-path), [identifier](#user-content-identifier)_; +Go to: _[package-path](#user-content-package-path), [identifier](#user-content-identifier), [package-name](#user-content-package-name)_; Finally, we define a file as a sequence of zero or more declarations. @@ -1668,7 +1667,7 @@ declaration = import-declaration / circuit-declaration ``` -Go to: _[circuit-declaration](#user-content-circuit-declaration), [import-declaration](#user-content-import-declaration), [function-declaration](#user-content-function-declaration)_; +Go to: _[function-declaration](#user-content-function-declaration), [import-declaration](#user-content-import-declaration), [circuit-declaration](#user-content-circuit-declaration)_; @@ -1683,16 +1682,17 @@ file = *declaration Format Note ----------- -The ABNF standard requires grammars to consist of lines terminated by CR LF +The ABNF standard requires grammars to consist of lines terminated by (i.e. carriage return followed by line feed, DOS/Windows-style), as explained in the background on ABNF earlier in this file. -This file's lines are therefore terminated by CR LF. +This file's lines are therefore terminated by . To avoid losing this requirement across systems, this file is marked as 'text eol=crlf' in .gitattributes: this means that the file is textual, enabling visual diffs, -but its lines will always be terminated by CR LF on any system. +but its lines will always be terminated by on any system. -Note that this CR LF requirement only applies to the grammar files themselves. +Note that this requirement only applies +to the grammar files themselves. It does not apply to the lines of the languages described by the grammar. ABNF grammars may describe any kind of languages, with any kind of line terminators, diff --git a/grammar/abnf-grammar.txt b/grammar/abnf-grammar.txt index b986c6bef7..83056b2c28 100644 --- a/grammar/abnf-grammar.txt +++ b/grammar/abnf-grammar.txt @@ -318,15 +318,15 @@ character = %x0-10FFFF ; any Unicode code point ; We give names to certain ASCII characters. -horizontal-tab = %x9 +horizontal-tab = %x9 ; -line-feed = %xA +line-feed = %xA ; -carriage-return = %xD +carriage-return = %xD ; -space = %x20 +space = %x20 ; -double-quote = %x22 +double-quote = %x22 ; " ; We give names to complements of certain ASCII characters. ; These consist of all the Unicode characters except for one or two. From df6c4d586c5700b5270ceaea0dc739c83d95ed0d Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Wed, 21 Apr 2021 22:33:52 -0700 Subject: [PATCH 38/41] [ABNF] Use markdown in doc comments, and a few fixes. By using markdown in the documentation comments of the grammar, the markdown file generated from the grammar includes those markdown features in the text, making it more readable and better-looking. Also fixed a few typos in the documentation comments. Also updated a few documentation comments that were out of date after making changes to the grammar. Also removed a now-obsolete grammar rule for "input" parameters of functions. --- grammar/README.md | 225 +++++++++++++++++++-------------------- grammar/abnf-grammar.txt | 158 ++++++++++++++------------- 2 files changed, 188 insertions(+), 195 deletions(-) diff --git a/grammar/README.md b/grammar/README.md index e5f30b6bd0..7d5fe66a6c 100644 --- a/grammar/README.md +++ b/grammar/README.md @@ -57,59 +57,59 @@ without going beyond context-free grammars. Instead of BNF's angle-bracket notation for nonterminals, ABNF uses case-insensitive names consisting of letters, digits, and dashes, -e.g. HTTP-message and IPv6address. +e.g. `HTTP-message` and `IPv6address`. ABNF includes an angle-bracket notation for prose descriptions, -e.g. , +e.g. ``, usable as last resort in the definiens of a nonterminal. While BNF allows arbitrary terminals, ABNF uses only natural numbers as terminals, and denotes them via: (i) binary, decimal, or hexadecimal sequences, -e.g. %b1.11.1010, %d1.3.10, and %x.1.3.A -all denote the sequence of terminals '1 3 10'; +e.g. `%b1.11.1010`, `%d1.3.10`, and `%x.1.3.A` +all denote the sequence of terminals [1, 3, 10]; (ii) binary, decimal, or hexadecimal ranges, -e.g. %x30-39 denotes any singleton sequence of terminals -'n' with 48 <= n <= 57 (an ASCII digit); +e.g. `%x30-39` denotes any singleton sequence of terminals +[_n_] with 48 <= _n_ <= 57 (an ASCII digit); (iii) case-sensitive ASCII strings, -e.g. %s"Ab" denotes the sequence of terminals '65 98'; +e.g. `%s"Ab"` denotes the sequence of terminals [65, 98]; and (iv) case-insensitive ASCII strings, -e.g. %i"ab", or just "ab", denotes +e.g. `%i"ab"`, or just `"ab"`, denotes any sequence of terminals among -'65 66', -'65 98', -'97 66', and -'97 98'. +[65, 66], +[65, 98], +[97, 66], and +[97, 98]. ABNF terminals in suitable sets represent ASCII or Unicode characters. -ABNF allows repetition prefixes n*m, -where n and m are natural numbers in decimal notation; +ABNF allows repetition prefixes `n*m`, +where `n` and `m` are natural numbers in decimal notation; if absent, -n defaults to 0, and -m defaults to infinity. +`n` defaults to 0, and +`m` defaults to infinity. For example, -1*4HEXDIG denotes one to four HEXDIGs, -*3DIGIT denotes up to three DIGITs, and -1*OCTET denotes one or more OCTETs. -A single n prefix -abbreviates n*n, -e.g. 3DIGIT denotes three DIGITs. +`1*4HEXDIG` denotes one to four `HEXDIG`s, +`*3DIGIT` denotes up to three `DIGIT`s, and +`1*OCTET` denotes one or more `OCTET`s. +A single `n` prefix +abbreviates `n*n`, +e.g. `3DIGIT` denotes three `DIGIT`s. -Instead of BNF's |, ABNF uses / to separate alternatives. +Instead of BNF's `|`, ABNF uses `/` to separate alternatives. Repetition prefixes have precedence over juxtapositions, -which have precedence over /. +which have precedence over `/`. Round brackets group things and override the aforementioned precedence rules, -e.g. *(WSP / CRLF WSP) denotes sequences of terminals +e.g. `*(WSP / CRLF WSP)` denotes sequences of terminals obtained by repeating, zero or more times, -either (i) a WSP or (ii) a CRLF followed by a WSP. +either (i) a `WSP` or (ii) a `CRLF` followed by a `WSP`. Square brackets also group things but make them optional, -e.g. [":" port] is equivalent to 0*1(":" port). +e.g. `[":" port]` is equivalent to `0*1(":" port)`. -Instead of BNF's ::=, ABNF uses = to define nonterminals, -and =/ to incrementally add alternatives +Instead of BNF's `::=`, ABNF uses `=` to define nonterminals, +and `=/` to incrementally add alternatives to previously defined nonterminals. -For example, the rule BIT = "0" / "1" -is equivalent to BIT = "0" followed by BIT =/ "1". +For example, the rule `BIT = "0" / "1"` +is equivalent to `BIT = "0"` followed by `BIT =/ "1"`. The syntax of ABNF itself is formally specified in ABNF (in Section 4 of the aforementioned RFC 5234, @@ -131,7 +131,7 @@ Structure This ABNF grammar consists of two (sub-)grammars: (i) a lexical grammar that describes how sequence of characters are parsed into tokens, and -(ii) a syntactic grammar that described how +(ii) a syntactic grammar that describes how tokens are parsed into expressions, statements, etc. The adjectives 'lexical' and 'syntactic' are the same ones used in the Java language reference, @@ -198,8 +198,8 @@ additive-expression = These rules tell us -that the additive operators '+' and '-' have lower precedence -than the multiplicative operators '*' and '/', +that the additive operators `+` and `-` have lower precedence +than the multiplicative operators `*` and `/`, and that both the additive and multiplicative operators associate to the left. This may be best understood via the examples given below. @@ -295,7 +295,7 @@ Naming Convention This ABNF grammar uses nonterminal names that consist of complete English words, separated by dashes, and that describe the construct the way it is in English. -For instance, we use the name 'conditional-statement' +For instance, we use the name `conditional-statement` to describe conditional statements. At the same time, this grammar establishes @@ -354,8 +354,8 @@ Lexical Grammar A Leo file is a finite sequence of Unicode characters, represented as Unicode code points, -which are numbers in the range form 0 to 10FFFFh. -These are captured by the ABNF rule 'character' below. +which are numbers in the range from 0 to 10FFFFh. +These are captured by the ABNF rule `character` below. The lexical grammar defines how, at least conceptually, the sequence of characters is turned into @@ -363,20 +363,20 @@ a sequence of tokens, comments, and whitespaces: these entities are all defined by the grammar rules below. As stated, the lexical grammar alone is ambiguous. -For example, the sequence of characters '**' (i.e. two stars) -could be equally parsed as two '*' symbol tokens or one '**' symbol token -(see rule for 'symbol' below). -As another example, the sequence or characters '' +For example, the sequence of characters `**` (i.e. two stars) +could be equally parsed as two `*` symbol tokens or one `**` symbol token +(see rule for `symbol` below). +As another example, the sequence or characters `` (i.e. carriage return followed by line feed) could be equally parsed as two line terminators or one -(see rule for 'newline'). +(see rule for `newline`). Thus, as often done in language syntax definitions, the lexical grammar is disambiguated by the extra-grammatical requirement that the longest possible sequence of characters is always parsed. -This way, '**' must be parsed as one '**' symbol token, -and '' must be parsed as one line terminator. +This way, `**` must be parsed as one `**` symbol token, +and `` must be parsed as one line terminator. As mentioned above, a character is any Unicode code point. This grammar does not say how those are encoded in files (e.g. UTF-8): @@ -480,12 +480,12 @@ Go to: _[horizontal-tab](#user-content-horizontal-tab), [space](#user-content-sp There are two kinds of comments in Leo, as in other languages. -One is block comments of the form '/* ... */', -and the other is end-of-line comments of the form '// ...'. -The first kind start at '/*' and end at the first '*/', +One is block comments of the form `/* ... */`, +and the other is end-of-line comments of the form `// ...`. +The first kind start at `/*` and end at the first `*/`, possibly spanning multiple (partial) lines; these do no nest. -The second kind start at '//' and extend till the end of the line. +The second kind start at `//` and extend till the end of the line. The rules about comments given below are similar to the ones used in the Java language reference. @@ -511,7 +511,7 @@ rest-of-block-comment = "*" rest-of-block-comment-after-star / not-star rest-of-block-comment ``` -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](#user-content-not-star)_; +Go to: _[not-star](#user-content-not-star), [rest-of-block-comment-after-star](#user-content-rest-of-block-comment-after-star), [rest-of-block-comment](#user-content-rest-of-block-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), [not-star-or-slash](#user-content-not-star-or-slash), [rest-of-block-comment-after-star](#user-content-rest-of-block-comment-after-star)_; @@ -596,7 +596,7 @@ lowercase-letter = %x61-7A ; a-z letter = uppercase-letter / lowercase-letter ``` -Go to: _[lowercase-letter](#user-content-lowercase-letter), [uppercase-letter](#user-content-uppercase-letter)_; +Go to: _[uppercase-letter](#user-content-uppercase-letter), [lowercase-letter](#user-content-lowercase-letter)_; An identifier is a non-empty sequence of letters, digits, and underscores, @@ -622,7 +622,7 @@ package-name = 1*( lowercase-letter / digit ) A format string is a sequence of characters, other than double quote, surrounded by double quotes. -Within a format string, sub-strings '{}' are distinguished as containers +Within a format string, sub-strings `{}` are distinguished as containers (these are the ones that may be matched with values whose textual representation replaces the containers in the printed string). @@ -639,7 +639,7 @@ format-string-element = not-double-quote-or-open-brace / format-string-container ``` -Go to: _[format-string-container](#user-content-format-string-container), [not-double-quote-or-close-brace](#user-content-not-double-quote-or-close-brace), [not-double-quote-or-open-brace](#user-content-not-double-quote-or-open-brace)_; +Go to: _[not-double-quote-or-close-brace](#user-content-not-double-quote-or-close-brace), [format-string-container](#user-content-format-string-container), [not-double-quote-or-open-brace](#user-content-not-double-quote-or-open-brace)_; @@ -650,7 +650,7 @@ format-string = double-quote *format-string-element double-quote Go to: _[double-quote](#user-content-double-quote)_; -Annotations have names, which are identifiers immediately preceded by '@'. +Annotations have names, which are identifiers immediately preceded by `@`. ```abnf @@ -661,7 +661,7 @@ Go to: _[identifier](#user-content-identifier)_; A natural (number) is a sequence of one or more digits. -We allow leading zeros, e.g. '007'. +We allow leading zeros, e.g. `007`. ```abnf @@ -669,7 +669,7 @@ natural = 1*digit ``` An integer (number) is either a natural or its negation. -We allow leading zeros also in negative numbers, e.g. '-007'. +We allow leading zeros also in negative numbers, e.g. `-007`. ```abnf @@ -740,7 +740,7 @@ Boolean literals are the usual two. boolean-literal = %s"true" / %s"false" ``` -An address literal starts with 'aleo1' +An address literal starts with `aleo1` and continues with exactly 58 lowercase letters and digits. Thus an address always consists of 63 characters. @@ -764,16 +764,16 @@ atomic-literal = untyped-literal / address-literal ``` -Go to: _[field-literal](#user-content-field-literal), [signed-literal](#user-content-signed-literal), [unsigned-literal](#user-content-unsigned-literal), [product-group-literal](#user-content-product-group-literal), [untyped-literal](#user-content-untyped-literal), [boolean-literal](#user-content-boolean-literal), [address-literal](#user-content-address-literal)_; +Go to: _[signed-literal](#user-content-signed-literal), [field-literal](#user-content-field-literal), [product-group-literal](#user-content-product-group-literal), [unsigned-literal](#user-content-unsigned-literal), [untyped-literal](#user-content-untyped-literal), [boolean-literal](#user-content-boolean-literal), [address-literal](#user-content-address-literal)_; After defining the (mostly) alphanumeric tokens above, -it remains to define tokens for non-alphanumeric symbols such as "+" and "(". +it remains to define tokens for non-alphanumeric symbols such as `+` and `(`. Different programming languages used different terminologies for these, e.g. operators, separators, punctuators, etc. -Here we use 'symbol', for all of them. +Here we use `symbol`, for all of them. We also include a token consisting of -a closing parenthesis immediately followed by 'group': +a closing parenthesis `)` immediately followed by `group`: as defined in the syntactic grammar, this is the final part of an affine group literal; even though it includes letters, @@ -791,7 +791,7 @@ equality-operator = "==" -and defining 'symbol' in terms of those +and defining `symbol` in terms of those @@ -806,7 +806,7 @@ but it would help establish a terminology in the grammar, namely the exact names of some of these token. On the other hand, at least some of them are perhaps simple enough that they could be just described in terms of their symbols, -e.g. 'double dot', 'question mark', etc. +e.g. double dot, question mark, etc. ```abnf @@ -837,7 +837,7 @@ token = keyword / symbol ``` -Go to: _[annotation-name](#user-content-annotation-name), [package-name](#user-content-package-name), [identifier](#user-content-identifier), [format-string](#user-content-format-string), [keyword](#user-content-keyword), [atomic-literal](#user-content-atomic-literal), [symbol](#user-content-symbol)_; +Go to: _[package-name](#user-content-package-name), [format-string](#user-content-format-string), [symbol](#user-content-symbol), [identifier](#user-content-identifier), [atomic-literal](#user-content-atomic-literal), [annotation-name](#user-content-annotation-name), [keyword](#user-content-keyword)_; @@ -873,7 +873,7 @@ signed-type = %s"i8" / %s"i16" / %s"i32" / %s"i64" / %s"i128" integer-type = unsigned-type / signed-type ``` -Go to: _[unsigned-type](#user-content-unsigned-type), [signed-type](#user-content-signed-type)_; +Go to: _[signed-type](#user-content-signed-type), [unsigned-type](#user-content-unsigned-type)_; The integer types, along with the field and group types, @@ -894,7 +894,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: _[group-type](#user-content-group-type), [field-type](#user-content-field-type), [integer-type](#user-content-integer-type)_; The arithmetic types, along with the boolean and address types, @@ -915,10 +915,10 @@ address-type = %s"address" scalar-type = boolean-type / arithmetic-type / address-type ``` -Go to: _[boolean-type](#user-content-boolean-type), [address-type](#user-content-address-type), [arithmetic-type](#user-content-arithmetic-type)_; +Go to: _[address-type](#user-content-address-type), [arithmetic-type](#user-content-arithmetic-type), [boolean-type](#user-content-boolean-type)_; -Circuit types are denoted by identifiers and the keyword 'Self'. +Circuit types are denoted by identifiers and the keyword `Self`. The latter is only allowed inside a circuit definition, to denote the circuit being defined. @@ -932,7 +932,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. @@ -955,7 +955,7 @@ or a tuple of one or more dimensions. array-type = "[" type ";" array-dimensions "]" ``` -Go to: _[type](#user-content-type), [array-dimensions](#user-content-array-dimensions)_; +Go to: _[array-dimensions](#user-content-array-dimensions), [type](#user-content-type)_; @@ -976,7 +976,7 @@ i.e. types whose values contain (sub-)values aggregate-type = tuple-type / array-type / circuit-type ``` -Go to: _[tuple-type](#user-content-tuple-type), [array-type](#user-content-array-type), [circuit-type](#user-content-circuit-type)_; +Go to: _[array-type](#user-content-array-type), [circuit-type](#user-content-circuit-type), [tuple-type](#user-content-tuple-type)_; Scalar and aggregate types form all the types. @@ -1026,7 +1026,7 @@ Go to: _[atomic-literal](#user-content-atomic-literal), [affine-group-literal](# The following rule is not directly referenced in the rules for expressions -(which reference 'literal' instead), +(which reference `literal` instead), but it is useful to establish terminology: a group literal is either a product group literal or an affine group literal. @@ -1064,7 +1064,7 @@ primary-expression = identifier / circuit-expression ``` -Go to: _[array-expression](#user-content-array-expression), [literal](#user-content-literal), [circuit-expression](#user-content-circuit-expression), [expression](#user-content-expression), [identifier](#user-content-identifier), [tuple-expression](#user-content-tuple-expression)_; +Go to: _[array-expression](#user-content-array-expression), [identifier](#user-content-identifier), [expression](#user-content-expression), [literal](#user-content-literal), [tuple-expression](#user-content-tuple-expression), [circuit-expression](#user-content-circuit-expression)_; Tuple expressions construct tuples. @@ -1089,7 +1089,7 @@ Go to: _[tuple-construction](#user-content-tuple-construction)_; Array expressions construct arrays. There are two kinds: one lists the element expressions (at least one), -including spreads (via '...') which are arrays being spliced in; +including spreads (via `...`) which are arrays being spliced in; the other repeats (the value of) a single expression across one or more dimensions. @@ -1125,7 +1125,7 @@ Go to: _[expression](#user-content-expression), [array-dimensions](#user-content array-construction = array-inline-construction / array-repeat-construction ``` -Go to: _[array-inline-construction](#user-content-array-inline-construction), [array-repeat-construction](#user-content-array-repeat-construction)_; +Go to: _[array-repeat-construction](#user-content-array-repeat-construction), [array-inline-construction](#user-content-array-inline-construction)_; @@ -1148,11 +1148,12 @@ so they are syntactically identical but semantically different. ```abnf circuit-construction = circuit-type "{" - circuit-inline-element *( "," circuit-inline-element ) [ "," ] + circuit-inline-element + *( "," circuit-inline-element ) [ "," ] "}" ``` -Go to: _[circuit-inline-element](#user-content-circuit-inline-element), [circuit-type](#user-content-circuit-type)_; +Go to: _[circuit-type](#user-content-circuit-type), [circuit-inline-element](#user-content-circuit-inline-element)_; @@ -1211,7 +1212,7 @@ postfix-expression = primary-expression / postfix-expression "[" [expression] ".." [expression] "]" ``` -Go to: _[function-arguments](#user-content-function-arguments), [natural](#user-content-natural), [postfix-expression](#user-content-postfix-expression), [identifier](#user-content-identifier), [primary-expression](#user-content-primary-expression), [expression](#user-content-expression), [circuit-type](#user-content-circuit-type)_; +Go to: _[identifier](#user-content-identifier), [function-arguments](#user-content-function-arguments), [natural](#user-content-natural), [circuit-type](#user-content-circuit-type), [primary-expression](#user-content-primary-expression), [postfix-expression](#user-content-postfix-expression), [expression](#user-content-expression)_; Unary operators have the highest operator precedence. @@ -1230,8 +1231,8 @@ Go to: _[postfix-expression](#user-content-postfix-expression), [unary-expressio Next in the operator precedence is exponentiation, following mathematical practice. -The current rule below makes exponentiation left-associative, -i.e. 'a ** b ** c' must be parsed as '(a ** b) ** c'. +The current rule below makes exponentiation right-associative, +i.e. `a ** b ** c` must be parsed as `a ** (b ** c)`. ```abnf @@ -1291,7 +1292,7 @@ equality-expression = ordering-expression / equality-expression "!=" ordering-expression ``` -Go to: _[equality-expression](#user-content-equality-expression), [ordering-expression](#user-content-ordering-expression)_; +Go to: _[ordering-expression](#user-content-ordering-expression), [equality-expression](#user-content-equality-expression)_; Next come conjunctive expressions, left-associative. @@ -1313,7 +1314,7 @@ disjunctive-expression = conjunctive-expression / disjunctive-expression "||" conjunctive-expression ``` -Go to: _[disjunctive-expression](#user-content-disjunctive-expression), [conjunctive-expression](#user-content-conjunctive-expression)_; +Go to: _[conjunctive-expression](#user-content-conjunctive-expression), [disjunctive-expression](#user-content-disjunctive-expression)_; Finally we have conditional expressions. @@ -1358,7 +1359,7 @@ statement = expression-statement / block ``` -Go to: _[loop-statement](#user-content-loop-statement), [expression-statement](#user-content-expression-statement), [block](#user-content-block), [return-statement](#user-content-return-statement), [conditional-statement](#user-content-conditional-statement), [console-statement](#user-content-console-statement), [assignment-statement](#user-content-assignment-statement), [variable-definition-statement](#user-content-variable-definition-statement)_; +Go to: _[return-statement](#user-content-return-statement), [loop-statement](#user-content-loop-statement), [assignment-statement](#user-content-assignment-statement), [expression-statement](#user-content-expression-statement), [console-statement](#user-content-console-statement), [block](#user-content-block), [conditional-statement](#user-content-conditional-statement), [variable-definition-statement](#user-content-variable-definition-statement)_; @@ -1377,8 +1378,7 @@ expression-statement = expression ";" Go to: _[expression](#user-content-expression)_; -A return statement always takes an expression, -and does not end with a semicolon. +A return statement always takes an expression, and ends with a semicolon. ```abnf @@ -1401,7 +1401,7 @@ variable-definition-statement = ( %s"let" / %s"const" ) [ ":" type ] "=" expression ";" ``` -Go to: _[identifier-or-identifiers](#user-content-identifier-or-identifiers), [expression](#user-content-expression), [type](#user-content-type)_; +Go to: _[type](#user-content-type), [identifier-or-identifiers](#user-content-identifier-or-identifiers), [expression](#user-content-expression)_; @@ -1434,7 +1434,7 @@ conditional-statement = branch / branch %s"else" conditional-statement ``` -Go to: _[branch](#user-content-branch), [conditional-statement](#user-content-conditional-statement), [block](#user-content-block)_; +Go to: _[block](#user-content-block), [conditional-statement](#user-content-conditional-statement), [branch](#user-content-branch)_; A loop statement implicitly defines a loop variable @@ -1446,11 +1446,11 @@ The body is a block. loop-statement = %s"for" identifier %s"in" expression ".." expression block ``` -Go to: _[expression](#user-content-expression), [identifier](#user-content-identifier), [block](#user-content-block)_; +Go to: _[block](#user-content-block), [expression](#user-content-expression), [identifier](#user-content-identifier)_; An assignment statement is straightforward. -Based on the operator, the assignment may be simple (i.e. '=') +Based on the operator, the assignment may be simple (i.e. `=`) or compound (i.e. combining assignment with an arithmetic operation). @@ -1463,16 +1463,16 @@ assignment-operator = "=" / "+=" / "-=" / "*=" / "/=" / "**=" assignment-statement = expression assignment-operator expression ";" ``` -Go to: _[assignment-operator](#user-content-assignment-operator), [expression](#user-content-expression)_; +Go to: _[expression](#user-content-expression), [assignment-operator](#user-content-assignment-operator)_; -Console statements start with the 'console' keyword, +Console statements start with the `console` keyword, followed by a console function call. The call may be an assertion or a print command. The former takes an expression (which must be boolean) as argument. The latter takes either no argument, or a format string followed by expressions, -whose number must match the number of containers '{}' in the format string. +whose number must match the number of containers `{}` in the format string. Note that the console function names are identifiers, not keywords. There are three kinds of print commands. @@ -1490,7 +1490,7 @@ console-call = assert-call / print-call ``` -Go to: _[print-call](#user-content-print-call), [assert-call](#user-content-assert-call)_; +Go to: _[assert-call](#user-content-assert-call), [print-call](#user-content-print-call)_; @@ -1519,10 +1519,10 @@ Go to: _[format-string](#user-content-format-string)_; print-call = print-function print-arguments ``` -Go to: _[print-function](#user-content-print-function), [print-arguments](#user-content-print-arguments)_; +Go to: _[print-arguments](#user-content-print-arguments), [print-function](#user-content-print-function)_; -An annotation consists of an annotation name (which starts with '@') +An annotation consists of an annotation name (which starts with `@`) with optional annotation arguments, which are identifiers. Note that no parentheses are used if there are no arguments. @@ -1540,8 +1540,7 @@ The output type is optional, defaulting to the empty tuple type. In general, a function input consists of an identifier and a type, with an optional 'const' modifier. Additionally, functions inside circuits -may start with a 'mut self' or 'const self' or 'self' parameter. -Furthermore, any function may end with an 'input' parameter. +may start with a `mut self` or `const self` or `self` parameter. ```abnf @@ -1550,7 +1549,7 @@ function-declaration = *annotation %s"function" identifier block ``` -Go to: _[function-parameters](#user-content-function-parameters), [identifier](#user-content-identifier), [type](#user-content-type), [block](#user-content-block)_; +Go to: _[type](#user-content-type), [block](#user-content-block), [identifier](#user-content-identifier), [function-parameters](#user-content-function-parameters)_; @@ -1560,7 +1559,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)_; @@ -1584,11 +1583,6 @@ function-input = [ %s"const" ] identifier ":" type Go to: _[identifier](#user-content-identifier), [type](#user-content-type)_; - -```abnf -input-parameter = %s"input" -``` - A circuit member variable declaration consists of an identifier and a type. A circuit member function declaration consists of a function declaration. @@ -1598,7 +1592,7 @@ member-declaration = member-variable-declaration / member-function-declaration ``` -Go to: _[member-function-declaration](#user-content-member-function-declaration), [member-variable-declaration](#user-content-member-variable-declaration)_; +Go to: _[member-variable-declaration](#user-content-member-variable-declaration), [member-function-declaration](#user-content-member-function-declaration)_; @@ -1606,7 +1600,7 @@ Go to: _[member-function-declaration](#user-content-member-function-declaration) member-variable-declaration = identifier ":" type ``` -Go to: _[type](#user-content-type), [identifier](#user-content-identifier)_; +Go to: _[identifier](#user-content-identifier), [type](#user-content-type)_; @@ -1626,10 +1620,10 @@ circuit-declaration = *annotation %s"circuit" identifier "{" member-declaration *( "," member-declaration ) "}" ``` -Go to: _[member-declaration](#user-content-member-declaration), [identifier](#user-content-identifier)_; +Go to: _[identifier](#user-content-identifier), [member-declaration](#user-content-member-declaration)_; -An import declaration consists of the 'import' keyword +An import declaration consists of the `import` keyword followed by a package path, which may be one of the following: a single wildcard; an identifier, optionally followed by a local renamer; @@ -1655,7 +1649,7 @@ package-path = "*" / "(" package-path *( "," package-path ) [","] ")" ``` -Go to: _[package-path](#user-content-package-path), [identifier](#user-content-identifier), [package-name](#user-content-package-name)_; +Go to: _[package-name](#user-content-package-name), [package-path](#user-content-package-path), [identifier](#user-content-identifier)_; Finally, we define a file as a sequence of zero or more declarations. @@ -1667,7 +1661,7 @@ declaration = import-declaration / circuit-declaration ``` -Go to: _[function-declaration](#user-content-function-declaration), [import-declaration](#user-content-import-declaration), [circuit-declaration](#user-content-circuit-declaration)_; +Go to: _[function-declaration](#user-content-function-declaration), [circuit-declaration](#user-content-circuit-declaration), [import-declaration](#user-content-import-declaration)_; @@ -1682,16 +1676,17 @@ file = *declaration Format Note ----------- -The ABNF standard requires grammars to consist of lines terminated by +The ABNF standard requires grammars +to consist of lines terminated by `` (i.e. carriage return followed by line feed, DOS/Windows-style), as explained in the background on ABNF earlier in this file. -This file's lines are therefore terminated by . +This file's lines are therefore terminated by ``. To avoid losing this requirement across systems, -this file is marked as 'text eol=crlf' in .gitattributes: +this file is marked as `text eol=crlf` in `.gitattributes`: this means that the file is textual, enabling visual diffs, -but its lines will always be terminated by on any system. +but its lines will always be terminated by `` on any system. -Note that this requirement only applies +Note that this `` requirement only applies to the grammar files themselves. It does not apply to the lines of the languages described by the grammar. ABNF grammars may describe any kind of languages, diff --git a/grammar/abnf-grammar.txt b/grammar/abnf-grammar.txt index 83056b2c28..48057feb18 100644 --- a/grammar/abnf-grammar.txt +++ b/grammar/abnf-grammar.txt @@ -53,59 +53,59 @@ ; Instead of BNF's angle-bracket notation for nonterminals, ; ABNF uses case-insensitive names consisting of letters, digits, and dashes, -; e.g. HTTP-message and IPv6address. +; e.g. `HTTP-message` and `IPv6address`. ; ABNF includes an angle-bracket notation for prose descriptions, -; e.g. , +; e.g. ``, ; usable as last resort in the definiens of a nonterminal. ; While BNF allows arbitrary terminals, ; ABNF uses only natural numbers as terminals, ; and denotes them via: ; (i) binary, decimal, or hexadecimal sequences, -; e.g. %b1.11.1010, %d1.3.10, and %x.1.3.A -; all denote the sequence of terminals '1 3 10'; +; e.g. `%b1.11.1010`, `%d1.3.10`, and `%x.1.3.A` +; all denote the sequence of terminals [1, 3, 10]; ; (ii) binary, decimal, or hexadecimal ranges, -; e.g. %x30-39 denotes any singleton sequence of terminals -; 'n' with 48 <= n <= 57 (an ASCII digit); +; e.g. `%x30-39` denotes any singleton sequence of terminals +; [_n_] with 48 <= _n_ <= 57 (an ASCII digit); ; (iii) case-sensitive ASCII strings, -; e.g. %s"Ab" denotes the sequence of terminals '65 98'; +; e.g. `%s"Ab"` denotes the sequence of terminals [65, 98]; ; and (iv) case-insensitive ASCII strings, -; e.g. %i"ab", or just "ab", denotes +; e.g. `%i"ab"`, or just `"ab"`, denotes ; any sequence of terminals among -; '65 66', -; '65 98', -; '97 66', and -; '97 98'. +; [65, 66], +; [65, 98], +; [97, 66], and +; [97, 98]. ; ABNF terminals in suitable sets represent ASCII or Unicode characters. -; ABNF allows repetition prefixes n*m, -; where n and m are natural numbers in decimal notation; +; ABNF allows repetition prefixes `n*m`, +; where `n` and `m` are natural numbers in decimal notation; ; if absent, -; n defaults to 0, and -; m defaults to infinity. +; `n` defaults to 0, and +; `m` defaults to infinity. ; For example, -; 1*4HEXDIG denotes one to four HEXDIGs, -; *3DIGIT denotes up to three DIGITs, and -; 1*OCTET denotes one or more OCTETs. -; A single n prefix -; abbreviates n*n, -; e.g. 3DIGIT denotes three DIGITs. +; `1*4HEXDIG` denotes one to four `HEXDIG`s, +; `*3DIGIT` denotes up to three `DIGIT`s, and +; `1*OCTET` denotes one or more `OCTET`s. +; A single `n` prefix +; abbreviates `n*n`, +; e.g. `3DIGIT` denotes three `DIGIT`s. -; Instead of BNF's |, ABNF uses / to separate alternatives. +; Instead of BNF's `|`, ABNF uses `/` to separate alternatives. ; Repetition prefixes have precedence over juxtapositions, -; which have precedence over /. +; which have precedence over `/`. ; Round brackets group things and override the aforementioned precedence rules, -; e.g. *(WSP / CRLF WSP) denotes sequences of terminals +; e.g. `*(WSP / CRLF WSP)` denotes sequences of terminals ; obtained by repeating, zero or more times, -; either (i) a WSP or (ii) a CRLF followed by a WSP. +; either (i) a `WSP` or (ii) a `CRLF` followed by a `WSP`. ; Square brackets also group things but make them optional, -; e.g. [":" port] is equivalent to 0*1(":" port). +; e.g. `[":" port]` is equivalent to `0*1(":" port)`. -; Instead of BNF's ::=, ABNF uses = to define nonterminals, -; and =/ to incrementally add alternatives +; Instead of BNF's `::=`, ABNF uses `=` to define nonterminals, +; and `=/` to incrementally add alternatives ; to previously defined nonterminals. -; For example, the rule BIT = "0" / "1" -; is equivalent to BIT = "0" followed by BIT =/ "1". +; For example, the rule `BIT = "0" / "1"` +; is equivalent to `BIT = "0"` followed by `BIT =/ "1"`. ; The syntax of ABNF itself is formally specified in ABNF ; (in Section 4 of the aforementioned RFC 5234, @@ -125,7 +125,7 @@ ; This ABNF grammar consists of two (sub-)grammars: ; (i) a lexical grammar that describes how ; sequence of characters are parsed into tokens, and -; (ii) a syntactic grammar that described how +; (ii) a syntactic grammar that describes how ; tokens are parsed into expressions, statements, etc. ; The adjectives 'lexical' and 'syntactic' are ; the same ones used in the Java language reference, @@ -180,8 +180,8 @@ ; / additive-expression "-" multiplicative-expression ; ; These rules tell us -; that the additive operators '+' and '-' have lower precedence -; than the multiplicative operators '*' and '/', +; that the additive operators `+` and `-` have lower precedence +; than the multiplicative operators `*` and `/`, ; and that both the additive and multiplicative operators associate to the left. ; This may be best understood via the examples given below. @@ -239,7 +239,7 @@ ; This ABNF grammar uses nonterminal names ; that consist of complete English words, separated by dashes, ; and that describe the construct the way it is in English. -; For instance, we use the name 'conditional-statement' +; For instance, we use the name `conditional-statement` ; to describe conditional statements. ; At the same time, this grammar establishes @@ -284,8 +284,8 @@ ; A Leo file is a finite sequence of Unicode characters, ; represented as Unicode code points, -; which are numbers in the range form 0 to 10FFFFh. -; These are captured by the ABNF rule 'character' below. +; which are numbers in the range from 0 to 10FFFFh. +; These are captured by the ABNF rule `character` below. ; The lexical grammar defines how, at least conceptually, ; the sequence of characters is turned into @@ -293,20 +293,20 @@ ; these entities are all defined by the grammar rules below. ; As stated, the lexical grammar alone is ambiguous. -; For example, the sequence of characters '**' (i.e. two stars) -; could be equally parsed as two '*' symbol tokens or one '**' symbol token -; (see rule for 'symbol' below). -; As another example, the sequence or characters '' +; For example, the sequence of characters `**` (i.e. two stars) +; could be equally parsed as two `*` symbol tokens or one `**` symbol token +; (see rule for `symbol` below). +; As another example, the sequence or characters `` ; (i.e. carriage return followed by line feed) ; could be equally parsed as two line terminators or one -; (see rule for 'newline'). +; (see rule for `newline`). ; Thus, as often done in language syntax definitions, ; the lexical grammar is disambiguated by ; the extra-grammatical requirement that ; the longest possible sequence of characters is always parsed. -; This way, '**' must be parsed as one '**' symbol token, -; and '' must be parsed as one line terminator. +; This way, `**` must be parsed as one `**` symbol token, +; and `` must be parsed as one line terminator. ; As mentioned above, a character is any Unicode code point. ; This grammar does not say how those are encoded in files (e.g. UTF-8): @@ -362,12 +362,12 @@ newline = line-feed / carriage-return / carriage-return line-feed whitespace = space / horizontal-tab / newline ; There are two kinds of comments in Leo, as in other languages. -; One is block comments of the form '/* ... */', -; and the other is end-of-line comments of the form '// ...'. -; The first kind start at '/*' and end at the first '*/', +; One is block comments of the form `/* ... */`, +; and the other is end-of-line comments of the form `// ...`. +; The first kind start at `/*` and end at the first `*/`, ; possibly spanning multiple (partial) lines; ; these do no nest. -; The second kind start at '//' and extend till the end of the line. +; The second kind start at `//` and extend till the end of the line. ; The rules about comments given below are similar to ; the ones used in the Java language reference. @@ -447,7 +447,7 @@ package-name = 1*( lowercase-letter / digit ) ; A format string is a sequence of characters, other than double quote, ; surrounded by double quotes. -; Within a format string, sub-strings '{}' are distinguished as containers +; Within a format string, sub-strings `{}` are distinguished as containers ; (these are the ones that may be matched with values ; whose textual representation replaces the containers ; in the printed string). @@ -460,17 +460,17 @@ format-string-element = not-double-quote-or-open-brace format-string = double-quote *format-string-element double-quote -; Annotations have names, which are identifiers immediately preceded by '@'. +; Annotations have names, which are identifiers immediately preceded by `@`. annotation-name = "@" identifier ; A natural (number) is a sequence of one or more digits. -; We allow leading zeros, e.g. '007'. +; We allow leading zeros, e.g. `007`. natural = 1*digit ; An integer (number) is either a natural or its negation. -; We allow leading zeros also in negative numbers, e.g. '-007'. +; We allow leading zeros also in negative numbers, e.g. `-007`. integer = [ "-" ] natural @@ -502,7 +502,7 @@ product-group-literal = integer %s"group" boolean-literal = %s"true" / %s"false" -; An address literal starts with 'aleo1' +; An address literal starts with `aleo1` ; and continues with exactly 58 lowercase letters and digits. ; Thus an address always consists of 63 characters. @@ -521,12 +521,12 @@ atomic-literal = untyped-literal / address-literal ; After defining the (mostly) alphanumeric tokens above, -; it remains to define tokens for non-alphanumeric symbols such as "+" and "(". +; it remains to define tokens for non-alphanumeric symbols such as `+` and `(`. ; Different programming languages used different terminologies for these, ; e.g. operators, separators, punctuators, etc. -; Here we use 'symbol', for all of them. +; Here we use `symbol`, for all of them. ; We also include a token consisting of -; a closing parenthesis immediately followed by 'group': +; a closing parenthesis `)` immediately followed by `group`: ; as defined in the syntactic grammar, ; this is the final part of an affine group literal; ; even though it includes letters, @@ -538,7 +538,7 @@ atomic-literal = untyped-literal ; ; equality-operator = "==" ; -; and defining 'symbol' in terms of those +; and defining `symbol` in terms of those ; ; symbol = ... / equality-operator / ... ; @@ -547,7 +547,7 @@ atomic-literal = untyped-literal ; namely the exact names of some of these token. ; On the other hand, at least some of them are perhaps simple enough ; that they could be just described in terms of their symbols, -; e.g. 'double dot', 'question mark', etc. +; e.g. double dot, question mark, etc. symbol = "!" / "&&" / "||" / "==" / "!=" @@ -612,7 +612,7 @@ address-type = %s"address" scalar-type = boolean-type / arithmetic-type / address-type -; Circuit types are denoted by identifiers and the keyword 'Self'. +; Circuit types are denoted by identifiers and the keyword `Self`. ; The latter is only allowed inside a circuit definition, ; to denote the circuit being defined. @@ -663,7 +663,7 @@ affine-group-literal = "(" group-coordinate "," group-coordinate %s")group" literal = atomic-literal / affine-group-literal ; The following rule is not directly referenced in the rules for expressions -; (which reference 'literal' instead), +; (which reference `literal` instead), ; but it is useful to establish terminology: ; a group literal is either a product group literal or an affine group literal. @@ -702,7 +702,7 @@ tuple-expression = tuple-construction ; Array expressions construct arrays. ; There are two kinds: ; one lists the element expressions (at least one), -; including spreads (via '...') which are arrays being spliced in; +; including spreads (via `...`) which are arrays being spliced in; ; the other repeats (the value of) a single expression ; across one or more dimensions. @@ -729,7 +729,8 @@ array-expression = array-construction ; so they are syntactically identical but semantically different. circuit-construction = circuit-type "{" - circuit-inline-element *( "," circuit-inline-element ) [ "," ] + circuit-inline-element + *( "," circuit-inline-element ) [ "," ] "}" circuit-inline-element = identifier ":" expression / identifier @@ -777,8 +778,8 @@ unary-expression = postfix-expression ; Next in the operator precedence is exponentiation, ; following mathematical practice. -; The current rule below makes exponentiation left-associative, -; i.e. 'a ** b ** c' must be parsed as '(a ** b) ** c'. +; The current rule below makes exponentiation right-associative, +; i.e. `a ** b ** c` must be parsed as `a ** (b ** c)`. exponential-expression = unary-expression / unary-expression "**" exponential-expression @@ -855,8 +856,7 @@ block = "{" *statement "}" expression-statement = expression ";" -; A return statement always takes an expression, -; and does not end with a semicolon. +; A return statement always takes an expression, and ends with a semicolon. return-statement = %s"return" expression ";" @@ -892,20 +892,20 @@ conditional-statement = branch loop-statement = %s"for" identifier %s"in" expression ".." expression block ; An assignment statement is straightforward. -; Based on the operator, the assignment may be simple (i.e. '=') +; Based on the operator, the assignment may be simple (i.e. `=`) ; or compound (i.e. combining assignment with an arithmetic operation). assignment-operator = "=" / "+=" / "-=" / "*=" / "/=" / "**=" assignment-statement = expression assignment-operator expression ";" -; Console statements start with the 'console' keyword, +; Console statements start with the `console` keyword, ; followed by a console function call. ; The call may be an assertion or a print command. ; The former takes an expression (which must be boolean) as argument. ; The latter takes either no argument, ; or a format string followed by expressions, -; whose number must match the number of containers '{}' in the format string. +; whose number must match the number of containers `{}` in the format string. ; Note that the console function names are identifiers, not keywords. ; There are three kinds of print commands. @@ -922,7 +922,7 @@ print-arguments = "(" [ format-string *( "," expression ) ] ")" print-call = print-function print-arguments -; An annotation consists of an annotation name (which starts with '@') +; An annotation consists of an annotation name (which starts with `@`) ; with optional annotation arguments, which are identifiers. ; Note that no parentheses are used if there are no arguments. @@ -934,8 +934,7 @@ annotation = annotation-name ; In general, a function input consists of an identifier and a type, ; with an optional 'const' modifier. ; Additionally, functions inside circuits -; may start with a 'mut self' or 'const self' or 'self' parameter. -; Furthermore, any function may end with an 'input' parameter. +; may start with a `mut self` or `const self` or `self` parameter. function-declaration = *annotation %s"function" identifier "(" [ function-parameters ] ")" [ "->" type ] @@ -951,8 +950,6 @@ function-inputs = function-input *( "," function-input ) function-input = [ %s"const" ] identifier ":" type -input-parameter = %s"input" - ; A circuit member variable declaration consists of an identifier and a type. ; A circuit member function declaration consists of a function declaration. @@ -969,7 +966,7 @@ member-function-declaration = function-declaration circuit-declaration = *annotation %s"circuit" identifier "{" member-declaration *( "," member-declaration ) "}" -; An import declaration consists of the 'import' keyword +; An import declaration consists of the `import` keyword ; followed by a package path, which may be one of the following: ; a single wildcard; ; an identifier, optionally followed by a local renamer; @@ -999,16 +996,17 @@ file = *declaration ; Format Note ; ----------- -; The ABNF standard requires grammars to consist of lines terminated by +; The ABNF standard requires grammars +; to consist of lines terminated by `` ; (i.e. carriage return followed by line feed, DOS/Windows-style), ; as explained in the background on ABNF earlier in this file. -; This file's lines are therefore terminated by . +; This file's lines are therefore terminated by ``. ; To avoid losing this requirement across systems, -; this file is marked as 'text eol=crlf' in .gitattributes: +; this file is marked as `text eol=crlf` in `.gitattributes`: ; this means that the file is textual, enabling visual diffs, -; but its lines will always be terminated by on any system. +; but its lines will always be terminated by `` on any system. -; Note that this requirement only applies +; Note that this `` requirement only applies ; to the grammar files themselves. ; It does not apply to the lines of the languages described by the grammar. ; ABNF grammars may describe any kind of languages, From 0d523fb1e1235f9c553212c338d6ee25535867f4 Mon Sep 17 00:00:00 2001 From: damirka Date: Thu, 22 Apr 2021 11:35:17 +0300 Subject: [PATCH 39/41] changes --api to env --- leo/api.rs | 2 +- leo/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/leo/api.rs b/leo/api.rs index 5ef55124a6..f34813045a 100644 --- a/leo/api.rs +++ b/leo/api.rs @@ -149,7 +149,7 @@ impl Route for Fetch { // 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 is hidden"), + StatusCode::NOT_FOUND => anyhow!("Package not found"), _ => anyhow!("Unknown API error: {}", status), } } diff --git a/leo/main.rs b/leo/main.rs index c0bd4bbc76..72ed9dfdf8 100644 --- a/leo/main.rs +++ b/leo/main.rs @@ -55,7 +55,7 @@ struct Opt { #[structopt(subcommand)] command: CommandOpts, - #[structopt(long, global = true, help = "Aleo PM API Url")] + #[structopt(global = true, help = "URL to custom Aleo PM backend", env = "APM_URL")] api: Option, #[structopt( From 8dbb12cfe347e33bc3608198b13d8f8b410ed8c0 Mon Sep 17 00:00:00 2001 From: damirka Date: Thu, 22 Apr 2021 11:44:22 +0300 Subject: [PATCH 40/41] fixed comment --- leo/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leo/main.rs b/leo/main.rs index 72ed9dfdf8..73589df29d 100644 --- a/leo/main.rs +++ b/leo/main.rs @@ -55,7 +55,7 @@ struct Opt { #[structopt(subcommand)] command: CommandOpts, - #[structopt(global = true, help = "URL to custom Aleo PM backend", env = "APM_URL")] + #[structopt(help = "Custom Aleo PM backend URL", env = "APM_URL")] api: Option, #[structopt( From 3c13aae0e949b185219ff08941081dc2fa49671e Mon Sep 17 00:00:00 2001 From: collin Date: Thu, 22 Apr 2021 11:16:01 -0700 Subject: [PATCH 41/41] fix comments --- leo/api.rs | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/leo/api.rs b/leo/api.rs index f34813045a..4763c7a27d 100644 --- a/leo/api.rs +++ b/leo/api.rs @@ -22,25 +22,24 @@ use reqwest::{ }; use serde::{Deserialize, Serialize}; -/// Trait describes API Routes and Request bodies, struct which implements -/// Route MUST also support Serialize to be usable in Api::run_route(r: Route) +/// API Routes and Request bodies. +/// Structs that implement Route MUST also support Serialize to be usable in Api::run_route(r: Route) pub trait Route { - /// Whether to use bearer auth or not. Some routes may have additional - /// features for logged-in users, so authorization token should be sent - /// if it is created of course + /// [`true`] if a route supports bearer authentication. + /// For example, the login route. const AUTH: bool; - /// HTTP method to use when requesting + /// The HTTP method to use when requesting. const METHOD: Method; - /// URL path without first forward slash (e.g. v1/package/fetch) + /// The URL path without the first forward slash (e.g. v1/package/fetch) const PATH: &'static str; - /// Output type for this route. For login it is simple - String + /// The output type for this route. For example, the login route output is [`String`]. /// But for other routes may be more complex. type Output; - /// Process reqwest Response and turn it into Output + /// Process the reqwest Response and turn it into an Output. fn process(&self, res: Response) -> Result; /// Transform specific status codes into correct errors for this route. @@ -50,18 +49,18 @@ pub trait Route { } } -/// REST API handler with reqwest::blocking inside +/// REST API handler with reqwest::blocking inside. #[derive(Clone, Debug)] pub struct Api { host: String, client: Client, - /// Authorization token for API requests + /// Authorization token for API requests. auth_token: Option, } impl Api { - /// Create new instance of API, set host and Client is going to be - /// created and set automatically + /// Returns a new instance of API. + /// The set host and Client are created automatically. pub fn new(host: String, auth_token: Option) -> Api { Api { client: Client::new(), @@ -74,18 +73,19 @@ impl Api { &*self.host } - /// Get token for bearer auth, should be passed into Api through Context + /// Returns the token for bearer auth, otherwise None. + /// The [`auth_token`] should be passed into the Api through Context. pub fn auth_token(&self) -> Option { self.auth_token.clone() } - /// Set authorization token for future requests + /// Set the authorization token for future requests. pub fn set_auth_token(&mut self, token: String) { self.auth_token = Some(token); } /// Run specific route struct. Turn struct into request body - /// and use type constants and Route implementation to get request params + /// and use type constants and Route implementation to get request params. pub fn run_route(&self, route: T) -> Result where T: Route, @@ -104,9 +104,9 @@ impl Api { }; // only one error is possible here - let res = res - .send() - .map_err(|_| anyhow!("Unable to connect to Aleo PM. Check URL if you specified custom API endpoint"))?; + 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") + })?; // where magic begins route.process(res) @@ -189,7 +189,7 @@ impl Route for Login { } /// Handler for 'my_profile' route. Meant to be used to get profile details but -/// in current application is used to check if user is logged in. Any non-200 response +/// in the current application it is used to check if the user is logged in. Any non-200 response /// is treated as Unauthorized. #[derive(Serialize)] pub struct Profile {}