From 4fb95d1195cf581beb8fed164d6998436a17b358 Mon Sep 17 00:00:00 2001 From: gluax Date: Tue, 3 May 2022 11:26:56 -0700 Subject: [PATCH 01/16] initial commit for tc, adds get_type to Node --- compiler/ast/src/common/identifier.rs | 5 +++ compiler/ast/src/expression/binary.rs | 17 ++++++++ compiler/ast/src/expression/call.rs | 4 ++ compiler/ast/src/expression/err.rs | 4 ++ compiler/ast/src/expression/mod.rs | 17 +++++++- compiler/ast/src/expression/ternary.rs | 4 ++ compiler/ast/src/expression/unary.rs | 4 ++ compiler/ast/src/expression/value.rs | 32 +++++++------- compiler/ast/src/functions/function.rs | 5 +++ .../ast/src/functions/input/function_input.rs | 5 +++ .../ast/src/functions/input/input_variable.rs | 8 ++++ compiler/ast/src/input/input_value.rs | 5 +-- compiler/ast/src/node.rs | 6 +++ compiler/ast/src/statements/assign/mod.rs | 6 ++- compiler/ast/src/statements/block.rs | 7 +++- compiler/ast/src/statements/conditional.rs | 5 +++ .../src/statements/console/console_args.rs | 5 +++ .../statements/console/console_function.rs | 5 +++ .../statements/console/console_statement.rs | 5 +++ compiler/ast/src/statements/definition/mod.rs | 5 +++ .../statements/definition/variable_name.rs | 5 +++ compiler/ast/src/statements/expression.rs | 5 +++ compiler/ast/src/statements/iteration.rs | 5 +++ .../ast/src/statements/return_statement.rs | 5 +++ compiler/ast/src/statements/statement.rs | 17 +++++++- compiler/parser/src/test.rs | 8 +--- compiler/passes/src/lib.rs | 3 ++ compiler/passes/src/symbol_table/table.rs | 4 ++ compiler/passes/src/type_checker/check.rs | 42 +++++++++++++++++++ compiler/passes/src/type_checker/checker.rs | 36 ++++++++++++++++ compiler/passes/src/type_checker/mod.rs | 39 +++++++++++++++++ .../literal/int_parse/field.leo.out | 11 +---- .../parser/unreachable/postfix_pass.leo.out | 4 +- 33 files changed, 296 insertions(+), 42 deletions(-) create mode 100644 compiler/passes/src/type_checker/check.rs create mode 100644 compiler/passes/src/type_checker/checker.rs create mode 100644 compiler/passes/src/type_checker/mod.rs diff --git a/compiler/ast/src/common/identifier.rs b/compiler/ast/src/common/identifier.rs index e520d98a47..d3e2c9a64b 100644 --- a/compiler/ast/src/common/identifier.rs +++ b/compiler/ast/src/common/identifier.rs @@ -14,6 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . +use leo_errors::Result; use leo_span::{Span, Symbol}; use crate::Node; @@ -50,6 +51,10 @@ impl Node for Identifier { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + Ok(None) + } } impl Identifier { diff --git a/compiler/ast/src/expression/binary.rs b/compiler/ast/src/expression/binary.rs index 5be8b12901..32aaa0c72a 100644 --- a/compiler/ast/src/expression/binary.rs +++ b/compiler/ast/src/expression/binary.rs @@ -156,4 +156,21 @@ impl Node for BinaryExpression { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + match self.op.class() { + BinaryOperationClass::Boolean => Ok(Some(Type::Boolean)), + BinaryOperationClass::Numeric => { + let left = self.left.get_type()?; + let right = self.right.get_type()?; + + match (left, right) { + (Some(t1), Some(t2)) if t1 == t2 => Ok(Some(t1)), + (None, None) => Ok(None), + (Some(t1), Some(t2)) => todo!("throw err"), + (None, Some(t)) | (Some(t), None) => todo!("throw err"), + } + } + } + } } diff --git a/compiler/ast/src/expression/call.rs b/compiler/ast/src/expression/call.rs index 2670141391..6c1c975129 100644 --- a/compiler/ast/src/expression/call.rs +++ b/compiler/ast/src/expression/call.rs @@ -49,4 +49,8 @@ impl Node for CallExpression { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + Ok(None) + } } diff --git a/compiler/ast/src/expression/err.rs b/compiler/ast/src/expression/err.rs index 23c94eeeeb..afa09f12a2 100644 --- a/compiler/ast/src/expression/err.rs +++ b/compiler/ast/src/expression/err.rs @@ -37,4 +37,8 @@ impl Node for ErrExpression { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + Ok(None) + } } diff --git a/compiler/ast/src/expression/mod.rs b/compiler/ast/src/expression/mod.rs index e4f0e7a117..d28403463e 100644 --- a/compiler/ast/src/expression/mod.rs +++ b/compiler/ast/src/expression/mod.rs @@ -14,8 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{GroupValue, Identifier, IntegerType, Node}; - +use crate::{GroupValue, Identifier, IntegerType, Node, Type}; +use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -80,6 +80,19 @@ impl Node for Expression { Err(n) => n.set_span(span), } } + + fn get_type(&self) -> Result> { + use Expression::*; + match self { + Identifier(n) => n.get_type(), + Value(n) => n.get_type(), + Binary(n) => n.get_type(), + Unary(n) => n.get_type(), + Ternary(n) => n.get_type(), + Call(n) => n.get_type(), + Err(n) => n.get_type(), + } + } } impl fmt::Display for Expression { diff --git a/compiler/ast/src/expression/ternary.rs b/compiler/ast/src/expression/ternary.rs index 55b17a0630..738b0565de 100644 --- a/compiler/ast/src/expression/ternary.rs +++ b/compiler/ast/src/expression/ternary.rs @@ -43,4 +43,8 @@ impl Node for TernaryExpression { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + Ok(None) + } } diff --git a/compiler/ast/src/expression/unary.rs b/compiler/ast/src/expression/unary.rs index 4f52cc0d19..f627f267d6 100644 --- a/compiler/ast/src/expression/unary.rs +++ b/compiler/ast/src/expression/unary.rs @@ -64,4 +64,8 @@ impl Node for UnaryExpression { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + self.inner.get_type() + } } diff --git a/compiler/ast/src/expression/value.rs b/compiler/ast/src/expression/value.rs index 566abd4321..da22d2d267 100644 --- a/compiler/ast/src/expression/value.rs +++ b/compiler/ast/src/expression/value.rs @@ -33,8 +33,6 @@ pub enum ValueExpression { /// A group literal, either product or affine. /// For example, `42group` or `(12, 52)group`. Group(Box), - /// A negated non-integer literal, e.g., `-4.2`. - Implicit(String, #[serde(with = "leo_span::span_json")] Span), /// An integer literal, e.g., `42`. Integer(IntegerType, String, #[serde(with = "leo_span::span_json")] Span), /// A string literal, e.g., `"foobar"`. @@ -49,7 +47,6 @@ impl fmt::Display for ValueExpression { Boolean(boolean, _) => write!(f, "{}", boolean), Char(character) => write!(f, "{}", character), Field(field, _) => write!(f, "{}", field), - Implicit(implicit, _) => write!(f, "{}", implicit), Integer(type_, value, _) => write!(f, "{}{}", value, type_), Group(group) => write!(f, "{}", group), String(string, _) => { @@ -66,12 +63,7 @@ impl Node for ValueExpression { fn span(&self) -> &Span { use ValueExpression::*; match &self { - Address(_, span) - | Boolean(_, span) - | Field(_, span) - | Implicit(_, span) - | Integer(_, _, span) - | String(_, span) => span, + Address(_, span) | Boolean(_, span) | Field(_, span) | Integer(_, _, span) | String(_, span) => span, Char(character) => &character.span, Group(group) => match &**group { GroupValue::Single(_, span) => span, @@ -83,12 +75,9 @@ impl Node for ValueExpression { fn set_span(&mut self, new_span: Span) { use ValueExpression::*; match self { - Address(_, span) - | Boolean(_, span) - | Field(_, span) - | Implicit(_, span) - | Integer(_, _, span) - | String(_, span) => *span = new_span, + Address(_, span) | Boolean(_, span) | Field(_, span) | Integer(_, _, span) | String(_, span) => { + *span = new_span + } Char(character) => character.span = new_span, Group(group) => match &mut **group { GroupValue::Single(_, span) => *span = new_span, @@ -96,4 +85,17 @@ impl Node for ValueExpression { }, } } + + fn get_type(&self) -> Result> { + use ValueExpression::*; + Ok(Some(match &self { + Address(_, _) => Type::Address, + Boolean(_, _) => Type::Boolean, + Char(_) => Type::Char, + Field(_, _) => Type::Field, + Integer(type_, _, _) => Type::IntegerType(*type_), + Group(_) => Type::Group, + String(_, _) => return Ok(None), + })) + } } diff --git a/compiler/ast/src/functions/function.rs b/compiler/ast/src/functions/function.rs index 63128083be..ed8d1c0c8f 100644 --- a/compiler/ast/src/functions/function.rs +++ b/compiler/ast/src/functions/function.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . use crate::{Block, FunctionInput, Identifier, Node, Type}; +use leo_errors::Result; use leo_span::{sym, Span, Symbol}; use serde::{Deserialize, Serialize}; @@ -92,4 +93,8 @@ impl Node for Function { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + Ok(Some(self.output.clone())) + } } diff --git a/compiler/ast/src/functions/input/function_input.rs b/compiler/ast/src/functions/input/function_input.rs index 19494375e5..c2be83f140 100644 --- a/compiler/ast/src/functions/input/function_input.rs +++ b/compiler/ast/src/functions/input/function_input.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . use crate::{Identifier, Node, Type}; +use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -99,4 +100,8 @@ impl Node for FunctionInputVariable { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + Ok(Some(self.type_.clone())) + } } diff --git a/compiler/ast/src/functions/input/input_variable.rs b/compiler/ast/src/functions/input/input_variable.rs index 9317cb7b23..3e0aebbedc 100644 --- a/compiler/ast/src/functions/input/input_variable.rs +++ b/compiler/ast/src/functions/input/input_variable.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . use crate::{FunctionInputVariable, Node}; +use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -83,4 +84,11 @@ impl Node for FunctionInput { Variable(variable) => variable.span = span, } } + + fn get_type(&self) -> Result> { + use FunctionInput::*; + match self { + Variable(variable) => variable.get_type(), + } + } } diff --git a/compiler/ast/src/input/input_value.rs b/compiler/ast/src/input/input_value.rs index bb46164825..b5dc1c904a 100644 --- a/compiler/ast/src/input/input_value.rs +++ b/compiler/ast/src/input/input_value.rs @@ -42,11 +42,8 @@ impl TryFrom<(Type, Expression)> for InputValue { Self::Boolean(bool_value) } (Type::Char, ValueExpression::Char(value)) => Self::Char(value), - (Type::Field, ValueExpression::Field(value, _) | ValueExpression::Implicit(value, _)) => { - Self::Field(value) - } + (Type::Field, ValueExpression::Field(value, _)) => Self::Field(value), (Type::Group, ValueExpression::Group(value)) => Self::Group(*value), - (Type::IntegerType(type_), ValueExpression::Implicit(value, _)) => Self::Integer(type_, value), (Type::IntegerType(expected), ValueExpression::Integer(actual, value, span)) => { if expected == actual { Self::Integer(expected, value) diff --git a/compiler/ast/src/node.rs b/compiler/ast/src/node.rs index be0c100b9c..7f62efcaed 100644 --- a/compiler/ast/src/node.rs +++ b/compiler/ast/src/node.rs @@ -14,8 +14,11 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . +use leo_errors::Result; use leo_span::Span; +use crate::Type; + /// A node in the AST. pub trait Node: std::fmt::Debug + std::fmt::Display + Clone + PartialEq + Eq + serde::Serialize + serde::de::DeserializeOwned @@ -25,4 +28,7 @@ pub trait Node: /// Sets the span of the node. fn set_span(&mut self, span: Span); + + /// Gets the type of the node if it exists. + fn get_type(&self) -> Result>; } diff --git a/compiler/ast/src/statements/assign/mod.rs b/compiler/ast/src/statements/assign/mod.rs index fed8398c28..e78e617c1a 100644 --- a/compiler/ast/src/statements/assign/mod.rs +++ b/compiler/ast/src/statements/assign/mod.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{Expression, Node}; - +use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -109,4 +109,8 @@ impl Node for AssignStatement { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + self.value.get_type() + } } diff --git a/compiler/ast/src/statements/block.rs b/compiler/ast/src/statements/block.rs index e54a4a6ba5..62e20c2af2 100644 --- a/compiler/ast/src/statements/block.rs +++ b/compiler/ast/src/statements/block.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Node, Statement}; +use crate::{Node, Statement, Type}; +use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -51,4 +52,8 @@ impl Node for Block { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + Ok(None) + } } diff --git a/compiler/ast/src/statements/conditional.rs b/compiler/ast/src/statements/conditional.rs index 2e4adf6b65..e9895382f5 100644 --- a/compiler/ast/src/statements/conditional.rs +++ b/compiler/ast/src/statements/conditional.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . use crate::{Block, Expression, Node, Statement}; +use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -51,4 +52,8 @@ impl Node for ConditionalStatement { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + Ok(None) + } } diff --git a/compiler/ast/src/statements/console/console_args.rs b/compiler/ast/src/statements/console/console_args.rs index 4c03aa26df..6eb79ae7ae 100644 --- a/compiler/ast/src/statements/console/console_args.rs +++ b/compiler/ast/src/statements/console/console_args.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . use crate::{Char, Expression, Node}; +use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -54,4 +55,8 @@ impl Node for ConsoleArgs { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + Ok(None) + } } diff --git a/compiler/ast/src/statements/console/console_function.rs b/compiler/ast/src/statements/console/console_function.rs index dc7a2baf08..e22928e77b 100644 --- a/compiler/ast/src/statements/console/console_function.rs +++ b/compiler/ast/src/statements/console/console_function.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . use crate::{ConsoleArgs, Expression, Node}; +use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -58,4 +59,8 @@ impl Node for ConsoleFunction { ConsoleFunction::Error(formatted) | ConsoleFunction::Log(formatted) => formatted.set_span(span), } } + + fn get_type(&self) -> Result> { + Ok(None) + } } diff --git a/compiler/ast/src/statements/console/console_statement.rs b/compiler/ast/src/statements/console/console_statement.rs index 7673ef3ca3..28fd48fe2a 100644 --- a/compiler/ast/src/statements/console/console_statement.rs +++ b/compiler/ast/src/statements/console/console_statement.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . use crate::{ConsoleFunction, Node}; +use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -49,4 +50,8 @@ impl Node for ConsoleStatement { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + Ok(None) + } } diff --git a/compiler/ast/src/statements/definition/mod.rs b/compiler/ast/src/statements/definition/mod.rs index 4f0e514438..1cdaf2dd76 100644 --- a/compiler/ast/src/statements/definition/mod.rs +++ b/compiler/ast/src/statements/definition/mod.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . use crate::{Expression, Node, Type}; +use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -72,4 +73,8 @@ impl Node for DefinitionStatement { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + Ok(Some(self.type_.clone())) + } } diff --git a/compiler/ast/src/statements/definition/variable_name.rs b/compiler/ast/src/statements/definition/variable_name.rs index 71f43aa6d1..22b169c7e6 100644 --- a/compiler/ast/src/statements/definition/variable_name.rs +++ b/compiler/ast/src/statements/definition/variable_name.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . use crate::{Identifier, Node}; +use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -45,4 +46,8 @@ impl Node for VariableName { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + Ok(None) + } } diff --git a/compiler/ast/src/statements/expression.rs b/compiler/ast/src/statements/expression.rs index 93ed15c3e5..e429109f1e 100644 --- a/compiler/ast/src/statements/expression.rs +++ b/compiler/ast/src/statements/expression.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . use crate::{Expression, Node}; +use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -43,4 +44,8 @@ impl Node for ExpressionStatement { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + self.expression.get_type() + } } diff --git a/compiler/ast/src/statements/iteration.rs b/compiler/ast/src/statements/iteration.rs index 3fdfc94bc9..00ac0f7830 100644 --- a/compiler/ast/src/statements/iteration.rs +++ b/compiler/ast/src/statements/iteration.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . use crate::{Block, Expression, Identifier, Node, Type}; +use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -59,4 +60,8 @@ impl Node for IterationStatement { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + Ok(Some(self.type_.clone())) + } } diff --git a/compiler/ast/src/statements/return_statement.rs b/compiler/ast/src/statements/return_statement.rs index e1d25dc050..ae9f00a8dd 100644 --- a/compiler/ast/src/statements/return_statement.rs +++ b/compiler/ast/src/statements/return_statement.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . use crate::{Expression, Node}; +use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -43,4 +44,8 @@ impl Node for ReturnStatement { fn set_span(&mut self, span: Span) { self.span = span; } + + fn get_type(&self) -> Result> { + self.expression.get_type() + } } diff --git a/compiler/ast/src/statements/statement.rs b/compiler/ast/src/statements/statement.rs index c6f97e8f45..c6d6aed9a0 100644 --- a/compiler/ast/src/statements/statement.rs +++ b/compiler/ast/src/statements/statement.rs @@ -14,7 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{ConditionalStatement, Node}; +use crate::{ConditionalStatement, Node, Type}; +use leo_errors::Result; use leo_span::Span; use super::*; @@ -86,4 +87,18 @@ impl Node for Statement { Block(n) => n.set_span(span), } } + + fn get_type(&self) -> Result> { + use Statement::*; + match self { + Return(n) => n.get_type(), + Definition(n) => n.get_type(), + Assign(n) => n.get_type(), + Conditional(n) => n.get_type(), + Iteration(n) => n.get_type(), + Console(n) => n.get_type(), + Expression(n) => n.get_type(), + Block(n) => n.get_type(), + } + } } diff --git a/compiler/parser/src/test.rs b/compiler/parser/src/test.rs index abe1d50c21..6eb034b686 100644 --- a/compiler/parser/src/test.rs +++ b/compiler/parser/src/test.rs @@ -76,10 +76,6 @@ fn with_handler( Ok(parsed) } -fn implicit_value_expr() -> Expression { - Expression::Value(ValueExpression::Implicit("".into(), Span::default())) -} - fn tokenize(test: Test) -> Result, String> { tokenizer::tokenize("test", &test.content).map_err(|x| x.to_string()) } @@ -105,7 +101,7 @@ impl Namespace for ParseExpressionNamespace { create_session_if_not_set_then(|_| { let tokenizer = tokenize(test)?; if all_are_comments(&tokenizer) { - return Ok(yaml_or_fail(implicit_value_expr())); + return Ok(yaml_or_fail("")); } with_handler(tokenizer, |p| p.parse_expression()).map(yaml_or_fail) }) @@ -124,7 +120,7 @@ impl Namespace for ParseStatementNamespace { let tokenizer = tokenize(test)?; if all_are_comments(&tokenizer) { return Ok(yaml_or_fail(Statement::Expression(ExpressionStatement { - expression: implicit_value_expr(), + expression: Expression::Value(ValueExpression::String(Vec::new(), Default::default())), span: Span::default(), }))); } diff --git a/compiler/passes/src/lib.rs b/compiler/passes/src/lib.rs index efc2b74574..4d56f75550 100644 --- a/compiler/passes/src/lib.rs +++ b/compiler/passes/src/lib.rs @@ -31,3 +31,6 @@ pub use self::pass::*; pub mod symbol_table; pub use symbol_table::*; + +pub mod type_checker; +pub use type_checker::*; diff --git a/compiler/passes/src/symbol_table/table.rs b/compiler/passes/src/symbol_table/table.rs index ccc6a3f363..5425c24af5 100644 --- a/compiler/passes/src/symbol_table/table.rs +++ b/compiler/passes/src/symbol_table/table.rs @@ -53,6 +53,10 @@ impl<'a> SymbolTable<'a> { self.functions.insert(symbol, function); Ok(()) } + + pub fn lookup_fn(&mut self, symbol: &Symbol) -> Option<&&'a Function> { + self.functions.get(symbol) + } } impl<'a> Display for SymbolTable<'a> { diff --git a/compiler/passes/src/type_checker/check.rs b/compiler/passes/src/type_checker/check.rs new file mode 100644 index 0000000000..5d6f78446d --- /dev/null +++ b/compiler/passes/src/type_checker/check.rs @@ -0,0 +1,42 @@ +// Copyright (C) 2019-2022 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +use leo_ast::*; + +use crate::TypeChecker; + +impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {} + +impl<'a> StatementVisitor<'a> for TypeChecker<'a> { + fn visit_return(&mut self, input: &'a ReturnStatement) -> VisitResult { + let parent = self.parent.unwrap(); + if let Some(func) = self.symbol_table.lookup_fn(&parent) { + // if func.get_type()? != input.get_type()? { + // // self.handler.emit_err(err); + // } + } + + VisitResult::VisitChildren + } +} + +impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { + fn visit_function(&mut self, input: &'a Function) -> VisitResult { + self.symbol_table.clear_variables(); + self.parent = Some(input.name()); + VisitResult::VisitChildren + } +} diff --git a/compiler/passes/src/type_checker/checker.rs b/compiler/passes/src/type_checker/checker.rs new file mode 100644 index 0000000000..da4fb88117 --- /dev/null +++ b/compiler/passes/src/type_checker/checker.rs @@ -0,0 +1,36 @@ +// Copyright (C) 2019-2022 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +use leo_errors::emitter::Handler; +use leo_span::Symbol; + +use crate::SymbolTable; + +pub struct TypeChecker<'a> { + pub(crate) symbol_table: SymbolTable<'a>, + pub(crate) handler: &'a Handler, + pub(crate) parent: Option, +} + +impl<'a> TypeChecker<'a> { + pub fn new(symbol_table: SymbolTable<'a>, handler: &'a Handler) -> Self { + Self { + symbol_table, + handler, + parent: None, + } + } +} diff --git a/compiler/passes/src/type_checker/mod.rs b/compiler/passes/src/type_checker/mod.rs new file mode 100644 index 0000000000..f33bf66bdd --- /dev/null +++ b/compiler/passes/src/type_checker/mod.rs @@ -0,0 +1,39 @@ +// Copyright (C) 2019-2022 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +pub mod check; +pub use check::*; + +pub mod checker; +pub use checker::*; + +use crate::{Pass, SymbolTable}; + +use leo_ast::{Ast, VisitorDirector}; +use leo_errors::{emitter::Handler, Result}; + +impl<'a> Pass<'a> for TypeChecker<'a> { + type Input = (&'a Ast, SymbolTable<'a>, &'a Handler); + type Output = Result<()>; + + fn do_pass((ast, symbol_table, handler): Self::Input) -> Self::Output { + let mut visitor = VisitorDirector::new(TypeChecker::new(symbol_table, handler)); + visitor.visit_program(ast.as_repr()); + handler.last_err()?; + + Ok(()) + } +} diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/field.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/field.leo.out index 9c571beb3d..2b86197922 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/field.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/field.leo.out @@ -32,16 +32,7 @@ outputs: col_stop: 9 path: "" content: 456field - - Value: - Implicit: - - "" - - span: - line_start: 0 - line_stop: 0 - col_start: 0 - col_stop: 0 - path: "" - content: "" + - "" - Value: Field: - "87377802873778028737780287377802873778028737780287377802873778028737780287377802" diff --git a/tests/expectations/parser/parser/unreachable/postfix_pass.leo.out b/tests/expectations/parser/parser/unreachable/postfix_pass.leo.out index 47a8e8b1fb..f274e7c5f3 100644 --- a/tests/expectations/parser/parser/unreachable/postfix_pass.leo.out +++ b/tests/expectations/parser/parser/unreachable/postfix_pass.leo.out @@ -5,8 +5,8 @@ outputs: - Expression: expression: Value: - Implicit: - - "" + String: + - [] - span: line_start: 0 line_stop: 0 From 1a25db8e23db305f74da621d2670c262669b070a Mon Sep 17 00:00:00 2001 From: gluax Date: Tue, 3 May 2022 13:16:13 -0700 Subject: [PATCH 02/16] start on type checking statements --- compiler/ast/src/passes/visitor_director.rs | 1 - compiler/passes/src/symbol_table/table.rs | 30 +++++-- .../src/symbol_table/variable_symbol.rs | 25 ++---- compiler/passes/src/type_checker/check.rs | 79 ++++++++++++++++++- leo/errors/src/errors/parser/parser_errors.rs | 6 +- 5 files changed, 110 insertions(+), 31 deletions(-) diff --git a/compiler/ast/src/passes/visitor_director.rs b/compiler/ast/src/passes/visitor_director.rs index f1cb373a21..9fee6cdda1 100644 --- a/compiler/ast/src/passes/visitor_director.rs +++ b/compiler/ast/src/passes/visitor_director.rs @@ -76,7 +76,6 @@ impl<'a, V: ExpressionVisitor<'a>> VisitorDirector<'a, V> { pub fn visit_call(&mut self, input: &'a CallExpression) { if let VisitResult::VisitChildren = self.visitor.visit_call(input) { - self.visit_expression(&input.function); for expr in input.arguments.iter() { self.visit_expression(expr); } diff --git a/compiler/passes/src/symbol_table/table.rs b/compiler/passes/src/symbol_table/table.rs index 5425c24af5..3ec37efa08 100644 --- a/compiler/passes/src/symbol_table/table.rs +++ b/compiler/passes/src/symbol_table/table.rs @@ -16,7 +16,7 @@ use std::fmt::Display; -use leo_ast::Function; +use leo_ast::{DefinitionStatement, Function, FunctionInput}; use leo_errors::{AstError, Result}; use leo_span::Symbol; @@ -31,7 +31,7 @@ pub struct SymbolTable<'a> { functions: IndexMap, /// Variables represents functions variable definitions and input variables. /// This field is not populated till necessary. - variables: VariableSymbol<'a>, + pub(crate) variables: VariableSymbol<'a>, } impl<'a> SymbolTable<'a> { @@ -48,15 +48,35 @@ impl<'a> SymbolTable<'a> { self.variables.clear(); } - pub fn insert_fn(&mut self, symbol: Symbol, function: &'a Function) -> Result<()> { + pub fn insert_fn(&mut self, symbol: Symbol, insert: &'a Function) -> Result<()> { self.check_shadowing(&symbol)?; - self.functions.insert(symbol, function); + self.functions.insert(symbol, insert); Ok(()) } - pub fn lookup_fn(&mut self, symbol: &Symbol) -> Option<&&'a Function> { + pub fn insert_fn_input(&mut self, symbol: Symbol, insert: &'a FunctionInput) -> Result<()> { + self.check_shadowing(&symbol)?; + self.variables.inputs.insert(symbol, insert); + Ok(()) + } + + pub fn insert_variable(&mut self, symbol: Symbol, insert: &'a DefinitionStatement) -> Result<()> { + self.check_shadowing(&symbol)?; + self.variables.variables.insert(symbol, insert); + Ok(()) + } + + pub fn lookup_fn(&self, symbol: &Symbol) -> Option<&&'a Function> { self.functions.get(symbol) } + + pub fn lookup_fn_input(&self, symbol: &Symbol) -> Option<&&'a FunctionInput> { + self.variables.inputs.get(symbol) + } + + pub fn lookup_var(&self, symbol: &Symbol) -> Option<&&'a DefinitionStatement> { + self.variables.variables.get(symbol) + } } impl<'a> Display for SymbolTable<'a> { diff --git a/compiler/passes/src/symbol_table/variable_symbol.rs b/compiler/passes/src/symbol_table/variable_symbol.rs index 01d3bd4776..0903c84dcf 100644 --- a/compiler/passes/src/symbol_table/variable_symbol.rs +++ b/compiler/passes/src/symbol_table/variable_symbol.rs @@ -17,7 +17,7 @@ use std::fmt::Display; use indexmap::IndexMap; -use leo_ast::{DefinitionStatement, FunctionInput, FunctionInputVariable}; +use leo_ast::{DefinitionStatement, FunctionInput, Node}; use leo_errors::{AstError, Result}; use leo_span::Symbol; @@ -27,33 +27,20 @@ pub struct VariableSymbol<'a> { /// For example if we are in a if block inside a function. /// The parent would be the functions variables and inputs. /// This field is populated as necessary. - parent: Option>>, + pub(crate) parent: Option>>, /// The input variables defined in a scope. /// This field is populated as necessary. - inputs: IndexMap, + pub(crate) inputs: IndexMap, /// The variables defined in a scope. /// This field is populated as necessary. - variables: IndexMap, + pub(crate) variables: IndexMap, } impl<'a> VariableSymbol<'a> { - pub fn new(parent: Option>>, inputs: Vec<&'a FunctionInput>) -> Self { - Self { - parent, - inputs: inputs - .iter() - .map(|input| { - let inner = input.get_variable(); - (inner.identifier.name, inner) - }) - .collect(), - variables: IndexMap::new(), - } - } - pub fn check_shadowing(&self, symbol: &Symbol) -> Result<()> { if let Some(input) = self.inputs.get(symbol) { - Err(AstError::shadowed_function_input(symbol, &input.span).into()) + let span = input.span(); + Err(AstError::shadowed_function_input(symbol, span).into()) } else if let Some(var) = self.variables.get(symbol) { Err(AstError::shadowed_variable(symbol, &var.span).into()) } else if let Some(parent) = &self.parent { diff --git a/compiler/passes/src/type_checker/check.rs b/compiler/passes/src/type_checker/check.rs index 5d6f78446d..9494175b63 100644 --- a/compiler/passes/src/type_checker/check.rs +++ b/compiler/passes/src/type_checker/check.rs @@ -15,28 +15,101 @@ // along with the Leo library. If not, see . use leo_ast::*; +use leo_errors::Result; use crate::TypeChecker; +impl<'a> TypeChecker<'a> { + fn compare_types(&self, t1: Result>, t2: Result>) { + match (t1, t2) { + (Ok(Some(t1)), Ok(Some(t2))) if t1 != t2 => self.handler.emit_err(todo!()), + (Ok(Some(t)), Ok(None)) | (Ok(None), Ok(Some(t))) => self.handler.emit_err(todo!()), + (Err(err), Ok(None)) | (Ok(None), Err(err)) => self.handler.emit_err(err), + (Err(err1), Err(err2)) => { + self.handler.emit_err(err1); + self.handler.emit_err(err2); + } + _ => {} + } + } +} + impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {} +// we can safely unwrap all self.parent instances because +// statements should always have some parent block impl<'a> StatementVisitor<'a> for TypeChecker<'a> { fn visit_return(&mut self, input: &'a ReturnStatement) -> VisitResult { let parent = self.parent.unwrap(); + if let Some(func) = self.symbol_table.lookup_fn(&parent) { - // if func.get_type()? != input.get_type()? { - // // self.handler.emit_err(err); - // } + self.compare_types(func.get_type(), input.get_type()); } VisitResult::VisitChildren } + + fn visit_definition(&mut self, input: &'a DefinitionStatement) -> VisitResult { + input.variable_names.iter().for_each(|v| { + if let Err(err) = self.symbol_table.insert_variable(v.identifier.name, input) { + self.handler.emit_err(err); + } + }); + + VisitResult::VisitChildren + } + + fn visit_assign(&mut self, input: &'a AssignStatement) -> VisitResult { + let input_var = self.symbol_table.lookup_fn_input(&input.assignee.identifier.name); + let var = self.symbol_table.lookup_var(&input.assignee.identifier.name); + + match (input_var, var) { + (Some(var), None) => { + self.compare_types(var.get_type(), input.value.get_type()); + } + (None, Some(var)) => { + self.compare_types(var.get_type(), input.value.get_type()); + } + (None, None) => self.handler.emit_err(todo!()), + // Don't have to error here as shadowing checks are done during insertions. + _ => {} + } + + Default::default() + } + + fn visit_conditional(&mut self, _input: &'a ConditionalStatement) -> VisitResult { + Default::default() + } + + fn visit_iteration(&mut self, _input: &'a IterationStatement) -> VisitResult { + Default::default() + } + + fn visit_console(&mut self, _input: &'a ConsoleStatement) -> VisitResult { + Default::default() + } + + fn visit_expression_statement(&mut self, _input: &'a ExpressionStatement) -> VisitResult { + Default::default() + } + + fn visit_block(&mut self, _input: &'a Block) -> VisitResult { + Default::default() + } } impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { fn visit_function(&mut self, input: &'a Function) -> VisitResult { self.symbol_table.clear_variables(); self.parent = Some(input.name()); + input.input.iter().for_each(|i| { + let symbol = i.get_variable().identifier.name; + if let Err(err) = self.symbol_table.insert_fn_input(symbol, i) { + self.handler.emit_err(err); + } + }); + VisitResult::VisitChildren } } diff --git a/leo/errors/src/errors/parser/parser_errors.rs b/leo/errors/src/errors/parser/parser_errors.rs index 687c97c911..bd7bae6151 100644 --- a/leo/errors/src/errors/parser/parser_errors.rs +++ b/leo/errors/src/errors/parser/parser_errors.rs @@ -291,9 +291,9 @@ create_messages!( /// When the user tries to pass an implicit value. @formatted implicit_values_not_allowed { - args: (input: impl Display), - msg: format!("Could not parse the implicit value: {}.", input), - help: None, + args: (input: impl Display), + msg: format!("Could not parse the implicit value: {}.", input), + help: None, } /// When a escaped unicode char was given but no following closing symbol. From 461260280775bc3dd71f0a155de0e95cf351d991 Mon Sep 17 00:00:00 2001 From: gluax Date: Tue, 3 May 2022 14:00:40 -0700 Subject: [PATCH 03/16] type checking errors so far --- compiler/ast/src/expression/binary.rs | 8 +- compiler/passes/src/type_checker/check.rs | 44 +++++++++-- leo/errors/src/errors/input/input_errors.rs | 2 +- leo/errors/src/errors/mod.rs | 9 +++ leo/errors/src/errors/type_checker/mod.rs | 19 +++++ .../errors/type_checker/type_checker_error.rs | 75 +++++++++++++++++++ 6 files changed, 146 insertions(+), 11 deletions(-) create mode 100644 leo/errors/src/errors/type_checker/mod.rs create mode 100644 leo/errors/src/errors/type_checker/type_checker_error.rs diff --git a/compiler/ast/src/expression/binary.rs b/compiler/ast/src/expression/binary.rs index 32aaa0c72a..f520ac2dda 100644 --- a/compiler/ast/src/expression/binary.rs +++ b/compiler/ast/src/expression/binary.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . +use leo_errors::TypeCheckerError; + use super::*; /// A binary operator. @@ -167,8 +169,10 @@ impl Node for BinaryExpression { match (left, right) { (Some(t1), Some(t2)) if t1 == t2 => Ok(Some(t1)), (None, None) => Ok(None), - (Some(t1), Some(t2)) => todo!("throw err"), - (None, Some(t)) | (Some(t), None) => todo!("throw err"), + (Some(t1), Some(t2)) => Err(TypeCheckerError::types_do_not_match(t1, t2, self.span()).into()), + (None, Some(t)) | (Some(t), None) => { + Err(TypeCheckerError::type_expected_but_not_found(t, self.span()).into()) + } } } } diff --git a/compiler/passes/src/type_checker/check.rs b/compiler/passes/src/type_checker/check.rs index 9494175b63..de3ba95ab0 100644 --- a/compiler/passes/src/type_checker/check.rs +++ b/compiler/passes/src/type_checker/check.rs @@ -15,15 +15,20 @@ // along with the Leo library. If not, see . use leo_ast::*; -use leo_errors::Result; +use leo_errors::{Result, TypeCheckerError}; +use leo_span::Span; use crate::TypeChecker; impl<'a> TypeChecker<'a> { - fn compare_types(&self, t1: Result>, t2: Result>) { + fn compare_types(&self, t1: Result>, t2: Result>, span: &Span) { match (t1, t2) { - (Ok(Some(t1)), Ok(Some(t2))) if t1 != t2 => self.handler.emit_err(todo!()), - (Ok(Some(t)), Ok(None)) | (Ok(None), Ok(Some(t))) => self.handler.emit_err(todo!()), + (Ok(Some(t1)), Ok(Some(t2))) if t1 != t2 => self + .handler + .emit_err(TypeCheckerError::types_do_not_match(t1, t2, span).into()), + (Ok(Some(t)), Ok(None)) | (Ok(None), Ok(Some(t))) => self + .handler + .emit_err(TypeCheckerError::type_expected_but_not_found(t, span).into()), (Err(err), Ok(None)) | (Ok(None), Err(err)) => self.handler.emit_err(err), (Err(err1), Err(err2)) => { self.handler.emit_err(err1); @@ -43,7 +48,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { let parent = self.parent.unwrap(); if let Some(func) = self.symbol_table.lookup_fn(&parent) { - self.compare_types(func.get_type(), input.get_type()); + self.compare_types(func.get_type(), input.get_type(), input.span()); } VisitResult::VisitChildren @@ -54,6 +59,8 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { if let Err(err) = self.symbol_table.insert_variable(v.identifier.name, input) { self.handler.emit_err(err); } + + self.compare_types(input.get_type(), input.get_type(), input.span()); }); VisitResult::VisitChildren @@ -65,12 +72,33 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { match (input_var, var) { (Some(var), None) => { - self.compare_types(var.get_type(), input.value.get_type()); + let inner = var.get_variable(); + if inner.mode() == ParamMode::Constant { + self.handler.emit_err( + TypeCheckerError::cannont_assign_to_const_input(&inner.identifier.name, var.span()).into(), + ); + } + + self.compare_types(var.get_type(), input.value.get_type(), input.span()); } (None, Some(var)) => { - self.compare_types(var.get_type(), input.value.get_type()); + if var.declaration_type == Declare::Const { + // there will always be one variable name + // as we don't allow tuples at the moment. + self.handler.emit_err( + TypeCheckerError::cannont_assign_to_const_input( + &var.variable_names[0].identifier.name, + var.span(), + ) + .into(), + ); + } + + self.compare_types(var.get_type(), input.value.get_type(), input.span()); } - (None, None) => self.handler.emit_err(todo!()), + (None, None) => self + .handler + .emit_err(TypeCheckerError::unknown_assignee(&input.assignee.identifier.name, input.span()).into()), // Don't have to error here as shadowing checks are done during insertions. _ => {} } diff --git a/leo/errors/src/errors/input/input_errors.rs b/leo/errors/src/errors/input/input_errors.rs index 4ee87065cb..bc664b558e 100644 --- a/leo/errors/src/errors/input/input_errors.rs +++ b/leo/errors/src/errors/input/input_errors.rs @@ -20,7 +20,7 @@ use std::fmt::{Debug, Display}; create_messages!( /// InputError enum that represents all the errors for the inputs part of `leo-ast` crate. InputError, - code_mask: 8000i32, + code_mask: 1000i32, code_prefix: "INP", /// For when declared variable type mismatches actual type. diff --git a/leo/errors/src/errors/mod.rs b/leo/errors/src/errors/mod.rs index 90014fafdc..2e56a1e302 100644 --- a/leo/errors/src/errors/mod.rs +++ b/leo/errors/src/errors/mod.rs @@ -41,6 +41,10 @@ pub use self::package::*; pub mod parser; pub use self::parser::*; +/// Contains the Type Checker error definitions. +pub mod type_checker; +pub use self::type_checker::*; + /// The LeoError type that contains all sub error types. /// This allows a unified error type throughout the Leo crates. #[derive(Clone, Debug, Error)] @@ -63,6 +67,9 @@ pub enum LeoError { /// Represents an Parser Error in a Leo Error. #[error(transparent)] ParserError(#[from] ParserError), + /// Represents an Type Checker Error in a Leo Error. + #[error(transparent)] + TypeCheckerError(#[from] TypeCheckerError), } impl LeoError { @@ -77,6 +84,7 @@ impl LeoError { InputError(error) => error.error_code(), ParserError(error) => error.error_code(), PackageError(error) => error.error_code(), + TypeCheckerError(error) => error.error_code(), } } @@ -91,6 +99,7 @@ impl LeoError { InputError(error) => error.exit_code(), ParserError(error) => error.exit_code(), PackageError(error) => error.exit_code(), + TypeCheckerError(error) => error.exit_code(), } } } diff --git a/leo/errors/src/errors/type_checker/mod.rs b/leo/errors/src/errors/type_checker/mod.rs new file mode 100644 index 0000000000..9e6a457ca2 --- /dev/null +++ b/leo/errors/src/errors/type_checker/mod.rs @@ -0,0 +1,19 @@ +// Copyright (C) 2019-2022 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +/// This module contains the Input error definitions. +pub mod type_checker_error; +pub use self::type_checker_error::*; diff --git a/leo/errors/src/errors/type_checker/type_checker_error.rs b/leo/errors/src/errors/type_checker/type_checker_error.rs new file mode 100644 index 0000000000..5fd062bb85 --- /dev/null +++ b/leo/errors/src/errors/type_checker/type_checker_error.rs @@ -0,0 +1,75 @@ +// Copyright (C) 2019-2022 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +use crate::create_messages; +use std::fmt::{Debug, Display}; + +create_messages!( + /// InputError enum that represents all the errors for the inputs part of `leo-ast` crate. + TypeCheckerError, + code_mask: 2000i32, + code_prefix: "TYC", + + /// For when types do not match. + @formatted + types_do_not_match { + args: (lhs: impl Display, rhs: impl Display), + msg: format!( + "unexpected type, lhs type is: '{lhs}', but rhs type is: '{rhs}'", + ), + help: None, + } + + /// For when types do not match. + @formatted + type_expected_but_not_found { + args: (known: impl Display), + msg: format!( + "One side has type: '{known}', but the other has no type", + ), + help: None, + } + + /// For when the user tries to assign to a unknown variable. + @formatted + unknown_assignee { + args: (var: impl Display), + msg: format!( + "Unknown assignee `{var}`", + ), + help: None, + } + + /// For when the user tries to assign to a const input. + @formatted + cannont_assign_to_const_input { + args: (input: impl Display), + msg: format!( + "Cannot assign to const input `{input}`", + ), + help: None, + } + + /// For when the user tries to assign to a const input. + @formatted + cannont_assign_to_const_var { + args: (var: impl Display), + msg: format!( + "Cannot assign to const variable `{var}`", + ), + help: None, + } +); From d39ee319339b1d39cd8835300ddbcbfcfea77419 Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Tue, 3 May 2022 17:33:46 -0700 Subject: [PATCH 04/16] statements almost done, iteration statements causing issues --- compiler/ast/src/passes/visitor_director.rs | 22 +++---- compiler/passes/src/symbol_table/table.rs | 15 +++++ compiler/passes/src/type_checker/check.rs | 66 +++++++++++++++---- .../errors/type_checker/type_checker_error.rs | 46 ++++++++----- 4 files changed, 108 insertions(+), 41 deletions(-) diff --git a/compiler/ast/src/passes/visitor_director.rs b/compiler/ast/src/passes/visitor_director.rs index 9fee6cdda1..ede3a24a75 100644 --- a/compiler/ast/src/passes/visitor_director.rs +++ b/compiler/ast/src/passes/visitor_director.rs @@ -76,9 +76,7 @@ impl<'a, V: ExpressionVisitor<'a>> VisitorDirector<'a, V> { pub fn visit_call(&mut self, input: &'a CallExpression) { if let VisitResult::VisitChildren = self.visitor.visit_call(input) { - for expr in input.arguments.iter() { - self.visit_expression(expr); - } + input.arguments.iter().for_each(|expr| self.visit_expression(expr)); } } } @@ -137,8 +135,11 @@ impl<'a, V: ExpressionVisitor<'a> + StatementVisitor<'a>> VisitorDirector<'a, V> pub fn visit_console(&mut self, input: &'a ConsoleStatement) { if let VisitResult::VisitChildren = self.visitor.visit_console(input) { - if let ConsoleFunction::Assert(expr) = &input.function { - self.visit_expression(expr); + match &input.function { + ConsoleFunction::Assert(expr) => self.visit_expression(expr), + ConsoleFunction::Error(fmt) | ConsoleFunction::Log(fmt) => { + fmt.parameters.iter().for_each(|expr| self.visit_expression(expr)); + } } } } @@ -151,9 +152,7 @@ impl<'a, V: ExpressionVisitor<'a> + StatementVisitor<'a>> VisitorDirector<'a, V> pub fn visit_block(&mut self, input: &'a Block) { if let VisitResult::VisitChildren = self.visitor.visit_block(input) { - for stmt in input.statements.iter() { - self.visit_statement(stmt); - } + input.statements.iter().for_each(|stmt| self.visit_statement(stmt)); } } } @@ -161,9 +160,10 @@ impl<'a, V: ExpressionVisitor<'a> + StatementVisitor<'a>> VisitorDirector<'a, V> impl<'a, V: ExpressionVisitor<'a> + ProgramVisitor<'a> + StatementVisitor<'a>> VisitorDirector<'a, V> { pub fn visit_program(&mut self, input: &'a Program) { if let VisitResult::VisitChildren = self.visitor.visit_program(input) { - for function in input.functions.values() { - self.visit_function(function); - } + input + .functions + .values() + .for_each(|function| self.visit_function(function)); } } diff --git a/compiler/passes/src/symbol_table/table.rs b/compiler/passes/src/symbol_table/table.rs index 3ec37efa08..cc46ec0d60 100644 --- a/compiler/passes/src/symbol_table/table.rs +++ b/compiler/passes/src/symbol_table/table.rs @@ -77,6 +77,21 @@ impl<'a> SymbolTable<'a> { pub fn lookup_var(&self, symbol: &Symbol) -> Option<&&'a DefinitionStatement> { self.variables.variables.get(symbol) } + + pub fn push_variable_scope(&mut self) { + let current_scope = self.variables.clone(); + self.variables = VariableSymbol { + parent: Some(Box::new(current_scope)), + inputs: Default::default(), + variables: Default::default(), + }; + } + + pub fn pop_variable_scope(&mut self) { + let parent = self.variables.parent.clone().unwrap(); + + self.variables = *parent; + } } impl<'a> Display for SymbolTable<'a> { diff --git a/compiler/passes/src/type_checker/check.rs b/compiler/passes/src/type_checker/check.rs index de3ba95ab0..a9070927b2 100644 --- a/compiler/passes/src/type_checker/check.rs +++ b/compiler/passes/src/type_checker/check.rs @@ -34,6 +34,17 @@ impl<'a> TypeChecker<'a> { self.handler.emit_err(err1); self.handler.emit_err(err2); } + // Types match + _ => {} + } + } + + fn assert_type(&self, type_: Result>, expected: Type, span: &Span) { + match type_ { + Ok(Some(type_)) if type_ != expected => self + .handler + .emit_err(TypeCheckerError::type_should_be(type_, expected, span).into()), + // Types match _ => {} } } @@ -103,27 +114,58 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { _ => {} } - Default::default() + VisitResult::VisitChildren } - fn visit_conditional(&mut self, _input: &'a ConditionalStatement) -> VisitResult { - Default::default() + fn visit_conditional(&mut self, input: &'a ConditionalStatement) -> VisitResult { + self.assert_type(input.condition.get_type(), Type::Boolean, input.span()); + + VisitResult::VisitChildren } - fn visit_iteration(&mut self, _input: &'a IterationStatement) -> VisitResult { - Default::default() + fn visit_iteration(&mut self, input: &'a IterationStatement) -> VisitResult { + // TODO: need to change symbol table to some other repr for variables. + // self.symbol_table.insert_variable(input.variable.name, input); + + let iter_var_type = input.get_type(); + + self.compare_types(iter_var_type.clone(), input.start.get_type(), input.span()); + self.compare_types(iter_var_type, input.stop.get_type(), input.span()); + + VisitResult::VisitChildren } - fn visit_console(&mut self, _input: &'a ConsoleStatement) -> VisitResult { - Default::default() + fn visit_console(&mut self, input: &'a ConsoleStatement) -> VisitResult { + match &input.function { + ConsoleFunction::Assert(expr) => { + self.assert_type(expr.get_type(), Type::Boolean, expr.span()); + } + ConsoleFunction::Error(_) | ConsoleFunction::Log(_) => { + todo!("need to discuss this"); + } + } + + VisitResult::VisitChildren } - fn visit_expression_statement(&mut self, _input: &'a ExpressionStatement) -> VisitResult { - Default::default() - } + fn visit_block(&mut self, input: &'a Block) -> VisitResult { + self.symbol_table.push_variable_scope(); + // have to redo the logic here so we have scoping + input.statements.iter().for_each(|stmt| { + match stmt { + Statement::Return(stmt) => self.visit_return(stmt), + Statement::Definition(stmt) => self.visit_definition(stmt), + Statement::Assign(stmt) => self.visit_assign(stmt), + Statement::Conditional(stmt) => self.visit_conditional(stmt), + Statement::Iteration(stmt) => self.visit_iteration(stmt), + Statement::Console(stmt) => self.visit_console(stmt), + Statement::Expression(stmt) => self.visit_expression_statement(stmt), + Statement::Block(stmt) => self.visit_block(stmt), + }; + }); + self.symbol_table.pop_variable_scope(); - fn visit_block(&mut self, _input: &'a Block) -> VisitResult { - Default::default() + VisitResult::SkipChildren } } diff --git a/leo/errors/src/errors/type_checker/type_checker_error.rs b/leo/errors/src/errors/type_checker/type_checker_error.rs index 5fd062bb85..cd6ce3b152 100644 --- a/leo/errors/src/errors/type_checker/type_checker_error.rs +++ b/leo/errors/src/errors/type_checker/type_checker_error.rs @@ -53,23 +53,33 @@ create_messages!( help: None, } - /// For when the user tries to assign to a const input. - @formatted - cannont_assign_to_const_input { - args: (input: impl Display), - msg: format!( - "Cannot assign to const input `{input}`", - ), - help: None, - } + /// For when the user tries to assign to a const input. + @formatted + cannont_assign_to_const_input { + args: (input: impl Display), + msg: format!( + "Cannot assign to const input `{input}`", + ), + help: None, + } - /// For when the user tries to assign to a const input. - @formatted - cannont_assign_to_const_var { - args: (var: impl Display), - msg: format!( - "Cannot assign to const variable `{var}`", - ), - help: None, - } + /// For when the user tries to assign to a const input. + @formatted + cannont_assign_to_const_var { + args: (var: impl Display), + msg: format!( + "Cannot assign to const variable `{var}`", + ), + help: None, + } + + /// For when the user tries to assign to a const input. + @formatted + type_should_be { + args: (type_: impl Display, expected: impl Display), + msg: format!( + "Found type `{type_}` but type `{expected}` was expected", + ), + help: None, + } ); From db6292609d4c828eca24543684b06bb974469fab Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Tue, 3 May 2022 18:39:28 -0700 Subject: [PATCH 05/16] refactor symbol variable to variable scope, create new symbol variable --- .../ast/src/functions/input/function_input.rs | 6 +- .../ast/src/passes/reconstructing_director.rs | 2 +- compiler/passes/src/symbol_table/mod.rs | 3 + compiler/passes/src/symbol_table/table.rs | 23 ++---- .../passes/src/symbol_table/variable_scope.rs | 68 +++++++++++++++++ .../src/symbol_table/variable_symbol.rs | 69 ++++++----------- compiler/passes/src/type_checker/check.rs | 75 ++++++++++--------- leo/errors/src/errors/ast/ast_errors.rs | 8 -- 8 files changed, 140 insertions(+), 114 deletions(-) create mode 100644 compiler/passes/src/symbol_table/variable_scope.rs diff --git a/compiler/ast/src/functions/input/function_input.rs b/compiler/ast/src/functions/input/function_input.rs index c2be83f140..ba2aeff3ad 100644 --- a/compiler/ast/src/functions/input/function_input.rs +++ b/compiler/ast/src/functions/input/function_input.rs @@ -48,7 +48,7 @@ pub struct FunctionInputVariable { /// The mode of the function parameter. mode: ParamMode, /// What's the parameter's type? - type_: Type, + pub type_: Type, /// The parameters span from any annotations to its type. pub span: Span, } @@ -66,10 +66,6 @@ impl FunctionInputVariable { pub fn mode(&self) -> ParamMode { self.mode } - - pub fn type_(&self) -> Type { - self.type_.clone() - } } impl FunctionInputVariable { diff --git a/compiler/ast/src/passes/reconstructing_director.rs b/compiler/ast/src/passes/reconstructing_director.rs index 71a9dc7019..2bbc241852 100644 --- a/compiler/ast/src/passes/reconstructing_director.rs +++ b/compiler/ast/src/passes/reconstructing_director.rs @@ -275,7 +275,7 @@ impl ReconstructingDirector { variable: &FunctionInputVariable, ) -> Result { let identifier = self.reduce_identifier(&variable.identifier)?; - let type_ = self.reduce_type(&variable.type_(), &variable.span)?; + let type_ = self.reduce_type(&variable.type_, &variable.span)?; self.reducer.reduce_function_input_variable(variable, identifier, type_) } diff --git a/compiler/passes/src/symbol_table/mod.rs b/compiler/passes/src/symbol_table/mod.rs index 77622607e3..e29c798986 100644 --- a/compiler/passes/src/symbol_table/mod.rs +++ b/compiler/passes/src/symbol_table/mod.rs @@ -20,6 +20,9 @@ pub use create::*; pub mod table; pub use table::*; +pub mod variable_scope; +pub use variable_scope::*; + pub mod variable_symbol; pub use variable_symbol::*; diff --git a/compiler/passes/src/symbol_table/table.rs b/compiler/passes/src/symbol_table/table.rs index cc46ec0d60..f1f1895bfa 100644 --- a/compiler/passes/src/symbol_table/table.rs +++ b/compiler/passes/src/symbol_table/table.rs @@ -16,13 +16,13 @@ use std::fmt::Display; -use leo_ast::{DefinitionStatement, Function, FunctionInput}; +use leo_ast::Function; use leo_errors::{AstError, Result}; use leo_span::Symbol; use indexmap::IndexMap; -use crate::VariableSymbol; +use crate::{VariableScope, VariableSymbol}; #[derive(Clone, Debug, Default, Eq, PartialEq)] pub struct SymbolTable<'a> { @@ -31,7 +31,7 @@ pub struct SymbolTable<'a> { functions: IndexMap, /// Variables represents functions variable definitions and input variables. /// This field is not populated till necessary. - pub(crate) variables: VariableSymbol<'a>, + pub(crate) variables: VariableScope<'a>, } impl<'a> SymbolTable<'a> { @@ -54,13 +54,7 @@ impl<'a> SymbolTable<'a> { Ok(()) } - pub fn insert_fn_input(&mut self, symbol: Symbol, insert: &'a FunctionInput) -> Result<()> { - self.check_shadowing(&symbol)?; - self.variables.inputs.insert(symbol, insert); - Ok(()) - } - - pub fn insert_variable(&mut self, symbol: Symbol, insert: &'a DefinitionStatement) -> Result<()> { + pub fn insert_variable(&mut self, symbol: Symbol, insert: VariableSymbol<'a>) -> Result<()> { self.check_shadowing(&symbol)?; self.variables.variables.insert(symbol, insert); Ok(()) @@ -70,19 +64,14 @@ impl<'a> SymbolTable<'a> { self.functions.get(symbol) } - pub fn lookup_fn_input(&self, symbol: &Symbol) -> Option<&&'a FunctionInput> { - self.variables.inputs.get(symbol) - } - - pub fn lookup_var(&self, symbol: &Symbol) -> Option<&&'a DefinitionStatement> { + pub fn lookup_variable(&self, symbol: &Symbol) -> Option<&VariableSymbol<'a>> { self.variables.variables.get(symbol) } pub fn push_variable_scope(&mut self) { let current_scope = self.variables.clone(); - self.variables = VariableSymbol { + self.variables = VariableScope { parent: Some(Box::new(current_scope)), - inputs: Default::default(), variables: Default::default(), }; } diff --git a/compiler/passes/src/symbol_table/variable_scope.rs b/compiler/passes/src/symbol_table/variable_scope.rs new file mode 100644 index 0000000000..ef11a3eba0 --- /dev/null +++ b/compiler/passes/src/symbol_table/variable_scope.rs @@ -0,0 +1,68 @@ +// Copyright (C) 2019-2022 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +use std::fmt::Display; + +use indexmap::IndexMap; +use leo_errors::{AstError, Result}; +use leo_span::Symbol; + +use crate::VariableSymbol; + +#[derive(Clone, Debug, Default, Eq, PartialEq)] +pub struct VariableScope<'a> { + /// The parent scope of variables if it exists. + /// For example if we are in a if block inside a function. + /// The parent would be the functions variables and inputs. + /// This field is populated as necessary. + pub(crate) parent: Option>>, + /// The variables defined in a scope. + /// This field is populated as necessary. + pub(crate) variables: IndexMap>, +} + +impl<'a> VariableScope<'a> { + pub fn check_shadowing(&self, symbol: &Symbol) -> Result<()> { + if let Some(var) = self.variables.get(symbol) { + Err(AstError::shadowed_variable(symbol, var.span).into()) + } else if let Some(parent) = &self.parent { + parent.check_shadowing(symbol) + } else { + Ok(()) + } + } + + pub fn clear(&mut self) { + self.parent = None; + self.variables.clear(); + } +} + +impl<'a> Display for VariableScope<'a> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "VariableScope")?; + self.parent + .as_ref() + .map(|parent| write!(f, "parent {parent}")) + .transpose()?; + + for (sym, var) in self.variables.iter() { + write!(f, "{sym} {var}")?; + } + + Ok(()) + } +} diff --git a/compiler/passes/src/symbol_table/variable_symbol.rs b/compiler/passes/src/symbol_table/variable_symbol.rs index 0903c84dcf..bcd2463206 100644 --- a/compiler/passes/src/symbol_table/variable_symbol.rs +++ b/compiler/passes/src/symbol_table/variable_symbol.rs @@ -16,63 +16,38 @@ use std::fmt::Display; -use indexmap::IndexMap; -use leo_ast::{DefinitionStatement, FunctionInput, Node}; -use leo_errors::{AstError, Result}; -use leo_span::Symbol; +use leo_ast::{ParamMode, Type}; +use leo_span::Span; -#[derive(Clone, Debug, Default, Eq, PartialEq)] -pub struct VariableSymbol<'a> { - /// The parent scope of variables if it exists. - /// For example if we are in a if block inside a function. - /// The parent would be the functions variables and inputs. - /// This field is populated as necessary. - pub(crate) parent: Option>>, - /// The input variables defined in a scope. - /// This field is populated as necessary. - pub(crate) inputs: IndexMap, - /// The variables defined in a scope. - /// This field is populated as necessary. - pub(crate) variables: IndexMap, +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum Declaration { + Const, + Input(ParamMode), + Mut, } -impl<'a> VariableSymbol<'a> { - pub fn check_shadowing(&self, symbol: &Symbol) -> Result<()> { - if let Some(input) = self.inputs.get(symbol) { - let span = input.span(); - Err(AstError::shadowed_function_input(symbol, span).into()) - } else if let Some(var) = self.variables.get(symbol) { - Err(AstError::shadowed_variable(symbol, &var.span).into()) - } else if let Some(parent) = &self.parent { - parent.check_shadowing(symbol) - } else { - Ok(()) +impl Display for Declaration { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + use Declaration::*; + + match self { + Const => write!(f, "const var"), + Input(m) => write!(f, "{m} input"), + Mut => write!(f, "mut var"), } } +} - pub fn clear(&mut self) { - self.parent = None; - self.inputs.clear(); - self.variables.clear(); - } +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct VariableSymbol<'a> { + pub type_: &'a Type, + pub span: &'a Span, + pub declaration: Declaration, } impl<'a> Display for VariableSymbol<'a> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "VariableSymbol")?; - self.parent - .as_ref() - .map(|parent| write!(f, "parent {parent}")) - .transpose()?; - - for input in self.inputs.values() { - write!(f, "{input}")?; - } - - for var in self.variables.values() { - write!(f, "{var}")?; - } - + write!(f, "{}: {}", self.declaration, self.type_)?; Ok(()) } } diff --git a/compiler/passes/src/type_checker/check.rs b/compiler/passes/src/type_checker/check.rs index a9070927b2..7ef9789c0e 100644 --- a/compiler/passes/src/type_checker/check.rs +++ b/compiler/passes/src/type_checker/check.rs @@ -18,7 +18,7 @@ use leo_ast::*; use leo_errors::{Result, TypeCheckerError}; use leo_span::Span; -use crate::TypeChecker; +use crate::{Declaration, TypeChecker, VariableSymbol}; impl<'a> TypeChecker<'a> { fn compare_types(&self, t1: Result>, t2: Result>, span: &Span) { @@ -66,8 +66,21 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { } fn visit_definition(&mut self, input: &'a DefinitionStatement) -> VisitResult { + let declaration = if input.declaration_type == Declare::Const { + Declaration::Const + } else { + Declaration::Mut + }; + input.variable_names.iter().for_each(|v| { - if let Err(err) = self.symbol_table.insert_variable(v.identifier.name, input) { + if let Err(err) = self.symbol_table.insert_variable( + v.identifier.name, + VariableSymbol { + type_: &input.type_, + span: input.span(), + declaration: declaration.clone(), + }, + ) { self.handler.emit_err(err); } @@ -78,40 +91,22 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { } fn visit_assign(&mut self, input: &'a AssignStatement) -> VisitResult { - let input_var = self.symbol_table.lookup_fn_input(&input.assignee.identifier.name); - let var = self.symbol_table.lookup_var(&input.assignee.identifier.name); - - match (input_var, var) { - (Some(var), None) => { - let inner = var.get_variable(); - if inner.mode() == ParamMode::Constant { - self.handler.emit_err( - TypeCheckerError::cannont_assign_to_const_input(&inner.identifier.name, var.span()).into(), - ); - } - - self.compare_types(var.get_type(), input.value.get_type(), input.span()); + let var_name = &input.assignee.identifier.name; + if let Some(var) = self.symbol_table.lookup_variable(var_name) { + match &var.declaration { + Declaration::Const => self + .handler + .emit_err(TypeCheckerError::cannont_assign_to_const_var(var_name, var.span).into()), + Declaration::Input(ParamMode::Constant) => self + .handler + .emit_err(TypeCheckerError::cannont_assign_to_const_input(var_name, var.span).into()), + _ => {} } - (None, Some(var)) => { - if var.declaration_type == Declare::Const { - // there will always be one variable name - // as we don't allow tuples at the moment. - self.handler.emit_err( - TypeCheckerError::cannont_assign_to_const_input( - &var.variable_names[0].identifier.name, - var.span(), - ) - .into(), - ); - } - self.compare_types(var.get_type(), input.value.get_type(), input.span()); - } - (None, None) => self - .handler - .emit_err(TypeCheckerError::unknown_assignee(&input.assignee.identifier.name, input.span()).into()), - // Don't have to error here as shadowing checks are done during insertions. - _ => {} + self.assert_type(input.value.get_type(), var.type_.clone(), input.span()) + } else { + self.handler + .emit_err(TypeCheckerError::unknown_assignee(&input.assignee.identifier.name, input.span()).into()) } VisitResult::VisitChildren @@ -174,8 +169,16 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { self.symbol_table.clear_variables(); self.parent = Some(input.name()); input.input.iter().for_each(|i| { - let symbol = i.get_variable().identifier.name; - if let Err(err) = self.symbol_table.insert_fn_input(symbol, i) { + let input_var = i.get_variable(); + + if let Err(err) = self.symbol_table.insert_variable( + input_var.identifier.name, + VariableSymbol { + type_: &input_var.type_, + span: input_var.span(), + declaration: Declaration::Input(input_var.mode()), + }, + ) { self.handler.emit_err(err); } }); diff --git a/leo/errors/src/errors/ast/ast_errors.rs b/leo/errors/src/errors/ast/ast_errors.rs index 3ca7ad1b10..c4d229e3cb 100644 --- a/leo/errors/src/errors/ast/ast_errors.rs +++ b/leo/errors/src/errors/ast/ast_errors.rs @@ -147,14 +147,6 @@ create_messages!( help: None, } - /// For when a user shadows a function input. - @formatted - shadowed_function_input { - args: (fn_input: impl Display), - msg: format!("function input `{fn_input}` shadowed"), - help: None, - } - /// For when a user shadows a variable. @formatted shadowed_variable { From 5cb4a5d8c0ada02cb7013714c40bc6f0b9056676 Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Tue, 3 May 2022 19:32:59 -0700 Subject: [PATCH 06/16] run tests so far, fix statements so far --- compiler/compiler/src/lib.rs | 2 + compiler/passes/src/symbol_table/table.rs | 2 +- .../passes/src/symbol_table/variable_scope.rs | 10 ++++ compiler/passes/src/type_checker/check.rs | 59 +++++++++++++++---- compiler/passes/src/type_checker/checker.rs | 4 +- compiler/passes/src/type_checker/mod.rs | 2 +- .../errors/type_checker/type_checker_error.rs | 10 ++++ 7 files changed, 75 insertions(+), 14 deletions(-) diff --git a/compiler/compiler/src/lib.rs b/compiler/compiler/src/lib.rs index e063b577e9..e94381c40b 100644 --- a/compiler/compiler/src/lib.rs +++ b/compiler/compiler/src/lib.rs @@ -130,6 +130,8 @@ impl<'a> Compiler<'a> { fn compiler_stages(&self) -> Result> { let symbol_table = CreateSymbolTable::do_pass((&self.ast, self.handler))?; + TypeChecker::do_pass((&self.ast, &mut symbol_table.clone(), self.handler))?; + Ok(symbol_table) } diff --git a/compiler/passes/src/symbol_table/table.rs b/compiler/passes/src/symbol_table/table.rs index f1f1895bfa..5c9df7b6ad 100644 --- a/compiler/passes/src/symbol_table/table.rs +++ b/compiler/passes/src/symbol_table/table.rs @@ -65,7 +65,7 @@ impl<'a> SymbolTable<'a> { } pub fn lookup_variable(&self, symbol: &Symbol) -> Option<&VariableSymbol<'a>> { - self.variables.variables.get(symbol) + self.variables.lookup_variable(symbol) } pub fn push_variable_scope(&mut self) { diff --git a/compiler/passes/src/symbol_table/variable_scope.rs b/compiler/passes/src/symbol_table/variable_scope.rs index ef11a3eba0..8d9cc98099 100644 --- a/compiler/passes/src/symbol_table/variable_scope.rs +++ b/compiler/passes/src/symbol_table/variable_scope.rs @@ -49,6 +49,16 @@ impl<'a> VariableScope<'a> { self.parent = None; self.variables.clear(); } + + pub fn lookup_variable(&self, symbol: &Symbol) -> Option<&VariableSymbol<'a>> { + if let Some(var) = self.variables.get(symbol) { + Some(var) + } else if let Some(parent) = &self.parent { + parent.lookup_variable(symbol) + } else { + None + } + } } impl<'a> Display for VariableScope<'a> { diff --git a/compiler/passes/src/type_checker/check.rs b/compiler/passes/src/type_checker/check.rs index 7ef9789c0e..576c91ffd5 100644 --- a/compiler/passes/src/type_checker/check.rs +++ b/compiler/passes/src/type_checker/check.rs @@ -48,18 +48,49 @@ impl<'a> TypeChecker<'a> { _ => {} } } + + fn compare_expr_type(&self, compare: Result>, expr: &Expression, span: &Span) { + match expr { + Expression::Identifier(ident) => { + if let Some(var) = self.symbol_table.lookup_variable(&ident.name) { + self.assert_type(compare, var.type_.clone(), span); + } else { + self.handler + .emit_err(TypeCheckerError::unknown_returnee(ident.name, span).into()); + } + } + expr => self.compare_types(compare, expr.get_type(), span), + } + } + + fn assert_expr_type(&self, expr: &Expression, expected: Type, span: &Span) { + match expr { + Expression::Identifier(ident) => { + if let Some(var) = self.symbol_table.lookup_variable(&ident.name) { + if var.type_ != &expected { + self.handler + .emit_err(TypeCheckerError::type_should_be(var.type_, expected, span).into()); + } + } else { + self.handler + .emit_err(TypeCheckerError::unknown_returnee(ident.name, span).into()); + } + } + expr => self.assert_type(expr.get_type(), expected, span), + } + } } impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {} -// we can safely unwrap all self.parent instances because -// statements should always have some parent block impl<'a> StatementVisitor<'a> for TypeChecker<'a> { fn visit_return(&mut self, input: &'a ReturnStatement) -> VisitResult { + // we can safely unwrap all self.parent instances because + // statements should always have some parent block let parent = self.parent.unwrap(); if let Some(func) = self.symbol_table.lookup_fn(&parent) { - self.compare_types(func.get_type(), input.get_type(), input.span()); + self.compare_expr_type(func.get_type(), &input.expression, input.span()); } VisitResult::VisitChildren @@ -103,7 +134,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { _ => {} } - self.assert_type(input.value.get_type(), var.type_.clone(), input.span()) + self.assert_expr_type(&input.value, var.type_.clone(), input.span()) } else { self.handler .emit_err(TypeCheckerError::unknown_assignee(&input.assignee.identifier.name, input.span()).into()) @@ -113,19 +144,27 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { } fn visit_conditional(&mut self, input: &'a ConditionalStatement) -> VisitResult { - self.assert_type(input.condition.get_type(), Type::Boolean, input.span()); + self.assert_expr_type(&input.condition, Type::Boolean, input.span()); VisitResult::VisitChildren } fn visit_iteration(&mut self, input: &'a IterationStatement) -> VisitResult { - // TODO: need to change symbol table to some other repr for variables. - // self.symbol_table.insert_variable(input.variable.name, input); + if let Err(err) = self.symbol_table.insert_variable( + input.variable.name, + VariableSymbol { + type_: &input.type_, + span: input.span(), + declaration: Declaration::Const, + }, + ) { + self.handler.emit_err(err); + } let iter_var_type = input.get_type(); - self.compare_types(iter_var_type.clone(), input.start.get_type(), input.span()); - self.compare_types(iter_var_type, input.stop.get_type(), input.span()); + self.compare_expr_type(iter_var_type.clone(), &input.start, input.span()); + self.compare_expr_type(iter_var_type, &input.stop, input.span()); VisitResult::VisitChildren } @@ -133,7 +172,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { fn visit_console(&mut self, input: &'a ConsoleStatement) -> VisitResult { match &input.function { ConsoleFunction::Assert(expr) => { - self.assert_type(expr.get_type(), Type::Boolean, expr.span()); + self.assert_expr_type(expr, Type::Boolean, expr.span()); } ConsoleFunction::Error(_) | ConsoleFunction::Log(_) => { todo!("need to discuss this"); diff --git a/compiler/passes/src/type_checker/checker.rs b/compiler/passes/src/type_checker/checker.rs index da4fb88117..33609632f9 100644 --- a/compiler/passes/src/type_checker/checker.rs +++ b/compiler/passes/src/type_checker/checker.rs @@ -20,13 +20,13 @@ use leo_span::Symbol; use crate::SymbolTable; pub struct TypeChecker<'a> { - pub(crate) symbol_table: SymbolTable<'a>, + pub(crate) symbol_table: &'a mut SymbolTable<'a>, pub(crate) handler: &'a Handler, pub(crate) parent: Option, } impl<'a> TypeChecker<'a> { - pub fn new(symbol_table: SymbolTable<'a>, handler: &'a Handler) -> Self { + pub fn new(symbol_table: &'a mut SymbolTable<'a>, handler: &'a Handler) -> Self { Self { symbol_table, handler, diff --git a/compiler/passes/src/type_checker/mod.rs b/compiler/passes/src/type_checker/mod.rs index f33bf66bdd..f5ce2e0b24 100644 --- a/compiler/passes/src/type_checker/mod.rs +++ b/compiler/passes/src/type_checker/mod.rs @@ -26,7 +26,7 @@ use leo_ast::{Ast, VisitorDirector}; use leo_errors::{emitter::Handler, Result}; impl<'a> Pass<'a> for TypeChecker<'a> { - type Input = (&'a Ast, SymbolTable<'a>, &'a Handler); + type Input = (&'a Ast, &'a mut SymbolTable<'a>, &'a Handler); type Output = Result<()>; fn do_pass((ast, symbol_table, handler): Self::Input) -> Self::Output { diff --git a/leo/errors/src/errors/type_checker/type_checker_error.rs b/leo/errors/src/errors/type_checker/type_checker_error.rs index cd6ce3b152..41a7f5c291 100644 --- a/leo/errors/src/errors/type_checker/type_checker_error.rs +++ b/leo/errors/src/errors/type_checker/type_checker_error.rs @@ -82,4 +82,14 @@ create_messages!( ), help: None, } + + /// For when the user tries to return a unknown variable. + @formatted + unknown_returnee { + args: (var: impl Display), + msg: format!( + "Unknown returnee `{var}`", + ), + help: None, + } ); From 9c8ac64871a343b1aff9e45607b6e06bce0eaf4c Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Wed, 4 May 2022 09:27:00 -0700 Subject: [PATCH 07/16] expressions so far, and clean up, need to appropiately handle binary exprs --- compiler/ast/src/common/identifier.rs | 4 - compiler/ast/src/expression/binary.rs | 21 --- compiler/ast/src/expression/call.rs | 4 - compiler/ast/src/expression/err.rs | 4 - compiler/ast/src/expression/mod.rs | 16 +-- compiler/ast/src/expression/ternary.rs | 4 - compiler/ast/src/expression/unary.rs | 8 -- compiler/ast/src/expression/value.rs | 13 -- compiler/ast/src/functions/function.rs | 5 - .../ast/src/functions/input/function_input.rs | 5 - .../ast/src/functions/input/input_variable.rs | 8 -- compiler/ast/src/node.rs | 6 - compiler/ast/src/statements/assign/mod.rs | 5 - compiler/ast/src/statements/block.rs | 7 +- compiler/ast/src/statements/conditional.rs | 5 - .../src/statements/console/console_args.rs | 5 - .../statements/console/console_function.rs | 5 - .../statements/console/console_statement.rs | 5 - compiler/ast/src/statements/definition/mod.rs | 5 - .../statements/definition/variable_name.rs | 5 - compiler/ast/src/statements/expression.rs | 5 - compiler/ast/src/statements/iteration.rs | 5 - .../ast/src/statements/return_statement.rs | 5 - compiler/ast/src/statements/statement.rs | 17 +-- .../src/type_checker/check_expressions.rs | 129 ++++++++++++++++++ .../passes/src/type_checker/check_file.rs | 42 ++++++ .../{check.rs => check_statements.rs} | 115 +++------------- compiler/passes/src/type_checker/checker.rs | 12 +- compiler/passes/src/type_checker/mod.rs | 10 +- .../errors/type_checker/type_checker_error.rs | 66 ++++----- 30 files changed, 241 insertions(+), 305 deletions(-) create mode 100644 compiler/passes/src/type_checker/check_expressions.rs create mode 100644 compiler/passes/src/type_checker/check_file.rs rename compiler/passes/src/type_checker/{check.rs => check_statements.rs} (52%) diff --git a/compiler/ast/src/common/identifier.rs b/compiler/ast/src/common/identifier.rs index d3e2c9a64b..a3937c0bc0 100644 --- a/compiler/ast/src/common/identifier.rs +++ b/compiler/ast/src/common/identifier.rs @@ -51,10 +51,6 @@ impl Node for Identifier { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - Ok(None) - } } impl Identifier { diff --git a/compiler/ast/src/expression/binary.rs b/compiler/ast/src/expression/binary.rs index f520ac2dda..5be8b12901 100644 --- a/compiler/ast/src/expression/binary.rs +++ b/compiler/ast/src/expression/binary.rs @@ -14,8 +14,6 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_errors::TypeCheckerError; - use super::*; /// A binary operator. @@ -158,23 +156,4 @@ impl Node for BinaryExpression { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - match self.op.class() { - BinaryOperationClass::Boolean => Ok(Some(Type::Boolean)), - BinaryOperationClass::Numeric => { - let left = self.left.get_type()?; - let right = self.right.get_type()?; - - match (left, right) { - (Some(t1), Some(t2)) if t1 == t2 => Ok(Some(t1)), - (None, None) => Ok(None), - (Some(t1), Some(t2)) => Err(TypeCheckerError::types_do_not_match(t1, t2, self.span()).into()), - (None, Some(t)) | (Some(t), None) => { - Err(TypeCheckerError::type_expected_but_not_found(t, self.span()).into()) - } - } - } - } - } } diff --git a/compiler/ast/src/expression/call.rs b/compiler/ast/src/expression/call.rs index 6c1c975129..2670141391 100644 --- a/compiler/ast/src/expression/call.rs +++ b/compiler/ast/src/expression/call.rs @@ -49,8 +49,4 @@ impl Node for CallExpression { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - Ok(None) - } } diff --git a/compiler/ast/src/expression/err.rs b/compiler/ast/src/expression/err.rs index afa09f12a2..23c94eeeeb 100644 --- a/compiler/ast/src/expression/err.rs +++ b/compiler/ast/src/expression/err.rs @@ -37,8 +37,4 @@ impl Node for ErrExpression { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - Ok(None) - } } diff --git a/compiler/ast/src/expression/mod.rs b/compiler/ast/src/expression/mod.rs index d28403463e..601b29c914 100644 --- a/compiler/ast/src/expression/mod.rs +++ b/compiler/ast/src/expression/mod.rs @@ -14,8 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{GroupValue, Identifier, IntegerType, Node, Type}; -use leo_errors::Result; +use crate::{GroupValue, Identifier, IntegerType, Node}; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -80,19 +79,6 @@ impl Node for Expression { Err(n) => n.set_span(span), } } - - fn get_type(&self) -> Result> { - use Expression::*; - match self { - Identifier(n) => n.get_type(), - Value(n) => n.get_type(), - Binary(n) => n.get_type(), - Unary(n) => n.get_type(), - Ternary(n) => n.get_type(), - Call(n) => n.get_type(), - Err(n) => n.get_type(), - } - } } impl fmt::Display for Expression { diff --git a/compiler/ast/src/expression/ternary.rs b/compiler/ast/src/expression/ternary.rs index 738b0565de..55b17a0630 100644 --- a/compiler/ast/src/expression/ternary.rs +++ b/compiler/ast/src/expression/ternary.rs @@ -43,8 +43,4 @@ impl Node for TernaryExpression { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - Ok(None) - } } diff --git a/compiler/ast/src/expression/unary.rs b/compiler/ast/src/expression/unary.rs index f627f267d6..d0abc53fef 100644 --- a/compiler/ast/src/expression/unary.rs +++ b/compiler/ast/src/expression/unary.rs @@ -24,9 +24,6 @@ pub enum UnaryOperation { Not, /// The arithmetic negation operator, i.e., `-`. Negate, - /// The bitwise negation operator, i.e., `~`. - /// For example, it transforms `1010` to `0101`. - BitNot, } impl AsRef for UnaryOperation { @@ -34,7 +31,6 @@ impl AsRef for UnaryOperation { match self { UnaryOperation::Not => "!", UnaryOperation::Negate => "-", - UnaryOperation::BitNot => "~", } } } @@ -64,8 +60,4 @@ impl Node for UnaryExpression { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - self.inner.get_type() - } } diff --git a/compiler/ast/src/expression/value.rs b/compiler/ast/src/expression/value.rs index da22d2d267..550b947c1b 100644 --- a/compiler/ast/src/expression/value.rs +++ b/compiler/ast/src/expression/value.rs @@ -85,17 +85,4 @@ impl Node for ValueExpression { }, } } - - fn get_type(&self) -> Result> { - use ValueExpression::*; - Ok(Some(match &self { - Address(_, _) => Type::Address, - Boolean(_, _) => Type::Boolean, - Char(_) => Type::Char, - Field(_, _) => Type::Field, - Integer(type_, _, _) => Type::IntegerType(*type_), - Group(_) => Type::Group, - String(_, _) => return Ok(None), - })) - } } diff --git a/compiler/ast/src/functions/function.rs b/compiler/ast/src/functions/function.rs index ed8d1c0c8f..63128083be 100644 --- a/compiler/ast/src/functions/function.rs +++ b/compiler/ast/src/functions/function.rs @@ -15,7 +15,6 @@ // along with the Leo library. If not, see . use crate::{Block, FunctionInput, Identifier, Node, Type}; -use leo_errors::Result; use leo_span::{sym, Span, Symbol}; use serde::{Deserialize, Serialize}; @@ -93,8 +92,4 @@ impl Node for Function { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - Ok(Some(self.output.clone())) - } } diff --git a/compiler/ast/src/functions/input/function_input.rs b/compiler/ast/src/functions/input/function_input.rs index ba2aeff3ad..def6089a4c 100644 --- a/compiler/ast/src/functions/input/function_input.rs +++ b/compiler/ast/src/functions/input/function_input.rs @@ -15,7 +15,6 @@ // along with the Leo library. If not, see . use crate::{Identifier, Node, Type}; -use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -96,8 +95,4 @@ impl Node for FunctionInputVariable { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - Ok(Some(self.type_.clone())) - } } diff --git a/compiler/ast/src/functions/input/input_variable.rs b/compiler/ast/src/functions/input/input_variable.rs index 3e0aebbedc..9317cb7b23 100644 --- a/compiler/ast/src/functions/input/input_variable.rs +++ b/compiler/ast/src/functions/input/input_variable.rs @@ -15,7 +15,6 @@ // along with the Leo library. If not, see . use crate::{FunctionInputVariable, Node}; -use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -84,11 +83,4 @@ impl Node for FunctionInput { Variable(variable) => variable.span = span, } } - - fn get_type(&self) -> Result> { - use FunctionInput::*; - match self { - Variable(variable) => variable.get_type(), - } - } } diff --git a/compiler/ast/src/node.rs b/compiler/ast/src/node.rs index 7f62efcaed..be0c100b9c 100644 --- a/compiler/ast/src/node.rs +++ b/compiler/ast/src/node.rs @@ -14,11 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_errors::Result; use leo_span::Span; -use crate::Type; - /// A node in the AST. pub trait Node: std::fmt::Debug + std::fmt::Display + Clone + PartialEq + Eq + serde::Serialize + serde::de::DeserializeOwned @@ -28,7 +25,4 @@ pub trait Node: /// Sets the span of the node. fn set_span(&mut self, span: Span); - - /// Gets the type of the node if it exists. - fn get_type(&self) -> Result>; } diff --git a/compiler/ast/src/statements/assign/mod.rs b/compiler/ast/src/statements/assign/mod.rs index e78e617c1a..3aba9075f5 100644 --- a/compiler/ast/src/statements/assign/mod.rs +++ b/compiler/ast/src/statements/assign/mod.rs @@ -15,7 +15,6 @@ // along with the Leo library. If not, see . use crate::{Expression, Node}; -use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -109,8 +108,4 @@ impl Node for AssignStatement { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - self.value.get_type() - } } diff --git a/compiler/ast/src/statements/block.rs b/compiler/ast/src/statements/block.rs index 62e20c2af2..e54a4a6ba5 100644 --- a/compiler/ast/src/statements/block.rs +++ b/compiler/ast/src/statements/block.rs @@ -14,8 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Node, Statement, Type}; -use leo_errors::Result; +use crate::{Node, Statement}; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -52,8 +51,4 @@ impl Node for Block { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - Ok(None) - } } diff --git a/compiler/ast/src/statements/conditional.rs b/compiler/ast/src/statements/conditional.rs index e9895382f5..2e4adf6b65 100644 --- a/compiler/ast/src/statements/conditional.rs +++ b/compiler/ast/src/statements/conditional.rs @@ -15,7 +15,6 @@ // along with the Leo library. If not, see . use crate::{Block, Expression, Node, Statement}; -use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -52,8 +51,4 @@ impl Node for ConditionalStatement { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - Ok(None) - } } diff --git a/compiler/ast/src/statements/console/console_args.rs b/compiler/ast/src/statements/console/console_args.rs index 6eb79ae7ae..4c03aa26df 100644 --- a/compiler/ast/src/statements/console/console_args.rs +++ b/compiler/ast/src/statements/console/console_args.rs @@ -15,7 +15,6 @@ // along with the Leo library. If not, see . use crate::{Char, Expression, Node}; -use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -55,8 +54,4 @@ impl Node for ConsoleArgs { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - Ok(None) - } } diff --git a/compiler/ast/src/statements/console/console_function.rs b/compiler/ast/src/statements/console/console_function.rs index e22928e77b..dc7a2baf08 100644 --- a/compiler/ast/src/statements/console/console_function.rs +++ b/compiler/ast/src/statements/console/console_function.rs @@ -15,7 +15,6 @@ // along with the Leo library. If not, see . use crate::{ConsoleArgs, Expression, Node}; -use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -59,8 +58,4 @@ impl Node for ConsoleFunction { ConsoleFunction::Error(formatted) | ConsoleFunction::Log(formatted) => formatted.set_span(span), } } - - fn get_type(&self) -> Result> { - Ok(None) - } } diff --git a/compiler/ast/src/statements/console/console_statement.rs b/compiler/ast/src/statements/console/console_statement.rs index 28fd48fe2a..7673ef3ca3 100644 --- a/compiler/ast/src/statements/console/console_statement.rs +++ b/compiler/ast/src/statements/console/console_statement.rs @@ -15,7 +15,6 @@ // along with the Leo library. If not, see . use crate::{ConsoleFunction, Node}; -use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -50,8 +49,4 @@ impl Node for ConsoleStatement { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - Ok(None) - } } diff --git a/compiler/ast/src/statements/definition/mod.rs b/compiler/ast/src/statements/definition/mod.rs index 1cdaf2dd76..4f0e514438 100644 --- a/compiler/ast/src/statements/definition/mod.rs +++ b/compiler/ast/src/statements/definition/mod.rs @@ -15,7 +15,6 @@ // along with the Leo library. If not, see . use crate::{Expression, Node, Type}; -use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -73,8 +72,4 @@ impl Node for DefinitionStatement { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - Ok(Some(self.type_.clone())) - } } diff --git a/compiler/ast/src/statements/definition/variable_name.rs b/compiler/ast/src/statements/definition/variable_name.rs index 22b169c7e6..71f43aa6d1 100644 --- a/compiler/ast/src/statements/definition/variable_name.rs +++ b/compiler/ast/src/statements/definition/variable_name.rs @@ -15,7 +15,6 @@ // along with the Leo library. If not, see . use crate::{Identifier, Node}; -use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -46,8 +45,4 @@ impl Node for VariableName { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - Ok(None) - } } diff --git a/compiler/ast/src/statements/expression.rs b/compiler/ast/src/statements/expression.rs index e429109f1e..93ed15c3e5 100644 --- a/compiler/ast/src/statements/expression.rs +++ b/compiler/ast/src/statements/expression.rs @@ -15,7 +15,6 @@ // along with the Leo library. If not, see . use crate::{Expression, Node}; -use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -44,8 +43,4 @@ impl Node for ExpressionStatement { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - self.expression.get_type() - } } diff --git a/compiler/ast/src/statements/iteration.rs b/compiler/ast/src/statements/iteration.rs index 00ac0f7830..3fdfc94bc9 100644 --- a/compiler/ast/src/statements/iteration.rs +++ b/compiler/ast/src/statements/iteration.rs @@ -15,7 +15,6 @@ // along with the Leo library. If not, see . use crate::{Block, Expression, Identifier, Node, Type}; -use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -60,8 +59,4 @@ impl Node for IterationStatement { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - Ok(Some(self.type_.clone())) - } } diff --git a/compiler/ast/src/statements/return_statement.rs b/compiler/ast/src/statements/return_statement.rs index ae9f00a8dd..e1d25dc050 100644 --- a/compiler/ast/src/statements/return_statement.rs +++ b/compiler/ast/src/statements/return_statement.rs @@ -15,7 +15,6 @@ // along with the Leo library. If not, see . use crate::{Expression, Node}; -use leo_errors::Result; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -44,8 +43,4 @@ impl Node for ReturnStatement { fn set_span(&mut self, span: Span) { self.span = span; } - - fn get_type(&self) -> Result> { - self.expression.get_type() - } } diff --git a/compiler/ast/src/statements/statement.rs b/compiler/ast/src/statements/statement.rs index c6d6aed9a0..c6f97e8f45 100644 --- a/compiler/ast/src/statements/statement.rs +++ b/compiler/ast/src/statements/statement.rs @@ -14,8 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{ConditionalStatement, Node, Type}; -use leo_errors::Result; +use crate::{ConditionalStatement, Node}; use leo_span::Span; use super::*; @@ -87,18 +86,4 @@ impl Node for Statement { Block(n) => n.set_span(span), } } - - fn get_type(&self) -> Result> { - use Statement::*; - match self { - Return(n) => n.get_type(), - Definition(n) => n.get_type(), - Assign(n) => n.get_type(), - Conditional(n) => n.get_type(), - Iteration(n) => n.get_type(), - Console(n) => n.get_type(), - Expression(n) => n.get_type(), - Block(n) => n.get_type(), - } - } } diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs new file mode 100644 index 0000000000..b0ee74657b --- /dev/null +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -0,0 +1,129 @@ +// Copyright (C) 2019-2022 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +use leo_ast::*; +use leo_errors::TypeCheckerError; +use leo_span::Span; + +use crate::TypeChecker; + +impl<'a> TypeChecker<'a> { + pub(crate) fn compare_expr_type(&self, expr: &Expression, expected: Type, span: &Span) { + match expr { + Expression::Identifier(ident) => { + if let Some(var) = self.symbol_table.lookup_variable(&ident.name) { + self.assert_type(var.type_.clone(), expected, var.span); + } else { + self.handler + .emit_err(TypeCheckerError::unknown_sym("variable", ident.name, span).into()); + } + } + Expression::Value(value) => match value { + ValueExpression::Address(_, _) => self.assert_type(Type::Address, expected, value.span()), + ValueExpression::Boolean(_, _) => self.assert_type(Type::Boolean, expected, value.span()), + ValueExpression::Char(_) => self.assert_type(Type::Char, expected, value.span()), + ValueExpression::Field(_, _) => self.assert_type(Type::Field, expected, value.span()), + ValueExpression::Integer(type_, _, _) => { + self.assert_type(Type::IntegerType(*type_), expected, value.span()) + } + ValueExpression::Group(_) => self.assert_type(Type::Group, expected, value.span()), + ValueExpression::String(_, _) => {} + }, + Expression::Binary(binary) => match binary.op.class() { + // some ops support more types than listed here + BinaryOperationClass::Boolean => { + self.assert_type(Type::Boolean, expected, span); + self.compare_expr_type(&binary.left, Type::Boolean, binary.span()); + self.compare_expr_type(&binary.right, Type::Boolean, binary.span()); + } + BinaryOperationClass::Numeric => { + // depending on operation could also be field or group + if !matches!(expected, Type::IntegerType(_)) { + self.handler + .emit_err(TypeCheckerError::type_should_be_integer(binary.op, expected.clone(), span).into()); + } + + self.compare_expr_type(&binary.left, expected.clone(), binary.span()); + self.compare_expr_type(&binary.right, expected, binary.span()); + } + }, + Expression::Unary(unary) => match unary.op { + UnaryOperation::Not => { + self.assert_type(Type::Boolean, expected, unary.span()); + self.compare_expr_type(&unary.inner, Type::Boolean, unary.inner.span()); + } + UnaryOperation::Negate => { + match expected { + Type::IntegerType( + IntegerType::I8 + | IntegerType::I16 + | IntegerType::I32 + | IntegerType::I64 + | IntegerType::I128, + ) + | Type::Field + | Type::Group => {} + _ => self.handler.emit_err( + TypeCheckerError::type_is_not_negatable(expected.clone(), unary.inner.span()).into(), + ), + } + self.compare_expr_type(&unary.inner, expected, unary.inner.span()); + } + }, + Expression::Ternary(ternary) => { + self.compare_expr_type(&ternary.condition, Type::Boolean, ternary.condition.span()); + self.compare_expr_type(&ternary.if_true, expected.clone(), ternary.if_true.span()); + self.compare_expr_type(&ternary.if_false, expected, ternary.if_false.span()); + } + Expression::Call(call) => match &*call.function { + Expression::Identifier(ident) => { + if let Some(func) = self.symbol_table.lookup_fn(&ident.name) { + self.assert_type(func.output.clone(), expected, ident.span()); + + if func.input.len() != call.arguments.len() { + self.handler.emit_err( + TypeCheckerError::incorrect_num_args_to_call( + func.input.len(), + call.arguments.len(), + call.span(), + ) + .into(), + ); + } + + func.input + .iter() + .zip(call.arguments.iter()) + .for_each(|(expected, argument)| { + self.compare_expr_type( + argument, + expected.get_variable().type_.clone(), + argument.span(), + ); + }); + } else { + self.handler + .emit_err(TypeCheckerError::unknown_sym("function", &ident.name, ident.span()).into()); + } + } + expr => self.compare_expr_type(expr, expected, call.span()), + }, + Expression::Err(_) => {} + } + } +} + +impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {} diff --git a/compiler/passes/src/type_checker/check_file.rs b/compiler/passes/src/type_checker/check_file.rs new file mode 100644 index 0000000000..d46163d3a3 --- /dev/null +++ b/compiler/passes/src/type_checker/check_file.rs @@ -0,0 +1,42 @@ +// Copyright (C) 2019-2022 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +use leo_ast::*; + +use crate::{Declaration, TypeChecker, VariableSymbol}; + +impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { + fn visit_function(&mut self, input: &'a Function) -> VisitResult { + self.symbol_table.clear_variables(); + self.parent = Some(input.name()); + input.input.iter().for_each(|i| { + let input_var = i.get_variable(); + + if let Err(err) = self.symbol_table.insert_variable( + input_var.identifier.name, + VariableSymbol { + type_: &input_var.type_, + span: input_var.span(), + declaration: Declaration::Input(input_var.mode()), + }, + ) { + self.handler.emit_err(err); + } + }); + + VisitResult::VisitChildren + } +} diff --git a/compiler/passes/src/type_checker/check.rs b/compiler/passes/src/type_checker/check_statements.rs similarity index 52% rename from compiler/passes/src/type_checker/check.rs rename to compiler/passes/src/type_checker/check_statements.rs index 576c91ffd5..3ca5b4394d 100644 --- a/compiler/passes/src/type_checker/check.rs +++ b/compiler/passes/src/type_checker/check_statements.rs @@ -15,73 +15,10 @@ // along with the Leo library. If not, see . use leo_ast::*; -use leo_errors::{Result, TypeCheckerError}; -use leo_span::Span; +use leo_errors::TypeCheckerError; use crate::{Declaration, TypeChecker, VariableSymbol}; -impl<'a> TypeChecker<'a> { - fn compare_types(&self, t1: Result>, t2: Result>, span: &Span) { - match (t1, t2) { - (Ok(Some(t1)), Ok(Some(t2))) if t1 != t2 => self - .handler - .emit_err(TypeCheckerError::types_do_not_match(t1, t2, span).into()), - (Ok(Some(t)), Ok(None)) | (Ok(None), Ok(Some(t))) => self - .handler - .emit_err(TypeCheckerError::type_expected_but_not_found(t, span).into()), - (Err(err), Ok(None)) | (Ok(None), Err(err)) => self.handler.emit_err(err), - (Err(err1), Err(err2)) => { - self.handler.emit_err(err1); - self.handler.emit_err(err2); - } - // Types match - _ => {} - } - } - - fn assert_type(&self, type_: Result>, expected: Type, span: &Span) { - match type_ { - Ok(Some(type_)) if type_ != expected => self - .handler - .emit_err(TypeCheckerError::type_should_be(type_, expected, span).into()), - // Types match - _ => {} - } - } - - fn compare_expr_type(&self, compare: Result>, expr: &Expression, span: &Span) { - match expr { - Expression::Identifier(ident) => { - if let Some(var) = self.symbol_table.lookup_variable(&ident.name) { - self.assert_type(compare, var.type_.clone(), span); - } else { - self.handler - .emit_err(TypeCheckerError::unknown_returnee(ident.name, span).into()); - } - } - expr => self.compare_types(compare, expr.get_type(), span), - } - } - - fn assert_expr_type(&self, expr: &Expression, expected: Type, span: &Span) { - match expr { - Expression::Identifier(ident) => { - if let Some(var) = self.symbol_table.lookup_variable(&ident.name) { - if var.type_ != &expected { - self.handler - .emit_err(TypeCheckerError::type_should_be(var.type_, expected, span).into()); - } - } else { - self.handler - .emit_err(TypeCheckerError::unknown_returnee(ident.name, span).into()); - } - } - expr => self.assert_type(expr.get_type(), expected, span), - } - } -} - -impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {} impl<'a> StatementVisitor<'a> for TypeChecker<'a> { fn visit_return(&mut self, input: &'a ReturnStatement) -> VisitResult { @@ -90,7 +27,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { let parent = self.parent.unwrap(); if let Some(func) = self.symbol_table.lookup_fn(&parent) { - self.compare_expr_type(func.get_type(), &input.expression, input.span()); + self.compare_expr_type(&input.expression, func.output.clone(), input.expression.span()); } VisitResult::VisitChildren @@ -115,7 +52,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { self.handler.emit_err(err); } - self.compare_types(input.get_type(), input.get_type(), input.span()); + self.compare_expr_type(&input.value, input.type_.clone(), input.value.span()); }); VisitResult::VisitChildren @@ -134,17 +71,18 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { _ => {} } - self.assert_expr_type(&input.value, var.type_.clone(), input.span()) + self.compare_expr_type(&input.value, var.type_.clone(), input.value.span()) } else { - self.handler - .emit_err(TypeCheckerError::unknown_assignee(&input.assignee.identifier.name, input.span()).into()) + self.handler.emit_err( + TypeCheckerError::unknown_sym("variable", &input.assignee.identifier.name, &input.assignee.span).into(), + ) } VisitResult::VisitChildren } fn visit_conditional(&mut self, input: &'a ConditionalStatement) -> VisitResult { - self.assert_expr_type(&input.condition, Type::Boolean, input.span()); + self.compare_expr_type(&input.condition, Type::Boolean, input.condition.span()); VisitResult::VisitChildren } @@ -161,10 +99,8 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { self.handler.emit_err(err); } - let iter_var_type = input.get_type(); - - self.compare_expr_type(iter_var_type.clone(), &input.start, input.span()); - self.compare_expr_type(iter_var_type, &input.stop, input.span()); + self.compare_expr_type(&input.start, input.type_.clone(), input.start.span()); + self.compare_expr_type(&input.stop, input.type_.clone(), input.stop.span()); VisitResult::VisitChildren } @@ -172,7 +108,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { fn visit_console(&mut self, input: &'a ConsoleStatement) -> VisitResult { match &input.function { ConsoleFunction::Assert(expr) => { - self.assert_expr_type(expr, Type::Boolean, expr.span()); + self.compare_expr_type(expr, Type::Boolean, expr.span()); } ConsoleFunction::Error(_) | ConsoleFunction::Log(_) => { todo!("need to discuss this"); @@ -182,6 +118,10 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { VisitResult::VisitChildren } + fn visit_expression_statement(&mut self, _input: &'a ExpressionStatement) -> VisitResult { + VisitResult::SkipChildren + } + fn visit_block(&mut self, input: &'a Block) -> VisitResult { self.symbol_table.push_variable_scope(); // have to redo the logic here so we have scoping @@ -201,27 +141,4 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { VisitResult::SkipChildren } -} - -impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { - fn visit_function(&mut self, input: &'a Function) -> VisitResult { - self.symbol_table.clear_variables(); - self.parent = Some(input.name()); - input.input.iter().for_each(|i| { - let input_var = i.get_variable(); - - if let Err(err) = self.symbol_table.insert_variable( - input_var.identifier.name, - VariableSymbol { - type_: &input_var.type_, - span: input_var.span(), - declaration: Declaration::Input(input_var.mode()), - }, - ) { - self.handler.emit_err(err); - } - }); - - VisitResult::VisitChildren - } -} +} \ No newline at end of file diff --git a/compiler/passes/src/type_checker/checker.rs b/compiler/passes/src/type_checker/checker.rs index 33609632f9..a22acf9d12 100644 --- a/compiler/passes/src/type_checker/checker.rs +++ b/compiler/passes/src/type_checker/checker.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_errors::emitter::Handler; -use leo_span::Symbol; +use leo_ast::Type; +use leo_errors::{emitter::Handler, TypeCheckerError}; +use leo_span::{Symbol, Span}; use crate::SymbolTable; @@ -33,4 +34,11 @@ impl<'a> TypeChecker<'a> { parent: None, } } + + pub(crate) fn assert_type(&self, type_: Type, expected: Type, span: &Span) { + if type_ != expected { + self.handler + .emit_err(TypeCheckerError::type_should_be(type_, expected, span).into()); + } + } } diff --git a/compiler/passes/src/type_checker/mod.rs b/compiler/passes/src/type_checker/mod.rs index f5ce2e0b24..b16ea905b7 100644 --- a/compiler/passes/src/type_checker/mod.rs +++ b/compiler/passes/src/type_checker/mod.rs @@ -14,8 +14,14 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -pub mod check; -pub use check::*; +pub mod check_expressions; +pub use check_expressions::*; + +pub mod check_file; +pub use check_file::*; + +pub mod check_statements; +pub use check_statements::*; pub mod checker; pub use checker::*; diff --git a/leo/errors/src/errors/type_checker/type_checker_error.rs b/leo/errors/src/errors/type_checker/type_checker_error.rs index 41a7f5c291..95cff62401 100644 --- a/leo/errors/src/errors/type_checker/type_checker_error.rs +++ b/leo/errors/src/errors/type_checker/type_checker_error.rs @@ -23,36 +23,6 @@ create_messages!( code_mask: 2000i32, code_prefix: "TYC", - /// For when types do not match. - @formatted - types_do_not_match { - args: (lhs: impl Display, rhs: impl Display), - msg: format!( - "unexpected type, lhs type is: '{lhs}', but rhs type is: '{rhs}'", - ), - help: None, - } - - /// For when types do not match. - @formatted - type_expected_but_not_found { - args: (known: impl Display), - msg: format!( - "One side has type: '{known}', but the other has no type", - ), - help: None, - } - - /// For when the user tries to assign to a unknown variable. - @formatted - unknown_assignee { - args: (var: impl Display), - msg: format!( - "Unknown assignee `{var}`", - ), - help: None, - } - /// For when the user tries to assign to a const input. @formatted cannont_assign_to_const_input { @@ -85,10 +55,40 @@ create_messages!( /// For when the user tries to return a unknown variable. @formatted - unknown_returnee { - args: (var: impl Display), + unknown_sym { + args: (kind: impl Display, sym: impl Display), msg: format!( - "Unknown returnee `{var}`", + "Unknown {kind} `{sym}`", + ), + help: None, + } + + /// For when the user tries to expect a non integer type . + @formatted + type_should_be_integer { + args: (op: impl Debug, type_: impl Display), + msg: format!( + "Binary statement has numeric operation `{op:?}` but has expected type `{type_}`", + ), + help: None, + } + + /// For when the user tries to negate a non negatable type. + @formatted + type_is_not_negatable { + args: (type_: impl Display), + msg: format!( + "The type `{type_}` is not negatable", + ), + help: None, + } + + /// For when the user tries calls a function with the incorrect number of args. + @formatted + incorrect_num_args_to_call { + args: (expected: impl Display, received: impl Display), + msg: format!( + "Call expected `{expected}` args, got `{received}`", ), help: None, } From 2c252f7878e958e8c34b1fc2c53ce2f3a5807176 Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Wed, 4 May 2022 13:37:53 -0700 Subject: [PATCH 08/16] all current compiler tests pass, need to add more --- compiler/ast/src/expression/binary.rs | 28 --- .../src/type_checker/check_expressions.rs | 172 ++++++++++++++---- .../passes/src/type_checker/check_file.rs | 2 +- .../src/type_checker/check_statements.rs | 19 +- compiler/passes/src/type_checker/checker.rs | 91 ++++++++- .../errors/type_checker/type_checker_error.rs | 42 ++++- .../integers/i16/{pow.leo => pow_fail.leo} | 2 +- .../integers/i8/{pow.leo => pow_fail.leo} | 2 +- .../compiler/compiler/address/branch.leo.out | 2 +- .../compiler/definition/out_of_order.leo.out | 2 +- .../function/conditional_return.leo.out | 2 +- .../compiler/function/iteration.leo.out | 2 +- .../function/iteration_repeated.leo.out | 2 +- .../compiler/function/repeated.leo.out | 2 +- .../compiler/compiler/function/return.leo.out | 2 +- .../input_files/program_input/main.leo.out | 2 +- .../program_input/main_field.leo.out | 2 +- .../program_input/main_group.leo.out | 2 +- .../program_input_constants/main.leo.out | 2 +- .../main_field.leo.out | 2 +- .../main_group.leo.out | 2 +- .../main_multiple.leo.out | 2 +- .../compiler/integers/i128/add.leo.out | 2 +- .../integers/i128/console_assert.leo.out | 2 +- .../compiler/integers/i128/div.leo.out | 2 +- .../compiler/integers/i128/eq.leo.out | 2 +- .../compiler/integers/i128/max.leo.out | 2 +- .../compiler/integers/i128/min.leo.out | 2 +- .../compiler/integers/i16/add.leo.out | 2 +- .../integers/i16/console_assert.leo.out | 2 +- .../compiler/integers/i16/div.leo.out | 2 +- .../compiler/compiler/integers/i16/eq.leo.out | 2 +- .../compiler/integers/i16/max.leo.out | 2 +- .../compiler/integers/i16/min.leo.out | 2 +- .../compiler/integers/i16/pow_fail.leo.out | 5 + .../compiler/integers/i32/add.leo.out | 2 +- .../integers/i32/console_assert.leo.out | 2 +- .../compiler/integers/i32/div.leo.out | 2 +- .../compiler/compiler/integers/i32/eq.leo.out | 2 +- .../compiler/integers/i32/max.leo.out | 2 +- .../compiler/integers/i32/min.leo.out | 2 +- .../compiler/integers/i64/add.leo.out | 2 +- .../integers/i64/console_assert.leo.out | 2 +- .../compiler/integers/i64/div.leo.out | 2 +- .../compiler/compiler/integers/i64/eq.leo.out | 2 +- .../compiler/integers/i64/max.leo.out | 2 +- .../compiler/integers/i64/min.leo.out | 2 +- .../compiler/compiler/integers/i8/add.leo.out | 2 +- .../integers/i8/console_assert.leo.out | 2 +- .../compiler/compiler/integers/i8/div.leo.out | 2 +- .../compiler/compiler/integers/i8/eq.leo.out | 2 +- .../compiler/compiler/integers/i8/max.leo.out | 2 +- .../compiler/compiler/integers/i8/min.leo.out | 2 +- .../compiler/integers/i8/pow_fail.leo.out | 5 + .../compiler/integers/u128/add.leo.out | 2 +- .../integers/u128/console_assert.leo.out | 2 +- .../compiler/integers/u128/div.leo.out | 2 +- .../compiler/integers/u128/eq.leo.out | 2 +- .../compiler/integers/u128/max.leo.out | 2 +- .../compiler/integers/u128/min.leo.out | 2 +- .../compiler/integers/u16/add.leo.out | 2 +- .../integers/u16/console_assert.leo.out | 2 +- .../compiler/integers/u16/div.leo.out | 2 +- .../compiler/compiler/integers/u16/eq.leo.out | 2 +- .../compiler/integers/u16/max.leo.out | 2 +- .../compiler/integers/u16/min.leo.out | 2 +- .../compiler/integers/u16/pow.leo.out | 2 +- .../compiler/integers/u32/add.leo.out | 2 +- .../integers/u32/console_assert.leo.out | 2 +- .../compiler/integers/u32/div.leo.out | 2 +- .../compiler/compiler/integers/u32/eq.leo.out | 2 +- .../compiler/integers/u32/max.leo.out | 2 +- .../compiler/integers/u32/min.leo.out | 2 +- .../compiler/integers/u64/add.leo.out | 2 +- .../integers/u64/console_assert.leo.out | 2 +- .../compiler/integers/u64/div.leo.out | 2 +- .../compiler/compiler/integers/u64/eq.leo.out | 2 +- .../compiler/integers/u64/max.leo.out | 2 +- .../compiler/integers/u64/min.leo.out | 2 +- .../compiler/compiler/integers/u8/add.leo.out | 2 +- .../integers/u8/console_assert.leo.out | 2 +- .../compiler/compiler/integers/u8/div.leo.out | 2 +- .../compiler/compiler/integers/u8/eq.leo.out | 2 +- .../compiler/compiler/integers/u8/max.leo.out | 2 +- .../compiler/compiler/integers/u8/min.leo.out | 2 +- .../compiler/compiler/integers/u8/pow.leo.out | 2 +- .../compiler/mutability/cond_mut.leo.out | 2 +- .../mutability/function_input_mut.leo.out | 2 +- .../mutability/let_mut_nested.leo.out | 2 +- .../ternary_explicit_and_implicit.leo.out | 2 +- 90 files changed, 364 insertions(+), 164 deletions(-) rename tests/compiler/integers/i16/{pow.leo => pow_fail.leo} (87%) rename tests/compiler/integers/i8/{pow.leo => pow_fail.leo} (87%) create mode 100644 tests/expectations/compiler/compiler/integers/i16/pow_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i8/pow_fail.leo.out diff --git a/compiler/ast/src/expression/binary.rs b/compiler/ast/src/expression/binary.rs index 5be8b12901..f183626566 100644 --- a/compiler/ast/src/expression/binary.rs +++ b/compiler/ast/src/expression/binary.rs @@ -47,20 +47,6 @@ pub enum BinaryOperation { Le, /// Lesser-than relation, i.e. `<`. Lt, - /// Bitwise-or inclusive, i.e., `|`. - BitOr, - /// Bitwise-and, i.e., `&`. - BitAnd, - /// Bitwise-or exclusive, i.e., `^`. - BitXor, - /// Shift-right, i.e `>>`. - Shr, - /// Unsigned shift-right, i.e `>>>`. - ShrSigned, - /// Shift-left, i.e `<<`. - Shl, - /// Modulus or remainder operation, i.e., `%`. - Mod, } /// The category a binary operation belongs to. @@ -88,13 +74,6 @@ impl AsRef for BinaryOperation { BinaryOperation::Gt => ">", BinaryOperation::Le => "<=", BinaryOperation::Lt => "<", - BinaryOperation::BitOr => "|", - BinaryOperation::BitAnd => "&", - BinaryOperation::BitXor => "^", - BinaryOperation::Shr => ">>", - BinaryOperation::ShrSigned => ">>>", - BinaryOperation::Shl => "<<", - BinaryOperation::Mod => "%", } } } @@ -108,13 +87,6 @@ impl BinaryOperation { | BinaryOperation::Sub | BinaryOperation::Mul | BinaryOperation::Div - | BinaryOperation::BitOr - | BinaryOperation::BitAnd - | BinaryOperation::BitXor - | BinaryOperation::Shr - | BinaryOperation::ShrSigned - | BinaryOperation::Shl - | BinaryOperation::Mod | BinaryOperation::Pow => BinaryOperationClass::Numeric, BinaryOperation::Or | BinaryOperation::And diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index b0ee74657b..4934b6495b 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -20,78 +20,175 @@ use leo_span::Span; use crate::TypeChecker; +fn return_incorrect_type(t1: Option, t2: Option, expected: Option) -> Option { + match (t1, t2) { + (Some(t1), Some(t2)) if t1 == t2 => Some(t1), + (Some(t1), Some(t2)) => { + if let Some(expected) = expected { + if t1 != expected { + Some(t1) + } else { + Some(t2) + } + } else { + Some(t1) + } + } + (None, Some(_)) | (Some(_), None) | (None, None) => None, + } +} + impl<'a> TypeChecker<'a> { - pub(crate) fn compare_expr_type(&self, expr: &Expression, expected: Type, span: &Span) { + pub(crate) fn compare_expr_type(&self, expr: &Expression, expected: Option, span: &Span) -> Option { match expr { Expression::Identifier(ident) => { if let Some(var) = self.symbol_table.lookup_variable(&ident.name) { - self.assert_type(var.type_.clone(), expected, var.span); + Some(self.assert_type(var.type_.clone(), expected, span)) } else { self.handler .emit_err(TypeCheckerError::unknown_sym("variable", ident.name, span).into()); + None } } Expression::Value(value) => match value { - ValueExpression::Address(_, _) => self.assert_type(Type::Address, expected, value.span()), - ValueExpression::Boolean(_, _) => self.assert_type(Type::Boolean, expected, value.span()), - ValueExpression::Char(_) => self.assert_type(Type::Char, expected, value.span()), - ValueExpression::Field(_, _) => self.assert_type(Type::Field, expected, value.span()), + ValueExpression::Address(_, _) => Some(self.assert_type(Type::Address, expected, value.span())), + ValueExpression::Boolean(_, _) => Some(self.assert_type(Type::Boolean, expected, value.span())), + ValueExpression::Char(_) => Some(self.assert_type(Type::Char, expected, value.span())), + ValueExpression::Field(_, _) => Some(self.assert_type(Type::Field, expected, value.span())), ValueExpression::Integer(type_, _, _) => { - self.assert_type(Type::IntegerType(*type_), expected, value.span()) + Some(self.assert_type(Type::IntegerType(*type_), expected, value.span())) } - ValueExpression::Group(_) => self.assert_type(Type::Group, expected, value.span()), - ValueExpression::String(_, _) => {} + ValueExpression::Group(_) => Some(self.assert_type(Type::Group, expected, value.span())), + ValueExpression::String(_, _) => None, }, - Expression::Binary(binary) => match binary.op.class() { - // some ops support more types than listed here - BinaryOperationClass::Boolean => { - self.assert_type(Type::Boolean, expected, span); - self.compare_expr_type(&binary.left, Type::Boolean, binary.span()); - self.compare_expr_type(&binary.right, Type::Boolean, binary.span()); + Expression::Binary(binary) => match binary.op { + BinaryOperation::And | BinaryOperation::Or => { + self.assert_type(Type::Boolean, expected.clone(), binary.span()); + let t1 = self.compare_expr_type(&binary.left, expected.clone(), binary.left.span()); + let t2 = self.compare_expr_type(&binary.right, expected.clone(), binary.right.span()); + + return_incorrect_type(t1, t2, expected) } - BinaryOperationClass::Numeric => { - // depending on operation could also be field or group - if !matches!(expected, Type::IntegerType(_)) { - self.handler - .emit_err(TypeCheckerError::type_should_be_integer(binary.op, expected.clone(), span).into()); + BinaryOperation::Add | BinaryOperation::Sub => { + self.assert_arith_type(expected.clone(), binary.span()); + let t1 = self.compare_expr_type(&binary.left, expected.clone(), binary.left.span()); + let t2 = self.compare_expr_type(&binary.right, expected.clone(), binary.right.span()); + + return_incorrect_type(t1, t2, expected) + } + BinaryOperation::Mul => { + self.assert_arith_type(expected.clone(), binary.span()); + + let t1 = self.compare_expr_type(&binary.left, None, binary.left.span()); + let t2 = self.compare_expr_type(&binary.right, None, binary.right.span()); + + match (t1.as_ref(), t2.as_ref()) { + (Some(Type::Group), Some(other)) | (Some(other), Some(Type::Group)) => { + self.assert_int_type(Some(other.clone()), binary.span()); + Some(Type::Group) + } + _ => return_incorrect_type(t1, t2, expected), + } + } + BinaryOperation::Div => { + self.assert_field_or_int_type(expected.clone(), binary.span()); + + let t1 = self.compare_expr_type(&binary.left, expected.clone(), binary.left.span()); + let t2 = self.compare_expr_type(&binary.right, expected.clone(), binary.right.span()); + return_incorrect_type(t1, t2, expected) + } + BinaryOperation::Pow => { + let t1 = self.compare_expr_type(&binary.left, None, binary.left.span()); + let t2 = self.compare_expr_type(&binary.right, None, binary.right.span()); + + match (t1.as_ref(), t2.as_ref()) { + // Type A must be an int. + // Type B must be a unsigned int. + (Some(Type::IntegerType(_)), Some(Type::IntegerType(itype))) if !itype.is_signed() => { + self.assert_type(t1.clone().unwrap(), expected, binary.span()); + } + // Type A was an int. + // But Type B was not a unsigned int. + (Some(Type::IntegerType(_)), Some(t)) => { + self.handler.emit_err( + TypeCheckerError::incorrect_pow_exponent_type("unsigned int", t, binary.right.span()) + .into(), + ); + } + // Type A must be a field. + // Type B must be an int. + (Some(Type::Field), Some(Type::IntegerType(_))) => { + self.assert_type(Type::Field, expected, binary.span()); + } + // Type A was a field. + // But Type B was not an int. + (Some(Type::Field), Some(t)) => { + self.handler.emit_err( + TypeCheckerError::incorrect_pow_exponent_type("int", t, binary.right.span()).into(), + ); + } + // The base is some type thats not an int or field. + (Some(t), _) => { + self.handler + .emit_err(TypeCheckerError::incorrect_pow_base_type(t, binary.left.span()).into()); + } + _ => {} } - self.compare_expr_type(&binary.left, expected.clone(), binary.span()); - self.compare_expr_type(&binary.right, expected, binary.span()); + t1 + } + BinaryOperation::Eq | BinaryOperation::Ne => { + self.assert_type(Type::Boolean, expected.clone(), binary.span()); + + let t1 = self.compare_expr_type(&binary.left, None, binary.left.span()); + let t2 = self.compare_expr_type(&binary.right, None, binary.right.span()); + + return_incorrect_type(t1, t2, expected) + } + BinaryOperation::Lt | BinaryOperation::Gt | BinaryOperation::Le | BinaryOperation::Ge => { + self.assert_type(Type::Boolean, expected.clone(), binary.span()); + + let t1 = self.compare_expr_type(&binary.left, None, binary.left.span()); + self.assert_int_type(t1.clone(), binary.left.span()); + + let t2 = self.compare_expr_type(&binary.right, None, binary.right.span()); + self.assert_int_type(t2.clone(), binary.right.span()); + + return_incorrect_type(t1, t2, expected) } }, Expression::Unary(unary) => match unary.op { UnaryOperation::Not => { - self.assert_type(Type::Boolean, expected, unary.span()); - self.compare_expr_type(&unary.inner, Type::Boolean, unary.inner.span()); + self.assert_type(Type::Boolean, expected.clone(), unary.span()); + self.compare_expr_type(&unary.inner, expected, unary.inner.span()) } UnaryOperation::Negate => { - match expected { + /* match expected { Type::IntegerType( IntegerType::I8 | IntegerType::I16 | IntegerType::I32 | IntegerType::I64 | IntegerType::I128, - ) - | Type::Field - | Type::Group => {} + ) => {}, + Type::Field | Type::Group => {} _ => self.handler.emit_err( TypeCheckerError::type_is_not_negatable(expected.clone(), unary.inner.span()).into(), ), - } - self.compare_expr_type(&unary.inner, expected, unary.inner.span()); + } */ + self.compare_expr_type(&unary.inner, expected, unary.inner.span()) } }, Expression::Ternary(ternary) => { - self.compare_expr_type(&ternary.condition, Type::Boolean, ternary.condition.span()); - self.compare_expr_type(&ternary.if_true, expected.clone(), ternary.if_true.span()); - self.compare_expr_type(&ternary.if_false, expected, ternary.if_false.span()); + self.compare_expr_type(&ternary.condition, Some(Type::Boolean), ternary.condition.span()); + let t1 = self.compare_expr_type(&ternary.if_true, expected.clone(), ternary.if_true.span()); + let t2 = self.compare_expr_type(&ternary.if_false, expected.clone(), ternary.if_false.span()); + return_incorrect_type(t1, t2, expected) } Expression::Call(call) => match &*call.function { Expression::Identifier(ident) => { if let Some(func) = self.symbol_table.lookup_fn(&ident.name) { - self.assert_type(func.output.clone(), expected, ident.span()); + let ret = self.assert_type(func.output.clone(), expected, ident.span()); if func.input.len() != call.arguments.len() { self.handler.emit_err( @@ -110,18 +207,21 @@ impl<'a> TypeChecker<'a> { .for_each(|(expected, argument)| { self.compare_expr_type( argument, - expected.get_variable().type_.clone(), + Some(expected.get_variable().type_.clone()), argument.span(), ); }); + + Some(ret) } else { self.handler .emit_err(TypeCheckerError::unknown_sym("function", &ident.name, ident.span()).into()); + None } } expr => self.compare_expr_type(expr, expected, call.span()), }, - Expression::Err(_) => {} + Expression::Err(_) => None, } } } diff --git a/compiler/passes/src/type_checker/check_file.rs b/compiler/passes/src/type_checker/check_file.rs index d46163d3a3..394079a211 100644 --- a/compiler/passes/src/type_checker/check_file.rs +++ b/compiler/passes/src/type_checker/check_file.rs @@ -29,7 +29,7 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { input_var.identifier.name, VariableSymbol { type_: &input_var.type_, - span: input_var.span(), + span: input_var.identifier.span(), declaration: Declaration::Input(input_var.mode()), }, ) { diff --git a/compiler/passes/src/type_checker/check_statements.rs b/compiler/passes/src/type_checker/check_statements.rs index 3ca5b4394d..d17eb3f317 100644 --- a/compiler/passes/src/type_checker/check_statements.rs +++ b/compiler/passes/src/type_checker/check_statements.rs @@ -19,7 +19,6 @@ use leo_errors::TypeCheckerError; use crate::{Declaration, TypeChecker, VariableSymbol}; - impl<'a> StatementVisitor<'a> for TypeChecker<'a> { fn visit_return(&mut self, input: &'a ReturnStatement) -> VisitResult { // we can safely unwrap all self.parent instances because @@ -27,7 +26,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { let parent = self.parent.unwrap(); if let Some(func) = self.symbol_table.lookup_fn(&parent) { - self.compare_expr_type(&input.expression, func.output.clone(), input.expression.span()); + self.compare_expr_type(&input.expression, Some(func.output.clone()), input.expression.span()); } VisitResult::VisitChildren @@ -52,7 +51,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { self.handler.emit_err(err); } - self.compare_expr_type(&input.value, input.type_.clone(), input.value.span()); + self.compare_expr_type(&input.value, Some(input.type_.clone()), input.value.span()); }); VisitResult::VisitChildren @@ -71,7 +70,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { _ => {} } - self.compare_expr_type(&input.value, var.type_.clone(), input.value.span()) + self.compare_expr_type(&input.value, Some(var.type_.clone()), input.value.span()); } else { self.handler.emit_err( TypeCheckerError::unknown_sym("variable", &input.assignee.identifier.name, &input.assignee.span).into(), @@ -82,7 +81,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { } fn visit_conditional(&mut self, input: &'a ConditionalStatement) -> VisitResult { - self.compare_expr_type(&input.condition, Type::Boolean, input.condition.span()); + self.compare_expr_type(&input.condition, Some(Type::Boolean), input.condition.span()); VisitResult::VisitChildren } @@ -99,8 +98,8 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { self.handler.emit_err(err); } - self.compare_expr_type(&input.start, input.type_.clone(), input.start.span()); - self.compare_expr_type(&input.stop, input.type_.clone(), input.stop.span()); + self.compare_expr_type(&input.start, Some(input.type_.clone()), input.start.span()); + self.compare_expr_type(&input.stop, Some(input.type_.clone()), input.stop.span()); VisitResult::VisitChildren } @@ -108,10 +107,10 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { fn visit_console(&mut self, input: &'a ConsoleStatement) -> VisitResult { match &input.function { ConsoleFunction::Assert(expr) => { - self.compare_expr_type(expr, Type::Boolean, expr.span()); + self.compare_expr_type(expr, Some(Type::Boolean), expr.span()); } ConsoleFunction::Error(_) | ConsoleFunction::Log(_) => { - todo!("need to discuss this"); + // TODO: undetermined } } @@ -141,4 +140,4 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { VisitResult::SkipChildren } -} \ No newline at end of file +} diff --git a/compiler/passes/src/type_checker/checker.rs b/compiler/passes/src/type_checker/checker.rs index a22acf9d12..c4f8a29440 100644 --- a/compiler/passes/src/type_checker/checker.rs +++ b/compiler/passes/src/type_checker/checker.rs @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_ast::Type; +use leo_ast::{IntegerType, Type}; use leo_errors::{emitter::Handler, TypeCheckerError}; -use leo_span::{Symbol, Span}; +use leo_span::{Span, Symbol}; use crate::SymbolTable; @@ -26,6 +26,48 @@ pub struct TypeChecker<'a> { pub(crate) parent: Option, } +const ARITHMATIC_TYPES: &[Type] = &[ + Type::Field, + Type::Group, + Type::IntegerType(IntegerType::I8), + Type::IntegerType(IntegerType::I16), + Type::IntegerType(IntegerType::I32), + Type::IntegerType(IntegerType::I64), + Type::IntegerType(IntegerType::I128), + Type::IntegerType(IntegerType::U8), + Type::IntegerType(IntegerType::U16), + Type::IntegerType(IntegerType::U32), + Type::IntegerType(IntegerType::U64), + Type::IntegerType(IntegerType::U128), +]; + +const FIELD_AND_INT_TYPES: &[Type] = &[ + Type::Field, + Type::IntegerType(IntegerType::I8), + Type::IntegerType(IntegerType::I16), + Type::IntegerType(IntegerType::I32), + Type::IntegerType(IntegerType::I64), + Type::IntegerType(IntegerType::I128), + Type::IntegerType(IntegerType::U8), + Type::IntegerType(IntegerType::U16), + Type::IntegerType(IntegerType::U32), + Type::IntegerType(IntegerType::U64), + Type::IntegerType(IntegerType::U128), +]; + +const INT_TYPES: &[Type] = &[ + Type::IntegerType(IntegerType::I8), + Type::IntegerType(IntegerType::I16), + Type::IntegerType(IntegerType::I32), + Type::IntegerType(IntegerType::I64), + Type::IntegerType(IntegerType::I128), + Type::IntegerType(IntegerType::U8), + Type::IntegerType(IntegerType::U16), + Type::IntegerType(IntegerType::U32), + Type::IntegerType(IntegerType::U64), + Type::IntegerType(IntegerType::U128), +]; + impl<'a> TypeChecker<'a> { pub fn new(symbol_table: &'a mut SymbolTable<'a>, handler: &'a Handler) -> Self { Self { @@ -35,10 +77,47 @@ impl<'a> TypeChecker<'a> { } } - pub(crate) fn assert_type(&self, type_: Type, expected: Type, span: &Span) { - if type_ != expected { - self.handler - .emit_err(TypeCheckerError::type_should_be(type_, expected, span).into()); + pub(crate) fn assert_type(&self, type_: Type, expected: Option, span: &Span) -> Type { + if let Some(expected) = expected { + if type_ != expected { + self.handler + .emit_err(TypeCheckerError::type_should_be(type_.clone(), expected, span).into()); + } } + + type_ + } + + pub(crate) fn assert_one_of_types(&self, type_: Option, expected: &[Type], span: &Span) -> Option { + if let Some(type_) = type_.clone() { + for t in expected.iter() { + if &type_ == t { + return Some(type_); + } + } + + self.handler.emit_err( + TypeCheckerError::expected_one_type_of( + expected.iter().map(|t| t.to_string() + ",").collect::(), + type_, + span, + ) + .into(), + ); + } + + type_ + } + + pub(crate) fn assert_arith_type(&self, type_: Option, span: &Span) -> Option { + self.assert_one_of_types(type_, ARITHMATIC_TYPES, span) + } + + pub(crate) fn assert_field_or_int_type(&self, type_: Option, span: &Span) -> Option { + self.assert_one_of_types(type_, FIELD_AND_INT_TYPES, span) + } + + pub(crate) fn assert_int_type(&self, type_: Option, span: &Span) -> Option { + self.assert_one_of_types(type_, INT_TYPES, span) } } diff --git a/leo/errors/src/errors/type_checker/type_checker_error.rs b/leo/errors/src/errors/type_checker/type_checker_error.rs index 95cff62401..842e663c64 100644 --- a/leo/errors/src/errors/type_checker/type_checker_error.rs +++ b/leo/errors/src/errors/type_checker/type_checker_error.rs @@ -88,7 +88,47 @@ create_messages!( incorrect_num_args_to_call { args: (expected: impl Display, received: impl Display), msg: format!( - "Call expected `{expected}` args, got `{received}`", + "Call expected `{expected}` args, but got `{received}`", + ), + help: None, + } + + /// For when one of the following types was expected. + @formatted + expected_one_type_of { + args: (expected: impl Display, received: impl Display), + msg: format!( + "Expected one type from `{expected}`, but got `{received}`", + ), + help: None, + } + + /// For when the base of a power is not a valid type. + @formatted + incorrect_pow_base_type { + args: (type_: impl Display), + msg: format!( + "The first operand must be an integer or field but got type `{type_}`", + ), + help: None, + } + + /// For when the exponent of a power is not a valid type. + @formatted + incorrect_pow_exponent_type { + args: (allowed: impl Display, type_: impl Display), + msg: format!( + "The second operand must be a {allowed} but got type `{type_}`", + ), + help: None, + } + + /// For when a type is does not exist. + @formatted + unknown_type { + args: (), + msg: format!( + "The type", ), help: None, } diff --git a/tests/compiler/integers/i16/pow.leo b/tests/compiler/integers/i16/pow_fail.leo similarity index 87% rename from tests/compiler/integers/i16/pow.leo rename to tests/compiler/integers/i16/pow_fail.leo index 6076e64601..5b89c8c83b 100644 --- a/tests/compiler/integers/i16/pow.leo +++ b/tests/compiler/integers/i16/pow_fail.leo @@ -1,6 +1,6 @@ /* namespace: Compile -expectation: Pass +expectation: Fail input_file: inputs/pow.in */ diff --git a/tests/compiler/integers/i8/pow.leo b/tests/compiler/integers/i8/pow_fail.leo similarity index 87% rename from tests/compiler/integers/i8/pow.leo rename to tests/compiler/integers/i8/pow_fail.leo index 912199885c..a91751332a 100644 --- a/tests/compiler/integers/i8/pow.leo +++ b/tests/compiler/integers/i8/pow_fail.leo @@ -1,6 +1,6 @@ /* namespace: Compile -expectation: Pass +expectation: Fail input_file: inputs/pow.in */ diff --git a/tests/expectations/compiler/compiler/address/branch.leo.out b/tests/expectations/compiler/compiler/address/branch.leo.out index 5d73e12658..857ba59bd1 100644 --- a/tests/expectations/compiler/compiler/address/branch.leo.out +++ b/tests/expectations/compiler/compiler/address/branch.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: bbe973798ab14152165455260924a0de60131d31da32d2e223228954365dc609 - symbol_table: 48301928ee2c6e396e20c53b0b59a8e76dabe0f60e5f7544349665683db0eae5 + symbol_table: 9d42b1d8f167826635e5169bc3a50c14f722fba8e5ce2480fbde3b8cf2e75237 initial_ast: ddf5a3cdb4d2796c15e7c590647ef497e9c1e9dd876d35053b7d20e0327201f2 diff --git a/tests/expectations/compiler/compiler/definition/out_of_order.leo.out b/tests/expectations/compiler/compiler/definition/out_of_order.leo.out index b27f67e4ca..88ef816435 100644 --- a/tests/expectations/compiler/compiler/definition/out_of_order.leo.out +++ b/tests/expectations/compiler/compiler/definition/out_of_order.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: fe836874629cdc86427a1048352c6e75e7a2981ee5c9819df0fd946eb79d4d8b + symbol_table: 66779461e33acc9c5c732509637db91bd72aff3e9dae6aee0c137d0537446878 initial_ast: 5ef5995607c9487bbba88bd6e2806f19ca1ef11bf6bb7507f75f6a5f32d39fb6 diff --git a/tests/expectations/compiler/compiler/function/conditional_return.leo.out b/tests/expectations/compiler/compiler/function/conditional_return.leo.out index 895061ec42..d85f8be887 100644 --- a/tests/expectations/compiler/compiler/function/conditional_return.leo.out +++ b/tests/expectations/compiler/compiler/function/conditional_return.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 26679d48a4f878012c9f9cacccf9d2d1ef568126030a21abf74a5a4d8e5116d4 - symbol_table: 201ed1188a77438794f46c40fd317d61309595d6b8a6964db2391ea33194ba9c + symbol_table: 577abb859b2f33b9e81c5e94c82b559601f44025143fa7a6757561b47e78efa5 initial_ast: 9e6a274bbf78b10fc2fe402fb5b75fec31690d4661259dec5695ee38520a9d6f diff --git a/tests/expectations/compiler/compiler/function/iteration.leo.out b/tests/expectations/compiler/compiler/function/iteration.leo.out index 0755ccac95..776b836b61 100644 --- a/tests/expectations/compiler/compiler/function/iteration.leo.out +++ b/tests/expectations/compiler/compiler/function/iteration.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: e518f4721bb7a7b6c63e380710a5a8cf4e489ccf66461bf9a68dc4b369e16445 - symbol_table: cff4db3f27fee6b775583fc702d4ca35863eba50454cc6427ea0b68df0918012 + symbol_table: 6754c028b1d3793f022a7da93be8510a6844da8a2e45f5dcaa9566252e418ee2 initial_ast: 09226f61bcbb3f65fab6d0609b39333bc31bdf51c3aec686894ffb502ca56b6a diff --git a/tests/expectations/compiler/compiler/function/iteration_repeated.leo.out b/tests/expectations/compiler/compiler/function/iteration_repeated.leo.out index 60cb740ae6..eb6eaa257d 100644 --- a/tests/expectations/compiler/compiler/function/iteration_repeated.leo.out +++ b/tests/expectations/compiler/compiler/function/iteration_repeated.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: e518f4721bb7a7b6c63e380710a5a8cf4e489ccf66461bf9a68dc4b369e16445 - symbol_table: 65959471601270dd1e0ccf004824d13cfe39c2681a462348d7d38c39cc185228 + symbol_table: c45d23aa877641cbf1853709cc103d389f3e3105b5c873f8bb90c3a0c48bd2ff initial_ast: 559dc5437784316568a2e63a662f50940bf7fda5ae78ce338f328ebf816a4087 diff --git a/tests/expectations/compiler/compiler/function/repeated.leo.out b/tests/expectations/compiler/compiler/function/repeated.leo.out index c90f7afe8f..4e71f69958 100644 --- a/tests/expectations/compiler/compiler/function/repeated.leo.out +++ b/tests/expectations/compiler/compiler/function/repeated.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: e518f4721bb7a7b6c63e380710a5a8cf4e489ccf66461bf9a68dc4b369e16445 - symbol_table: 891b34c1f12859f1265a787428e786500fb04041cc0fda38bb25fc65a14bae15 + symbol_table: 7c82d098d4b483b968c5b928f68a4a6f040bf961bbf5192bf323ddabbe592da8 initial_ast: 127164b1571c0f14ac66be72c670be93c0f04973e06564cd0a382cb99bb32e11 diff --git a/tests/expectations/compiler/compiler/function/return.leo.out b/tests/expectations/compiler/compiler/function/return.leo.out index 46915c5eb6..e4de889589 100644 --- a/tests/expectations/compiler/compiler/function/return.leo.out +++ b/tests/expectations/compiler/compiler/function/return.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: e518f4721bb7a7b6c63e380710a5a8cf4e489ccf66461bf9a68dc4b369e16445 - symbol_table: b25c0ab70906c0cac81eca91609c3ad6201198c2f871147e455f0689d1222e6d + symbol_table: 8bddbedba52c66dc7a86530a2df470eb3222992c10b75842431a82afc7e936d4 initial_ast: 3c9f874c442a8b41ff0e3f3f212d96690d2665022d7898045bec0b18495db1bc diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main.leo.out index ad763c111b..46dd89ecfd 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: dcc83a9319d9784c4bed7596d95f4bb19e2f5db1122e17bfa37e3458ed69c4fd - symbol_table: aabee41c31620f09539e282b4e32b28bde056bd182c3866ffd9a095f1dd60c14 + symbol_table: 00f652a7b8e969478d433c749951ee63b97343691ff9ade7e1e9288757814ef6 initial_ast: 06f1b743bd89e797249d51660f05d3b53d8c3e5a55c00c414795059fdd194ca1 diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_field.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main_field.leo.out index b82e5fa919..1de70a62c4 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_field.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_field.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 0c1be8e106149f3dbe5d151e6372f7d6acf3d0986643537ed9610c2f89eb9ed4 - symbol_table: 5a73abac57c301567a8824e865c06c6e771418fb1b6aec0d7e5f598ccbcdfed0 + symbol_table: a3dad989c81fa120b3092919ca6bd0cc90221424459f5691b7f172e5564ba1ae initial_ast: ffdacfde92b14a8fc1e7c53d51cf47345ba944ceac0340520122f64e80c0ab1e diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_group.leo.out b/tests/expectations/compiler/compiler/input_files/program_input/main_group.leo.out index 46e4ac6ead..4ccc84795c 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_group.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_group.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 723e9ab87822d7d8d793ca1611eabcebc684097a64f37a4cd246ff9e506a4865 - symbol_table: dbaced3c15523197bc369f20cc57998cd430e95ac40c4030c9aad2b47dda86ec + symbol_table: 3b68eff86b45e4f940b0a1031e19a64178b0bf802acb59f3b743e664f3010876 initial_ast: 5932c467cdf3a483848183af054e2ec2d256b1d8b6e01f9ac4209b400863c137 diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main.leo.out index 3afe4bfd40..6411e1b777 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: ce38ef1ec7bdaaf35b68d011803255589ed870002583000a76f137d7682bc3d6 - symbol_table: 21f3e603be14808f79859aaf18a4b7da2a22a7aef7f4b758b0514b745bc52474 + symbol_table: 031a91bf50d051b6ffb92f6853fa4bece1f5f8f0aa145a28abed6bd1d4cf7bdd initial_ast: 806f13e7c1584039d0f1aae5c8b4f8ed432d35770ec576610d6249afb88141bb diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.leo.out index 54e6f1120d..085a15b790 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3273de56f5b29e324e4f4ef3cc7c0c8d468962214728d611aeb4b788fd73aefb - symbol_table: e3a4953e1d858fcd09177faa813c5a4f70850a7fb3394ac3c6b32eb37d38931c + symbol_table: ec750d5d5f4a1e5b31a63e0bc8e12944eef200f2d71efcdb0fd85811ac6e2d31 initial_ast: f64a7585251a99b5a711175263bf8bd39fa959a7f1488f9aa3a8ba40a5dc9247 diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_group.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_group.leo.out index a8c87c40b6..b3d9ab183e 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_group.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_group.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: eebcd00b27aba004420d4f00da025325da9ff86d29162e54401fa55b5758ae39 - symbol_table: 218ef310cf0f462d7729c17904f4abd6e7f1fb05a4de0ab0a80b1eba84f765e7 + symbol_table: 14140f05d5fb8a85352940a67860fd36ed597f93ac882fdb76ef3d1ed89b5031 initial_ast: 8b077463b76328b9a910bf0eaab51a74e7b69e1cddbcedc9226a5358f13b9bf0 diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multiple.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multiple.leo.out index fa1dbe706f..77710ed876 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multiple.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multiple.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 81306ba48e4ea08106311612bfd5c1bce79242ca08695fda8584780329266063 - symbol_table: 6680aaab1d739d10eb145876c05f90779c9888b98dce5eeb122517ef87fb4536 + symbol_table: 9674d1e094af108a21c9a8f2e9c5b911f76504d728866f9b57b6e38318c52741 initial_ast: 3c27f9f5dddfc4a5a036c33fd9bbbff4594bcdb188cff720d0e8ae7f171f6acf diff --git a/tests/expectations/compiler/compiler/integers/i128/add.leo.out b/tests/expectations/compiler/compiler/integers/i128/add.leo.out index 5974025612..c807b545f5 100644 --- a/tests/expectations/compiler/compiler/integers/i128/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/add.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 0eb1ad9d13a2a11ba96f8ae311f1f91922abd5316ec123f92be78864c33464b4 - symbol_table: 54846553d446c2927d5ecb9ee1011ad792d4d1c40ea844401f2426b10715a680 + symbol_table: 26e29ab43161625435a7de57fba18feffa2ca86b908d3720a652c8fabc1a6adf initial_ast: 4ba3f688a429a73f874a1c391a591e7155a4722ff99c339d0814eb903b3265db diff --git a/tests/expectations/compiler/compiler/integers/i128/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/i128/console_assert.leo.out index 39487d44c1..3db6f36e86 100644 --- a/tests/expectations/compiler/compiler/integers/i128/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/console_assert.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 2b35d182059f5f8aea05705b54c7446011ee78919bbda9f163927613f924f100 - symbol_table: 9c9e7151463a523fd4410f3bd700725a01f6a80c8c8dc3f1c993966c0de98c09 + symbol_table: 6f25f2987af24695b2fb70fb856a108c3d185a98289e796f5af4cb60c0de946a initial_ast: 48e5e86ca0706ef02b3889899d4a0f4b8f33f95a4b93a1eef6f86c1e0a7699d7 diff --git a/tests/expectations/compiler/compiler/integers/i128/div.leo.out b/tests/expectations/compiler/compiler/integers/i128/div.leo.out index 2f5d6c8ae6..4302234d86 100644 --- a/tests/expectations/compiler/compiler/integers/i128/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/div.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: a8d3b28b557b2c19b8bb0083c015f5f217971e856d0a5c2462e956bf55b68126 - symbol_table: 261fff42cc71579a58e904653d48ba00de0882492824bceba53de8f7088f0022 + symbol_table: 13298cf22dc30ccc0e18f787e657068fd0531e71e9b29155541503bf7209801b initial_ast: 22d811ec372bfcfa643f49485200451dc5fe2b928483cb9801cd10461100e3b1 diff --git a/tests/expectations/compiler/compiler/integers/i128/eq.leo.out b/tests/expectations/compiler/compiler/integers/i128/eq.leo.out index da2702b948..1349beca96 100644 --- a/tests/expectations/compiler/compiler/integers/i128/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/eq.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 2b35d182059f5f8aea05705b54c7446011ee78919bbda9f163927613f924f100 - symbol_table: 7742acd8e7ea62cf83f6f958bdff8ee3c97b8217e496ae97abb297a97e922ece + symbol_table: e354ff29052ba6cf646dc2a940fb2489c740245554aa81f4a9b71c314f431618 initial_ast: da2b5ade996589a255e02d69a67f76814bb7ac0b0e685bf7e9776ceb4e0b9a7c diff --git a/tests/expectations/compiler/compiler/integers/i128/max.leo.out b/tests/expectations/compiler/compiler/integers/i128/max.leo.out index 9e0534fcd7..0ff3e0c76d 100644 --- a/tests/expectations/compiler/compiler/integers/i128/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/max.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: 9eebcbd9094f2ad4b0018bc13dfbe52a8214316004da92be68f57a1a2009dd2d + symbol_table: b9f23cb88072c4321465b95ec69bba96f8fb225616244266e05a9e6eeb99da5b initial_ast: 4d6fa010bac61cc40182ea755147c7f2aae2f8fc06329d2235318a6203d301c2 diff --git a/tests/expectations/compiler/compiler/integers/i128/min.leo.out b/tests/expectations/compiler/compiler/integers/i128/min.leo.out index 6af907ac74..26205bf2ef 100644 --- a/tests/expectations/compiler/compiler/integers/i128/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/min.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: 84b433ec855332e3655b6e721ef94105e6abeb5c6391cb1ee02b8e13b62444c6 + symbol_table: 6b54f07ea0046f948e794781960eb3df9271e7e2d10be3e278e2b02d4d810da7 initial_ast: a6ef77091458c48187ba317d13ed659ca96c156f4cd6cc27b122474c8bb25c51 diff --git a/tests/expectations/compiler/compiler/integers/i16/add.leo.out b/tests/expectations/compiler/compiler/integers/i16/add.leo.out index 51cd886f1a..ec001dcc65 100644 --- a/tests/expectations/compiler/compiler/integers/i16/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/add.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 52a0e922c0ada1f3302f3d4d7feb758ff3937a8615a2fd23325cffcb0c50cf45 - symbol_table: 96a506d25fe727e53530eacbd3682793addcb7a84023076157685efc7b361094 + symbol_table: c0f4ce3ef2a4953e653c50d9adbccfc069c2047c6adda1830646d92934d66726 initial_ast: 9ebcf93a3a1c925cbda80ad0a4f715a975500a8a08698ef25e8c980bc5c074fc diff --git a/tests/expectations/compiler/compiler/integers/i16/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/i16/console_assert.leo.out index 1a449abba0..9bc4481aed 100644 --- a/tests/expectations/compiler/compiler/integers/i16/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/console_assert.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: b12ba1759e7600fe50376c2dc04f2cc908cae643be6693583c167493b8b5064e - symbol_table: 8148993a56b823d1c3ed2b0091421bed32de7ee8e06e4675a634df7f26c11ed6 + symbol_table: 4ba20f16852ff2fe7616b71c2d07aeadaed53777e2f304ded7c449948fe2f853 initial_ast: f8796fe09d11eab12fb3fd4de7daff8179e542873a689874fcc85f61fe6f52eb diff --git a/tests/expectations/compiler/compiler/integers/i16/div.leo.out b/tests/expectations/compiler/compiler/integers/i16/div.leo.out index 89b46a36c6..d66fbc45e9 100644 --- a/tests/expectations/compiler/compiler/integers/i16/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/div.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: d60a59011ffd9b722482df1f60fecf4035905e7991faf3509dc956204e26dbdb - symbol_table: 8145a65338e36b50928ebf9b2abe5188f1c463bc8c7d3e81e32af1455dfab6c2 + symbol_table: 0e193ca48f95a41e91fe8b791ba0bcee677e3fb5edf1af8659aaa4f16607c122 initial_ast: 69e960fb1923255efda2ba99dc07c01cd2e8d38cbf63363f7112f9c4e9efc768 diff --git a/tests/expectations/compiler/compiler/integers/i16/eq.leo.out b/tests/expectations/compiler/compiler/integers/i16/eq.leo.out index d64b132606..7a37635874 100644 --- a/tests/expectations/compiler/compiler/integers/i16/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/eq.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: b12ba1759e7600fe50376c2dc04f2cc908cae643be6693583c167493b8b5064e - symbol_table: 30b68abf213d0d951d5a152ffd42ea17a71908f6d9b33cefed8bfe51545e351c + symbol_table: 8f43f463b85046218c11afbd5aa39021ba131f2b7474f2f9e1743e5b4b617d49 initial_ast: a6cb462814fae8bb80601fdc772c4ba3831c35b069b235e01f1ad8fe857d879d diff --git a/tests/expectations/compiler/compiler/integers/i16/max.leo.out b/tests/expectations/compiler/compiler/integers/i16/max.leo.out index 82edbd4345..187e64520e 100644 --- a/tests/expectations/compiler/compiler/integers/i16/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/max.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: c82cb31f1b713cc70c711897294d9d4bbe5e35785537467ab45969690350c7c9 + symbol_table: bff54d1345b964af7d0d8caa2e69b103810988c8acdd599f7843498255b52d69 initial_ast: 55dbbaccb9439eb1c53b6df0a9c02fb66a2b168ba4ec50df1f39f660551d8a06 diff --git a/tests/expectations/compiler/compiler/integers/i16/min.leo.out b/tests/expectations/compiler/compiler/integers/i16/min.leo.out index 124cde0c2c..8c03daeb7a 100644 --- a/tests/expectations/compiler/compiler/integers/i16/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/min.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: f209efc7d5d09745fcf38517aa376f3aa6cdddf261e47345c9fd237084fcbe19 + symbol_table: 9f669ef27076d235af9438e4a4732be0d93854a67b7e3df0e3a99f62bc9db684 initial_ast: 7228343ff18271420a6aca3be6f76604abb0dcb795e88088d6c9dfcad6e6ed8e diff --git a/tests/expectations/compiler/compiler/integers/i16/pow_fail.leo.out b/tests/expectations/compiler/compiler/integers/i16/pow_fail.leo.out new file mode 100644 index 0000000000..e26b4183de --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i16/pow_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [ETYC0372009]: The second operand must be a unsigned int but got type `i16`\n --> compiler-test:4:17\n |\n 4 | return a ** b == c;\n | ^\nError [ETYC0372009]: The second operand must be a unsigned int but got type `i16`\n --> compiler-test:4:17\n |\n 4 | return a ** b == c;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i32/add.leo.out b/tests/expectations/compiler/compiler/integers/i32/add.leo.out index c529517352..79ab5aee99 100644 --- a/tests/expectations/compiler/compiler/integers/i32/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/add.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 187821d38d4d6bee83ad16df121b4cd61453c250259cc88b5224cde2cb0f81bd - symbol_table: 456cb5f3b7f9a73ee28c016d041b322f5e72d5b8bdaf6eb6ead7799b3d6b3435 + symbol_table: ae5ef5cfb1044cbd8c7efa5be8935eb1742fc65c72b7f8aba9d9f7fb72f8556b initial_ast: cf9129f53ff9903788b6c1dc51f1068af87f29e6ba40694f24648ef5c5e147b6 diff --git a/tests/expectations/compiler/compiler/integers/i32/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/i32/console_assert.leo.out index 1ac0afb6a7..97f074f17d 100644 --- a/tests/expectations/compiler/compiler/integers/i32/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/console_assert.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: a139a8bae62ab18b9235331f7dde3acb349c1445e807293c71235fd149b12c7a - symbol_table: 02813ad8615c1b4d489af2d0302fa220060d45ba5938d8fa5226f8d6c859e824 + symbol_table: e7e8be510bca7adc0598527ef337c1938d3f5c8666448cafe2831594e553d39e initial_ast: af1f895a3ffd3c6b09bf785a7ba78085a828a7d267db27e39ceb0b5ebe6f1a98 diff --git a/tests/expectations/compiler/compiler/integers/i32/div.leo.out b/tests/expectations/compiler/compiler/integers/i32/div.leo.out index 9cade3a791..28c34c39b8 100644 --- a/tests/expectations/compiler/compiler/integers/i32/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/div.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 5c4c17182ebea3e67d0b4f30c4c5541f039ff6d44914806b5358ae789fde1576 - symbol_table: e07c9c8414f7a348d9b78f47e2c74e889afcded8c8ec4cc062e9cde4790021ff + symbol_table: 088e7adb11ab06a554256c44b806f86c2c1f13273e00be2a80b8c8e797e51eb2 initial_ast: a163bed0fb5969ce86f5ee3f27097c710163519a79148e06354a7ae52f598687 diff --git a/tests/expectations/compiler/compiler/integers/i32/eq.leo.out b/tests/expectations/compiler/compiler/integers/i32/eq.leo.out index 16eafa4302..a0a77eacc8 100644 --- a/tests/expectations/compiler/compiler/integers/i32/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/eq.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: a139a8bae62ab18b9235331f7dde3acb349c1445e807293c71235fd149b12c7a - symbol_table: bf48d3e21defc5b5e17968032fa47e3381d4dae35473bbaa9f0f548a31f5df50 + symbol_table: 7a2619dfcf2d5f5132253f84196ad0d3ab6ee0ab95df55062240dd92cca23e0b initial_ast: ba62f96d9796deebf5cb8c68abe3265e0a0352a6ba500b3197a43ebc19436606 diff --git a/tests/expectations/compiler/compiler/integers/i32/max.leo.out b/tests/expectations/compiler/compiler/integers/i32/max.leo.out index 350fc867c7..683c3f737d 100644 --- a/tests/expectations/compiler/compiler/integers/i32/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/max.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: 685c90b13a7165098cc79c186d8243b0985e54621b71b08d58c88a85db4ad829 + symbol_table: e4eff856d1f884c746d9549c80e05a6d7ef3c23cab40a056f6be96cedcf093b5 initial_ast: 325f4f22fdbc8d3f0b1cde27e60492870a4dfa137875e0a818d44d2ecd9dbbcb diff --git a/tests/expectations/compiler/compiler/integers/i32/min.leo.out b/tests/expectations/compiler/compiler/integers/i32/min.leo.out index 160240a206..eeda66a438 100644 --- a/tests/expectations/compiler/compiler/integers/i32/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/min.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: 2b8a11c1cacfb8051dfe754f83616693a63dd51d9b23f8e22d9d9aa403797962 + symbol_table: fe289642ca33db01ce62474ee358f4cff826e221724cc5b4d28f0e878d4f08e6 initial_ast: 4475c8e73b8a4d016c8487f18c33a319fb4b641cabbd1cfcee179fd7917082ec diff --git a/tests/expectations/compiler/compiler/integers/i64/add.leo.out b/tests/expectations/compiler/compiler/integers/i64/add.leo.out index 15fdc4611f..263ee7b3b0 100644 --- a/tests/expectations/compiler/compiler/integers/i64/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/add.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 4487891a65166322700df8b88e062dd55ba1ba1eab41086faeecb89866ce6353 - symbol_table: cc01117c31fe70222e5dd9db208832e0f80f925b010474edca6c9d4e5ea377a6 + symbol_table: d819410bf10134f81bb62eb4e11ff16ef2ee5d3aed52c328514db13cc79c9385 initial_ast: 4c8ecc77fb85464f37ed6510270912bab6d7f59d34c906a47eee5eba72e18b84 diff --git a/tests/expectations/compiler/compiler/integers/i64/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/i64/console_assert.leo.out index 37a6ca9e95..1ae066e6f7 100644 --- a/tests/expectations/compiler/compiler/integers/i64/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/console_assert.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 9ac72a16994c4f4145cf0eaa23f0d58de951926f8b9cb500bc33644cc242d288 - symbol_table: 3e3de362ea1f800858c664f4243266429d9bd8aae01e94365461312b195fa687 + symbol_table: fbeac8715fd60fea0f3ef8db7373e8ec195887ff4ba92bb7af7346181db2164d initial_ast: 88f1001604765bde373b06ffb83c2d46bbc16548296178fc9ccb47eb49e0212b diff --git a/tests/expectations/compiler/compiler/integers/i64/div.leo.out b/tests/expectations/compiler/compiler/integers/i64/div.leo.out index 703c29dc83..953efd4fb3 100644 --- a/tests/expectations/compiler/compiler/integers/i64/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/div.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 0a764dba657d55d3997cad318c763d1bc29b3bd68e720c29bdb329e31544cfa2 - symbol_table: 0723f77e60787bcbe32ff2b04e6c27188e455bc24962c67faecff9c6de960fb0 + symbol_table: 00f270ed9ebe98ec0543be83c941aef7d465c6c79780eacac64a8b09120dd09b initial_ast: 1ac553449dbba81518d78f57a0728f69efc8040ac83ee09516a99b52812d0ce5 diff --git a/tests/expectations/compiler/compiler/integers/i64/eq.leo.out b/tests/expectations/compiler/compiler/integers/i64/eq.leo.out index 3031703cc4..d02c5d6fb2 100644 --- a/tests/expectations/compiler/compiler/integers/i64/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/eq.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 9ac72a16994c4f4145cf0eaa23f0d58de951926f8b9cb500bc33644cc242d288 - symbol_table: fa044d414491ad830416830c60667d80173594ff31bbb53a1cf2dc2d0b516ab7 + symbol_table: fe562696dece608fab527d7894d61a1bbccbcdd2ddf7fcb5cc52a0d596fcaff3 initial_ast: 9d96dab7f2cf21a2358200798a2689f722d388fe23c58bc00f13feefc05328e0 diff --git a/tests/expectations/compiler/compiler/integers/i64/max.leo.out b/tests/expectations/compiler/compiler/integers/i64/max.leo.out index a4065cace5..3cc5809166 100644 --- a/tests/expectations/compiler/compiler/integers/i64/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/max.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: 1535e52514a734e56a9724400cd6e6db7c666052c3855ab4d5f7dd5d1cdbcfe7 + symbol_table: d7d7a90af5b30ced5d014e0f7539fe023299e3050aac61c26ebfbffd00997991 initial_ast: d4867119d1bfa7f5f65b1046e5a14178ce9fccd4e46036f5f9760f1bbbaa3a2a diff --git a/tests/expectations/compiler/compiler/integers/i64/min.leo.out b/tests/expectations/compiler/compiler/integers/i64/min.leo.out index 1ac3174277..7d19861cee 100644 --- a/tests/expectations/compiler/compiler/integers/i64/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/min.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: 6d623b8d0710870095158c39af63333fde476c595298d604d4f545ef2dd180c7 + symbol_table: ac8a22d4c2415f3853d5d7220433fab10c5f91eab939302666a2224601209d19 initial_ast: da6e4041a114d42150b9768cef5675545691f07f3949332a52a72156fa5bcd02 diff --git a/tests/expectations/compiler/compiler/integers/i8/add.leo.out b/tests/expectations/compiler/compiler/integers/i8/add.leo.out index bfc6212d60..2af7096a51 100644 --- a/tests/expectations/compiler/compiler/integers/i8/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/add.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: a4cac5c153aca7bfef6dabb6cbf703d96938699bebce6f063d39011de78a5bd4 - symbol_table: ebda3c79c3cef5c180c423066cfe7afb72f559e295b3b0650192b4b41acf97ab + symbol_table: 0d30cbd5adc20ac5b03559dcd90334ac82572a3d5a195325d49ee681b4597089 initial_ast: e5b43164c337c686cc881208115e1bbadd1926c5fb388cb0d0592dd26c40bbb3 diff --git a/tests/expectations/compiler/compiler/integers/i8/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/i8/console_assert.leo.out index 387f0ad109..ac95589450 100644 --- a/tests/expectations/compiler/compiler/integers/i8/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/console_assert.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 387087e4e03168d09782d693bd8b288dd097f978e8470bf2d0fae6a18b0a5dba - symbol_table: ffefcd9198ba11e15d017d24ed65f0ff46563f3049221d37343c4698a85df0f9 + symbol_table: 94888e7a3878be6164b483f223840d704e815d8f29e1d90d04130e0f363c21d0 initial_ast: 7057b25d4c10f2cfb35c7c7897e1ce77eaf0ea00c5f13d5fe61be2db93f33e2d diff --git a/tests/expectations/compiler/compiler/integers/i8/div.leo.out b/tests/expectations/compiler/compiler/integers/i8/div.leo.out index 0f3cfb0e7f..c0f3176cae 100644 --- a/tests/expectations/compiler/compiler/integers/i8/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/div.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 2bb926ee08666d2f770b02d22884fb353d718b57ffd34c156dd70431c16b713c - symbol_table: ebcfabb92de4aca10e7fc6d1356b31611062fca8d9feb5b8a18c5bb9d20ba662 + symbol_table: 856843c2915ab5599b921ca4c73e2be480e792d719ba89f86425195ece44a654 initial_ast: df29046329d8b12827f7885dfafee8a88abb17450a6fef94f5c192d582c170a9 diff --git a/tests/expectations/compiler/compiler/integers/i8/eq.leo.out b/tests/expectations/compiler/compiler/integers/i8/eq.leo.out index 6ef3a1af93..f57cc9ef37 100644 --- a/tests/expectations/compiler/compiler/integers/i8/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/eq.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 387087e4e03168d09782d693bd8b288dd097f978e8470bf2d0fae6a18b0a5dba - symbol_table: 9e8afe87541faf262a089029805a31c5377d0d9610c1e8e221ba386ea6c7b078 + symbol_table: 7814b27104ef5de9ad3357bc67b519cf5642a0960e054e7419d46786fa6b4f08 initial_ast: cb0fef3c670b24effcfe01867ad5997394daf09593f2e90f721070dcd88dbd6a diff --git a/tests/expectations/compiler/compiler/integers/i8/max.leo.out b/tests/expectations/compiler/compiler/integers/i8/max.leo.out index 2488ea18ab..4afec08028 100644 --- a/tests/expectations/compiler/compiler/integers/i8/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/max.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: 1e0904126bcb9810bea07c7c1b266e4add58d581ca95138fcfbae893eb94e296 + symbol_table: 66106e69fbd949ea2dbfd4416f5d1c9227684eff438d1625c93d6bb4f8573ce9 initial_ast: 85c93894bc0241a6d82bfeda8828d664c83bde70155e6a0eb21bfe01ca32602e diff --git a/tests/expectations/compiler/compiler/integers/i8/min.leo.out b/tests/expectations/compiler/compiler/integers/i8/min.leo.out index cb3455596c..709f374ac6 100644 --- a/tests/expectations/compiler/compiler/integers/i8/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/min.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: f8a675e1fa5be6255425c9d60c42f17ce72d4bf99e507ab11df201a81c91ffbf + symbol_table: 98cceb8df5e7a49587ca9cd0c728a7ae7d31f69b41541d3f2463315c75d825eb initial_ast: 8745ea25fc61ad3db822e2fb1a4ca4098ef12bf2cf4477f4e7962ddf9f011cba diff --git a/tests/expectations/compiler/compiler/integers/i8/pow_fail.leo.out b/tests/expectations/compiler/compiler/integers/i8/pow_fail.leo.out new file mode 100644 index 0000000000..2ebf9503b5 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i8/pow_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [ETYC0372009]: The second operand must be a unsigned int but got type `i8`\n --> compiler-test:4:17\n |\n 4 | return a ** b == c;\n | ^\nError [ETYC0372009]: The second operand must be a unsigned int but got type `i8`\n --> compiler-test:4:17\n |\n 4 | return a ** b == c;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u128/add.leo.out b/tests/expectations/compiler/compiler/integers/u128/add.leo.out index 79357fd6ac..a8a08e032d 100644 --- a/tests/expectations/compiler/compiler/integers/u128/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/add.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: d3082b5edd6d814cd5eba97f5cfee8cd6ac7c859b0bd6345152d07ff71c77704 - symbol_table: d57b055bb6df31b13110ac1a7ca039216c5bea705df0258140cc5d840853c662 + symbol_table: 94c3952749ff384b298cc1bddaae404acf571029e7f6489b4eef469f19f62238 initial_ast: e4e1d70546dfe483ecf16d57945e3febbd19da7fc3f64c2d158e8c70b887c0b2 diff --git a/tests/expectations/compiler/compiler/integers/u128/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/u128/console_assert.leo.out index d3b1f648e9..d8df5de276 100644 --- a/tests/expectations/compiler/compiler/integers/u128/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/console_assert.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: b5c6120ae963f4518dfbcf01566c85e1414ed347b18ca65dcbc03ff3addfb8ea - symbol_table: 861bca327e9df1f188d2e6da784fd0bb468999c721457d55b418642eaad37b76 + symbol_table: 505948f27498d87c22e63417f71cf1f3047085a4cdb257ef7aedf3c86b238ebe initial_ast: ecbc8484a3548fc10ab2e25aae6bca7b24b5010b972a161fb385ec0d7fbaca41 diff --git a/tests/expectations/compiler/compiler/integers/u128/div.leo.out b/tests/expectations/compiler/compiler/integers/u128/div.leo.out index 90a0ec038f..895b2bffdf 100644 --- a/tests/expectations/compiler/compiler/integers/u128/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/div.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 55766cfb9cd3036356494aed386f6369a46eaa459e732b4b125adc71cc9487de - symbol_table: c3657fefe6f9a6c177da5817cb1eb47ba94b1a0cd2dc89838dfb0434d32da7ad + symbol_table: 678f356035aea39bec07a37d127fab99dfb8f8aaa118bf1454f3fb40e2943c2c initial_ast: 6d70edf319a5036a4004d3c3c6e8b01608b7e882d91f335b7c0dec725185641a diff --git a/tests/expectations/compiler/compiler/integers/u128/eq.leo.out b/tests/expectations/compiler/compiler/integers/u128/eq.leo.out index f8aea6143c..7b1178484c 100644 --- a/tests/expectations/compiler/compiler/integers/u128/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/eq.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: b5c6120ae963f4518dfbcf01566c85e1414ed347b18ca65dcbc03ff3addfb8ea - symbol_table: cd54572eeca90e6ebc795ff0f682c1edf27af71422545ded66f72026443ec213 + symbol_table: 59a92879cd9e8632b6ad1780ce4f687f9b9b0b142c38b31586578918c41690e7 initial_ast: e47f3796c64fdda060e19aa678de8af0a2956d41b9c88efc95276749bdb40c74 diff --git a/tests/expectations/compiler/compiler/integers/u128/max.leo.out b/tests/expectations/compiler/compiler/integers/u128/max.leo.out index 1408fc1f84..a19ad87db0 100644 --- a/tests/expectations/compiler/compiler/integers/u128/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/max.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: efd8b8d0fd3a8ef0d7b7037674780c38c56b208883af547d1284f0e45efffcb0 + symbol_table: 4edd22a9c1a03a2c2bd62bb1d7d907e8afe5cdae6dbe0f8ac4711fd69bb5407b initial_ast: 236d3017dfc1cf965041253c04fb854461b39448f3eae307be991d45c098d38f diff --git a/tests/expectations/compiler/compiler/integers/u128/min.leo.out b/tests/expectations/compiler/compiler/integers/u128/min.leo.out index dee7aee8c0..52eb4281d7 100644 --- a/tests/expectations/compiler/compiler/integers/u128/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/min.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: 839797470779b28c08f83b6b037d9441fe295dff9b1304a6147e219640e06704 + symbol_table: bf6b5da28a9adbc7dfb1b3b5aef006a6c040bb8eb94e142262611a131fcbec5e initial_ast: 40d6ad0c2bd53551e19fd32809afd7392603641c6408c1bde1d53029b506d6c8 diff --git a/tests/expectations/compiler/compiler/integers/u16/add.leo.out b/tests/expectations/compiler/compiler/integers/u16/add.leo.out index 7d71ef15bc..9adf8d7452 100644 --- a/tests/expectations/compiler/compiler/integers/u16/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/add.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 6f6d6764c925433e3966deefe74381d0fdd560c52a5cc48713e3c4dfb1c6c3a1 - symbol_table: 25f1d9fe9e4fc26868f1edad4c25d613f4814d7b51fbc6bbf602c364a2df7389 + symbol_table: b773a3747693ac625d3346f79cc3787d155e81da2eef74e8961fa5c0b6beda9c initial_ast: 20246e906b0724847c1f313e849ca183da6f2cb8f327ad52f6cad54eb612d9cb diff --git a/tests/expectations/compiler/compiler/integers/u16/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/u16/console_assert.leo.out index b03ca1fdb2..61ea8dac09 100644 --- a/tests/expectations/compiler/compiler/integers/u16/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/console_assert.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: cb0e4f51087e3221ca9d60ad25194233446b1827dcbd3af17206be357599915b - symbol_table: 52f1f76db8301f361bc2511178f18d8269c20e7ee2a5e41350c7cd4b4294a9dd + symbol_table: 31ea54152de57df0f234b406c8f78d84cc20dc9b998f4712ce4ac733f22b9a45 initial_ast: 129c0fd5a3df9124a00f91abc2ddcf228b5bd01b6ea2ac277a3cfc3e5c517021 diff --git a/tests/expectations/compiler/compiler/integers/u16/div.leo.out b/tests/expectations/compiler/compiler/integers/u16/div.leo.out index 1e55e2a80e..66cbcfda26 100644 --- a/tests/expectations/compiler/compiler/integers/u16/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/div.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 366c095f1dc13d5327fec0236867df3dd4efed80fefc990b402455be221ae3ae - symbol_table: d3bb974805db7c028da81baa4afcb0a24c1b9b05fae97c60aeb0c27680bb9267 + symbol_table: 52e163bd2142999e83b8c807c5f05d8f6dcff305472c4a4ad16c82d78be9823a initial_ast: c7f8663c2e35a240f8cd40af952012e44860be93cf691e97c2720cab99e29944 diff --git a/tests/expectations/compiler/compiler/integers/u16/eq.leo.out b/tests/expectations/compiler/compiler/integers/u16/eq.leo.out index 873b4718f0..a749f6de2b 100644 --- a/tests/expectations/compiler/compiler/integers/u16/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/eq.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: cb0e4f51087e3221ca9d60ad25194233446b1827dcbd3af17206be357599915b - symbol_table: ad01930069124344e81b3d2104a8d65eff211c9d4cccfefdd0c8d81fc3bdd276 + symbol_table: 2f35e5aa4269f54adddaa53477d4bd09d1e4a5d81068e61f5b6b5db001f5e316 initial_ast: 3bba994afe74ff41813d814792c6bea23ce00b52eaf9c24f999d2a97d6333a63 diff --git a/tests/expectations/compiler/compiler/integers/u16/max.leo.out b/tests/expectations/compiler/compiler/integers/u16/max.leo.out index 94bb368f3a..a27ef17f60 100644 --- a/tests/expectations/compiler/compiler/integers/u16/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/max.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: b6c2532a06245e8da2940be77fbef0f3a6f4f2a8e98049a3b56b1bd82811c555 + symbol_table: 69f776332dcb4ed2daf222bb7796116d60df76d7bba3686891fa352fcfbe1fcc initial_ast: b3f1ab730f6a8bec88ce1684856a373bc98d574ec875352fd72d5c102161df92 diff --git a/tests/expectations/compiler/compiler/integers/u16/min.leo.out b/tests/expectations/compiler/compiler/integers/u16/min.leo.out index 1ef816a8a8..2df2d3b5c9 100644 --- a/tests/expectations/compiler/compiler/integers/u16/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/min.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: 92e877fc934530476eaf8a8985c7a4f3b7be3acc65c93fe601ccf496de113c4c + symbol_table: 406df287bf9772b5916e8effb291efe4c4c7b182f25e9ffdc8d8a99abcd96d85 initial_ast: 7ddde153ed675096ff4d17849c055eec4548abe098837fbbb2df25e3be9eed24 diff --git a/tests/expectations/compiler/compiler/integers/u16/pow.leo.out b/tests/expectations/compiler/compiler/integers/u16/pow.leo.out index f5c99c0054..1b009a6d8f 100644 --- a/tests/expectations/compiler/compiler/integers/u16/pow.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/pow.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3454670db4ae2ae2274a879a456ea7b2ff6b89d119686417577495d5bc7a2d1a - symbol_table: 00785eb0f002a244cc196d4394fec5b0071d5ed7e4b6702e14938456b72cbb5f + symbol_table: 615d122bb3c4eabb96bb46044fde38d0ea81d56fe4ea0db9adbcdb74fab95258 initial_ast: e50a17ea461e6bf067a2b2728f73104065b911e47766a959d444b4a5d50dcf9a diff --git a/tests/expectations/compiler/compiler/integers/u32/add.leo.out b/tests/expectations/compiler/compiler/integers/u32/add.leo.out index 317ad375ea..ef35492f3a 100644 --- a/tests/expectations/compiler/compiler/integers/u32/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/add.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 7900982a0b59b180658c9c973f14c0f43f64e6c26ccf3dc72ccabbe97e6f7c1c - symbol_table: 0d39fc8fb24c3a5abbf3196c391cd23590eab1dddbe670dff1ad3d7953e45d4a + symbol_table: 25778e3ab23f629380da9c2cdb6f1e865643e9361fd650eabdf6768375fc0717 initial_ast: 6f17e86164961b0f5dd63f426dfe5a1c7097b7042ce9c80d9cd3e2b3c7918ab2 diff --git a/tests/expectations/compiler/compiler/integers/u32/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/u32/console_assert.leo.out index 4b967b0fab..cf2694c287 100644 --- a/tests/expectations/compiler/compiler/integers/u32/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/console_assert.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 0d8bd4140882c8076fc6f31339195bd136210fa8468de7232564be89d208c570 - symbol_table: e1e1412dbb433d0f7456b6d00d7702d4487bc9e837abd1b6503aedbd71573310 + symbol_table: 8f03b54e860293c2c5fd9b3bb1199e1691e582712f7f5e5f462c1f7a2fb0d5d1 initial_ast: 910eb749b9f449162c71e28c281111b11a0eddd0b51a5c3ac925217620257d56 diff --git a/tests/expectations/compiler/compiler/integers/u32/div.leo.out b/tests/expectations/compiler/compiler/integers/u32/div.leo.out index 1db95754b9..013c40d1c2 100644 --- a/tests/expectations/compiler/compiler/integers/u32/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/div.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 1899a411753778ecc51ee4565405c95f5dc93e7dfc084268332a034da1a4e22a - symbol_table: 5de00fad1a2c72b4dcc1abadc1b1cb0f494f94f5a4b8241759ec69856ad1e61d + symbol_table: 48c50aee2e6f9f2e525cb743866ce2fc9119566076cd63d30cdb0398f328a4ba initial_ast: f0756849f355e001af5182cb5b788cc796745499258548e421e5187e177f275f diff --git a/tests/expectations/compiler/compiler/integers/u32/eq.leo.out b/tests/expectations/compiler/compiler/integers/u32/eq.leo.out index ba20b94cf7..d8034bdfd0 100644 --- a/tests/expectations/compiler/compiler/integers/u32/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/eq.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 0d8bd4140882c8076fc6f31339195bd136210fa8468de7232564be89d208c570 - symbol_table: 9cef6bc5907dc9578a6d19e2f9b56ccc4e06b522efc4a2277c4ed418a9985e72 + symbol_table: e081f2d0bc92a375a18466c9298d728d8d2ae35a67fbedeb733ea4cd5a12409d initial_ast: 727e4ea81a78093866181fe291c97cc7dd006287a09f808402cb6c79d5ce1654 diff --git a/tests/expectations/compiler/compiler/integers/u32/max.leo.out b/tests/expectations/compiler/compiler/integers/u32/max.leo.out index f912f92577..00bd10527a 100644 --- a/tests/expectations/compiler/compiler/integers/u32/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/max.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: de89c559ab8acfd3a5e5d3f55637b989d555c8f67d507b776ece16d3ab9d1585 + symbol_table: 6cb33ae7380c96471000854378fc11a0ac0986e2f0cc82d0b67157ea1f66375e initial_ast: 3ee32e9424c5f287e7dcd311cd8962fa6da2506a9804b9358d828292152bf40a diff --git a/tests/expectations/compiler/compiler/integers/u32/min.leo.out b/tests/expectations/compiler/compiler/integers/u32/min.leo.out index d2da5c857a..39991d191b 100644 --- a/tests/expectations/compiler/compiler/integers/u32/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/min.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: 1a110d738c265a9fdca9772b4191e645c833df7d86e8f3c1a4c2a069d64b7637 + symbol_table: ae53f8e2991eb6e1c5411e9323fe1f0a0362ed74ded446743ac7cc7b6472c685 initial_ast: 9312408c86bd423f22addf6c9f8359743ce80ebe0f78be275cc533ded55b5a7a diff --git a/tests/expectations/compiler/compiler/integers/u64/add.leo.out b/tests/expectations/compiler/compiler/integers/u64/add.leo.out index 503beaabba..2a2a0ef2e2 100644 --- a/tests/expectations/compiler/compiler/integers/u64/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/add.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: e716ba579037b58227d1e433d4304f99f2b2eef51f88fdc8b3086a482ee7771e - symbol_table: 48a3b99e31105bcac10e57226f098c9b3462b6288683cc1ab1c86d6cf9d037ac + symbol_table: c1c13f861658664abf92e0a1fc7bdc65c51458a53b7bc3810fd624bc3893d5ff initial_ast: 437ed1d3a2f85fc715a4094f9336df301ee7fe1ba9d63e06a1662c97c3f07345 diff --git a/tests/expectations/compiler/compiler/integers/u64/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/u64/console_assert.leo.out index 2185ca4e64..847a3251a9 100644 --- a/tests/expectations/compiler/compiler/integers/u64/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/console_assert.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 0293b081f0efa060d6d6be2a41792af71a74b1a894832aef14166c5bbd242e2e - symbol_table: 2710b3b28bf4eb04445f205b07f4f573370c745cb858c2ffd82711d6a2422f47 + symbol_table: 7753ab45670bf14beb7642f47b735da9c08b49839bc42ea6827bcdf965cfe1ed initial_ast: cc17de8b54b55ee1cd6dfe70cd0e4635899e1313611a73251266b81fe1d1f959 diff --git a/tests/expectations/compiler/compiler/integers/u64/div.leo.out b/tests/expectations/compiler/compiler/integers/u64/div.leo.out index 0720047aef..9626dfc123 100644 --- a/tests/expectations/compiler/compiler/integers/u64/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/div.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 9f6987350c5148b7587ed453e96e575bb967b5115a1f0648764bce5b4d977c46 - symbol_table: 642ee9396286a65734b8b0ab826706fca67bdf5ac1d39903a7d398182f27e715 + symbol_table: 96d922c665c2723cb7ca22f4f416dbf9d2d76f07ce2d4ce7b3c1becc41ebc9b6 initial_ast: b1506f24dec921f4767cad398fb94c42ad773be1a034427e8377a4ffca6fd5cd diff --git a/tests/expectations/compiler/compiler/integers/u64/eq.leo.out b/tests/expectations/compiler/compiler/integers/u64/eq.leo.out index 6cf5eea937..efa39f4a61 100644 --- a/tests/expectations/compiler/compiler/integers/u64/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/eq.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 0293b081f0efa060d6d6be2a41792af71a74b1a894832aef14166c5bbd242e2e - symbol_table: 91b81bbb60572c2ab26ca90a2008ec67795620c4eded2c865f552ca26826a8da + symbol_table: 89b3e14b1880e4d3ce547087df3229f7c0b20a40c6c55130b9af3f17af90fc01 initial_ast: 0895f12f7a9102ae711b05156078d0c06db88469c1134f1afaae1571f6d55dd6 diff --git a/tests/expectations/compiler/compiler/integers/u64/max.leo.out b/tests/expectations/compiler/compiler/integers/u64/max.leo.out index 39e6ce0449..5aeef45200 100644 --- a/tests/expectations/compiler/compiler/integers/u64/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/max.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: ac5dff57de37bbb67bafaa848106ace90f242446d6dbac90a0c15dee454e51e1 + symbol_table: a7e47aec9a839e089b64e17d3dac5e110bccdf3b97b69d5e8a1a64e4a32138b2 initial_ast: 01b9771e78ab5bba09192e745dc5ffb2d6efcbe8a7c9cf95f9ff2eefe40e3f29 diff --git a/tests/expectations/compiler/compiler/integers/u64/min.leo.out b/tests/expectations/compiler/compiler/integers/u64/min.leo.out index 35f1233313..cc89c40532 100644 --- a/tests/expectations/compiler/compiler/integers/u64/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/min.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: a29f0a95778e3e879a3e71e61bf69894060e0ff338890149d48fd9af0014c4d3 + symbol_table: 9579cc0870b2c20e1ce3e47deecb81a0925d4e883403626870b125c10eceb59c initial_ast: 7424362afeae0eb87938c932dbf8ed126779d6626fbb310a937f01e5e6a43b7f diff --git a/tests/expectations/compiler/compiler/integers/u8/add.leo.out b/tests/expectations/compiler/compiler/integers/u8/add.leo.out index 7d4bb179db..4dcef25aa6 100644 --- a/tests/expectations/compiler/compiler/integers/u8/add.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/add.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: bec6adce6675e69f58bd54bfd2d89ed483f5e6bb722ba9ba3889f200aaf830d1 - symbol_table: 7c9d2537c4dfee02096129a884b7f7e811c8834ad7d1b11c35027eb8caab39c7 + symbol_table: b49bebf927e5e92ff081f5c76a421532e86ac349fe85391e838879928e58c9e7 initial_ast: b7dd798a6c169b0e90da360b86a56644bca050365f6d3f59f20f6b58df88b336 diff --git a/tests/expectations/compiler/compiler/integers/u8/console_assert.leo.out b/tests/expectations/compiler/compiler/integers/u8/console_assert.leo.out index 85914a7783..25841c2f96 100644 --- a/tests/expectations/compiler/compiler/integers/u8/console_assert.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/console_assert.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3e4fef1af04fd43972dc710e4b0e67e1b5f3b03cf0e8d1373cedfb0426b5adb7 - symbol_table: 8aca3b9422a6097b27e54c6d205754032eb01b325bf5febc689cb0a1dfd9c93c + symbol_table: c57bb0b106be07bd5f495f1623ebeb3c455437f59d583d3790cf036253a8e363 initial_ast: 0e5b41d2d779d29056c60c35f03c863883fb4ff50cf3833b2f40960757b6adda diff --git a/tests/expectations/compiler/compiler/integers/u8/div.leo.out b/tests/expectations/compiler/compiler/integers/u8/div.leo.out index 5c58083e00..3a8da08929 100644 --- a/tests/expectations/compiler/compiler/integers/u8/div.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/div.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: e03a50836125b20c3b6f5c0616054b65a694fb183a135db8c600cc84a4e07636 - symbol_table: 5df47e489214d269e01b424fbccba97be8c1f81d3918c81cdf626ed9ec609d32 + symbol_table: 8f1027beea373169e2bb06491736fd4099425a4f4d3f8fcb612462982cdb0d05 initial_ast: 01ffcd880e5569626d16ac43de9db56cd4ee17a01e570d45815277b003fbb01e diff --git a/tests/expectations/compiler/compiler/integers/u8/eq.leo.out b/tests/expectations/compiler/compiler/integers/u8/eq.leo.out index 5cdde740d6..f4b105cfe8 100644 --- a/tests/expectations/compiler/compiler/integers/u8/eq.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/eq.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3e4fef1af04fd43972dc710e4b0e67e1b5f3b03cf0e8d1373cedfb0426b5adb7 - symbol_table: 2c9ef296994a78746d48dfda0b631c806f27e373e6b7f87d118b845167131738 + symbol_table: 16076a22d3c0df71ab90df94e1ecb26ad330c02fe2536f0b5a5d1fc8a11e05c5 initial_ast: 8a55d90966d19eae8d35e12c03868d2fb2331b36c799253cd225c3dd92db3fd0 diff --git a/tests/expectations/compiler/compiler/integers/u8/max.leo.out b/tests/expectations/compiler/compiler/integers/u8/max.leo.out index b684102da8..d80f9f8644 100644 --- a/tests/expectations/compiler/compiler/integers/u8/max.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/max.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: e48e32b105e55526e8c3e2f86506b205fa0b66301397734fb29de2c29122b759 + symbol_table: 9ff7adccc170c1428f3844c390027a8f9641c9f8a76ce5f0024b2c9140f45d93 initial_ast: e95ec61a3ab9930a26c2de8e8f184efdc67a2d72f2673db3e1d2c701efc6fbf2 diff --git a/tests/expectations/compiler/compiler/integers/u8/min.leo.out b/tests/expectations/compiler/compiler/integers/u8/min.leo.out index 1df79d3cb3..197a4d8e75 100644 --- a/tests/expectations/compiler/compiler/integers/u8/min.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/min.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 - symbol_table: bc79ed97e649afd1c57c04787ef961f3e637c6c6a26a11eb0e1803a688dd4811 + symbol_table: 2dd055524a0d6eefa18c3248f40c0b7934080c4ea0f8052c2da2191408d2fea1 initial_ast: 287f0724a7c0aeba2473e7a28d2aab9d76e5810fa9a8ca8f6e1c5e98de496f0f diff --git a/tests/expectations/compiler/compiler/integers/u8/pow.leo.out b/tests/expectations/compiler/compiler/integers/u8/pow.leo.out index 014fe94ff2..abdceae059 100644 --- a/tests/expectations/compiler/compiler/integers/u8/pow.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/pow.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: ec515007a1c2cbe83aff0029932fe56e397a4ca82f99095abcc7fc25f4e0723f - symbol_table: 66ec3fbee8f9a937771f0042e29c84ed1a546bf89135019880eab7b3905f3a8a + symbol_table: 73fe24ea2c931a693a817e2b4606430192bc0214fdb762f6db260add7ddb22d4 initial_ast: 32f692f5afbbadfcd3255f61ce5d63e102d570529ed6bab0c00250f824ff01dd diff --git a/tests/expectations/compiler/compiler/mutability/cond_mut.leo.out b/tests/expectations/compiler/compiler/mutability/cond_mut.leo.out index 3ec38ebe70..f9a7b6e5f8 100644 --- a/tests/expectations/compiler/compiler/mutability/cond_mut.leo.out +++ b/tests/expectations/compiler/compiler/mutability/cond_mut.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 534a7a2cf337da1dc9ea3d25dacec6390f4cdbf6b5961b481564abc44fff1442 - symbol_table: 7593283e1d83eedb1f92ebb1197d06a54ba86b856b88472e97bd82d5b649fe0c + symbol_table: 2945f5477f1985cd91fc0238eda0d96ee5b5e064b5579af5e37cb8d676dbc3cb initial_ast: 8f2221b11734ed4889d70e448bb3a6197146403f117d3ba015c611261aadf0df diff --git a/tests/expectations/compiler/compiler/mutability/function_input_mut.leo.out b/tests/expectations/compiler/compiler/mutability/function_input_mut.leo.out index d877751bea..095d45c143 100644 --- a/tests/expectations/compiler/compiler/mutability/function_input_mut.leo.out +++ b/tests/expectations/compiler/compiler/mutability/function_input_mut.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 534a7a2cf337da1dc9ea3d25dacec6390f4cdbf6b5961b481564abc44fff1442 - symbol_table: 6b646fc79abca7d9ef29d5d12fdfa3d2988d01a2332507ef512d34af7f2d1786 + symbol_table: 27a1e162691d8e54a3c88d50628e4d865bba598acdc5916aed7edf60d79e68d1 initial_ast: 0ee6dbfb6d2780de8853573772fac4f757bd7c33feef0e2e7e8d7518107a9e70 diff --git a/tests/expectations/compiler/compiler/mutability/let_mut_nested.leo.out b/tests/expectations/compiler/compiler/mutability/let_mut_nested.leo.out index 46729bf823..76cf66ff9e 100644 --- a/tests/expectations/compiler/compiler/mutability/let_mut_nested.leo.out +++ b/tests/expectations/compiler/compiler/mutability/let_mut_nested.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 534a7a2cf337da1dc9ea3d25dacec6390f4cdbf6b5961b481564abc44fff1442 - symbol_table: e4496279ec6d0ba8103bbca1cc65bf6c92bc40f554085207dbecdda82eb02caf + symbol_table: 31926a79e803f137c80e1ee8698b50261c831ee6e83f1b09895e3d2c2b09113f initial_ast: 04991c563333ddfd77104bef3d033222a0ea68f0ed97822dd0120adcae1e2eb4 diff --git a/tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.leo.out b/tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.leo.out index d9d0623e70..8adda863ae 100644 --- a/tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.leo.out +++ b/tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.leo.out @@ -4,5 +4,5 @@ expectation: Pass outputs: - output: - initial_input_ast: 86fdb64f9c593c85f97a5aae6c5e602840e5b403b1994211f280a1bc99a8ccf4 - symbol_table: 8abfa842d3611a25fa048e507ef0f53f02a838049f6dd53904da0c384fec2643 + symbol_table: ea61603fdb0d2d3f9ed43f0b8fd044438c4f662ae0cfb97e95505b741a82ce0b initial_ast: a96b034d1255f8b2b0633fb6b6d302b643b32135059bbdb51d4cd7ba91eb35d8 From 67fd130c0c2a4c3ed48018b65b72bceead6dc36a Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Wed, 4 May 2022 14:50:33 -0700 Subject: [PATCH 09/16] had to handle negation of signed integers --- .../src/type_checker/check_expressions.rs | 122 +++++++++++++++--- .../src/type_checker/check_statements.rs | 18 ++- compiler/passes/src/type_checker/checker.rs | 2 + .../errors/type_checker/type_checker_error.rs | 8 +- 4 files changed, 124 insertions(+), 26 deletions(-) diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index 4934b6495b..6e5d9b6c71 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -39,7 +39,7 @@ fn return_incorrect_type(t1: Option, t2: Option, expected: Option TypeChecker<'a> { - pub(crate) fn compare_expr_type(&self, expr: &Expression, expected: Option, span: &Span) -> Option { + pub(crate) fn compare_expr_type(&mut self, expr: &Expression, expected: Option, span: &Span) -> Option { match expr { Expression::Identifier(ident) => { if let Some(var) = self.symbol_table.lookup_variable(&ident.name) { @@ -55,11 +55,95 @@ impl<'a> TypeChecker<'a> { ValueExpression::Boolean(_, _) => Some(self.assert_type(Type::Boolean, expected, value.span())), ValueExpression::Char(_) => Some(self.assert_type(Type::Char, expected, value.span())), ValueExpression::Field(_, _) => Some(self.assert_type(Type::Field, expected, value.span())), - ValueExpression::Integer(type_, _, _) => { + ValueExpression::Integer(type_, str_content, _) => { + match type_ { + IntegerType::I8 => { + let int = if self.negate { + self.negate = false; + format!("-{str_content}") + } else { + str_content.clone() + }; + + if int.parse::().is_err() { + self.handler + .emit_err(TypeCheckerError::invalid_int_value(int, "i8", value.span()).into()); + } + } + IntegerType::I16 => { + let int = if self.negate { + self.negate = false; + format!("-{str_content}") + } else { + str_content.clone() + }; + + if int.parse::().is_err() { + self.handler + .emit_err(TypeCheckerError::invalid_int_value(int, "i16", value.span()).into()); + } + } + IntegerType::I32 => { + let int = if self.negate { + self.negate = false; + format!("-{str_content}") + } else { + str_content.clone() + }; + + if int.parse::().is_err() { + self.handler + .emit_err(TypeCheckerError::invalid_int_value(int, "i32", value.span()).into()); + } + } + IntegerType::I64 => { + let int = if self.negate { + self.negate = false; + format!("-{str_content}") + } else { + str_content.clone() + }; + + if int.parse::().is_err() { + self.handler + .emit_err(TypeCheckerError::invalid_int_value(int, "i64", value.span()).into()); + } + } + IntegerType::I128 => { + let int = if self.negate { + self.negate = false; + format!("-{str_content}") + } else { + str_content.clone() + }; + + if int.parse::().is_err() { + self.handler + .emit_err(TypeCheckerError::invalid_int_value(int, "i128", value.span()).into()); + } + } + + IntegerType::U8 if str_content.parse::().is_err() => self + .handler + .emit_err(TypeCheckerError::invalid_int_value(str_content, "u8", value.span()).into()), + IntegerType::U16 if str_content.parse::().is_err() => self + .handler + .emit_err(TypeCheckerError::invalid_int_value(str_content, "u16", value.span()).into()), + IntegerType::U32 if str_content.parse::().is_err() => self + .handler + .emit_err(TypeCheckerError::invalid_int_value(str_content, "u32", value.span()).into()), + IntegerType::U64 if str_content.parse::().is_err() => self + .handler + .emit_err(TypeCheckerError::invalid_int_value(str_content, "u64", value.span()).into()), + IntegerType::U128 if str_content.parse::().is_err() => self + .handler + .emit_err(TypeCheckerError::invalid_int_value(str_content, "u128", value.span()).into()), + _ => {} + } Some(self.assert_type(Type::IntegerType(*type_), expected, value.span())) } ValueExpression::Group(_) => Some(self.assert_type(Type::Group, expected, value.span())), - ValueExpression::String(_, _) => None, + ValueExpression::String(_, _) => unreachable!("String types are not reachable"), }, Expression::Binary(binary) => match binary.op { BinaryOperation::And | BinaryOperation::Or => { @@ -163,19 +247,25 @@ impl<'a> TypeChecker<'a> { self.compare_expr_type(&unary.inner, expected, unary.inner.span()) } UnaryOperation::Negate => { - /* match expected { - Type::IntegerType( - IntegerType::I8 - | IntegerType::I16 - | IntegerType::I32 - | IntegerType::I64 - | IntegerType::I128, - ) => {}, - Type::Field | Type::Group => {} - _ => self.handler.emit_err( - TypeCheckerError::type_is_not_negatable(expected.clone(), unary.inner.span()).into(), - ), - } */ + // -128i8 + // -(-128i16 + 3i16) = 125i16 + match expected.as_ref() { + Some( + Type::IntegerType( + IntegerType::I8 + | IntegerType::I16 + | IntegerType::I32 + | IntegerType::I64 + | IntegerType::I128, + ) + | Type::Field + | Type::Group, + ) => self.negate = !self.negate, + Some(t) => self + .handler + .emit_err(TypeCheckerError::type_is_not_negatable(t, unary.inner.span()).into()), + _ => {} + }; self.compare_expr_type(&unary.inner, expected, unary.inner.span()) } }, diff --git a/compiler/passes/src/type_checker/check_statements.rs b/compiler/passes/src/type_checker/check_statements.rs index d17eb3f317..e085db034d 100644 --- a/compiler/passes/src/type_checker/check_statements.rs +++ b/compiler/passes/src/type_checker/check_statements.rs @@ -25,9 +25,9 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { // statements should always have some parent block let parent = self.parent.unwrap(); - if let Some(func) = self.symbol_table.lookup_fn(&parent) { - self.compare_expr_type(&input.expression, Some(func.output.clone()), input.expression.span()); - } + // Would never be None. + let func_output_type = self.symbol_table.lookup_fn(&parent).map(|f| f.output.clone()); + self.compare_expr_type(&input.expression, func_output_type, input.expression.span()); VisitResult::VisitChildren } @@ -59,7 +59,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { fn visit_assign(&mut self, input: &'a AssignStatement) -> VisitResult { let var_name = &input.assignee.identifier.name; - if let Some(var) = self.symbol_table.lookup_variable(var_name) { + let var_type = if let Some(var) = self.symbol_table.lookup_variable(var_name) { match &var.declaration { Declaration::Const => self .handler @@ -70,11 +70,17 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { _ => {} } - self.compare_expr_type(&input.value, Some(var.type_.clone()), input.value.span()); + Some(var.type_.clone()) } else { self.handler.emit_err( TypeCheckerError::unknown_sym("variable", &input.assignee.identifier.name, &input.assignee.span).into(), - ) + ); + + None + }; + + if var_type.is_some() { + self.compare_expr_type(&input.value, var_type, input.value.span()); } VisitResult::VisitChildren diff --git a/compiler/passes/src/type_checker/checker.rs b/compiler/passes/src/type_checker/checker.rs index c4f8a29440..c38eebf023 100644 --- a/compiler/passes/src/type_checker/checker.rs +++ b/compiler/passes/src/type_checker/checker.rs @@ -24,6 +24,7 @@ pub struct TypeChecker<'a> { pub(crate) symbol_table: &'a mut SymbolTable<'a>, pub(crate) handler: &'a Handler, pub(crate) parent: Option, + pub(crate) negate: bool, } const ARITHMATIC_TYPES: &[Type] = &[ @@ -74,6 +75,7 @@ impl<'a> TypeChecker<'a> { symbol_table, handler, parent: None, + negate: false, } } diff --git a/leo/errors/src/errors/type_checker/type_checker_error.rs b/leo/errors/src/errors/type_checker/type_checker_error.rs index 842e663c64..6646d294ca 100644 --- a/leo/errors/src/errors/type_checker/type_checker_error.rs +++ b/leo/errors/src/errors/type_checker/type_checker_error.rs @@ -123,12 +123,12 @@ create_messages!( help: None, } - /// For when a type is does not exist. + /// For when an integer is not in a valid range. @formatted - unknown_type { - args: (), + invalid_int_value { + args: (value: impl Display, type_: impl Display), msg: format!( - "The type", + "The value {value} is not a valid `{type_}`", ), help: None, } From b97bf4c9bcbb4e7f4c4731c9af679b14b52fd92a Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Wed, 4 May 2022 15:37:59 -0700 Subject: [PATCH 10/16] started going through deprecated tests, noticed parts of testframework were broken --- compiler/compiler/src/test.rs | 35 +++++++++++++++---- .../src/type_checker/check_expressions.rs | 2 -- .../src/type_checker/check_statements.rs | 3 +- compiler/passes/src/type_checker/mod.rs | 2 ++ .../function/duplicate_parameter_fail.leo | 3 +- .../function/shadow_parameter_fail.leo | 3 +- .../compiler/function/undefined_fail.leo | 4 +-- .../compiler/compiler/address/equal.leo.out | 6 +++- .../compiler/compiler/address/ternary.leo.out | 6 +++- .../compiler/compiler/boolean/and.leo.out | 10 +++++- .../compiler/boolean/conditional.leo.out | 10 +++++- .../compiler/compiler/boolean/equal.leo.out | 10 +++++- .../compiler/boolean/not_equal.leo.out | 10 +++++- .../compiler/compiler/boolean/or.leo.out | 10 +++++- .../compiler/compiler/field/add.leo.out | 4 ++- .../compiler/compiler/field/div.leo.out | 4 ++- .../compiler/compiler/field/eq.leo.out | 4 ++- .../compiler/compiler/field/field.leo.out | 4 ++- .../compiler/compiler/field/mul.leo.out | 4 ++- .../compiler/compiler/field/negate.leo.out | 4 ++- .../function/duplicate_parameter_fail.leo.out | 5 +++ .../function/shadow_parameter_fail.leo.out | 5 +++ .../compiler/function/undefined_fail.leo.out | 5 +++ .../compiler/integers/i128/ge.leo.out | 6 +++- .../compiler/integers/i128/gt.leo.out | 6 +++- .../compiler/integers/i128/le.leo.out | 6 +++- .../compiler/integers/i128/lt.leo.out | 6 +++- .../compiler/integers/i128/mul.leo.out | 4 ++- .../compiler/integers/i128/ne.leo.out | 6 +++- .../compiler/integers/i128/negate.leo.out | 6 +++- .../integers/i128/negate_zero.leo.out | 4 ++- .../compiler/integers/i128/sub.leo.out | 4 ++- .../compiler/integers/i128/ternary.leo.out | 6 +++- .../compiler/compiler/integers/i16/ge.leo.out | 6 +++- .../compiler/compiler/integers/i16/gt.leo.out | 6 +++- .../compiler/compiler/integers/i16/le.leo.out | 6 +++- .../compiler/compiler/integers/i16/lt.leo.out | 6 +++- .../compiler/integers/i16/mul.leo.out | 4 ++- .../compiler/compiler/integers/i16/ne.leo.out | 6 +++- .../compiler/integers/i16/negate.leo.out | 6 +++- .../compiler/integers/i16/negate_zero.leo.out | 4 ++- .../compiler/integers/i16/sub.leo.out | 4 ++- .../compiler/integers/i16/ternary.leo.out | 6 +++- .../compiler/compiler/integers/i32/ge.leo.out | 6 +++- .../compiler/compiler/integers/i32/gt.leo.out | 6 +++- .../compiler/compiler/integers/i32/le.leo.out | 6 +++- .../compiler/compiler/integers/i32/lt.leo.out | 6 +++- .../compiler/integers/i32/mul.leo.out | 4 ++- .../compiler/compiler/integers/i32/ne.leo.out | 6 +++- .../compiler/integers/i32/negate.leo.out | 6 +++- .../compiler/integers/i32/negate_zero.leo.out | 4 ++- .../compiler/integers/i32/sub.leo.out | 4 ++- .../compiler/integers/i32/ternary.leo.out | 6 +++- .../compiler/compiler/integers/i64/ge.leo.out | 6 +++- .../compiler/compiler/integers/i64/gt.leo.out | 6 +++- .../compiler/compiler/integers/i64/le.leo.out | 6 +++- .../compiler/compiler/integers/i64/lt.leo.out | 6 +++- .../compiler/integers/i64/mul.leo.out | 4 ++- .../compiler/compiler/integers/i64/ne.leo.out | 6 +++- .../compiler/integers/i64/negate.leo.out | 6 +++- .../compiler/integers/i64/negate_zero.leo.out | 4 ++- .../compiler/integers/i64/sub.leo.out | 4 ++- .../compiler/integers/i64/ternary.leo.out | 6 +++- .../compiler/compiler/integers/i8/ge.leo.out | 6 +++- .../compiler/compiler/integers/i8/gt.leo.out | 6 +++- .../compiler/compiler/integers/i8/le.leo.out | 6 +++- .../compiler/compiler/integers/i8/lt.leo.out | 6 +++- .../compiler/compiler/integers/i8/mul.leo.out | 4 ++- .../compiler/compiler/integers/i8/ne.leo.out | 6 +++- .../compiler/integers/i8/negate.leo.out | 6 +++- .../compiler/integers/i8/negate_zero.leo.out | 4 ++- .../compiler/compiler/integers/i8/sub.leo.out | 4 ++- .../compiler/integers/i8/ternary.leo.out | 6 +++- .../compiler/integers/u128/ge.leo.out | 6 +++- .../compiler/integers/u128/gt.leo.out | 6 +++- .../compiler/integers/u128/le.leo.out | 6 +++- .../compiler/integers/u128/lt.leo.out | 6 +++- .../compiler/integers/u128/mul.leo.out | 4 ++- .../compiler/integers/u128/ne.leo.out | 6 +++- .../compiler/integers/u128/sub.leo.out | 4 ++- .../compiler/integers/u128/ternary.leo.out | 6 +++- .../compiler/compiler/integers/u16/ge.leo.out | 6 +++- .../compiler/compiler/integers/u16/gt.leo.out | 6 +++- .../compiler/compiler/integers/u16/le.leo.out | 6 +++- .../compiler/compiler/integers/u16/lt.leo.out | 6 +++- .../compiler/integers/u16/mul.leo.out | 4 ++- .../compiler/compiler/integers/u16/ne.leo.out | 6 +++- .../compiler/integers/u16/sub.leo.out | 4 ++- .../compiler/integers/u16/ternary.leo.out | 6 +++- .../compiler/compiler/integers/u32/ge.leo.out | 6 +++- .../compiler/compiler/integers/u32/gt.leo.out | 6 +++- .../compiler/compiler/integers/u32/le.leo.out | 6 +++- .../compiler/compiler/integers/u32/lt.leo.out | 6 +++- .../compiler/integers/u32/mul.leo.out | 4 ++- .../compiler/compiler/integers/u32/ne.leo.out | 6 +++- .../compiler/integers/u32/sub.leo.out | 4 ++- .../compiler/integers/u32/ternary.leo.out | 6 +++- .../compiler/compiler/integers/u64/ge.leo.out | 6 +++- .../compiler/compiler/integers/u64/gt.leo.out | 6 +++- .../compiler/compiler/integers/u64/le.leo.out | 6 +++- .../compiler/compiler/integers/u64/lt.leo.out | 6 +++- .../compiler/integers/u64/mul.leo.out | 4 ++- .../compiler/compiler/integers/u64/ne.leo.out | 6 +++- .../compiler/integers/u64/sub.leo.out | 4 ++- .../compiler/integers/u64/ternary.leo.out | 6 +++- .../compiler/compiler/integers/u8/ge.leo.out | 6 +++- .../compiler/compiler/integers/u8/gt.leo.out | 6 +++- .../compiler/compiler/integers/u8/le.leo.out | 6 +++- .../compiler/compiler/integers/u8/lt.leo.out | 6 +++- .../compiler/compiler/integers/u8/mul.leo.out | 4 ++- .../compiler/compiler/integers/u8/ne.leo.out | 6 +++- .../compiler/compiler/integers/u8/sub.leo.out | 4 ++- .../compiler/integers/u8/ternary.leo.out | 6 +++- .../compiler/statements/chain.leo.out | 8 ++++- .../statements/multiple_returns.leo.out | 6 +++- .../compiler/statements/mutate.leo.out | 6 +++- 116 files changed, 543 insertions(+), 120 deletions(-) rename {disabled_tests => tests}/compiler/function/duplicate_parameter_fail.leo (65%) rename {disabled_tests => tests}/compiler/function/shadow_parameter_fail.leo (75%) rename disabled_tests/compiler/function/undefined.leo => tests/compiler/function/undefined_fail.leo (61%) create mode 100644 tests/expectations/compiler/compiler/function/duplicate_parameter_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/function/shadow_parameter_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/function/undefined_fail.leo.out diff --git a/compiler/compiler/src/test.rs b/compiler/compiler/src/test.rs index e83fd80d42..1b2a56252d 100644 --- a/compiler/compiler/src/test.rs +++ b/compiler/compiler/src/test.rs @@ -102,6 +102,14 @@ fn get_input_file_paths(list: &mut Vec, test: &Test, input: &Value) { let mut input_file = input_file; input_file.push(input.as_str().expect("input_file was not a string or array")); list.push(input_file.clone()); + } else if let Some(seq) = input.as_sequence() { + for name in seq { + let mut input_file = input_file.clone(); + input_file.push(name.as_str().expect("input_file was not a string")); + list.push( + input_file.clone(), + ); + } } } @@ -118,9 +126,12 @@ fn collect_all_inputs(test: &Test) -> Result, String> { fn compile_and_process<'a>( parsed: &'a mut Compiler<'a>, - input_file_path: PathBuf, + input_file_path: Option, ) -> Result, LeoError> { - parsed.parse_input(input_file_path)?; + if let Some(input_file_path) = input_file_path { + parsed.parse_input(input_file_path)?; + } + parsed.compiler_stages() } @@ -183,17 +194,27 @@ fn run_test(test: Test, handler: &Handler, err_buf: &BufferEmitter) -> Result TypeChecker<'a> { self.compare_expr_type(&unary.inner, expected, unary.inner.span()) } UnaryOperation::Negate => { - // -128i8 - // -(-128i16 + 3i16) = 125i16 match expected.as_ref() { Some( Type::IntegerType( diff --git a/compiler/passes/src/type_checker/check_statements.rs b/compiler/passes/src/type_checker/check_statements.rs index e085db034d..21f8ef53ef 100644 --- a/compiler/passes/src/type_checker/check_statements.rs +++ b/compiler/passes/src/type_checker/check_statements.rs @@ -123,7 +123,8 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { VisitResult::VisitChildren } - fn visit_expression_statement(&mut self, _input: &'a ExpressionStatement) -> VisitResult { + fn visit_expression_statement(&mut self, input: &'a ExpressionStatement) -> VisitResult { + self.compare_expr_type(&input.expression, None, input.span()); VisitResult::SkipChildren } diff --git a/compiler/passes/src/type_checker/mod.rs b/compiler/passes/src/type_checker/mod.rs index b16ea905b7..3f9604f275 100644 --- a/compiler/passes/src/type_checker/mod.rs +++ b/compiler/passes/src/type_checker/mod.rs @@ -38,6 +38,8 @@ impl<'a> Pass<'a> for TypeChecker<'a> { fn do_pass((ast, symbol_table, handler): Self::Input) -> Self::Output { let mut visitor = VisitorDirector::new(TypeChecker::new(symbol_table, handler)); visitor.visit_program(ast.as_repr()); + // awkward cause last error double prints... + // but can't os exit or it causes tests to stop. handler.last_err()?; Ok(()) diff --git a/disabled_tests/compiler/function/duplicate_parameter_fail.leo b/tests/compiler/function/duplicate_parameter_fail.leo similarity index 65% rename from disabled_tests/compiler/function/duplicate_parameter_fail.leo rename to tests/compiler/function/duplicate_parameter_fail.leo index 3be8c21c18..e7badc1613 100644 --- a/disabled_tests/compiler/function/duplicate_parameter_fail.leo +++ b/tests/compiler/function/duplicate_parameter_fail.leo @@ -4,6 +4,7 @@ expectation: Fail input_file: input/dummy.in */ -function main(a: u32, a: u32) { +function main(a: u32, a: u32) -> u32 { console.log("{}", 1u8); + return a; } \ No newline at end of file diff --git a/disabled_tests/compiler/function/shadow_parameter_fail.leo b/tests/compiler/function/shadow_parameter_fail.leo similarity index 75% rename from disabled_tests/compiler/function/shadow_parameter_fail.leo rename to tests/compiler/function/shadow_parameter_fail.leo index 3d44753da1..ec1f9860b6 100644 --- a/disabled_tests/compiler/function/shadow_parameter_fail.leo +++ b/tests/compiler/function/shadow_parameter_fail.leo @@ -4,8 +4,9 @@ expectation: Fail input_file: input/dummy.in */ -function tester(hi: u8) { +function tester(hi: u8) -> u8 { const hi = 2u8; + return hi; } function main (y: bool) -> bool { diff --git a/disabled_tests/compiler/function/undefined.leo b/tests/compiler/function/undefined_fail.leo similarity index 61% rename from disabled_tests/compiler/function/undefined.leo rename to tests/compiler/function/undefined_fail.leo index 42e251c558..28bb6f5085 100644 --- a/disabled_tests/compiler/function/undefined.leo +++ b/tests/compiler/function/undefined_fail.leo @@ -3,7 +3,7 @@ namespace: Compile expectation: Fail */ - -function main() { +function main() -> u8 { my_function(); + return 0u8; } diff --git a/tests/expectations/compiler/compiler/address/equal.leo.out b/tests/expectations/compiler/compiler/address/equal.leo.out index e0ed232bf1..4beccc784e 100644 --- a/tests/expectations/compiler/compiler/address/equal.leo.out +++ b/tests/expectations/compiler/compiler/address/equal.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 98da6a76f2370e9311042851dde02ebaa4e64528d9461a5e722858f394d25f93 + symbol_table: 7ec407fabcae0eeef889009b8ba99beac3d18b2d79cc49e7760261d80bd59728 + - initial_input_ast: 85307a4f16278d38b746d321756e41c3cf48bbb2dc5bad2f0e9a7b8c4dd2541e + symbol_table: 7ec407fabcae0eeef889009b8ba99beac3d18b2d79cc49e7760261d80bd59728 initial_ast: 89da88a9e5d4a82174424afbca4a45949a62f142b3a527dc3b6a88c222517227 diff --git a/tests/expectations/compiler/compiler/address/ternary.leo.out b/tests/expectations/compiler/compiler/address/ternary.leo.out index 52fbb53b71..c9661571fb 100644 --- a/tests/expectations/compiler/compiler/address/ternary.leo.out +++ b/tests/expectations/compiler/compiler/address/ternary.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 98da6a76f2370e9311042851dde02ebaa4e64528d9461a5e722858f394d25f93 + symbol_table: 5a12f141aef86a7a00b86650e23cfd9af657d6f418df7b1ee9eab06714305d31 + - initial_input_ast: 85307a4f16278d38b746d321756e41c3cf48bbb2dc5bad2f0e9a7b8c4dd2541e + symbol_table: 5a12f141aef86a7a00b86650e23cfd9af657d6f418df7b1ee9eab06714305d31 initial_ast: cec8d55d8faab0dce20c07e9940c3477b694511cdf2059fc44531120d055c9d4 diff --git a/tests/expectations/compiler/compiler/boolean/and.leo.out b/tests/expectations/compiler/compiler/boolean/and.leo.out index ae26b05d29..9f0e2cec4b 100644 --- a/tests/expectations/compiler/compiler/boolean/and.leo.out +++ b/tests/expectations/compiler/compiler/boolean/and.leo.out @@ -2,5 +2,13 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 51b03881ad0ef3af7d105c163071fb69fb38048bea44c4bc380fd17367ce94e0 + symbol_table: f36863240edb9fb5fb852c212a9ae1db491ee8243d0469fc155592964595e7d0 + - initial_input_ast: 59b58754cc7667404c6bba5d90a9e53b7f9f36b6d7c9783e5b88d12728127e66 + symbol_table: f36863240edb9fb5fb852c212a9ae1db491ee8243d0469fc155592964595e7d0 + - initial_input_ast: 55ff7a9a3f210ea871c438a89f07da6c54ca1b8129e7344593017d22305297b4 + symbol_table: f36863240edb9fb5fb852c212a9ae1db491ee8243d0469fc155592964595e7d0 + - initial_input_ast: c89564770d1984e4e8c0c17c6c50b66b4a5d4ade85899562f506afc22e50496d + symbol_table: f36863240edb9fb5fb852c212a9ae1db491ee8243d0469fc155592964595e7d0 initial_ast: 603affb858de195474d9dc4f5896b019649fbd6f9fb28eb94c5ff41f9bcf67e2 diff --git a/tests/expectations/compiler/compiler/boolean/conditional.leo.out b/tests/expectations/compiler/compiler/boolean/conditional.leo.out index 16c9062fc6..4a3c730048 100644 --- a/tests/expectations/compiler/compiler/boolean/conditional.leo.out +++ b/tests/expectations/compiler/compiler/boolean/conditional.leo.out @@ -2,5 +2,13 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 51b03881ad0ef3af7d105c163071fb69fb38048bea44c4bc380fd17367ce94e0 + symbol_table: 4fd4e476609947028fbffe357ffb9d962e96c30a9abe3677d75675ae37b12587 + - initial_input_ast: 59b58754cc7667404c6bba5d90a9e53b7f9f36b6d7c9783e5b88d12728127e66 + symbol_table: 4fd4e476609947028fbffe357ffb9d962e96c30a9abe3677d75675ae37b12587 + - initial_input_ast: 55ff7a9a3f210ea871c438a89f07da6c54ca1b8129e7344593017d22305297b4 + symbol_table: 4fd4e476609947028fbffe357ffb9d962e96c30a9abe3677d75675ae37b12587 + - initial_input_ast: c89564770d1984e4e8c0c17c6c50b66b4a5d4ade85899562f506afc22e50496d + symbol_table: 4fd4e476609947028fbffe357ffb9d962e96c30a9abe3677d75675ae37b12587 initial_ast: f577369ef75a92dd680338305c55f95a94ffb0b5ea8e6d090d4e7682666da163 diff --git a/tests/expectations/compiler/compiler/boolean/equal.leo.out b/tests/expectations/compiler/compiler/boolean/equal.leo.out index d40e257a55..023acd67a8 100644 --- a/tests/expectations/compiler/compiler/boolean/equal.leo.out +++ b/tests/expectations/compiler/compiler/boolean/equal.leo.out @@ -2,5 +2,13 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 51b03881ad0ef3af7d105c163071fb69fb38048bea44c4bc380fd17367ce94e0 + symbol_table: c8dd46774e298ef70fc87f89ecb8b5f23f63b1f2401f337fc97ad83b54e85871 + - initial_input_ast: 59b58754cc7667404c6bba5d90a9e53b7f9f36b6d7c9783e5b88d12728127e66 + symbol_table: c8dd46774e298ef70fc87f89ecb8b5f23f63b1f2401f337fc97ad83b54e85871 + - initial_input_ast: 55ff7a9a3f210ea871c438a89f07da6c54ca1b8129e7344593017d22305297b4 + symbol_table: c8dd46774e298ef70fc87f89ecb8b5f23f63b1f2401f337fc97ad83b54e85871 + - initial_input_ast: c89564770d1984e4e8c0c17c6c50b66b4a5d4ade85899562f506afc22e50496d + symbol_table: c8dd46774e298ef70fc87f89ecb8b5f23f63b1f2401f337fc97ad83b54e85871 initial_ast: c366a1ca90cc0d6bd3bafb7e83313549d028b101d1759d30d587aeca574f36c6 diff --git a/tests/expectations/compiler/compiler/boolean/not_equal.leo.out b/tests/expectations/compiler/compiler/boolean/not_equal.leo.out index 029d2e95c2..ee8f866108 100644 --- a/tests/expectations/compiler/compiler/boolean/not_equal.leo.out +++ b/tests/expectations/compiler/compiler/boolean/not_equal.leo.out @@ -2,5 +2,13 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 51b03881ad0ef3af7d105c163071fb69fb38048bea44c4bc380fd17367ce94e0 + symbol_table: 8ed9a73e996562abfe75837cfbf2103a4d9213291298206f4f63a7dac808cbc1 + - initial_input_ast: 59b58754cc7667404c6bba5d90a9e53b7f9f36b6d7c9783e5b88d12728127e66 + symbol_table: 8ed9a73e996562abfe75837cfbf2103a4d9213291298206f4f63a7dac808cbc1 + - initial_input_ast: 55ff7a9a3f210ea871c438a89f07da6c54ca1b8129e7344593017d22305297b4 + symbol_table: 8ed9a73e996562abfe75837cfbf2103a4d9213291298206f4f63a7dac808cbc1 + - initial_input_ast: c89564770d1984e4e8c0c17c6c50b66b4a5d4ade85899562f506afc22e50496d + symbol_table: 8ed9a73e996562abfe75837cfbf2103a4d9213291298206f4f63a7dac808cbc1 initial_ast: 760e9080bf2690928551e6f4f2466824c75f81464043faa37580ac9d9e07ce2a diff --git a/tests/expectations/compiler/compiler/boolean/or.leo.out b/tests/expectations/compiler/compiler/boolean/or.leo.out index 3369afa293..29cb9de95a 100644 --- a/tests/expectations/compiler/compiler/boolean/or.leo.out +++ b/tests/expectations/compiler/compiler/boolean/or.leo.out @@ -2,5 +2,13 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 51b03881ad0ef3af7d105c163071fb69fb38048bea44c4bc380fd17367ce94e0 + symbol_table: 91630eda77eaf1e355744e663ceba26a0c3f860d3f69e8e46b03f5464d16950f + - initial_input_ast: 59b58754cc7667404c6bba5d90a9e53b7f9f36b6d7c9783e5b88d12728127e66 + symbol_table: 91630eda77eaf1e355744e663ceba26a0c3f860d3f69e8e46b03f5464d16950f + - initial_input_ast: 55ff7a9a3f210ea871c438a89f07da6c54ca1b8129e7344593017d22305297b4 + symbol_table: 91630eda77eaf1e355744e663ceba26a0c3f860d3f69e8e46b03f5464d16950f + - initial_input_ast: c89564770d1984e4e8c0c17c6c50b66b4a5d4ade85899562f506afc22e50496d + symbol_table: 91630eda77eaf1e355744e663ceba26a0c3f860d3f69e8e46b03f5464d16950f initial_ast: 0ed2a39bfdc56279524de062f31305fb67a8e073e29e159414bd82c17585369a diff --git a/tests/expectations/compiler/compiler/field/add.leo.out b/tests/expectations/compiler/compiler/field/add.leo.out index 8a0f18d33a..85f3a40e8f 100644 --- a/tests/expectations/compiler/compiler/field/add.leo.out +++ b/tests/expectations/compiler/compiler/field/add.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148 + symbol_table: d666098c1c0d7c670730cfa6548d47fa89d9a1dd33642f8021b0622f9abc0e5e initial_ast: c0f200537ad3f17f2dc9f703cd995c7644356a2eff79aa6d49bf799028e12c87 diff --git a/tests/expectations/compiler/compiler/field/div.leo.out b/tests/expectations/compiler/compiler/field/div.leo.out index 9d185fecd7..7a155aeb55 100644 --- a/tests/expectations/compiler/compiler/field/div.leo.out +++ b/tests/expectations/compiler/compiler/field/div.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148 + symbol_table: 38cbfecf35fb5189618a9767d3245d02e133d59ce2a0fc0f3aba37a8fa14fe8e initial_ast: 385b93965a80f1b5eadb12bf1d49f5fbaeebfefe3d24c735d94ef4f30730bdaf diff --git a/tests/expectations/compiler/compiler/field/eq.leo.out b/tests/expectations/compiler/compiler/field/eq.leo.out index 4f8a5c5215..4bef9c9c91 100644 --- a/tests/expectations/compiler/compiler/field/eq.leo.out +++ b/tests/expectations/compiler/compiler/field/eq.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148 + symbol_table: 0879cd6e4cc609ecdbdfc87ff0f08b4f3ae54367e0a1c02116304eb1411d2c23 initial_ast: 63b88151e636d767e04285b45861e6f08c9a96bbaea5f65f8d68b21ee9d332c8 diff --git a/tests/expectations/compiler/compiler/field/field.leo.out b/tests/expectations/compiler/compiler/field/field.leo.out index 7ce7da1f5e..e980ee6fdf 100644 --- a/tests/expectations/compiler/compiler/field/field.leo.out +++ b/tests/expectations/compiler/compiler/field/field.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148 + symbol_table: 879c99134415a9bae5a26b0d2dccfab01b9374218b810853c86bcf36a76d979c initial_ast: 7807bb74715d079409f6cb1b57e0e8a2d265df94a00c6a941f9302d2bf3a183b diff --git a/tests/expectations/compiler/compiler/field/mul.leo.out b/tests/expectations/compiler/compiler/field/mul.leo.out index 0f2b9baab9..9292dc8960 100644 --- a/tests/expectations/compiler/compiler/field/mul.leo.out +++ b/tests/expectations/compiler/compiler/field/mul.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148 + symbol_table: 47782aad84b54a835bead341b6113b471712ddd6d19005040d16c5d199a0920a initial_ast: 7daee749c08af61d98febaa31f6b0b372dd5e4edd8ac7782ade6e78072e54ad4 diff --git a/tests/expectations/compiler/compiler/field/negate.leo.out b/tests/expectations/compiler/compiler/field/negate.leo.out index 97fcd94580..819c42198c 100644 --- a/tests/expectations/compiler/compiler/field/negate.leo.out +++ b/tests/expectations/compiler/compiler/field/negate.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148 + symbol_table: e20aa1c0f5d1b64b310c0e6d6bb306713f8696f092d080eab4031eacc0dcb798 initial_ast: a379c937898e9a3ab56fee13ac2e5bb137f96dcc7faf121c0c8f5daec726a510 diff --git a/tests/expectations/compiler/compiler/function/duplicate_parameter_fail.leo.out b/tests/expectations/compiler/compiler/function/duplicate_parameter_fail.leo.out new file mode 100644 index 0000000000..65d6ec0b7b --- /dev/null +++ b/tests/expectations/compiler/compiler/function/duplicate_parameter_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EAST0372015]: variable `a` shadowed\n --> compiler-test:3:15\n |\n 3 | function main(a: u32, a: u32) -> u32 {\n | ^\nError [EAST0372015]: variable `a` shadowed\n --> compiler-test:3:15\n |\n 3 | function main(a: u32, a: u32) -> u32 {\n | ^" diff --git a/tests/expectations/compiler/compiler/function/shadow_parameter_fail.leo.out b/tests/expectations/compiler/compiler/function/shadow_parameter_fail.leo.out new file mode 100644 index 0000000000..ed9c2b60bd --- /dev/null +++ b/tests/expectations/compiler/compiler/function/shadow_parameter_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected : -- got '='\n --> compiler-test:4:14\n |\n 4 | const hi = 2u8;\n | ^" diff --git a/tests/expectations/compiler/compiler/function/undefined_fail.leo.out b/tests/expectations/compiler/compiler/function/undefined_fail.leo.out new file mode 100644 index 0000000000..1d76cbecb4 --- /dev/null +++ b/tests/expectations/compiler/compiler/function/undefined_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [ETYC0372003]: Unknown function `my_function`\n --> compiler-test:4:5\n |\n 4 | my_function();\n | ^^^^^^^^^^^\nError [ETYC0372003]: Unknown function `my_function`\n --> compiler-test:4:5\n |\n 4 | my_function();\n | ^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/integers/i128/ge.leo.out b/tests/expectations/compiler/compiler/integers/i128/ge.leo.out index 3e1908472e..7781308449 100644 --- a/tests/expectations/compiler/compiler/integers/i128/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/ge.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 2b35d182059f5f8aea05705b54c7446011ee78919bbda9f163927613f924f100 + symbol_table: a0b9f85aee4a145dd4f5a8f6488b4d50a627e317601a523b63b13cc969325401 + - initial_input_ast: 9dd6bd7a655947faefb64c288a9e9411b81148989543a4766fbad39a957dc8eb + symbol_table: a0b9f85aee4a145dd4f5a8f6488b4d50a627e317601a523b63b13cc969325401 initial_ast: 8eba6b11f24d8570a20e459d8aab9622ea6a5ba7af9a694c2987a3b7fd9ebbbe diff --git a/tests/expectations/compiler/compiler/integers/i128/gt.leo.out b/tests/expectations/compiler/compiler/integers/i128/gt.leo.out index 29c74ceb12..e56e69c0c3 100644 --- a/tests/expectations/compiler/compiler/integers/i128/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/gt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 2b35d182059f5f8aea05705b54c7446011ee78919bbda9f163927613f924f100 + symbol_table: 96ff00c92d164363ceb1fee06485b451062e76798f4381afa4141d60b2e88c96 + - initial_input_ast: cc80ffa5e25d4c0dcaf6154575b54f85ff5c2f86f50830a966e51bdd8f2274d0 + symbol_table: 96ff00c92d164363ceb1fee06485b451062e76798f4381afa4141d60b2e88c96 initial_ast: b8f337da7484c626ac9f36d2b2ef1b6d64a4c71c83fea6371fa8074580397f73 diff --git a/tests/expectations/compiler/compiler/integers/i128/le.leo.out b/tests/expectations/compiler/compiler/integers/i128/le.leo.out index 0f2779551b..7f3e0aeb7b 100644 --- a/tests/expectations/compiler/compiler/integers/i128/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/le.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 2b35d182059f5f8aea05705b54c7446011ee78919bbda9f163927613f924f100 + symbol_table: 4beca34f91e3bb4fbb997a1851b3fefb933c47d1e24f6a2e6258d4075c01918a + - initial_input_ast: 2bc5e353d29b75113a1b8976eddb617e0476110a0396b0dfc2dd48481803017c + symbol_table: 4beca34f91e3bb4fbb997a1851b3fefb933c47d1e24f6a2e6258d4075c01918a initial_ast: 565fed6c7ba818dd47e2623c8a1abb63d28ecb1a5038c076879fdf43dc908166 diff --git a/tests/expectations/compiler/compiler/integers/i128/lt.leo.out b/tests/expectations/compiler/compiler/integers/i128/lt.leo.out index 6e6fd295e6..b8103ad5cd 100644 --- a/tests/expectations/compiler/compiler/integers/i128/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/lt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 2b35d182059f5f8aea05705b54c7446011ee78919bbda9f163927613f924f100 + symbol_table: ad21c0cb65fd2f4f2360ed81da1bf608b83a0865801d2b569035eb1e36a7676a + - initial_input_ast: 5c8741c117817e7996c0add338f5d29437be59d7b7e3f7a68a2e575871c57824 + symbol_table: ad21c0cb65fd2f4f2360ed81da1bf608b83a0865801d2b569035eb1e36a7676a initial_ast: 7cb86efce158b9f000dc417a73bb2030617e38bc813f413bc36386fab0520406 diff --git a/tests/expectations/compiler/compiler/integers/i128/mul.leo.out b/tests/expectations/compiler/compiler/integers/i128/mul.leo.out index dad6dc39be..7a680e1a0e 100644 --- a/tests/expectations/compiler/compiler/integers/i128/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/mul.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: a0f0026c304d73c93060f61ad3a55094eb1fafaf8663a0e1972275be45d759e6 + symbol_table: c0c0cbcbbb0b8aa5351b8c74dec4bc556103902ca0f1ebcee2067768c553fd83 initial_ast: 58d78b11cee52cae54a5684cccaf0569c9788f8c2af0e51d18bae25004246a58 diff --git a/tests/expectations/compiler/compiler/integers/i128/ne.leo.out b/tests/expectations/compiler/compiler/integers/i128/ne.leo.out index 826e325a46..aef70614f9 100644 --- a/tests/expectations/compiler/compiler/integers/i128/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/ne.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 2b35d182059f5f8aea05705b54c7446011ee78919bbda9f163927613f924f100 + symbol_table: ee72f930a06f9409bfa70e2c08cb9453f255bd8ecf13470383dd7592fada8a93 + - initial_input_ast: b75ce6366bf607ddeebbfb8a7d491528a89ed4f3d5c4e57fb1480cfec43930e5 + symbol_table: ee72f930a06f9409bfa70e2c08cb9453f255bd8ecf13470383dd7592fada8a93 initial_ast: 5d8779407cc50f3e981e519370b2c0a3a73037572c8e35fc19b4dd421eee3d44 diff --git a/tests/expectations/compiler/compiler/integers/i128/negate.leo.out b/tests/expectations/compiler/compiler/integers/i128/negate.leo.out index ffc3338d54..29df7d3b64 100644 --- a/tests/expectations/compiler/compiler/integers/i128/negate.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/negate.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 5204f7264d13dc737097c1b0a1c707e19767854e922ba5571e902d23eb6847f4 + symbol_table: dbad7f718a950b554310d0eec61a2a595d5232be21ff783f0c8bd647d6275dcb + - initial_input_ast: 6c496394ee585ef0d7dc4bb8e1ef5a05656999502f8f466747e4044c439c3aed + symbol_table: dbad7f718a950b554310d0eec61a2a595d5232be21ff783f0c8bd647d6275dcb initial_ast: 26273053686377beb2d82077eadc49db45ca8b5bc24df8b9515182b998421cb9 diff --git a/tests/expectations/compiler/compiler/integers/i128/negate_zero.leo.out b/tests/expectations/compiler/compiler/integers/i128/negate_zero.leo.out index 8cecc4d97f..460aff8a27 100644 --- a/tests/expectations/compiler/compiler/integers/i128/negate_zero.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/negate_zero.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 + symbol_table: 7e7d4d32ae1e112e3ca3a14420225132520abf3f8dc327879b7f8f23f85a8b0d initial_ast: 4c16f86c1939e7a0fe20fc836c26de5f4d781129068eb3607f7880599c57859e diff --git a/tests/expectations/compiler/compiler/integers/i128/sub.leo.out b/tests/expectations/compiler/compiler/integers/i128/sub.leo.out index 9e5e78c417..84b92113d3 100644 --- a/tests/expectations/compiler/compiler/integers/i128/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/sub.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: a3dbcd20f9c1d5bce5a3667831f3cf05667a4b0253bdda31d99d47951ad98259 + symbol_table: e071ae07079f92ae418d648b75b982c8294698178699e138c3abfe2341d5b3fc initial_ast: 656588e753eb72edb9e3bde30e16df4fd81fc101eb8ccf9bfe572d5166e9b056 diff --git a/tests/expectations/compiler/compiler/integers/i128/ternary.leo.out b/tests/expectations/compiler/compiler/integers/i128/ternary.leo.out index 560b668819..4971766055 100644 --- a/tests/expectations/compiler/compiler/integers/i128/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/i128/ternary.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 40139f0e5c57dd40f292eb3eb9857b869d131d69050280f412c8bacf3c2be0a5 + symbol_table: 940d5266f13724648ceb54c883bd73b737d83b14d2925fed8b0fcdaa6d77294b + - initial_input_ast: 83772cf3d3bec2e16e513bf37ebc6df2558ecefe79f9b00232cba49bfee7a866 + symbol_table: 940d5266f13724648ceb54c883bd73b737d83b14d2925fed8b0fcdaa6d77294b initial_ast: 72562efc786e0ae93d8905b049d9e91540998bd4022393c58f90e6bb3b8d7346 diff --git a/tests/expectations/compiler/compiler/integers/i16/ge.leo.out b/tests/expectations/compiler/compiler/integers/i16/ge.leo.out index 79985ce6a0..8325f7c44b 100644 --- a/tests/expectations/compiler/compiler/integers/i16/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/ge.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: b12ba1759e7600fe50376c2dc04f2cc908cae643be6693583c167493b8b5064e + symbol_table: 23916724e149d291045330b89d96b60889a0fc778c31ae92c3a39b8ac7453285 + - initial_input_ast: 0ed5ac4e8e800b411f402e7957dbdfa4f421798943462089d15eaabc08c9cbf9 + symbol_table: 23916724e149d291045330b89d96b60889a0fc778c31ae92c3a39b8ac7453285 initial_ast: 5351c113c7e45be9e1ce080daaa2f8c8944d9cc551146e0da6bbfae5eb69ed01 diff --git a/tests/expectations/compiler/compiler/integers/i16/gt.leo.out b/tests/expectations/compiler/compiler/integers/i16/gt.leo.out index 347881b7aa..597e08e9d2 100644 --- a/tests/expectations/compiler/compiler/integers/i16/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/gt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: b12ba1759e7600fe50376c2dc04f2cc908cae643be6693583c167493b8b5064e + symbol_table: 78d0d78e216325ced3f912e92935818dc7e24065690b5d9d560b7997ca29eacd + - initial_input_ast: 60eab1c75b42a247473a1589e677e7270c77e15fc60b3a3081a267b27b550f9f + symbol_table: 78d0d78e216325ced3f912e92935818dc7e24065690b5d9d560b7997ca29eacd initial_ast: 31949f3b3950c34aadb02b7220d0b9ef6f088fc14bc9496ff1649d7dd3c44347 diff --git a/tests/expectations/compiler/compiler/integers/i16/le.leo.out b/tests/expectations/compiler/compiler/integers/i16/le.leo.out index a2d67d81fb..0d2397ea40 100644 --- a/tests/expectations/compiler/compiler/integers/i16/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/le.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: b12ba1759e7600fe50376c2dc04f2cc908cae643be6693583c167493b8b5064e + symbol_table: bf2a96b0ab9d2587f3b5bd9b6a4b33d2839e61219f68828a79fb40788190ca1a + - initial_input_ast: 61e14cdfb7cfc0eda6361c3dfe1c8b0435e69fe5dec14fd78d57631fb155ad3a + symbol_table: bf2a96b0ab9d2587f3b5bd9b6a4b33d2839e61219f68828a79fb40788190ca1a initial_ast: fcb3b9db14c713d885ec37a40aca86d034f1d12e85b22d103a20b7e181848e73 diff --git a/tests/expectations/compiler/compiler/integers/i16/lt.leo.out b/tests/expectations/compiler/compiler/integers/i16/lt.leo.out index 21ec865033..6102b5e7dd 100644 --- a/tests/expectations/compiler/compiler/integers/i16/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/lt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: b12ba1759e7600fe50376c2dc04f2cc908cae643be6693583c167493b8b5064e + symbol_table: 7b9a0a38448dc4a3bc8670c59d350d3ef11176a8965827ff5e7cac73afe4b7ad + - initial_input_ast: c56154a57fdc267eda5faf0b93fe3a124c52f9dbd9f1a46063018300138c474f + symbol_table: 7b9a0a38448dc4a3bc8670c59d350d3ef11176a8965827ff5e7cac73afe4b7ad initial_ast: 0058f607e4e76d621419f0378ced319e9bb7228e0af27793bb44f433369c23c3 diff --git a/tests/expectations/compiler/compiler/integers/i16/mul.leo.out b/tests/expectations/compiler/compiler/integers/i16/mul.leo.out index 465a8df148..7da80abe09 100644 --- a/tests/expectations/compiler/compiler/integers/i16/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/mul.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 80f618589bf50616df17ffbcc676f151b17416a702f14774d3441e457a4157b5 + symbol_table: 6ef3c6f53b59ccfacd7d3590250bf4f383dead38eb6403e278dced621c9a924c initial_ast: 7a0a6c7ece2f9c1a51f97c6a71b8c60a527329c30a3957185c2bc53b2fc00001 diff --git a/tests/expectations/compiler/compiler/integers/i16/ne.leo.out b/tests/expectations/compiler/compiler/integers/i16/ne.leo.out index 39a977291b..08bfdda319 100644 --- a/tests/expectations/compiler/compiler/integers/i16/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/ne.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: b12ba1759e7600fe50376c2dc04f2cc908cae643be6693583c167493b8b5064e + symbol_table: d06cab633083be51c77f53df2cfe0bce8137fcb17aac03346d885adc9c4b9be3 + - initial_input_ast: 4ac2084a873258d0f5b18c4936ddd323509944d808e66efe91c44593d2c2bbe1 + symbol_table: d06cab633083be51c77f53df2cfe0bce8137fcb17aac03346d885adc9c4b9be3 initial_ast: 571a0fb0e0122a7ecb2f631c44fd426c4b165d3610d81481fb395a3391175897 diff --git a/tests/expectations/compiler/compiler/integers/i16/negate.leo.out b/tests/expectations/compiler/compiler/integers/i16/negate.leo.out index e443c3d4d9..6dd1418aa1 100644 --- a/tests/expectations/compiler/compiler/integers/i16/negate.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/negate.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: e3239b93c2572ba5c5e7cf2edaa4d8045bb11212607af1a441eb351677f49087 + symbol_table: b693277ecb38a66fd37fc9482e73a650bf448aa84e0f2d60baf85e504ececdba + - initial_input_ast: 9da893ef2702d495a685100ea83f84397cdcc3716f4e9fa23736bb57a750d861 + symbol_table: b693277ecb38a66fd37fc9482e73a650bf448aa84e0f2d60baf85e504ececdba initial_ast: 06c7e204e308b875e2e027bf9a98e175aea8140a6af146562343fa19dd5b0f44 diff --git a/tests/expectations/compiler/compiler/integers/i16/negate_zero.leo.out b/tests/expectations/compiler/compiler/integers/i16/negate_zero.leo.out index a3060f546c..f78f1cd629 100644 --- a/tests/expectations/compiler/compiler/integers/i16/negate_zero.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/negate_zero.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 + symbol_table: d4d0d37668745d3e6320eb7f08a3b4e32e276177c75600b3fe8742d6b42e308e initial_ast: c22b66f467aea291c79cbe61f03e8b0e7cec24bdd9f224efd76f8b0eec505bb3 diff --git a/tests/expectations/compiler/compiler/integers/i16/sub.leo.out b/tests/expectations/compiler/compiler/integers/i16/sub.leo.out index afd095888b..dbc94aca8c 100644 --- a/tests/expectations/compiler/compiler/integers/i16/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/sub.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: a614a0d50bb1fdac14773ff4bc9e6e73cadf7577f704bd022d228f8012c5b82d + symbol_table: b04bbcf2084fb6c4abf70b9c36361dfac8cc78ac8f1004453b3020f7106b8378 initial_ast: f384f22efa0623afef6b74e89df6e2e238aea9bc84a9d422c1ac7f8ff567fd38 diff --git a/tests/expectations/compiler/compiler/integers/i16/ternary.leo.out b/tests/expectations/compiler/compiler/integers/i16/ternary.leo.out index de66732781..d4ab648f51 100644 --- a/tests/expectations/compiler/compiler/integers/i16/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/i16/ternary.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: b7e009a9242724e5b46c82c07ec09ceb37bd229e726aa7b10cf654222849047b + symbol_table: b92b41fc1f57be0e19b7ae98c07f01811e2400472c7577bd2facabfe011b2418 + - initial_input_ast: c58e80ea1edcaef89fe15d96be15c8285fa4cdd94fe5a4d89e86037b95d81f2b + symbol_table: b92b41fc1f57be0e19b7ae98c07f01811e2400472c7577bd2facabfe011b2418 initial_ast: ee85a07334728c9f2a3c127b1968114215aca9c6c960aa7fb5df20864fb0a0d2 diff --git a/tests/expectations/compiler/compiler/integers/i32/ge.leo.out b/tests/expectations/compiler/compiler/integers/i32/ge.leo.out index 044bcd730e..8c5d428f0d 100644 --- a/tests/expectations/compiler/compiler/integers/i32/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/ge.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: a139a8bae62ab18b9235331f7dde3acb349c1445e807293c71235fd149b12c7a + symbol_table: b599133b42cb178b6ecc71beee98b33229ba1bbb58282ace5b20faef31637bbb + - initial_input_ast: 6e2f4bca097cdfd636afe4221883da452290354178f85de45f1033dc3d99caf5 + symbol_table: b599133b42cb178b6ecc71beee98b33229ba1bbb58282ace5b20faef31637bbb initial_ast: 0917cf6662e2ab5b494a69c4141fc78a4c581fdbf5454bb50c176a09e06da902 diff --git a/tests/expectations/compiler/compiler/integers/i32/gt.leo.out b/tests/expectations/compiler/compiler/integers/i32/gt.leo.out index 565122874d..3a9fe158bd 100644 --- a/tests/expectations/compiler/compiler/integers/i32/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/gt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: a139a8bae62ab18b9235331f7dde3acb349c1445e807293c71235fd149b12c7a + symbol_table: 547e049dec4bad4d2e354d568151fc102474caffb82551bb5630c0b8906230c2 + - initial_input_ast: c0ba73ee8b61ed89f99395a94f23a5aa3a84f9345a4c4020460303b540c33c6c + symbol_table: 547e049dec4bad4d2e354d568151fc102474caffb82551bb5630c0b8906230c2 initial_ast: 2173bf8f6a793f208d79405952c3181a946b32cba0e9e83fb904b90f60c97c68 diff --git a/tests/expectations/compiler/compiler/integers/i32/le.leo.out b/tests/expectations/compiler/compiler/integers/i32/le.leo.out index 528e5fd2ed..bfe09a5148 100644 --- a/tests/expectations/compiler/compiler/integers/i32/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/le.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: a139a8bae62ab18b9235331f7dde3acb349c1445e807293c71235fd149b12c7a + symbol_table: 2471d7a0f956f30747d5bd8c5d03e8a47c628ac64766d2f19caaf3dadd7f1c06 + - initial_input_ast: f7bd61dab4f2768d6b2f631a06f5f33307a77755b1b640ebec2a187c3f9d0bb1 + symbol_table: 2471d7a0f956f30747d5bd8c5d03e8a47c628ac64766d2f19caaf3dadd7f1c06 initial_ast: b7a7ca7db84356eb19aa638e3b451da11b4a625b7d250e2de55126c07afadd5a diff --git a/tests/expectations/compiler/compiler/integers/i32/lt.leo.out b/tests/expectations/compiler/compiler/integers/i32/lt.leo.out index 58779d362e..e49ed92b1e 100644 --- a/tests/expectations/compiler/compiler/integers/i32/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/lt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: a139a8bae62ab18b9235331f7dde3acb349c1445e807293c71235fd149b12c7a + symbol_table: 688fa40d541217369a9c952f52de9be090829cb3c6d08e98d6312fcdfbd90d63 + - initial_input_ast: cc79bd922f3afc54250b7e7a60628a58b17ba8e7db58091349f13b67297ea1f5 + symbol_table: 688fa40d541217369a9c952f52de9be090829cb3c6d08e98d6312fcdfbd90d63 initial_ast: 438315810d75e57e5fb24c9ff2526ccf6eeeefaf98216162aaf9d5ef7b845585 diff --git a/tests/expectations/compiler/compiler/integers/i32/mul.leo.out b/tests/expectations/compiler/compiler/integers/i32/mul.leo.out index 85b7ad5530..280a15099f 100644 --- a/tests/expectations/compiler/compiler/integers/i32/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/mul.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: c767df287dda6925591fbdb496ed122c17e2e0b963f0f2819a03493e8f57656e + symbol_table: 7c31808962cf3c6fa13611d89e6edc2a3b6c5d1fb7c1913a337f436412cc5a34 initial_ast: ee8e95c8a34b19e8993ac970b94b56dab2c31b7e54dc92b27128000e7d05191d diff --git a/tests/expectations/compiler/compiler/integers/i32/ne.leo.out b/tests/expectations/compiler/compiler/integers/i32/ne.leo.out index 71f8508046..83d3de229e 100644 --- a/tests/expectations/compiler/compiler/integers/i32/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/ne.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: a139a8bae62ab18b9235331f7dde3acb349c1445e807293c71235fd149b12c7a + symbol_table: 86eb824aa5a8d1e3d8f4c4682aaabc503e02680c5c4ab6ab6500ff971ae21879 + - initial_input_ast: 3eb74ab23e5409471a8cddbdef932be85f95ab0027ad95caff181f26ef3f8e9d + symbol_table: 86eb824aa5a8d1e3d8f4c4682aaabc503e02680c5c4ab6ab6500ff971ae21879 initial_ast: 36333a73320637e60e5992db8f2c6cbf15a6958927a44a8e8a4bd4d6a79aa583 diff --git a/tests/expectations/compiler/compiler/integers/i32/negate.leo.out b/tests/expectations/compiler/compiler/integers/i32/negate.leo.out index 9f634666d7..5cecf2fb84 100644 --- a/tests/expectations/compiler/compiler/integers/i32/negate.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/negate.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 8016712e5cadc085ec477fe3261d863ed258f15bbcee3c229280a4434dc87bb6 + symbol_table: ff59dc483d6da2f11e881ea60ccd3534ab7c1655e2e1e8c2ca99c1d670c77a19 + - initial_input_ast: 7d83894bd97920d10bbdcbba5a40cffdd1c2ec823cc2af89a3cdf48376c5c554 + symbol_table: ff59dc483d6da2f11e881ea60ccd3534ab7c1655e2e1e8c2ca99c1d670c77a19 initial_ast: 1d82fb1de0617c8539255e7ba530cf7583bd799384d76e715da5053f822e976b diff --git a/tests/expectations/compiler/compiler/integers/i32/negate_zero.leo.out b/tests/expectations/compiler/compiler/integers/i32/negate_zero.leo.out index 1222d3afdd..d5508c8c86 100644 --- a/tests/expectations/compiler/compiler/integers/i32/negate_zero.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/negate_zero.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 + symbol_table: f03df27663cd6b55538ab7319ad179ba7be6e962fdc193c79365a684ef004c16 initial_ast: f3582c9a9f78e4d502e19f2310d875fe7f47c648be70889ae09de5cb3ffafd0e diff --git a/tests/expectations/compiler/compiler/integers/i32/sub.leo.out b/tests/expectations/compiler/compiler/integers/i32/sub.leo.out index 117e298009..27072e67db 100644 --- a/tests/expectations/compiler/compiler/integers/i32/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/sub.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: b0ba0dceefb39938d6365a1af8aff5b1ab305a264e70489cbf4ad244bb9642f7 + symbol_table: 5b6a8a1708a2047863f813b4b029c22fd49de20abf5a16bb667954c4c5ee2a23 initial_ast: b7e347f0b12557644f817848aabddd9c8da188d6289955cf88844a21714517ea diff --git a/tests/expectations/compiler/compiler/integers/i32/ternary.leo.out b/tests/expectations/compiler/compiler/integers/i32/ternary.leo.out index 015afa347d..6df15338dd 100644 --- a/tests/expectations/compiler/compiler/integers/i32/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/i32/ternary.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 541a92e4449861bc8a77cd1e3e0641ec8581ea2156adbb71a8805eb76b981535 + symbol_table: d69acacea66b05b7cb30053a47a32453810be97b933908e014f68d8cb046ee6d + - initial_input_ast: c0d707f8e705919c847736cd72c601642fc57cb205eab2b81bedf7cce768f18f + symbol_table: d69acacea66b05b7cb30053a47a32453810be97b933908e014f68d8cb046ee6d initial_ast: a6d197ae9afff916e45bf70d930c0d5ad740c19a434547da603a211d5e392c65 diff --git a/tests/expectations/compiler/compiler/integers/i64/ge.leo.out b/tests/expectations/compiler/compiler/integers/i64/ge.leo.out index 9196417ba0..6fa41019ce 100644 --- a/tests/expectations/compiler/compiler/integers/i64/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/ge.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 9ac72a16994c4f4145cf0eaa23f0d58de951926f8b9cb500bc33644cc242d288 + symbol_table: ecc8f2f906379f321b5babf4982047f1a42f03456c2624eeeafe8d0a9198e3d5 + - initial_input_ast: 6f2114abcc9ce0070e464adfbafdd625d2027563630b920462ae44cf648d10c3 + symbol_table: ecc8f2f906379f321b5babf4982047f1a42f03456c2624eeeafe8d0a9198e3d5 initial_ast: d051e63b0e248f8876e9d57ef905e0367a52fa9093bd2651ccbbf0312c7fafbc diff --git a/tests/expectations/compiler/compiler/integers/i64/gt.leo.out b/tests/expectations/compiler/compiler/integers/i64/gt.leo.out index e0e3fd7408..6a561b3cf6 100644 --- a/tests/expectations/compiler/compiler/integers/i64/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/gt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 9ac72a16994c4f4145cf0eaa23f0d58de951926f8b9cb500bc33644cc242d288 + symbol_table: e089bc1a3f005ed33b1f676a2ffff71fa6ec2f119f23e2537ca763bad3d56837 + - initial_input_ast: 77947a385da3cc07fb78bfd9d6d32f614be877f10e664addc4010f44dfd494fa + symbol_table: e089bc1a3f005ed33b1f676a2ffff71fa6ec2f119f23e2537ca763bad3d56837 initial_ast: 3c6a6a8e102fd584ce5ec3e7bb33a944d13f7d2940b9f7dd62ccffd4497b1858 diff --git a/tests/expectations/compiler/compiler/integers/i64/le.leo.out b/tests/expectations/compiler/compiler/integers/i64/le.leo.out index 6c74c826af..83b5de51f4 100644 --- a/tests/expectations/compiler/compiler/integers/i64/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/le.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 9ac72a16994c4f4145cf0eaa23f0d58de951926f8b9cb500bc33644cc242d288 + symbol_table: b186c6e3067b7544d334caa51380a5ddfcfb4d5a2efc6dc1acbe42282ef4cc60 + - initial_input_ast: 4d3d28e791b2bc01cc08f84e9c521c25de2cb9f1159c0810e18288ceade9384e + symbol_table: b186c6e3067b7544d334caa51380a5ddfcfb4d5a2efc6dc1acbe42282ef4cc60 initial_ast: a2708a17884e05a752fcac58df044096170c53df416cb7b5bf4e8d5228d7396d diff --git a/tests/expectations/compiler/compiler/integers/i64/lt.leo.out b/tests/expectations/compiler/compiler/integers/i64/lt.leo.out index 9fa444a3a2..070e245715 100644 --- a/tests/expectations/compiler/compiler/integers/i64/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/lt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 9ac72a16994c4f4145cf0eaa23f0d58de951926f8b9cb500bc33644cc242d288 + symbol_table: 40cf3641e69402664d36e3da2fc574fb909d73cb15a7a253c678d61076da6d1d + - initial_input_ast: 67194a693cde1f31bb02a14e2ee4e5cc686b33d59d3b7449e9dc7bf74fbd0bf8 + symbol_table: 40cf3641e69402664d36e3da2fc574fb909d73cb15a7a253c678d61076da6d1d initial_ast: 3fa8bf29f62927c016e625eccec688057f0390f8fe50072598774df9d9e60447 diff --git a/tests/expectations/compiler/compiler/integers/i64/mul.leo.out b/tests/expectations/compiler/compiler/integers/i64/mul.leo.out index 7342a4e993..a3d19bca0a 100644 --- a/tests/expectations/compiler/compiler/integers/i64/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/mul.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: d53c1c3a0b1c6aad2bddba6e4b5194ed04f76992c93301b9a5fdf71d0c6e12fb + symbol_table: e10e8f60976d59b92f39cb8402580330f13bf9d04cd7afdbf844c0c718897ecb initial_ast: 58c1234be63fc6d2e2622d64fdecacac6b657a7f08f5668c39c6f33793cbf910 diff --git a/tests/expectations/compiler/compiler/integers/i64/ne.leo.out b/tests/expectations/compiler/compiler/integers/i64/ne.leo.out index 7ffdd36d05..ed3773ac95 100644 --- a/tests/expectations/compiler/compiler/integers/i64/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/ne.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 9ac72a16994c4f4145cf0eaa23f0d58de951926f8b9cb500bc33644cc242d288 + symbol_table: cf15aab8ab6a6a35f3a7ae1c3827b7a1dd32be924cb0ea6b7febc46b60d5b449 + - initial_input_ast: a2ebbe7590f5035c9115e7e885e6cecd7c4f07d3567fbe34d464027f73e7ece2 + symbol_table: cf15aab8ab6a6a35f3a7ae1c3827b7a1dd32be924cb0ea6b7febc46b60d5b449 initial_ast: 952f7cee27658adbfb5ebc545740bfd721b2752bd9ce1f54a2d01b4d579fff2c diff --git a/tests/expectations/compiler/compiler/integers/i64/negate.leo.out b/tests/expectations/compiler/compiler/integers/i64/negate.leo.out index c8771f29c8..10f728225f 100644 --- a/tests/expectations/compiler/compiler/integers/i64/negate.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/negate.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: c2099c29aa512efefc2f4b24dfec851416921200642fdfc282c1c71b9d8e4fd3 + symbol_table: bc4883071e65ae85896379b2b51c6637ee6159ce84d85d38b6e44c90bb7f9b3d + - initial_input_ast: 60c2c4f5a8213dffdf7b02b324ba11327d7dd89d22bdd8f73032e9eb8aa7da90 + symbol_table: bc4883071e65ae85896379b2b51c6637ee6159ce84d85d38b6e44c90bb7f9b3d initial_ast: 967ef98b19841f65c071e3a99b51e271eac151e6eb29dd005ac2bb4993e2eb5d diff --git a/tests/expectations/compiler/compiler/integers/i64/negate_zero.leo.out b/tests/expectations/compiler/compiler/integers/i64/negate_zero.leo.out index bd566fac63..29a47c8255 100644 --- a/tests/expectations/compiler/compiler/integers/i64/negate_zero.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/negate_zero.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 + symbol_table: a456668190df24a0290cdc207ed29668d614565d90d9380187e371ea7cffc2b2 initial_ast: 1265a1500e63f4af0370db03e20cee843477f41200d0851f15ef5ad192c6a3c2 diff --git a/tests/expectations/compiler/compiler/integers/i64/sub.leo.out b/tests/expectations/compiler/compiler/integers/i64/sub.leo.out index 11512b8d83..fbfeec6030 100644 --- a/tests/expectations/compiler/compiler/integers/i64/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/sub.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: b58e6dd8d55347cdad90608837dfd6dee3d002202044f63844bfcfb764e4770d + symbol_table: fdaa2856fba7667905480b9477e3aa08c41c722ec9c51b5f75209420f502ae0d initial_ast: 5276434ecb5659d594e5d0d70a79253788619f6d14588e3264ae8095e55d14b5 diff --git a/tests/expectations/compiler/compiler/integers/i64/ternary.leo.out b/tests/expectations/compiler/compiler/integers/i64/ternary.leo.out index e8a8665f3c..09e083c060 100644 --- a/tests/expectations/compiler/compiler/integers/i64/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/i64/ternary.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 482e1a5ff8edd8d08f8a4e686f4b9bdd46f6c09fd6a45a91d80817d2792379c4 + symbol_table: c4cb362b056cea8c44ef71fbd260c067c8025b66d9000f1bfd72a0a2caf34b8f + - initial_input_ast: 9f06a756fd85b99ad71c8815e6d2e0988933eb8ff5f58cd3b25c797a99ae68ec + symbol_table: c4cb362b056cea8c44ef71fbd260c067c8025b66d9000f1bfd72a0a2caf34b8f initial_ast: 303c8f172bf1a89573e9c66daab696eae92c884d2fab440feb1b5592fb19873b diff --git a/tests/expectations/compiler/compiler/integers/i8/ge.leo.out b/tests/expectations/compiler/compiler/integers/i8/ge.leo.out index 6e13348762..3149b5a17b 100644 --- a/tests/expectations/compiler/compiler/integers/i8/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/ge.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 387087e4e03168d09782d693bd8b288dd097f978e8470bf2d0fae6a18b0a5dba + symbol_table: 653d6411a2d15feb4fce54c8f2ca038d0a5cc0e09226aa59d0a991228a438ec7 + - initial_input_ast: 2d8fb2c6466da29059eb6cc1d233fc87acbe4159c7e9f42783ac1900d4652bab + symbol_table: 653d6411a2d15feb4fce54c8f2ca038d0a5cc0e09226aa59d0a991228a438ec7 initial_ast: 308b765395012cf54485fea5aaf0d0c30709e893283637674269b795ec950923 diff --git a/tests/expectations/compiler/compiler/integers/i8/gt.leo.out b/tests/expectations/compiler/compiler/integers/i8/gt.leo.out index 7a6b1a9034..ac604371a0 100644 --- a/tests/expectations/compiler/compiler/integers/i8/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/gt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 387087e4e03168d09782d693bd8b288dd097f978e8470bf2d0fae6a18b0a5dba + symbol_table: 93a2e7caea996e9ab13b40a775adc500eba4f3a329b617cc2e0759179b783ab1 + - initial_input_ast: 795ae933e75a19aa21efbe4f8deb0931a0ae5b62c8a730df05b676190de5a70a + symbol_table: 93a2e7caea996e9ab13b40a775adc500eba4f3a329b617cc2e0759179b783ab1 initial_ast: 7c3a35f6d43020992906b2987c7bf36afc0f7294551609cf8bf4d08a084933d9 diff --git a/tests/expectations/compiler/compiler/integers/i8/le.leo.out b/tests/expectations/compiler/compiler/integers/i8/le.leo.out index 405d958c83..a357e59e0c 100644 --- a/tests/expectations/compiler/compiler/integers/i8/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/le.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 387087e4e03168d09782d693bd8b288dd097f978e8470bf2d0fae6a18b0a5dba + symbol_table: be6d3bc2c850155455878c8f4faa8089372643e126a5241892437882cadbc7cc + - initial_input_ast: 14894f63af1f3e81f95caf62f8ffae47096064cddd59e55a96b85c9436c6ecf3 + symbol_table: be6d3bc2c850155455878c8f4faa8089372643e126a5241892437882cadbc7cc initial_ast: e7cf5556592135d0f297a2e0f00c975b7687698a336319b50957a1e6012ecf84 diff --git a/tests/expectations/compiler/compiler/integers/i8/lt.leo.out b/tests/expectations/compiler/compiler/integers/i8/lt.leo.out index cf56740893..f71cc1a382 100644 --- a/tests/expectations/compiler/compiler/integers/i8/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/lt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 387087e4e03168d09782d693bd8b288dd097f978e8470bf2d0fae6a18b0a5dba + symbol_table: 4728ccd7dbbdc653e78c0ccfce8ad81762caf0ba516da7b9603a2543f0b89498 + - initial_input_ast: ec93c97f4993d2553199eaa4494be32270e7e60428374cc3a78b3c467458a24c + symbol_table: 4728ccd7dbbdc653e78c0ccfce8ad81762caf0ba516da7b9603a2543f0b89498 initial_ast: be23f46d9d959cf0fcc74fc8bc3ef332f4e85b544982986b72a74ff3af9428b8 diff --git a/tests/expectations/compiler/compiler/integers/i8/mul.leo.out b/tests/expectations/compiler/compiler/integers/i8/mul.leo.out index b8af18d44b..d4677aab12 100644 --- a/tests/expectations/compiler/compiler/integers/i8/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/mul.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: b22a779f02dd4aac1d2c90081aa815018712cc8e9208e9b56251456c1d0fc989 + symbol_table: a5a3bb7ed8ca56503ecd767a1ca1a997d5f5b3a06106dedfbe78d04700d70052 initial_ast: 2658ce56907ebd80cea3db992eadc797eba68c41ec626dac01f32639bf4eb01b diff --git a/tests/expectations/compiler/compiler/integers/i8/ne.leo.out b/tests/expectations/compiler/compiler/integers/i8/ne.leo.out index 683978a1b0..d622ba0c83 100644 --- a/tests/expectations/compiler/compiler/integers/i8/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/ne.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 387087e4e03168d09782d693bd8b288dd097f978e8470bf2d0fae6a18b0a5dba + symbol_table: 4fb6658a07bb0a63f1da45790682548f3a9eea88a6453f4dc12971d80766f89c + - initial_input_ast: 4a3a1f1b5a3ec22bcd0cc41eff2473442e5d1650661fc9aaf0f08dda58d062e2 + symbol_table: 4fb6658a07bb0a63f1da45790682548f3a9eea88a6453f4dc12971d80766f89c initial_ast: d4166d094d27116439254b21da8fd34134b28363484ab9496913e0b8c2b47b12 diff --git a/tests/expectations/compiler/compiler/integers/i8/negate.leo.out b/tests/expectations/compiler/compiler/integers/i8/negate.leo.out index 3de6a4bfd6..73d2adfddb 100644 --- a/tests/expectations/compiler/compiler/integers/i8/negate.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/negate.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 48011eb662fd0ab14d0bb1c77ee319c30114fb378809c0a880751cba5f721cc4 + symbol_table: 22bc9cc7565226e1ad3280c58cd06f4035bf064b80496bf97989bf6519f81937 + - initial_input_ast: a81bc9a08945b82a022ae53773d357f3d1f8786309c073cb17fb087562b042a4 + symbol_table: 22bc9cc7565226e1ad3280c58cd06f4035bf064b80496bf97989bf6519f81937 initial_ast: df5ed0b1077084a4c8706a71cf7441611b2fc0741b2657235c2e84dfd1a0e58a diff --git a/tests/expectations/compiler/compiler/integers/i8/negate_zero.leo.out b/tests/expectations/compiler/compiler/integers/i8/negate_zero.leo.out index e893f021f8..2fdd76240a 100644 --- a/tests/expectations/compiler/compiler/integers/i8/negate_zero.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/negate_zero.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 + symbol_table: dbe838d51c4237ebc843ac704d38d151682d6df925b8c46e681c3dde92b33f07 initial_ast: 64cd0f3474a735f1a39a6797cfd15bd212c7aef403a38531467778ada9d71351 diff --git a/tests/expectations/compiler/compiler/integers/i8/sub.leo.out b/tests/expectations/compiler/compiler/integers/i8/sub.leo.out index 4644ad9b1f..336d893bf5 100644 --- a/tests/expectations/compiler/compiler/integers/i8/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/sub.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: e493649c1e8d82f8080eb428d5006045e1cc91e91ccf16fa9a67f5f78b29f568 + symbol_table: 49ac09363ff46f225d86ff3aa73dc48ee921cf2f4c096ce111832903da6a9e97 initial_ast: e13464b8a4a1622f47fffd20c6f8c39c7812bd0831aba01178153b55d41ea199 diff --git a/tests/expectations/compiler/compiler/integers/i8/ternary.leo.out b/tests/expectations/compiler/compiler/integers/i8/ternary.leo.out index 68ffeadd26..06ef7c0706 100644 --- a/tests/expectations/compiler/compiler/integers/i8/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/i8/ternary.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 626d0af88ad79f131c83f117a6a78faf8414bbf4fe80326c298934ba49565bc1 + symbol_table: 64f5be13cd1e5bad65c85910f051acff84a21cc1483dc8d013a70d4f274fd419 + - initial_input_ast: 3838e2a3b3a7d4e9c0ac478113dfc08b2cc43c8692615ded04677a956104b542 + symbol_table: 64f5be13cd1e5bad65c85910f051acff84a21cc1483dc8d013a70d4f274fd419 initial_ast: b9416ca68224aa29194a091a73353bdb24efc097c1cf991dea7a3eab2de44139 diff --git a/tests/expectations/compiler/compiler/integers/u128/ge.leo.out b/tests/expectations/compiler/compiler/integers/u128/ge.leo.out index 1fdfc30b04..b25799a17f 100644 --- a/tests/expectations/compiler/compiler/integers/u128/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/ge.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: b5c6120ae963f4518dfbcf01566c85e1414ed347b18ca65dcbc03ff3addfb8ea + symbol_table: d62e5ca69883dfd4f502dd4b8ab0436e677a9871322a3cc33c0d51f3138760be + - initial_input_ast: 75784559839daa43fb68b6c0cb92764cbd5c8f1240b91c92d85a28f514020833 + symbol_table: d62e5ca69883dfd4f502dd4b8ab0436e677a9871322a3cc33c0d51f3138760be initial_ast: 827e5cc46b0fdd4d217c046e57af283a631f03a257452b34b97aca1b87aa4a73 diff --git a/tests/expectations/compiler/compiler/integers/u128/gt.leo.out b/tests/expectations/compiler/compiler/integers/u128/gt.leo.out index 51e6c65c6b..dac3e363d1 100644 --- a/tests/expectations/compiler/compiler/integers/u128/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/gt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: b5c6120ae963f4518dfbcf01566c85e1414ed347b18ca65dcbc03ff3addfb8ea + symbol_table: 4b855a9a384880ddddc5d93d16ae4e34c5b85a506426f89f3c545314cd58d86f + - initial_input_ast: 1d133b7dd2d597ec021f43ae433fa5ff220337500455acd2265714eee6381ad2 + symbol_table: 4b855a9a384880ddddc5d93d16ae4e34c5b85a506426f89f3c545314cd58d86f initial_ast: df9cd79c49062dde86e08031f53043d93799404903d97f68e1148198f4988548 diff --git a/tests/expectations/compiler/compiler/integers/u128/le.leo.out b/tests/expectations/compiler/compiler/integers/u128/le.leo.out index aad82e572f..6f61722143 100644 --- a/tests/expectations/compiler/compiler/integers/u128/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/le.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: b5c6120ae963f4518dfbcf01566c85e1414ed347b18ca65dcbc03ff3addfb8ea + symbol_table: 3d7f361f2ce4e99acbc47dfef2480dec0ce298a27a34769ddb8c1813b6581024 + - initial_input_ast: 2065df069397c90cd8c969b938bdca0867d1df06a37f8a7d7a49af96ea38019d + symbol_table: 3d7f361f2ce4e99acbc47dfef2480dec0ce298a27a34769ddb8c1813b6581024 initial_ast: dc5a1d60acec0e8a0bd8ac4da8dbf50314802ba4abc75b69e5a8036b880e1ea7 diff --git a/tests/expectations/compiler/compiler/integers/u128/lt.leo.out b/tests/expectations/compiler/compiler/integers/u128/lt.leo.out index b3e81a7cf9..044f22c3c2 100644 --- a/tests/expectations/compiler/compiler/integers/u128/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/lt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: b5c6120ae963f4518dfbcf01566c85e1414ed347b18ca65dcbc03ff3addfb8ea + symbol_table: 3209a6ec1b0ac01f379965c80861af6d65fae8dfa0f20a726dfaf89e0ccb1cf5 + - initial_input_ast: 0c9b9da62df2b51ef9ebb33821a7ec04e9652ce4e9c21c5153d48f5855af806e + symbol_table: 3209a6ec1b0ac01f379965c80861af6d65fae8dfa0f20a726dfaf89e0ccb1cf5 initial_ast: 119abb498a0b5214fa88b20b83c621728b722325c311a4b9095ee292a70fb94e diff --git a/tests/expectations/compiler/compiler/integers/u128/mul.leo.out b/tests/expectations/compiler/compiler/integers/u128/mul.leo.out index d35fe29cf0..98570d7b5b 100644 --- a/tests/expectations/compiler/compiler/integers/u128/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/mul.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: ca8e32e5d6116b1dcb308c569c4584297586cd605efe92b41ccad1975151eff4 + symbol_table: dd0098712d873cf92c367f89af907dad778d2b2b2f2e251d0eda2237be727c6c initial_ast: 113f8c2b15904292632fa1b1595a5dd1988001bfaf0ba8a4b3a1d4cb9535fbc6 diff --git a/tests/expectations/compiler/compiler/integers/u128/ne.leo.out b/tests/expectations/compiler/compiler/integers/u128/ne.leo.out index 406602524b..70692337c3 100644 --- a/tests/expectations/compiler/compiler/integers/u128/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/ne.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: b5c6120ae963f4518dfbcf01566c85e1414ed347b18ca65dcbc03ff3addfb8ea + symbol_table: b6d4ce61a5c1ee27261f3609a47c6b27daa5b5206e1bff4d50fa5d53c283aad4 + - initial_input_ast: a31b59bfd025f5562ede8f5e6f01ba3724dc9340e1798beaded0aee94682956b + symbol_table: b6d4ce61a5c1ee27261f3609a47c6b27daa5b5206e1bff4d50fa5d53c283aad4 initial_ast: 92df27cfda59130731bad66eeb592251d7e664bb2fa86b1dd59dc8dd7623673b diff --git a/tests/expectations/compiler/compiler/integers/u128/sub.leo.out b/tests/expectations/compiler/compiler/integers/u128/sub.leo.out index 6b9e44f617..0a0e70f33e 100644 --- a/tests/expectations/compiler/compiler/integers/u128/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/sub.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: ca31f79f44f6f99c64ba44c0e727428d042eb9368e222e1cd182db88cca34d09 + symbol_table: f5fc54506951419ceced5b81e17531ffe879b8665f340165ce00ee93a6375b0f initial_ast: 0321e2d1eba2f636836f78a2d0e729cc025e9f3ea67542574c804c4622845502 diff --git a/tests/expectations/compiler/compiler/integers/u128/ternary.leo.out b/tests/expectations/compiler/compiler/integers/u128/ternary.leo.out index 7534423053..0ffe9e8a12 100644 --- a/tests/expectations/compiler/compiler/integers/u128/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/u128/ternary.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 8e68c80562642f5f107fb42876a1a0bed112f771860a69222d65bd374ec8c7d6 + symbol_table: c9775810bca18ac5d6894681231f4bdf595c637c970dbc90a23d32c8407ccd5f + - initial_input_ast: d4fbdc7ebdf3ab8e4f3e42172cb039bd4fec87dc2ed0218e756b59af6334e3dc + symbol_table: c9775810bca18ac5d6894681231f4bdf595c637c970dbc90a23d32c8407ccd5f initial_ast: 49825c8bf4c5f1ab4c5032ff70563384b9eb08961e8b1ab87d9200e5256e188b diff --git a/tests/expectations/compiler/compiler/integers/u16/ge.leo.out b/tests/expectations/compiler/compiler/integers/u16/ge.leo.out index 590072055a..2949dc7d07 100644 --- a/tests/expectations/compiler/compiler/integers/u16/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/ge.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: cb0e4f51087e3221ca9d60ad25194233446b1827dcbd3af17206be357599915b + symbol_table: 19060c1c44e418ecc282948f304fd19959c49857d1cd93dcd2d9bf423e250f2f + - initial_input_ast: 3af712fb74fec6f2a6a3025f447b4097ac848a663b809869684dd4e7c67cee94 + symbol_table: 19060c1c44e418ecc282948f304fd19959c49857d1cd93dcd2d9bf423e250f2f initial_ast: bb07a170668679fe07c1a41c4c7edd601b55d9659bacbb41e55adef5d347fdeb diff --git a/tests/expectations/compiler/compiler/integers/u16/gt.leo.out b/tests/expectations/compiler/compiler/integers/u16/gt.leo.out index 1cd9296fca..bb80e77e9c 100644 --- a/tests/expectations/compiler/compiler/integers/u16/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/gt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: cb0e4f51087e3221ca9d60ad25194233446b1827dcbd3af17206be357599915b + symbol_table: e832ccf84a5e5dd9881b57a5c31de1d81ccd04e6d5c260db71d7f951ce57bc55 + - initial_input_ast: c5aaeea8372b4a20f0224a169e17873ce833ff051f2822638e96e0e5fae152b7 + symbol_table: e832ccf84a5e5dd9881b57a5c31de1d81ccd04e6d5c260db71d7f951ce57bc55 initial_ast: b973b26e654b6b561094b5d80fc17ffb8afe773a6f338a36eb19a91a74210e6b diff --git a/tests/expectations/compiler/compiler/integers/u16/le.leo.out b/tests/expectations/compiler/compiler/integers/u16/le.leo.out index 19fddf1540..82b91678e3 100644 --- a/tests/expectations/compiler/compiler/integers/u16/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/le.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: cb0e4f51087e3221ca9d60ad25194233446b1827dcbd3af17206be357599915b + symbol_table: 25b8f9d647642615b54428c2f0ce4e483459712ca7d82329a680b49e4ae7f22f + - initial_input_ast: 5e4ddfaff750bb3594818726ec94c8bfbef36dfecfbfc9b5e7ae9e08ff5b5739 + symbol_table: 25b8f9d647642615b54428c2f0ce4e483459712ca7d82329a680b49e4ae7f22f initial_ast: b285cc3429a247bb616cec8b1cef77f4f2da042898fa66f80952496b09b3f9db diff --git a/tests/expectations/compiler/compiler/integers/u16/lt.leo.out b/tests/expectations/compiler/compiler/integers/u16/lt.leo.out index 5c23eea345..2664a01c87 100644 --- a/tests/expectations/compiler/compiler/integers/u16/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/lt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: cb0e4f51087e3221ca9d60ad25194233446b1827dcbd3af17206be357599915b + symbol_table: ef70c4f5b504ad5c38821e26a2d6be275e2de4148dfec29b73d3b1eaba5044b1 + - initial_input_ast: 2042ed00f53e2028130ec5d2d04f4138cddae139face997cd49342b7dd79614f + symbol_table: ef70c4f5b504ad5c38821e26a2d6be275e2de4148dfec29b73d3b1eaba5044b1 initial_ast: 8010e3d578a0a42f4e1165e51e46041c6f9039aaa526c72165a72ed2cea4c577 diff --git a/tests/expectations/compiler/compiler/integers/u16/mul.leo.out b/tests/expectations/compiler/compiler/integers/u16/mul.leo.out index 7c00cc3f70..929d27b40f 100644 --- a/tests/expectations/compiler/compiler/integers/u16/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/mul.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 27db318ee991561d9cebe27f27dceeec5c9c8a63ab462313e344e3c1158aa758 + symbol_table: f7142c34960bdd46528d63022dc60428b00ff0183d2c480ef72a8c8b61a13127 initial_ast: 1f76a40705982a61b4d014e7bc91b4da748c41a48fd0f66c388c88eb33eeebaa diff --git a/tests/expectations/compiler/compiler/integers/u16/ne.leo.out b/tests/expectations/compiler/compiler/integers/u16/ne.leo.out index 5542180680..7d5d1a4538 100644 --- a/tests/expectations/compiler/compiler/integers/u16/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/ne.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: cb0e4f51087e3221ca9d60ad25194233446b1827dcbd3af17206be357599915b + symbol_table: 1d5a378efa184ef720922e0431978a779b5258838d7daaa4447d773de74b5726 + - initial_input_ast: 5e74a501b8e15c71c521d8a3d838bfe91ce8f37fa9bdaf79342c755564ea086a + symbol_table: 1d5a378efa184ef720922e0431978a779b5258838d7daaa4447d773de74b5726 initial_ast: e655135bbc414f50662dc8964849795a14e3c1fbf110ed0d93f428256e20337f diff --git a/tests/expectations/compiler/compiler/integers/u16/sub.leo.out b/tests/expectations/compiler/compiler/integers/u16/sub.leo.out index 829bc89eef..274a189b2b 100644 --- a/tests/expectations/compiler/compiler/integers/u16/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/sub.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 1e4b846165f77f1b45c8340f097596100a0513f2e09fb7847143c693dc4ab378 + symbol_table: bc40ab38ded0949abbd0d2b28ad41957043f09fadcd1522424674bc795fc4027 initial_ast: 2112ddaa6ca4f2b78137f7d5ae6834c00303bb61fd8c7f6a520f34fbd73ffcdd diff --git a/tests/expectations/compiler/compiler/integers/u16/ternary.leo.out b/tests/expectations/compiler/compiler/integers/u16/ternary.leo.out index 1268eaf781..8e7190f544 100644 --- a/tests/expectations/compiler/compiler/integers/u16/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/u16/ternary.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: a6d199a58056771f9b6da733f16030fe0b68f0d974ed0dcd093bec41a98063d4 + symbol_table: df9448449a94c3bc09affc5870c1749d4826072037d1fbe156feab39438a7bec + - initial_input_ast: c91db248acde5649f26d3d94264f944c1988fbecd352c71419f0021adc3c46f3 + symbol_table: df9448449a94c3bc09affc5870c1749d4826072037d1fbe156feab39438a7bec initial_ast: 0d16aad83164ce514af359ab754b7974565c97a1253d8a539e37380e7b1250c9 diff --git a/tests/expectations/compiler/compiler/integers/u32/ge.leo.out b/tests/expectations/compiler/compiler/integers/u32/ge.leo.out index 0b0ca3453f..aabe6f82e6 100644 --- a/tests/expectations/compiler/compiler/integers/u32/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/ge.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 0d8bd4140882c8076fc6f31339195bd136210fa8468de7232564be89d208c570 + symbol_table: 5ad082f22aed2d221d142cb3538a67c5814214bdd549b3514a369dec0b8b7922 + - initial_input_ast: 13faf6aa4d9e76c04acb1872465f0691ef01d8d604a1931bcef5a0f3337347ea + symbol_table: 5ad082f22aed2d221d142cb3538a67c5814214bdd549b3514a369dec0b8b7922 initial_ast: a5febe72565e2a143d4f2069cc6e5f3a75d3ccdf2e7f4a4af66d3600b9be26fe diff --git a/tests/expectations/compiler/compiler/integers/u32/gt.leo.out b/tests/expectations/compiler/compiler/integers/u32/gt.leo.out index 6f408330ff..e193aeb490 100644 --- a/tests/expectations/compiler/compiler/integers/u32/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/gt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 0d8bd4140882c8076fc6f31339195bd136210fa8468de7232564be89d208c570 + symbol_table: 6a754bcc8e62a2b8e6e27fbe48a36cb72c99d81ce09e594ebc3125e402f08d0c + - initial_input_ast: 15be215647f18a1a931f198ce7d30f6805f9bac29a2b24bf7e4abff24e5d20be + symbol_table: 6a754bcc8e62a2b8e6e27fbe48a36cb72c99d81ce09e594ebc3125e402f08d0c initial_ast: 85dd004fda33533c3622967dd7943343582f3904892b17a97620b98818ed18b9 diff --git a/tests/expectations/compiler/compiler/integers/u32/le.leo.out b/tests/expectations/compiler/compiler/integers/u32/le.leo.out index fd4de44b8a..d56962f457 100644 --- a/tests/expectations/compiler/compiler/integers/u32/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/le.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 0d8bd4140882c8076fc6f31339195bd136210fa8468de7232564be89d208c570 + symbol_table: e621662548365800e2cad034bcad6541940af5f5acc36dfa477554c1e72acc4f + - initial_input_ast: ba4710f02a41fe30785f0bed4ef61b919be8233d0397a57e6bec110a83e7bae7 + symbol_table: e621662548365800e2cad034bcad6541940af5f5acc36dfa477554c1e72acc4f initial_ast: 3fa3d0d0cf219277d2a244dfe54616d9874fe5db85ee575cd588f2cb941f9b3b diff --git a/tests/expectations/compiler/compiler/integers/u32/lt.leo.out b/tests/expectations/compiler/compiler/integers/u32/lt.leo.out index ab3ce9781d..b21f2726bf 100644 --- a/tests/expectations/compiler/compiler/integers/u32/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/lt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 0d8bd4140882c8076fc6f31339195bd136210fa8468de7232564be89d208c570 + symbol_table: 92fe7f7727a3bd4d14e36b28ec549f7348b898845534e872faaba4e362902f0b + - initial_input_ast: ea18893ff821300d48c4a7bafc0bf0b3091db8d0afa6a6061f4da66c9230befd + symbol_table: 92fe7f7727a3bd4d14e36b28ec549f7348b898845534e872faaba4e362902f0b initial_ast: b05b37054191d71799f0e1f5acbf281d12a8e25bf7cd9c81fe4af2ba66bb85e2 diff --git a/tests/expectations/compiler/compiler/integers/u32/mul.leo.out b/tests/expectations/compiler/compiler/integers/u32/mul.leo.out index 86f1f5b54c..8a6c62c8e6 100644 --- a/tests/expectations/compiler/compiler/integers/u32/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/mul.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3a833192a9e0c041f1f7064d4d270e04bf2b178a2e656fd8c6f8cf5d391057a7 + symbol_table: a361156a49b7611d0e4b3e231b073210bc8a19a6255b966c59d3b5e1d2f51f06 initial_ast: b4f789d7742023756857cd3da5560976f63adac5d0ff178cdf74397e8f597915 diff --git a/tests/expectations/compiler/compiler/integers/u32/ne.leo.out b/tests/expectations/compiler/compiler/integers/u32/ne.leo.out index e1a588f0c4..5096e82a91 100644 --- a/tests/expectations/compiler/compiler/integers/u32/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/ne.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 0d8bd4140882c8076fc6f31339195bd136210fa8468de7232564be89d208c570 + symbol_table: 737d38e0113d508ac46829d2233125443e36a78e22ff8614769821b64eb16227 + - initial_input_ast: e729164124bc010537c8d2b51bc78e5de23cca4b79b56fa12845fdbf6e9fdf2b + symbol_table: 737d38e0113d508ac46829d2233125443e36a78e22ff8614769821b64eb16227 initial_ast: 37f1d76e799523048b115f8189834f2e678305837b67fe13b5f5e605c03e9f6c diff --git a/tests/expectations/compiler/compiler/integers/u32/sub.leo.out b/tests/expectations/compiler/compiler/integers/u32/sub.leo.out index 1363261ff5..8757c42a00 100644 --- a/tests/expectations/compiler/compiler/integers/u32/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/sub.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 7a916ba3711c3e422e5a57af380dc8768fd68e0c407d6737a5848e83432fa2a4 + symbol_table: 7b6d3ffaf2dba4eb24b64929c9a2c756e966e822f3d3f45a05113963f22d76fd initial_ast: c8c2b4028587a62f1404c9298e16883c2b3326f5132d6b6472157f658f247172 diff --git a/tests/expectations/compiler/compiler/integers/u32/ternary.leo.out b/tests/expectations/compiler/compiler/integers/u32/ternary.leo.out index 5deefac2c0..7a73bcaef0 100644 --- a/tests/expectations/compiler/compiler/integers/u32/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/u32/ternary.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3cac85ec032e1af74a50f0be52f121512d2548e0db2971b227f7d286935968cd + symbol_table: 2f27d6dc05c17715b3c45e9ee6e501bfaec046241110fee1209904c92b2aa434 + - initial_input_ast: 31df4f8912365b8afba7a0bde5d29aa2d8ceb4d2aff5ac1e3b230777f124adbb + symbol_table: 2f27d6dc05c17715b3c45e9ee6e501bfaec046241110fee1209904c92b2aa434 initial_ast: 54bf1b2212f408693030bc58dab3c189d09a4b286348925179853fac652572c1 diff --git a/tests/expectations/compiler/compiler/integers/u64/ge.leo.out b/tests/expectations/compiler/compiler/integers/u64/ge.leo.out index 221d863135..9ec1979718 100644 --- a/tests/expectations/compiler/compiler/integers/u64/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/ge.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 0293b081f0efa060d6d6be2a41792af71a74b1a894832aef14166c5bbd242e2e + symbol_table: 8f6927e31fdde67cc1f67d8f2d214bf456a1fce6ebee106656b33f717aa770f7 + - initial_input_ast: 835fabf6828b0a76d3cef59ec709a9e084e7d05950a2307f51af0c4a7749c401 + symbol_table: 8f6927e31fdde67cc1f67d8f2d214bf456a1fce6ebee106656b33f717aa770f7 initial_ast: 540d8224f3c5b190acec728377d6da5c4e3697e905f445664ed0cb5ff5e798af diff --git a/tests/expectations/compiler/compiler/integers/u64/gt.leo.out b/tests/expectations/compiler/compiler/integers/u64/gt.leo.out index 9a60d873ec..dbfef6a0e4 100644 --- a/tests/expectations/compiler/compiler/integers/u64/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/gt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 0293b081f0efa060d6d6be2a41792af71a74b1a894832aef14166c5bbd242e2e + symbol_table: d3fbb159afcf5d889f310c0b277b588def80246861c318632d9416532c84901e + - initial_input_ast: 7677cedf6c5a32b8a4618cce2a2b2cd638b72a527fdce50167e73e1eee416861 + symbol_table: d3fbb159afcf5d889f310c0b277b588def80246861c318632d9416532c84901e initial_ast: 6b7a4afc593bb8518e8f8353d7da7c33fc20d07e1c1e45cc52d5a8762410fb3c diff --git a/tests/expectations/compiler/compiler/integers/u64/le.leo.out b/tests/expectations/compiler/compiler/integers/u64/le.leo.out index 1dac3dfbcf..24a7faf8ce 100644 --- a/tests/expectations/compiler/compiler/integers/u64/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/le.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 0293b081f0efa060d6d6be2a41792af71a74b1a894832aef14166c5bbd242e2e + symbol_table: 9c75212ccddfab209e82ced0636610b9c0b225af3a17badeb6d12b03200f9aa0 + - initial_input_ast: cf12465991469b1b836b27e59ea32d80211248e0514092b5971b6622b19d513e + symbol_table: 9c75212ccddfab209e82ced0636610b9c0b225af3a17badeb6d12b03200f9aa0 initial_ast: b19797e2966b3d5047b194ae9eae5c15ca5ad0ff05d1cba63c0c3c0cd4cd42b2 diff --git a/tests/expectations/compiler/compiler/integers/u64/lt.leo.out b/tests/expectations/compiler/compiler/integers/u64/lt.leo.out index 5f4c00d9be..2423d1fa10 100644 --- a/tests/expectations/compiler/compiler/integers/u64/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/lt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 0293b081f0efa060d6d6be2a41792af71a74b1a894832aef14166c5bbd242e2e + symbol_table: 22be10247e5c5f58c07b5ea7ed1dd2093561a57ef3a0c54e26799398d2dd8740 + - initial_input_ast: 4d94a5cd71d7a286a523db4c023a5cd8550750e443e930448d09e115aaa279a2 + symbol_table: 22be10247e5c5f58c07b5ea7ed1dd2093561a57ef3a0c54e26799398d2dd8740 initial_ast: 1d70859881833b2980e1f98a742003e40af8e8ae6080fbf33866ef7c12a3e64a diff --git a/tests/expectations/compiler/compiler/integers/u64/mul.leo.out b/tests/expectations/compiler/compiler/integers/u64/mul.leo.out index 19c7b42e67..58b8f6d150 100644 --- a/tests/expectations/compiler/compiler/integers/u64/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/mul.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 48c6ce857f2c1b7e105743975c53672d2d53dac5d48b006fbb7b98b7542dd5bb + symbol_table: 77c0adeb4d9f6bb7562a9eaf09c84d5fb4459ac432fffb77c71510cb77991662 initial_ast: eb1c470f2407c45abc32d8f98385af6f9e8b61a22f42f7d9cc479d770018551c diff --git a/tests/expectations/compiler/compiler/integers/u64/ne.leo.out b/tests/expectations/compiler/compiler/integers/u64/ne.leo.out index a3a4a3d966..8c6821a65d 100644 --- a/tests/expectations/compiler/compiler/integers/u64/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/ne.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 0293b081f0efa060d6d6be2a41792af71a74b1a894832aef14166c5bbd242e2e + symbol_table: 3243923d5a69e9bd20a247e6749255adaca834c5277061df09a8777ae0f34d2d + - initial_input_ast: 96b7d29d08b195d28c72abc7cda1febaf19b1a2d1ae660f786f3e5e66041ec5e + symbol_table: 3243923d5a69e9bd20a247e6749255adaca834c5277061df09a8777ae0f34d2d initial_ast: 36730570b95346a3c5bbd2f7bba8d9ea8c0a0f27f999cf47bdaac8fb4e2944f1 diff --git a/tests/expectations/compiler/compiler/integers/u64/sub.leo.out b/tests/expectations/compiler/compiler/integers/u64/sub.leo.out index 963ba1cc68..39e9c5828f 100644 --- a/tests/expectations/compiler/compiler/integers/u64/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/sub.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 945f0553365bda391e02276a38539f1361f6d5edadcb1673832b551528214ce9 + symbol_table: 48f44fca9b490df0387ccac24c8e4805e634896b968559d35645288cdd720562 initial_ast: 598a8893e0e64ce6a7c3e66c6a6164dcaf856c414954d6835d2b494f48dcc7d0 diff --git a/tests/expectations/compiler/compiler/integers/u64/ternary.leo.out b/tests/expectations/compiler/compiler/integers/u64/ternary.leo.out index d132024d82..d1bd491a5b 100644 --- a/tests/expectations/compiler/compiler/integers/u64/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/u64/ternary.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 02c22a2532fd696c3f0b5e59efff10fb7f423129f2d238a845ab20e296516b1c + symbol_table: 3e3b389b28b166b85423e398f80698529dbb1174326b121bb67ca4921c714aa4 + - initial_input_ast: 11c83531b97e6863b4dd609246fc11e071538831bd7f875d83c576068832da5f + symbol_table: 3e3b389b28b166b85423e398f80698529dbb1174326b121bb67ca4921c714aa4 initial_ast: c54869417af036645fdef9901883e8156638ddb6811ca7c1412a03cfeb226c60 diff --git a/tests/expectations/compiler/compiler/integers/u8/ge.leo.out b/tests/expectations/compiler/compiler/integers/u8/ge.leo.out index c64d50b196..5fd058dc46 100644 --- a/tests/expectations/compiler/compiler/integers/u8/ge.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/ge.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3e4fef1af04fd43972dc710e4b0e67e1b5f3b03cf0e8d1373cedfb0426b5adb7 + symbol_table: 1cf9efe37c13b89e2528c0257225192259dabdbb7df99c98d4ae31e74681eefe + - initial_input_ast: 182fd9244fdf4702346b84168c32db25759624daa7904c9ea6b081564864e53b + symbol_table: 1cf9efe37c13b89e2528c0257225192259dabdbb7df99c98d4ae31e74681eefe initial_ast: 201c2596f189ca81cbb8c1155f13fa5d6764bac8c4a24f1ea01ef80e26882336 diff --git a/tests/expectations/compiler/compiler/integers/u8/gt.leo.out b/tests/expectations/compiler/compiler/integers/u8/gt.leo.out index f765f4e7e5..44f1da54aa 100644 --- a/tests/expectations/compiler/compiler/integers/u8/gt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/gt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3e4fef1af04fd43972dc710e4b0e67e1b5f3b03cf0e8d1373cedfb0426b5adb7 + symbol_table: 0f19f2bdf03fa3f98d3b1b849195dee1ee2e23c968c8beab1d1106e2be74da19 + - initial_input_ast: c63bf7f9f9b98ca445f4a3fd4a419ea5f40041977aad5ff111f8319d90c25e2c + symbol_table: 0f19f2bdf03fa3f98d3b1b849195dee1ee2e23c968c8beab1d1106e2be74da19 initial_ast: a101c00dbf562bb0f5092240492f57859d481f66709fa7de9d694b5a7ffe99d9 diff --git a/tests/expectations/compiler/compiler/integers/u8/le.leo.out b/tests/expectations/compiler/compiler/integers/u8/le.leo.out index befd16b823..b5b0f5e37a 100644 --- a/tests/expectations/compiler/compiler/integers/u8/le.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/le.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3e4fef1af04fd43972dc710e4b0e67e1b5f3b03cf0e8d1373cedfb0426b5adb7 + symbol_table: 23d6582231481f7fe9071618585c6e81ff6f7571059cc4a2fc6deab71292ed43 + - initial_input_ast: 9794cb4036879a54fc3a9cc80507c19267ed41731b2faa7a7bea8ba9226a8452 + symbol_table: 23d6582231481f7fe9071618585c6e81ff6f7571059cc4a2fc6deab71292ed43 initial_ast: 6bd48110a2d4e17a18288fd55e786fe97b3917010460b0b7aa53a9b44f043ab8 diff --git a/tests/expectations/compiler/compiler/integers/u8/lt.leo.out b/tests/expectations/compiler/compiler/integers/u8/lt.leo.out index 2a55b25416..92ef816cdd 100644 --- a/tests/expectations/compiler/compiler/integers/u8/lt.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/lt.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3e4fef1af04fd43972dc710e4b0e67e1b5f3b03cf0e8d1373cedfb0426b5adb7 + symbol_table: 929c17fba43bfee01ec4b836cbbd8bd610e30bdf4294ececb75f247fdc8f2bcc + - initial_input_ast: 9a836e6f97b932a81455f105d6db0165d862ed190631b806e364f954b7d771f4 + symbol_table: 929c17fba43bfee01ec4b836cbbd8bd610e30bdf4294ececb75f247fdc8f2bcc initial_ast: a972ae2f70671860f9806aeb16f18ca23c4c1f9cbb8c7dcf7b780919802f58b0 diff --git a/tests/expectations/compiler/compiler/integers/u8/mul.leo.out b/tests/expectations/compiler/compiler/integers/u8/mul.leo.out index ce7c0fb770..fe1a0bf49d 100644 --- a/tests/expectations/compiler/compiler/integers/u8/mul.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/mul.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: df3fa1351cbc1798f527ff81eeefbd149fc841f2ee50695e5215cac690af7f1a + symbol_table: 89129eab1ef21cc91784b4c5d81e68012f35800778eac358efb24d56c20ef295 initial_ast: c2c0afa3fa10147ba3eb20c98fd5f5159977944992325c3a0300289510911c4e diff --git a/tests/expectations/compiler/compiler/integers/u8/ne.leo.out b/tests/expectations/compiler/compiler/integers/u8/ne.leo.out index 802c29365b..881a901b30 100644 --- a/tests/expectations/compiler/compiler/integers/u8/ne.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/ne.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 3e4fef1af04fd43972dc710e4b0e67e1b5f3b03cf0e8d1373cedfb0426b5adb7 + symbol_table: 299fff014274a3fef18437e73adb0f912b453399e6149db11763f4495c735b23 + - initial_input_ast: a6fd523cd4910b0a48a62b6ec8935805f10fbc041cfd5a8aed6899bcb3911788 + symbol_table: 299fff014274a3fef18437e73adb0f912b453399e6149db11763f4495c735b23 initial_ast: 3c4023f1a4fb93b562ee7202c6350b73e352a75deaf4a5e74648d904e7a32cac diff --git a/tests/expectations/compiler/compiler/integers/u8/sub.leo.out b/tests/expectations/compiler/compiler/integers/u8/sub.leo.out index d8bad719cc..3efebfc0ff 100644 --- a/tests/expectations/compiler/compiler/integers/u8/sub.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/sub.leo.out @@ -2,5 +2,7 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 74c3de795f0d6a8948600e20913d0798ed2017e11c2dd7bcbf2b363a9a384325 + symbol_table: ebe63398d3809fedaa38f4ada4fe18022296680cdc7d30fbcd16aa491134749c initial_ast: 2f52e4feba81598590c41cc2d8d101669bf358f32b80716e9442997d3beb5bf5 diff --git a/tests/expectations/compiler/compiler/integers/u8/ternary.leo.out b/tests/expectations/compiler/compiler/integers/u8/ternary.leo.out index de0de8aa3a..9f19ee0aa8 100644 --- a/tests/expectations/compiler/compiler/integers/u8/ternary.leo.out +++ b/tests/expectations/compiler/compiler/integers/u8/ternary.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 7362a319261fbc9de1aec131fdd81c6c720a27871817ce18155e8c767f9f615d + symbol_table: e80a26d28a4f36e79f1a113fc74cfc7bcf32cd54e21ba5af553b738a906de381 + - initial_input_ast: d71995f6949dab10ec87aec16bf99544c4dc9f5a492fceaef1d171f87229a2bc + symbol_table: e80a26d28a4f36e79f1a113fc74cfc7bcf32cd54e21ba5af553b738a906de381 initial_ast: 31513ce6226efe32897a6f626ebcedfe0c07d9881173d16b9cb1b9684c015f93 diff --git a/tests/expectations/compiler/compiler/statements/chain.leo.out b/tests/expectations/compiler/compiler/statements/chain.leo.out index adaee377cd..be67edbb3a 100644 --- a/tests/expectations/compiler/compiler/statements/chain.leo.out +++ b/tests/expectations/compiler/compiler/statements/chain.leo.out @@ -2,5 +2,11 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 7f5eb67955fff9556d758dea428c97687be661cf6ef33f8acf736e3e77d487f8 + symbol_table: 68eae40307674c0cfac9f10f03becf84fbfe9da68c0cac435d54b775e0c4618a + - initial_input_ast: 15ea6655d9cdaca2e4e57a62d0959b832e56ca7139e38bc3e3c16ad8965ee681 + symbol_table: 68eae40307674c0cfac9f10f03becf84fbfe9da68c0cac435d54b775e0c4618a + - initial_input_ast: 184db3c907c6636bf2bfe0499706c93c40901d50567d9c36bfc0219fd16c0e69 + symbol_table: 68eae40307674c0cfac9f10f03becf84fbfe9da68c0cac435d54b775e0c4618a initial_ast: 3d3e731e5647663de949e10d11bbf9941ba7b81e7a8ca91049b2f30e798c1a48 diff --git a/tests/expectations/compiler/compiler/statements/multiple_returns.leo.out b/tests/expectations/compiler/compiler/statements/multiple_returns.leo.out index 04db9e3d33..13f729bddd 100644 --- a/tests/expectations/compiler/compiler/statements/multiple_returns.leo.out +++ b/tests/expectations/compiler/compiler/statements/multiple_returns.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 7f5eb67955fff9556d758dea428c97687be661cf6ef33f8acf736e3e77d487f8 + symbol_table: a57230e14da3882433b1b2f0cfa8abd32f38a6b4bd207fd87fdfbea34fc5e71d + - initial_input_ast: 15ea6655d9cdaca2e4e57a62d0959b832e56ca7139e38bc3e3c16ad8965ee681 + symbol_table: a57230e14da3882433b1b2f0cfa8abd32f38a6b4bd207fd87fdfbea34fc5e71d initial_ast: b21850bcd854089338e66df98fbacc2ddf4359e0238f1957933720f5c0ad2c92 diff --git a/tests/expectations/compiler/compiler/statements/mutate.leo.out b/tests/expectations/compiler/compiler/statements/mutate.leo.out index ed4e9dcd04..d0ef47f443 100644 --- a/tests/expectations/compiler/compiler/statements/mutate.leo.out +++ b/tests/expectations/compiler/compiler/statements/mutate.leo.out @@ -2,5 +2,9 @@ namespace: Compile expectation: Pass outputs: - - output: [] + - output: + - initial_input_ast: 7f5eb67955fff9556d758dea428c97687be661cf6ef33f8acf736e3e77d487f8 + symbol_table: 6d82dfb1fcb0a50b6b18e771919dad3622d102b53b63ffa2186bc50bc0aa743c + - initial_input_ast: 15ea6655d9cdaca2e4e57a62d0959b832e56ca7139e38bc3e3c16ad8965ee681 + symbol_table: 6d82dfb1fcb0a50b6b18e771919dad3622d102b53b63ffa2186bc50bc0aa743c initial_ast: 05fe28f3b8ae599404b6f52e5e3e53efa22bdc43c9a951445142fc3c7d171945 From e03af95ff64ba0cf83be53968d54a83741541845 Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Wed, 4 May 2022 15:43:07 -0700 Subject: [PATCH 11/16] change output format, st doesn't change bc of input file --- compiler/compiler/src/test.rs | 22 +++++++------------ .../compiler/compiler/address/branch.leo.out | 2 +- .../compiler/compiler/address/equal.leo.out | 3 +-- .../compiler/compiler/address/ternary.leo.out | 3 +-- .../compiler/compiler/boolean/and.leo.out | 5 +---- .../compiler/boolean/conditional.leo.out | 5 +---- .../compiler/compiler/boolean/equal.leo.out | 5 +---- .../compiler/boolean/not_equal.leo.out | 5 +---- .../compiler/compiler/boolean/or.leo.out | 5 +---- .../compiler/definition/out_of_order.leo.out | 2 +- .../compiler/compiler/field/add.leo.out | 2 +- .../compiler/compiler/field/div.leo.out | 2 +- .../compiler/compiler/field/eq.leo.out | 2 +- .../compiler/compiler/field/field.leo.out | 2 +- .../compiler/compiler/field/mul.leo.out | 2 +- .../compiler/compiler/field/negate.leo.out | 2 +- .../function/conditional_return.leo.out | 2 +- .../compiler/function/iteration.leo.out | 2 +- .../function/iteration_repeated.leo.out | 2 +- .../compiler/function/repeated.leo.out | 2 +- .../compiler/compiler/function/return.leo.out | 2 +- .../input_files/program_input/main.leo.out | 2 +- .../program_input/main_field.leo.out | 2 +- .../program_input/main_group.leo.out | 2 +- .../program_input_constants/main.leo.out | 2 +- .../main_field.leo.out | 2 +- .../main_group.leo.out | 2 +- .../main_multiple.leo.out | 2 +- .../compiler/integers/i128/add.leo.out | 2 +- .../integers/i128/console_assert.leo.out | 2 +- .../compiler/integers/i128/div.leo.out | 2 +- .../compiler/integers/i128/eq.leo.out | 2 +- .../compiler/integers/i128/ge.leo.out | 3 +-- .../compiler/integers/i128/gt.leo.out | 3 +-- .../compiler/integers/i128/le.leo.out | 3 +-- .../compiler/integers/i128/lt.leo.out | 3 +-- .../compiler/integers/i128/max.leo.out | 2 +- .../compiler/integers/i128/min.leo.out | 2 +- .../compiler/integers/i128/mul.leo.out | 2 +- .../compiler/integers/i128/ne.leo.out | 3 +-- .../compiler/integers/i128/negate.leo.out | 3 +-- .../integers/i128/negate_zero.leo.out | 2 +- .../compiler/integers/i128/sub.leo.out | 2 +- .../compiler/integers/i128/ternary.leo.out | 3 +-- .../compiler/integers/i16/add.leo.out | 2 +- .../integers/i16/console_assert.leo.out | 2 +- .../compiler/integers/i16/div.leo.out | 2 +- .../compiler/compiler/integers/i16/eq.leo.out | 2 +- .../compiler/compiler/integers/i16/ge.leo.out | 3 +-- .../compiler/compiler/integers/i16/gt.leo.out | 3 +-- .../compiler/compiler/integers/i16/le.leo.out | 3 +-- .../compiler/compiler/integers/i16/lt.leo.out | 3 +-- .../compiler/integers/i16/max.leo.out | 2 +- .../compiler/integers/i16/min.leo.out | 2 +- .../compiler/integers/i16/mul.leo.out | 2 +- .../compiler/compiler/integers/i16/ne.leo.out | 3 +-- .../compiler/integers/i16/negate.leo.out | 3 +-- .../compiler/integers/i16/negate_zero.leo.out | 2 +- .../compiler/integers/i16/sub.leo.out | 2 +- .../compiler/integers/i16/ternary.leo.out | 3 +-- .../compiler/integers/i32/add.leo.out | 2 +- .../integers/i32/console_assert.leo.out | 2 +- .../compiler/integers/i32/div.leo.out | 2 +- .../compiler/compiler/integers/i32/eq.leo.out | 2 +- .../compiler/compiler/integers/i32/ge.leo.out | 3 +-- .../compiler/compiler/integers/i32/gt.leo.out | 3 +-- .../compiler/compiler/integers/i32/le.leo.out | 3 +-- .../compiler/compiler/integers/i32/lt.leo.out | 3 +-- .../compiler/integers/i32/max.leo.out | 2 +- .../compiler/integers/i32/min.leo.out | 2 +- .../compiler/integers/i32/mul.leo.out | 2 +- .../compiler/compiler/integers/i32/ne.leo.out | 3 +-- .../compiler/integers/i32/negate.leo.out | 3 +-- .../compiler/integers/i32/negate_zero.leo.out | 2 +- .../compiler/integers/i32/sub.leo.out | 2 +- .../compiler/integers/i32/ternary.leo.out | 3 +-- .../compiler/integers/i64/add.leo.out | 2 +- .../integers/i64/console_assert.leo.out | 2 +- .../compiler/integers/i64/div.leo.out | 2 +- .../compiler/compiler/integers/i64/eq.leo.out | 2 +- .../compiler/compiler/integers/i64/ge.leo.out | 3 +-- .../compiler/compiler/integers/i64/gt.leo.out | 3 +-- .../compiler/compiler/integers/i64/le.leo.out | 3 +-- .../compiler/compiler/integers/i64/lt.leo.out | 3 +-- .../compiler/integers/i64/max.leo.out | 2 +- .../compiler/integers/i64/min.leo.out | 2 +- .../compiler/integers/i64/mul.leo.out | 2 +- .../compiler/compiler/integers/i64/ne.leo.out | 3 +-- .../compiler/integers/i64/negate.leo.out | 3 +-- .../compiler/integers/i64/negate_zero.leo.out | 2 +- .../compiler/integers/i64/sub.leo.out | 2 +- .../compiler/integers/i64/ternary.leo.out | 3 +-- .../compiler/compiler/integers/i8/add.leo.out | 2 +- .../integers/i8/console_assert.leo.out | 2 +- .../compiler/compiler/integers/i8/div.leo.out | 2 +- .../compiler/compiler/integers/i8/eq.leo.out | 2 +- .../compiler/compiler/integers/i8/ge.leo.out | 3 +-- .../compiler/compiler/integers/i8/gt.leo.out | 3 +-- .../compiler/compiler/integers/i8/le.leo.out | 3 +-- .../compiler/compiler/integers/i8/lt.leo.out | 3 +-- .../compiler/compiler/integers/i8/max.leo.out | 2 +- .../compiler/compiler/integers/i8/min.leo.out | 2 +- .../compiler/compiler/integers/i8/mul.leo.out | 2 +- .../compiler/compiler/integers/i8/ne.leo.out | 3 +-- .../compiler/integers/i8/negate.leo.out | 3 +-- .../compiler/integers/i8/negate_zero.leo.out | 2 +- .../compiler/compiler/integers/i8/sub.leo.out | 2 +- .../compiler/integers/i8/ternary.leo.out | 3 +-- .../compiler/integers/u128/add.leo.out | 2 +- .../integers/u128/console_assert.leo.out | 2 +- .../compiler/integers/u128/div.leo.out | 2 +- .../compiler/integers/u128/eq.leo.out | 2 +- .../compiler/integers/u128/ge.leo.out | 3 +-- .../compiler/integers/u128/gt.leo.out | 3 +-- .../compiler/integers/u128/le.leo.out | 3 +-- .../compiler/integers/u128/lt.leo.out | 3 +-- .../compiler/integers/u128/max.leo.out | 2 +- .../compiler/integers/u128/min.leo.out | 2 +- .../compiler/integers/u128/mul.leo.out | 2 +- .../compiler/integers/u128/ne.leo.out | 3 +-- .../compiler/integers/u128/sub.leo.out | 2 +- .../compiler/integers/u128/ternary.leo.out | 3 +-- .../compiler/integers/u16/add.leo.out | 2 +- .../integers/u16/console_assert.leo.out | 2 +- .../compiler/integers/u16/div.leo.out | 2 +- .../compiler/compiler/integers/u16/eq.leo.out | 2 +- .../compiler/compiler/integers/u16/ge.leo.out | 3 +-- .../compiler/compiler/integers/u16/gt.leo.out | 3 +-- .../compiler/compiler/integers/u16/le.leo.out | 3 +-- .../compiler/compiler/integers/u16/lt.leo.out | 3 +-- .../compiler/integers/u16/max.leo.out | 2 +- .../compiler/integers/u16/min.leo.out | 2 +- .../compiler/integers/u16/mul.leo.out | 2 +- .../compiler/compiler/integers/u16/ne.leo.out | 3 +-- .../compiler/integers/u16/pow.leo.out | 2 +- .../compiler/integers/u16/sub.leo.out | 2 +- .../compiler/integers/u16/ternary.leo.out | 3 +-- .../compiler/integers/u32/add.leo.out | 2 +- .../integers/u32/console_assert.leo.out | 2 +- .../compiler/integers/u32/div.leo.out | 2 +- .../compiler/compiler/integers/u32/eq.leo.out | 2 +- .../compiler/compiler/integers/u32/ge.leo.out | 3 +-- .../compiler/compiler/integers/u32/gt.leo.out | 3 +-- .../compiler/compiler/integers/u32/le.leo.out | 3 +-- .../compiler/compiler/integers/u32/lt.leo.out | 3 +-- .../compiler/integers/u32/max.leo.out | 2 +- .../compiler/integers/u32/min.leo.out | 2 +- .../compiler/integers/u32/mul.leo.out | 2 +- .../compiler/compiler/integers/u32/ne.leo.out | 3 +-- .../compiler/integers/u32/sub.leo.out | 2 +- .../compiler/integers/u32/ternary.leo.out | 3 +-- .../compiler/integers/u64/add.leo.out | 2 +- .../integers/u64/console_assert.leo.out | 2 +- .../compiler/integers/u64/div.leo.out | 2 +- .../compiler/compiler/integers/u64/eq.leo.out | 2 +- .../compiler/compiler/integers/u64/ge.leo.out | 3 +-- .../compiler/compiler/integers/u64/gt.leo.out | 3 +-- .../compiler/compiler/integers/u64/le.leo.out | 3 +-- .../compiler/compiler/integers/u64/lt.leo.out | 3 +-- .../compiler/integers/u64/max.leo.out | 2 +- .../compiler/integers/u64/min.leo.out | 2 +- .../compiler/integers/u64/mul.leo.out | 2 +- .../compiler/compiler/integers/u64/ne.leo.out | 3 +-- .../compiler/integers/u64/sub.leo.out | 2 +- .../compiler/integers/u64/ternary.leo.out | 3 +-- .../compiler/compiler/integers/u8/add.leo.out | 2 +- .../integers/u8/console_assert.leo.out | 2 +- .../compiler/compiler/integers/u8/div.leo.out | 2 +- .../compiler/compiler/integers/u8/eq.leo.out | 2 +- .../compiler/compiler/integers/u8/ge.leo.out | 3 +-- .../compiler/compiler/integers/u8/gt.leo.out | 3 +-- .../compiler/compiler/integers/u8/le.leo.out | 3 +-- .../compiler/compiler/integers/u8/lt.leo.out | 3 +-- .../compiler/compiler/integers/u8/max.leo.out | 2 +- .../compiler/compiler/integers/u8/min.leo.out | 2 +- .../compiler/compiler/integers/u8/mul.leo.out | 2 +- .../compiler/compiler/integers/u8/ne.leo.out | 3 +-- .../compiler/compiler/integers/u8/pow.leo.out | 2 +- .../compiler/compiler/integers/u8/sub.leo.out | 2 +- .../compiler/integers/u8/ternary.leo.out | 3 +-- .../compiler/mutability/cond_mut.leo.out | 2 +- .../mutability/function_input_mut.leo.out | 2 +- .../mutability/let_mut_nested.leo.out | 2 +- .../compiler/statements/chain.leo.out | 4 +--- .../statements/multiple_returns.leo.out | 3 +-- .../compiler/statements/mutate.leo.out | 3 +-- .../ternary_explicit_and_implicit.leo.out | 2 +- 187 files changed, 194 insertions(+), 286 deletions(-) diff --git a/compiler/compiler/src/test.rs b/compiler/compiler/src/test.rs index 1b2a56252d..9511e74e23 100644 --- a/compiler/compiler/src/test.rs +++ b/compiler/compiler/src/test.rs @@ -86,13 +86,13 @@ impl Namespace for CompileNamespace { #[derive(Deserialize, PartialEq, Serialize)] struct OutputItem { pub initial_input_ast: String, - pub symbol_table: String, } #[derive(Deserialize, PartialEq, Serialize)] struct CompileOutput { pub output: Vec, pub initial_ast: String, + pub symbol_table: String, } /// Get the path of the `input_file` given in `input` into `list`. @@ -126,12 +126,7 @@ fn collect_all_inputs(test: &Test) -> Result, String> { fn compile_and_process<'a>( parsed: &'a mut Compiler<'a>, - input_file_path: Option, -) -> Result, LeoError> { - if let Some(input_file_path) = input_file_path { - parsed.parse_input(input_file_path)?; - } - +) -> Result, LeoError> { parsed.compiler_stages() } @@ -187,7 +182,7 @@ fn run_test(test: Test, handler: &Handler, err_buf: &BufferEmitter) -> Result Result Result Date: Thu, 5 May 2022 15:38:55 -0700 Subject: [PATCH 12/16] re-introduce some disabled tests, fix some --- compiler/parser/src/parser/type_.rs | 1 + ...empty.leo => log_parameter_empty_fail.leo} | 0 ...l_none.leo => log_parameter_none_fail.leo} | 0 .../function/multiple_returns_fail.leo | 7 ++--- .../shadow_global_const_input_fail copy.leo | 1 - .../{negate_min.leo => negate_min_fail.leo} | 0 disabled_tests/compiler/integers/i32/max.leo | 10 ------- disabled_tests/compiler/integers/i32/min.leo | 10 ------- disabled_tests/compiler/integers/i32/mul.leo | 17 ----------- disabled_tests/compiler/integers/i32/ne.leo | 25 ---------------- .../compiler/integers/i32/negate.leo | 23 --------------- .../compiler/integers/i32/negate_zero.leo | 17 ----------- disabled_tests/compiler/integers/i32/pow.leo | 3 -- disabled_tests/compiler/integers/i32/sub.leo | 17 ----------- .../compiler/integers/i32/ternary.leo | 29 ------------------- .../compiler/integers/i8/negate_min.leo | 11 ++++--- .../compiler/mutability/let_mut_nested.leo | 12 -------- .../compiler/statements/all_loops.leo | 29 ------------------- .../statements/iteration_variable.leo | 16 ---------- tests/compiler/_group/add.leo | 3 -- tests/compiler/_group/assert_eq.leo | 3 -- tests/compiler/_group/both_sign_high.leo | 3 -- tests/compiler/_group/both_sign_inferred.leo | 3 -- tests/compiler/_group/both_sign_low.leo | 3 -- tests/compiler/_group/eq.leo | 3 -- tests/compiler/_group/input.leo | 3 -- tests/compiler/_group/input/valid.in | 3 -- tests/compiler/_group/negate.leo | 3 -- .../_group/no_space_between_literal.leo | 3 -- tests/compiler/_group/one.leo | 3 -- tests/compiler/_group/point.leo | 3 -- tests/compiler/_group/point_input.leo | 3 -- .../compiler/_group/positive_and_negative.leo | 10 ------- tests/compiler/_group/sub.leo | 3 -- tests/compiler/_group/ternary.leo | 5 ---- tests/compiler/_group/x_sign_high.leo | 3 -- tests/compiler/_group/x_sign_inferred.leo | 3 -- tests/compiler/_group/x_sign_low.leo | 3 -- tests/compiler/_group/y_sign_high.leo | 3 -- tests/compiler/_group/y_sign_inferred.leo | 3 -- tests/compiler/_group/y_sign_low.leo | 3 -- tests/compiler/_group/zero.leo | 3 -- tests/compiler/boolean/and.leo | 8 ++--- tests/compiler/boolean/conditional.leo | 8 ++--- tests/compiler/boolean/equal.leo | 8 ++--- .../boolean/{input => inputs}/false_false.in | 0 .../boolean/{input => inputs}/false_true.in | 0 .../boolean/{input => inputs}/true_false.in | 0 .../boolean/{input => inputs}/true_true.in | 0 tests/compiler/boolean/not_equal.leo | 8 ++--- tests/compiler/boolean/or.leo | 8 ++--- .../compiler/char/inputs/ascii.in | 0 .../compiler/char/inputs/escaped.in | 0 .../compiler/char/inputs/escaped_unicode1.in | 0 .../compiler/char/inputs/escaped_unicode2.in | 0 .../compiler/char/inputs/escaped_unicode3.in | 0 .../compiler/char/inputs/escaped_unicode4.in | 0 .../compiler/char/inputs/escaped_unicode5.in | 0 .../compiler/char/inputs/escaped_unicode6.in | 0 .../compiler/char/inputs/hex1.in | 0 .../compiler/char/inputs/hex2.in | 0 .../compiler/char/inputs/nonprinting.in | 0 .../compiler/char/inputs/unicode1.in | 0 .../compiler/char/inputs/unicode2.in | 0 .../compiler/char/inputs/unicode3.in | 0 .../compiler/char/inputs/unicode4.in | 0 .../compiler/char/inputs/unicode5.in | 0 .../compiler/char/invalid_char.leo | 0 .../compiler/char/neq.leo | 0 .../compiler/char/out.leo | 0 .../compiler/console/assert.leo | 8 +---- .../compiler/console/conditional_assert.leo | 14 ++++----- .../compiler/console/error.leo | 2 +- .../compiler/console/inputs}/dummy.in | 0 tests/compiler/console/inputs/false.in | 5 ++++ .../compiler/console/inputs}/input_equal.in | 4 +-- .../compiler/console/inputs}/input_unequal.in | 4 +-- tests/compiler/console/inputs/true.in | 5 ++++ .../compiler/console/log.leo | 2 +- .../compiler/console/log_conditional.leo | 4 +-- .../compiler/console/log_fail.leo | 0 .../compiler/console/log_input.leo | 2 +- .../compiler/console/log_parameter.leo | 2 +- .../compiler/console/log_parameter_many.leo | 2 +- .../console/log_parameter_unkown_fail.leo | 0 .../definition/{input => inputs}/dummy.in | 0 tests/compiler/definition/out_of_order.leo | 2 +- tests/compiler/field/output/register_one.out | 2 -- tests/compiler/field/output/register_zero.out | 2 -- .../compiler/function/conditional_return.leo | 2 +- .../function/duplicate_definition_fail.leo | 2 +- .../function/duplicate_parameter_fail.leo | 2 +- .../function/{input => inputs}/dummy.in | 0 .../function/{input => inputs}/integers.in | 0 tests/compiler/function/iteration.leo | 2 +- .../compiler/function/iteration_repeated.leo | 2 +- tests/compiler/function/repeated.leo | 2 +- tests/compiler/function/return.leo | 2 +- .../compiler/function/scope_fail.leo | 4 +-- .../shadow_function_with_input_fail.leo | 16 ++++++++++ tests/compiler/group/add.leo | 11 +++++++ tests/compiler/group/assert_eq.leo | 10 +++++++ tests/compiler/group/both_sign_high.leo | 9 ++++++ tests/compiler/group/both_sign_inferred.leo | 9 ++++++ tests/compiler/group/both_sign_low.leo | 9 ++++++ tests/compiler/group/eq.leo | 10 +++++++ tests/compiler/group/input.leo | 10 +++++++ tests/compiler/group/inputs/dummy.in | 6 ++++ tests/compiler/group/inputs/eq.in | 6 ++++ .../{_group/input => group/inputs}/invalid.in | 0 .../{_group/input => group/inputs}/point.in | 5 +++- tests/compiler/group/inputs/three.in | 7 +++++ tests/compiler/group/negate.leo | 11 +++++++ .../group/no_space_between_literal.leo | 9 ++++++ tests/compiler/group/one.leo | 10 +++++++ tests/compiler/group/point.leo | 10 +++++++ tests/compiler/group/point_input.leo | 9 ++++++ .../compiler/group/positive_and_negative.leo | 17 +++++++++++ tests/compiler/group/sub.leo | 11 +++++++ tests/compiler/group/ternary.leo | 11 +++++++ tests/compiler/{_group => group}/x_and_y.leo | 0 tests/compiler/group/x_sign_high.leo | 10 +++++++ tests/compiler/group/x_sign_inferred.leo | 10 +++++++ tests/compiler/group/x_sign_low.leo | 10 +++++++ tests/compiler/group/y_sign_high.leo | 10 +++++++ tests/compiler/group/y_sign_inferred.leo | 10 +++++++ tests/compiler/group/y_sign_low.leo | 10 +++++++ tests/compiler/group/zero.leo | 10 +++++++ .../const_input_non_const.in | 0 .../different_types_const_signed_fail.in | 0 .../different_types_const_unsigned_fail.in | 0 .../different_types_fail_signed.in | 0 .../different_types_unsigned_fail.in | 0 .../program_input/{input => inputs}/main.in | 0 .../{input => inputs}/main_array.in | 0 .../{input => inputs}/main_array_fail.in | 0 .../{input => inputs}/main_char.in | 0 .../{input => inputs}/main_fail_name.in | 0 .../{input => inputs}/main_fail_type.in | 0 .../{input => inputs}/main_field.in | 0 .../{input => inputs}/main_group.in | 0 .../main_multi_dimension_array.in | 0 .../{input => inputs}/main_multiple.in | 0 .../{input => inputs}/main_string.in | 0 .../{input => inputs}/main_tuple.in | 0 .../{input => inputs}/main_tuple_fail.in | 0 .../non_const_input_const.in | 0 .../input_files/program_input/main.leo | 2 +- .../input_files/program_input/main_field.leo | 2 +- .../input_files/program_input/main_group.leo | 2 +- .../{input => inputs}/main.in | 0 .../{input => inputs}/main_array.in | 0 .../{input => inputs}/main_array_fail.in | 0 .../{input => inputs}/main_char.in | 0 .../{input => inputs}/main_fail_name.in | 0 .../{input => inputs}/main_fail_type.in | 0 .../{input => inputs}/main_field.in | 0 .../{input => inputs}/main_group.in | 0 .../main_multi_dimension_array.in | 0 .../{input => inputs}/main_multiple.in | 0 .../{input => inputs}/main_string.in | 0 .../{input => inputs}/main_tuple.in | 0 .../{input => inputs}/main_tuple_fail.in | 0 .../program_input_constants/main.leo | 2 +- .../program_input_constants/main_field.leo | 2 +- .../program_input_constants/main_group.leo | 2 +- .../program_input_constants/main_multiple.leo | 2 +- tests/compiler/integers/i128/max.leo | 2 +- tests/compiler/integers/i128/max_fail.leo | 8 +++++ tests/compiler/integers/i128/min.leo | 2 +- tests/compiler/integers/i128/min_fail.leo | 8 +++++ tests/compiler/integers/i128/negate_min.leo | 11 +++++++ tests/compiler/integers/i128/negate_zero.leo | 2 +- tests/compiler/integers/i16/max.leo | 2 +- tests/compiler/integers/i16/max_fail.leo | 8 +++++ tests/compiler/integers/i16/min.leo | 2 +- tests/compiler/integers/i16/min_fail.leo | 8 +++++ .../compiler/integers/i16/negate_min_fail.leo | 11 +++++++ tests/compiler/integers/i16/negate_zero.leo | 2 +- tests/compiler/integers/i32/max.leo | 2 +- tests/compiler/integers/i32/max_fail.leo | 8 +++++ tests/compiler/integers/i32/min.leo | 2 +- tests/compiler/integers/i32/min_fail.leo | 8 +++++ tests/compiler/integers/i32/negate_min.leo | 11 +++++++ tests/compiler/integers/i32/negate_zero.leo | 2 +- tests/compiler/integers/i64/max.leo | 2 +- tests/compiler/integers/i64/max_fail.leo | 8 +++++ tests/compiler/integers/i64/min.leo | 2 +- tests/compiler/integers/i64/min_fail.leo | 8 +++++ tests/compiler/integers/i64/negate_min.leo | 11 +++++++ tests/compiler/integers/i64/negate_zero.leo | 2 +- tests/compiler/integers/i8/max.leo | 2 +- tests/compiler/integers/i8/max_fail.leo | 8 +++++ tests/compiler/integers/i8/min.leo | 2 +- tests/compiler/integers/i8/min_fail.leo | 8 +++++ tests/compiler/integers/i8/negate_min.leo | 12 ++++++++ tests/compiler/integers/i8/negate_zero.leo | 2 +- .../integers/{input => inputs}/dummy.in | 0 tests/compiler/integers/u128/max.leo | 2 +- tests/compiler/integers/u128/max_fail.leo | 8 +++++ tests/compiler/integers/u128/min.leo | 2 +- tests/compiler/integers/u128/min_fail.leo | 8 +++++ tests/compiler/integers/u16/max.leo | 2 +- tests/compiler/integers/u16/max_fail.leo | 8 +++++ tests/compiler/integers/u16/min.leo | 2 +- tests/compiler/integers/u16/min_fail.leo | 8 +++++ tests/compiler/integers/u32/max.leo | 2 +- tests/compiler/integers/u32/max_fail.leo | 8 +++++ tests/compiler/integers/u32/min.leo | 2 +- tests/compiler/integers/u32/min_fail.leo | 8 +++++ tests/compiler/integers/u64/max.leo | 2 +- tests/compiler/integers/u64/max_fail.leo | 8 +++++ tests/compiler/integers/u64/min.leo | 2 +- tests/compiler/integers/u64/min_fail.leo | 8 +++++ tests/compiler/integers/u8/max.leo | 2 +- tests/compiler/integers/u8/max_fail.leo | 8 +++++ tests/compiler/integers/u8/min.leo | 2 +- .../compiler/integers/u8/min_fail.leo | 2 +- tests/compiler/mutability/cond_mut.leo | 2 +- .../mutability/function_input_mut.leo | 2 +- .../mutability/{input => inputs}/dummy.in | 0 .../mutability/{input => inputs}/index1.in | 0 .../{input => inputs}/index1_tuple.in | 0 .../mutability/{input => inputs}/index2.in | 0 .../{input => inputs}/index2_tuple.in | 0 tests/compiler/mutability/let_mut_nested.leo | 2 +- tests/compiler/statements/all_loops.leo | 29 +++++++++++++++++++ .../compiler/statements/assign_ternary.leo | 2 +- .../compiler/statements/block.leo | 6 ++-- .../statements/duplicate_variable.leo | 4 +-- .../compiler/statements/for_loop.leo | 10 +++---- .../compiler/statements/iteration_basic.leo | 8 ++--- .../statements/iteration_variable.leo | 16 ++++++++++ .../compiler/char/invalid_char.leo.out | 5 ++++ .../compiler/compiler/char/neq.leo.out | 22 ++++++++++++++ .../compiler/compiler/char/out.leo.out | 22 ++++++++++++++ .../compiler/compiler/console/assert.leo.out | 8 +++++ .../console/conditional_assert.leo.out | 9 ++++++ .../compiler/compiler/console/error.leo.out | 8 +++++ .../compiler/compiler/console/log.leo.out | 8 +++++ .../compiler/console/log_conditional.leo.out | 9 ++++++ .../compiler/console/log_fail.leo.out | 5 ++++ .../compiler/console/log_input.leo.out | 8 +++++ .../compiler/console/log_parameter.leo.out | 8 +++++ .../log_parameter_fail_unknown.leo.out | 5 ++++ .../console/log_parameter_many.leo.out | 8 +++++ .../console/log_parameter_unkown_fail.leo.out | 5 ++++ .../compiler/function/scope_fail.leo.out | 5 ++++ .../shadow_function_with_input_fail.leo.out | 5 ++++ .../compiler/compiler/group/add.leo.out | 8 +++++ .../compiler/compiler/group/assert_eq.leo.out | 8 +++++ .../compiler/group/both_sign_high.leo.out | 8 +++++ .../compiler/group/both_sign_inferred.leo.out | 8 +++++ .../compiler/group/both_sign_low.leo.out | 8 +++++ .../compiler/compiler/group/eq.leo.out | 8 +++++ .../compiler/compiler/group/input.leo.out | 8 +++++ .../compiler/compiler/group/negate.leo.out | 8 +++++ .../group/no_space_between_literal.leo.out | 5 ++++ .../compiler/compiler/group/one.leo.out | 8 +++++ .../compiler/compiler/group/point.leo.out | 8 +++++ .../compiler/group/point_input.leo.out | 8 +++++ .../group/positive_and_negative.leo.out | 8 +++++ .../compiler/compiler/group/sub.leo.out | 8 +++++ .../compiler/compiler/group/ternary.leo.out | 8 +++++ .../compiler/group/x_sign_high.leo.out | 8 +++++ .../compiler/group/x_sign_inferred.leo.out | 8 +++++ .../compiler/group/x_sign_low.leo.out | 8 +++++ .../compiler/group/y_sign_high.leo.out | 8 +++++ .../compiler/group/y_sign_inferred.leo.out | 8 +++++ .../compiler/group/y_sign_low.leo.out | 8 +++++ .../compiler/compiler/group/zero.leo.out | 8 +++++ .../compiler/integers/i128/max_fail.leo.out | 5 ++++ .../compiler/integers/i128/min_fail.leo.out | 5 ++++ .../compiler/integers/i128/negate_min.leo.out | 8 +++++ .../compiler/integers/i16/max_fail.leo.out | 5 ++++ .../compiler/integers/i16/min_fail.leo.out | 5 ++++ .../compiler/integers/i16/negate_min.leo.out | 8 +++++ .../integers/i16/negate_min_fail.leo.out | 8 +++++ .../compiler/integers/i32/max_fail.leo.out | 5 ++++ .../compiler/integers/i32/min_fail.leo.out | 5 ++++ .../compiler/integers/i32/negate_min.leo.out | 8 +++++ .../compiler/integers/i64/max_fail.leo.out | 5 ++++ .../compiler/integers/i64/min_fail.leo.out | 5 ++++ .../compiler/integers/i64/negate_min.leo.out | 8 +++++ .../compiler/integers/i8/max_fail.leo.out | 5 ++++ .../compiler/integers/i8/min_fail.leo.out | 5 ++++ .../compiler/integers/i8/negate_min.leo.out | 8 +++++ .../compiler/integers/u128/max_fail.leo.out | 5 ++++ .../compiler/integers/u128/min_fail.leo.out | 5 ++++ .../compiler/integers/u16/max_fail.leo.out | 5 ++++ .../compiler/integers/u16/min_fail.leo.out | 5 ++++ .../compiler/integers/u32/max_fail.leo.out | 5 ++++ .../compiler/integers/u32/min_fail.leo.out | 5 ++++ .../compiler/integers/u64/max_fail.leo.out | 5 ++++ .../compiler/integers/u64/min_fail.leo.out | 5 ++++ .../compiler/integers/u8/max_fail.leo.out | 5 ++++ .../compiler/integers/u8/min_fail.leo.out | 5 ++++ .../compiler/statements/all_loops.leo.out | 8 +++++ .../statements/assign_ternary.leo.out | 5 ++++ .../compiler/statements/block.leo.out | 8 +++++ .../statements/duplicate_variable.leo.out | 5 ++++ .../compiler/statements/for_loop.leo.out | 8 +++++ .../statements/iteration_basic.leo.out | 8 +++++ .../statements/iteration_variable.leo.out | 8 +++++ 304 files changed, 1148 insertions(+), 408 deletions(-) rename disabled_tests/compiler/console/{log_parameter_fail_empty.leo => log_parameter_empty_fail.leo} (100%) rename disabled_tests/compiler/console/{log_parameter_fail_none.leo => log_parameter_none_fail.leo} (100%) rename disabled_tests/compiler/integers/i16/{negate_min.leo => negate_min_fail.leo} (100%) delete mode 100644 disabled_tests/compiler/integers/i32/max.leo delete mode 100644 disabled_tests/compiler/integers/i32/min.leo delete mode 100644 disabled_tests/compiler/integers/i32/mul.leo delete mode 100644 disabled_tests/compiler/integers/i32/ne.leo delete mode 100644 disabled_tests/compiler/integers/i32/negate.leo delete mode 100644 disabled_tests/compiler/integers/i32/negate_zero.leo delete mode 100644 disabled_tests/compiler/integers/i32/pow.leo delete mode 100644 disabled_tests/compiler/integers/i32/sub.leo delete mode 100644 disabled_tests/compiler/integers/i32/ternary.leo delete mode 100644 disabled_tests/compiler/mutability/let_mut_nested.leo delete mode 100644 disabled_tests/compiler/statements/all_loops.leo delete mode 100644 disabled_tests/compiler/statements/iteration_variable.leo delete mode 100644 tests/compiler/_group/add.leo delete mode 100644 tests/compiler/_group/assert_eq.leo delete mode 100644 tests/compiler/_group/both_sign_high.leo delete mode 100644 tests/compiler/_group/both_sign_inferred.leo delete mode 100644 tests/compiler/_group/both_sign_low.leo delete mode 100644 tests/compiler/_group/eq.leo delete mode 100644 tests/compiler/_group/input.leo delete mode 100644 tests/compiler/_group/input/valid.in delete mode 100644 tests/compiler/_group/negate.leo delete mode 100644 tests/compiler/_group/no_space_between_literal.leo delete mode 100644 tests/compiler/_group/one.leo delete mode 100644 tests/compiler/_group/point.leo delete mode 100644 tests/compiler/_group/point_input.leo delete mode 100644 tests/compiler/_group/positive_and_negative.leo delete mode 100644 tests/compiler/_group/sub.leo delete mode 100644 tests/compiler/_group/ternary.leo delete mode 100644 tests/compiler/_group/x_sign_high.leo delete mode 100644 tests/compiler/_group/x_sign_inferred.leo delete mode 100644 tests/compiler/_group/x_sign_low.leo delete mode 100644 tests/compiler/_group/y_sign_high.leo delete mode 100644 tests/compiler/_group/y_sign_inferred.leo delete mode 100644 tests/compiler/_group/y_sign_low.leo delete mode 100644 tests/compiler/_group/zero.leo rename tests/compiler/boolean/{input => inputs}/false_false.in (100%) rename tests/compiler/boolean/{input => inputs}/false_true.in (100%) rename tests/compiler/boolean/{input => inputs}/true_false.in (100%) rename tests/compiler/boolean/{input => inputs}/true_true.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/ascii.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/escaped.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/escaped_unicode1.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/escaped_unicode2.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/escaped_unicode3.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/escaped_unicode4.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/escaped_unicode5.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/escaped_unicode6.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/hex1.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/hex2.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/nonprinting.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/unicode1.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/unicode2.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/unicode3.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/unicode4.in (100%) rename {disabled_tests => tests}/compiler/char/inputs/unicode5.in (100%) rename {disabled_tests => tests}/compiler/char/invalid_char.leo (100%) rename {disabled_tests => tests}/compiler/char/neq.leo (100%) rename {disabled_tests => tests}/compiler/char/out.leo (100%) rename {disabled_tests => tests}/compiler/console/assert.leo (58%) rename {disabled_tests => tests}/compiler/console/conditional_assert.leo (53%) rename {disabled_tests => tests}/compiler/console/error.leo (82%) rename {disabled_tests/compiler/console/input => tests/compiler/console/inputs}/dummy.in (100%) create mode 100644 tests/compiler/console/inputs/false.in rename {disabled_tests/compiler/console/input => tests/compiler/console/inputs}/input_equal.in (55%) rename {disabled_tests/compiler/console/input => tests/compiler/console/inputs}/input_unequal.in (55%) create mode 100644 tests/compiler/console/inputs/true.in rename {disabled_tests => tests}/compiler/console/log.leo (82%) rename {disabled_tests => tests}/compiler/console/log_conditional.leo (84%) rename {disabled_tests => tests}/compiler/console/log_fail.leo (100%) rename {disabled_tests => tests}/compiler/console/log_input.leo (82%) rename {disabled_tests => tests}/compiler/console/log_parameter.leo (82%) rename {disabled_tests => tests}/compiler/console/log_parameter_many.leo (83%) rename disabled_tests/compiler/console/log_parameter_fail_unknown.leo => tests/compiler/console/log_parameter_unkown_fail.leo (100%) rename tests/compiler/definition/{input => inputs}/dummy.in (100%) delete mode 100644 tests/compiler/field/output/register_one.out delete mode 100644 tests/compiler/field/output/register_zero.out rename tests/compiler/function/{input => inputs}/dummy.in (100%) rename tests/compiler/function/{input => inputs}/integers.in (100%) rename {disabled_tests => tests}/compiler/function/scope_fail.leo (67%) create mode 100644 tests/compiler/function/shadow_function_with_input_fail.leo create mode 100644 tests/compiler/group/add.leo create mode 100644 tests/compiler/group/assert_eq.leo create mode 100644 tests/compiler/group/both_sign_high.leo create mode 100644 tests/compiler/group/both_sign_inferred.leo create mode 100644 tests/compiler/group/both_sign_low.leo create mode 100644 tests/compiler/group/eq.leo create mode 100644 tests/compiler/group/input.leo create mode 100644 tests/compiler/group/inputs/dummy.in create mode 100644 tests/compiler/group/inputs/eq.in rename tests/compiler/{_group/input => group/inputs}/invalid.in (100%) rename tests/compiler/{_group/input => group/inputs}/point.in (64%) create mode 100644 tests/compiler/group/inputs/three.in create mode 100644 tests/compiler/group/negate.leo create mode 100644 tests/compiler/group/no_space_between_literal.leo create mode 100644 tests/compiler/group/one.leo create mode 100644 tests/compiler/group/point.leo create mode 100644 tests/compiler/group/point_input.leo create mode 100644 tests/compiler/group/positive_and_negative.leo create mode 100644 tests/compiler/group/sub.leo create mode 100644 tests/compiler/group/ternary.leo rename tests/compiler/{_group => group}/x_and_y.leo (100%) create mode 100644 tests/compiler/group/x_sign_high.leo create mode 100644 tests/compiler/group/x_sign_inferred.leo create mode 100644 tests/compiler/group/x_sign_low.leo create mode 100644 tests/compiler/group/y_sign_high.leo create mode 100644 tests/compiler/group/y_sign_inferred.leo create mode 100644 tests/compiler/group/y_sign_low.leo create mode 100644 tests/compiler/group/zero.leo rename tests/compiler/input_files/program_input/{input => inputs}/const_input_non_const.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/different_types_const_signed_fail.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/different_types_const_unsigned_fail.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/different_types_fail_signed.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/different_types_unsigned_fail.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/main.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/main_array.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/main_array_fail.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/main_char.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/main_fail_name.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/main_fail_type.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/main_field.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/main_group.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/main_multi_dimension_array.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/main_multiple.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/main_string.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/main_tuple.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/main_tuple_fail.in (100%) rename tests/compiler/input_files/program_input/{input => inputs}/non_const_input_const.in (100%) rename tests/compiler/input_files/program_input_constants/{input => inputs}/main.in (100%) rename tests/compiler/input_files/program_input_constants/{input => inputs}/main_array.in (100%) rename tests/compiler/input_files/program_input_constants/{input => inputs}/main_array_fail.in (100%) rename tests/compiler/input_files/program_input_constants/{input => inputs}/main_char.in (100%) rename tests/compiler/input_files/program_input_constants/{input => inputs}/main_fail_name.in (100%) rename tests/compiler/input_files/program_input_constants/{input => inputs}/main_fail_type.in (100%) rename tests/compiler/input_files/program_input_constants/{input => inputs}/main_field.in (100%) rename tests/compiler/input_files/program_input_constants/{input => inputs}/main_group.in (100%) rename tests/compiler/input_files/program_input_constants/{input => inputs}/main_multi_dimension_array.in (100%) rename tests/compiler/input_files/program_input_constants/{input => inputs}/main_multiple.in (100%) rename tests/compiler/input_files/program_input_constants/{input => inputs}/main_string.in (100%) rename tests/compiler/input_files/program_input_constants/{input => inputs}/main_tuple.in (100%) rename tests/compiler/input_files/program_input_constants/{input => inputs}/main_tuple_fail.in (100%) create mode 100644 tests/compiler/integers/i128/max_fail.leo create mode 100644 tests/compiler/integers/i128/min_fail.leo create mode 100644 tests/compiler/integers/i128/negate_min.leo create mode 100644 tests/compiler/integers/i16/max_fail.leo create mode 100644 tests/compiler/integers/i16/min_fail.leo create mode 100644 tests/compiler/integers/i16/negate_min_fail.leo create mode 100644 tests/compiler/integers/i32/max_fail.leo create mode 100644 tests/compiler/integers/i32/min_fail.leo create mode 100644 tests/compiler/integers/i32/negate_min.leo create mode 100644 tests/compiler/integers/i64/max_fail.leo create mode 100644 tests/compiler/integers/i64/min_fail.leo create mode 100644 tests/compiler/integers/i64/negate_min.leo create mode 100644 tests/compiler/integers/i8/max_fail.leo create mode 100644 tests/compiler/integers/i8/min_fail.leo create mode 100644 tests/compiler/integers/i8/negate_min.leo rename tests/compiler/integers/{input => inputs}/dummy.in (100%) create mode 100644 tests/compiler/integers/u128/max_fail.leo create mode 100644 tests/compiler/integers/u128/min_fail.leo create mode 100644 tests/compiler/integers/u16/max_fail.leo create mode 100644 tests/compiler/integers/u16/min_fail.leo create mode 100644 tests/compiler/integers/u32/max_fail.leo create mode 100644 tests/compiler/integers/u32/min_fail.leo create mode 100644 tests/compiler/integers/u64/max_fail.leo create mode 100644 tests/compiler/integers/u64/min_fail.leo create mode 100644 tests/compiler/integers/u8/max_fail.leo rename disabled_tests/compiler/integers/i32/no_space_between_literal.leo => tests/compiler/integers/u8/min_fail.leo (72%) rename tests/compiler/mutability/{input => inputs}/dummy.in (100%) rename tests/compiler/mutability/{input => inputs}/index1.in (100%) rename tests/compiler/mutability/{input => inputs}/index1_tuple.in (100%) rename tests/compiler/mutability/{input => inputs}/index2.in (100%) rename tests/compiler/mutability/{input => inputs}/index2_tuple.in (100%) create mode 100644 tests/compiler/statements/all_loops.leo rename {disabled_tests => tests}/compiler/statements/assign_ternary.leo (74%) rename {disabled_tests => tests}/compiler/statements/block.leo (65%) rename {disabled_tests => tests}/compiler/statements/duplicate_variable.leo (75%) rename {disabled_tests => tests}/compiler/statements/for_loop.leo (50%) rename {disabled_tests => tests}/compiler/statements/iteration_basic.leo (55%) create mode 100644 tests/compiler/statements/iteration_variable.leo create mode 100644 tests/expectations/compiler/compiler/char/invalid_char.leo.out create mode 100644 tests/expectations/compiler/compiler/char/neq.leo.out create mode 100644 tests/expectations/compiler/compiler/char/out.leo.out create mode 100644 tests/expectations/compiler/compiler/console/assert.leo.out create mode 100644 tests/expectations/compiler/compiler/console/conditional_assert.leo.out create mode 100644 tests/expectations/compiler/compiler/console/error.leo.out create mode 100644 tests/expectations/compiler/compiler/console/log.leo.out create mode 100644 tests/expectations/compiler/compiler/console/log_conditional.leo.out create mode 100644 tests/expectations/compiler/compiler/console/log_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/console/log_input.leo.out create mode 100644 tests/expectations/compiler/compiler/console/log_parameter.leo.out create mode 100644 tests/expectations/compiler/compiler/console/log_parameter_fail_unknown.leo.out create mode 100644 tests/expectations/compiler/compiler/console/log_parameter_many.leo.out create mode 100644 tests/expectations/compiler/compiler/console/log_parameter_unkown_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/function/scope_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/function/shadow_function_with_input_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/group/add.leo.out create mode 100644 tests/expectations/compiler/compiler/group/assert_eq.leo.out create mode 100644 tests/expectations/compiler/compiler/group/both_sign_high.leo.out create mode 100644 tests/expectations/compiler/compiler/group/both_sign_inferred.leo.out create mode 100644 tests/expectations/compiler/compiler/group/both_sign_low.leo.out create mode 100644 tests/expectations/compiler/compiler/group/eq.leo.out create mode 100644 tests/expectations/compiler/compiler/group/input.leo.out create mode 100644 tests/expectations/compiler/compiler/group/negate.leo.out create mode 100644 tests/expectations/compiler/compiler/group/no_space_between_literal.leo.out create mode 100644 tests/expectations/compiler/compiler/group/one.leo.out create mode 100644 tests/expectations/compiler/compiler/group/point.leo.out create mode 100644 tests/expectations/compiler/compiler/group/point_input.leo.out create mode 100644 tests/expectations/compiler/compiler/group/positive_and_negative.leo.out create mode 100644 tests/expectations/compiler/compiler/group/sub.leo.out create mode 100644 tests/expectations/compiler/compiler/group/ternary.leo.out create mode 100644 tests/expectations/compiler/compiler/group/x_sign_high.leo.out create mode 100644 tests/expectations/compiler/compiler/group/x_sign_inferred.leo.out create mode 100644 tests/expectations/compiler/compiler/group/x_sign_low.leo.out create mode 100644 tests/expectations/compiler/compiler/group/y_sign_high.leo.out create mode 100644 tests/expectations/compiler/compiler/group/y_sign_inferred.leo.out create mode 100644 tests/expectations/compiler/compiler/group/y_sign_low.leo.out create mode 100644 tests/expectations/compiler/compiler/group/zero.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i128/max_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i128/min_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i128/negate_min.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i16/max_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i16/min_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i16/negate_min.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i16/negate_min_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i32/max_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i32/min_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i32/negate_min.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i64/max_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i64/min_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i64/negate_min.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i8/max_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i8/min_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/i8/negate_min.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/u128/max_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/u128/min_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/u16/max_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/u16/min_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/u32/max_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/u32/min_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/u64/max_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/u64/min_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/u8/max_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/integers/u8/min_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/statements/all_loops.leo.out create mode 100644 tests/expectations/compiler/compiler/statements/assign_ternary.leo.out create mode 100644 tests/expectations/compiler/compiler/statements/block.leo.out create mode 100644 tests/expectations/compiler/compiler/statements/duplicate_variable.leo.out create mode 100644 tests/expectations/compiler/compiler/statements/for_loop.leo.out create mode 100644 tests/expectations/compiler/compiler/statements/iteration_basic.leo.out create mode 100644 tests/expectations/compiler/compiler/statements/iteration_variable.leo.out diff --git a/compiler/parser/src/parser/type_.rs b/compiler/parser/src/parser/type_.rs index 08ed2e336b..552efe421b 100644 --- a/compiler/parser/src/parser/type_.rs +++ b/compiler/parser/src/parser/type_.rs @@ -32,6 +32,7 @@ pub(crate) const TYPE_TOKENS: &[Token] = &[ Token::Group, Token::Address, Token::Bool, + Token::Char, ]; impl ParserContext<'_> { diff --git a/disabled_tests/compiler/console/log_parameter_fail_empty.leo b/disabled_tests/compiler/console/log_parameter_empty_fail.leo similarity index 100% rename from disabled_tests/compiler/console/log_parameter_fail_empty.leo rename to disabled_tests/compiler/console/log_parameter_empty_fail.leo diff --git a/disabled_tests/compiler/console/log_parameter_fail_none.leo b/disabled_tests/compiler/console/log_parameter_none_fail.leo similarity index 100% rename from disabled_tests/compiler/console/log_parameter_fail_none.leo rename to disabled_tests/compiler/console/log_parameter_none_fail.leo diff --git a/disabled_tests/compiler/function/multiple_returns_fail.leo b/disabled_tests/compiler/function/multiple_returns_fail.leo index ea4f5de447..2f956ea1d1 100644 --- a/disabled_tests/compiler/function/multiple_returns_fail.leo +++ b/disabled_tests/compiler/function/multiple_returns_fail.leo @@ -5,9 +5,6 @@ input_file: input/dummy.in */ function main() -> i8 { - if true { - return 1i8; //ignored - } - return 2i8; //ignored - return 3i8; //returns + return 2i8; + return 3i8; } diff --git a/disabled_tests/compiler/function/shadow_global_const_input_fail copy.leo b/disabled_tests/compiler/function/shadow_global_const_input_fail copy.leo index c07c729b2a..288c4ba829 100644 --- a/disabled_tests/compiler/function/shadow_global_const_input_fail copy.leo +++ b/disabled_tests/compiler/function/shadow_global_const_input_fail copy.leo @@ -1,7 +1,6 @@ /* namespace: Compile expectation: Fail -input_file: input/dummy.in */ const hi = 1u32; diff --git a/disabled_tests/compiler/integers/i16/negate_min.leo b/disabled_tests/compiler/integers/i16/negate_min_fail.leo similarity index 100% rename from disabled_tests/compiler/integers/i16/negate_min.leo rename to disabled_tests/compiler/integers/i16/negate_min_fail.leo diff --git a/disabled_tests/compiler/integers/i32/max.leo b/disabled_tests/compiler/integers/i32/max.leo deleted file mode 100644 index a0a9b81009..0000000000 --- a/disabled_tests/compiler/integers/i32/max.leo +++ /dev/null @@ -1,10 +0,0 @@ -/* -namespace: Compile -expectation: Pass -input_file: ../input/dummy.in -*/ - -function main(y: bool) -> bool { - const a: i32 = 2147483647; - return y == true; -} diff --git a/disabled_tests/compiler/integers/i32/min.leo b/disabled_tests/compiler/integers/i32/min.leo deleted file mode 100644 index a8ba83186c..0000000000 --- a/disabled_tests/compiler/integers/i32/min.leo +++ /dev/null @@ -1,10 +0,0 @@ -/* -namespace: Compile -expectation: Pass -input_file: ../input/dummy.in -*/ - -function main(y: bool) -> bool { - const a: i32 = -2147483648; - return y == true; -} diff --git a/disabled_tests/compiler/integers/i32/mul.leo b/disabled_tests/compiler/integers/i32/mul.leo deleted file mode 100644 index ce66848f09..0000000000 --- a/disabled_tests/compiler/integers/i32/mul.leo +++ /dev/null @@ -1,17 +0,0 @@ -/* -namespace: Compile -expectation: Pass -inputs: - - i32.in: | - [main] - a: i32 = 2; - b: i32 = 5; - c: i32 = 10; - - [registers] - r0: bool = false; -*/ - -function main(a: i32, b: i32, c: i32) -> bool { - return a * b == c; -} diff --git a/disabled_tests/compiler/integers/i32/ne.leo b/disabled_tests/compiler/integers/i32/ne.leo deleted file mode 100644 index 502ca22281..0000000000 --- a/disabled_tests/compiler/integers/i32/ne.leo +++ /dev/null @@ -1,25 +0,0 @@ -/* -namespace: Compile -expectation: Pass -inputs: - - i32_ne.in: | - [main] - a: i32 = 2; - b: i32 = 5; - c: bool = true; - - [registers] - r0: bool = false; - - i32_e.in: | - [main] - a: i32 = 5; - b: i32 = 5; - c: bool = false; - - [registers] - r0: bool = false; -*/ - -function main(a: i32, b: i32, c: bool) -> bool{ - return (a != b) == c; -} diff --git a/disabled_tests/compiler/integers/i32/negate.leo b/disabled_tests/compiler/integers/i32/negate.leo deleted file mode 100644 index 2aee276336..0000000000 --- a/disabled_tests/compiler/integers/i32/negate.leo +++ /dev/null @@ -1,23 +0,0 @@ -/* -namespace: Compile -expectation: Pass -inputs: - - i32.in: | - [main] - a: i32 = 5; - b: i32 = -5; - - [registers] - r0: bool = false; - - i32.in: | - [main] - a: i32 = -5; - b: i32 = 5; - - [registers] - r0: bool = false; -*/ - -function main(a: i32, b: i32) -> bool { - return -a == b; -} diff --git a/disabled_tests/compiler/integers/i32/negate_zero.leo b/disabled_tests/compiler/integers/i32/negate_zero.leo deleted file mode 100644 index fe9084ea56..0000000000 --- a/disabled_tests/compiler/integers/i32/negate_zero.leo +++ /dev/null @@ -1,17 +0,0 @@ -/* -namespace: Compile -expectation: Pass -inputs: - - dummy.in: | - [main] - y: bool = true; - - [registers] - r0: bool = false; -*/ - -function main(y: bool) -> bool { - const a = 0i32; - - return (-a == 0i32) == y; -} diff --git a/disabled_tests/compiler/integers/i32/pow.leo b/disabled_tests/compiler/integers/i32/pow.leo deleted file mode 100644 index 2db0063b3d..0000000000 --- a/disabled_tests/compiler/integers/i32/pow.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i32, b: i32, c: i32) -> bool { - return a ** b == c; -} diff --git a/disabled_tests/compiler/integers/i32/sub.leo b/disabled_tests/compiler/integers/i32/sub.leo deleted file mode 100644 index cf554eba72..0000000000 --- a/disabled_tests/compiler/integers/i32/sub.leo +++ /dev/null @@ -1,17 +0,0 @@ -/* -namespace: Compile -expectation: Pass -inputs: - - i32.in: | - [main] - a: i32 = 100; - b: i32 = 50; - c: i32 = 50; - - [registers] - r0: bool = false; -*/ - -function main(a: i32, b: i32, c: i32) -> bool { - return a - b == c; -} diff --git a/disabled_tests/compiler/integers/i32/ternary.leo b/disabled_tests/compiler/integers/i32/ternary.leo deleted file mode 100644 index bbbb2ac2db..0000000000 --- a/disabled_tests/compiler/integers/i32/ternary.leo +++ /dev/null @@ -1,29 +0,0 @@ -/* -namespace: Compile -expectation: Pass -inputs: - - i32.in: | - [main] - s: bool = true; - a: i32 = 10; - b: i32 = 5; - c: i32 = 10; - - [registers] - r0: bool = false; - - i32_rev.in: | - [main] - s: bool = false; - a: i32 = 10; - b: i32 = 5; - c: i32 = 5; - - [registers] - r0: bool = false; -*/ - -function main(s: bool, a: i32, b: i32, c: i32) -> bool { - let r = s ? a : b; - - return r == c; -} diff --git a/disabled_tests/compiler/integers/i8/negate_min.leo b/disabled_tests/compiler/integers/i8/negate_min.leo index 5ec07974bd..4e85c5d49c 100644 --- a/disabled_tests/compiler/integers/i8/negate_min.leo +++ b/disabled_tests/compiler/integers/i8/negate_min.leo @@ -1,9 +1,12 @@ /* namespace: Compile -expectation: Fail +expectation: Pass +input_file: ../input/dummy.in */ -function main() { - const a = -128i8; - const b = -a; +function main(y: bool) -> bool { + const a: = -128i8; + const b: = -a; + + return (b == -a) == y; } diff --git a/disabled_tests/compiler/mutability/let_mut_nested.leo b/disabled_tests/compiler/mutability/let_mut_nested.leo deleted file mode 100644 index 98d1293211..0000000000 --- a/disabled_tests/compiler/mutability/let_mut_nested.leo +++ /dev/null @@ -1,12 +0,0 @@ -/* -namespace: Compile -expectation: Pass -input_file: input/dummy.in -*/ - -function main(a: bool) -> bool { - let x = 2u8; - let y = x; - let z = y / 2u8; - return (z == 1) == a; -} diff --git a/disabled_tests/compiler/statements/all_loops.leo b/disabled_tests/compiler/statements/all_loops.leo deleted file mode 100644 index d8128513d5..0000000000 --- a/disabled_tests/compiler/statements/all_loops.leo +++ /dev/null @@ -1,29 +0,0 @@ -/* -namespace: Compile -expectation: Pass -input_file: inputs/dummy.in -*/ - -function main(k: bool) -> bool { - let reverse: u32 = 0; - for i in 9..0 { - reverse += i; - } - - let forward: u32 = 0; - for x in 0..10 { - forward += x; - } - - let reverse_inclusive: u32 = 0; - for a in 10..=0 { - reverse_inclusive += a; - } - - let forward_inclusive: u32 = 0; - for b in 0..=10 { - forward_inclusive += b; - } - - return (reverse == forward) && (reverse_inclusive == forward_inclusive) && k; -} \ No newline at end of file diff --git a/disabled_tests/compiler/statements/iteration_variable.leo b/disabled_tests/compiler/statements/iteration_variable.leo deleted file mode 100644 index 1726525f91..0000000000 --- a/disabled_tests/compiler/statements/iteration_variable.leo +++ /dev/null @@ -1,16 +0,0 @@ -/* -namespace: Compile -expectation: Pass -input_file: inputs/u32_3.in -*/ - -function main(x: u32) -> bool { - const COUNT: u32 = 2; - let y = x; - - for i in 0..COUNT { - y -= 1; - } - - return y == 1; -} diff --git a/tests/compiler/_group/add.leo b/tests/compiler/_group/add.leo deleted file mode 100644 index bb84df2d6c..0000000000 --- a/tests/compiler/_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/compiler/_group/assert_eq.leo b/tests/compiler/_group/assert_eq.leo deleted file mode 100644 index 3886a07bbf..0000000000 --- a/tests/compiler/_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/compiler/_group/both_sign_high.leo b/tests/compiler/_group/both_sign_high.leo deleted file mode 100644 index 4c93573e1e..0000000000 --- a/tests/compiler/_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/compiler/_group/both_sign_inferred.leo b/tests/compiler/_group/both_sign_inferred.leo deleted file mode 100644 index 0bbd360ba0..0000000000 --- a/tests/compiler/_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/compiler/_group/both_sign_low.leo b/tests/compiler/_group/both_sign_low.leo deleted file mode 100644 index 1cb4f46c55..0000000000 --- a/tests/compiler/_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/compiler/_group/eq.leo b/tests/compiler/_group/eq.leo deleted file mode 100644 index 09f6210ac3..0000000000 --- a/tests/compiler/_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/compiler/_group/input.leo b/tests/compiler/_group/input.leo deleted file mode 100644 index 3886a07bbf..0000000000 --- a/tests/compiler/_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/compiler/_group/input/valid.in b/tests/compiler/_group/input/valid.in deleted file mode 100644 index 651a28bea6..0000000000 --- a/tests/compiler/_group/input/valid.in +++ /dev/null @@ -1,3 +0,0 @@ -[main] -a: group = (0, -)group; -b: group = (0, _)group; diff --git a/tests/compiler/_group/negate.leo b/tests/compiler/_group/negate.leo deleted file mode 100644 index 506d8d73ce..0000000000 --- a/tests/compiler/_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/compiler/_group/no_space_between_literal.leo b/tests/compiler/_group/no_space_between_literal.leo deleted file mode 100644 index af53e5dffe..0000000000 --- a/tests/compiler/_group/no_space_between_literal.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const g = (0,1) group; -} \ No newline at end of file diff --git a/tests/compiler/_group/one.leo b/tests/compiler/_group/one.leo deleted file mode 100644 index 510110150b..0000000000 --- a/tests/compiler/_group/one.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const element = 1group; -} \ No newline at end of file diff --git a/tests/compiler/_group/point.leo b/tests/compiler/_group/point.leo deleted file mode 100644 index 5e68415a0d..0000000000 --- a/tests/compiler/_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/compiler/_group/point_input.leo b/tests/compiler/_group/point_input.leo deleted file mode 100644 index a3a8e63bd3..0000000000 --- a/tests/compiler/_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/compiler/_group/positive_and_negative.leo b/tests/compiler/_group/positive_and_negative.leo deleted file mode 100644 index 5d29e36ef2..0000000000 --- a/tests/compiler/_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/compiler/_group/sub.leo b/tests/compiler/_group/sub.leo deleted file mode 100644 index dfe82d8e31..0000000000 --- a/tests/compiler/_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/compiler/_group/ternary.leo b/tests/compiler/_group/ternary.leo deleted file mode 100644 index 97fba1f5b6..0000000000 --- a/tests/compiler/_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/compiler/_group/x_sign_high.leo b/tests/compiler/_group/x_sign_high.leo deleted file mode 100644 index f38b54ad9a..0000000000 --- a/tests/compiler/_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/compiler/_group/x_sign_inferred.leo b/tests/compiler/_group/x_sign_inferred.leo deleted file mode 100644 index 02c5ac988b..0000000000 --- a/tests/compiler/_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/compiler/_group/x_sign_low.leo b/tests/compiler/_group/x_sign_low.leo deleted file mode 100644 index ad74d18b64..0000000000 --- a/tests/compiler/_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/compiler/_group/y_sign_high.leo b/tests/compiler/_group/y_sign_high.leo deleted file mode 100644 index af2a20149d..0000000000 --- a/tests/compiler/_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/compiler/_group/y_sign_inferred.leo b/tests/compiler/_group/y_sign_inferred.leo deleted file mode 100644 index a4efa6a982..0000000000 --- a/tests/compiler/_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/compiler/_group/y_sign_low.leo b/tests/compiler/_group/y_sign_low.leo deleted file mode 100644 index f557ed0d35..0000000000 --- a/tests/compiler/_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/compiler/_group/zero.leo b/tests/compiler/_group/zero.leo deleted file mode 100644 index 6cdd4c960e..0000000000 --- a/tests/compiler/_group/zero.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main() { - const element = 0group; -} \ No newline at end of file diff --git a/tests/compiler/boolean/and.leo b/tests/compiler/boolean/and.leo index 738d413251..b109ac8781 100644 --- a/tests/compiler/boolean/and.leo +++ b/tests/compiler/boolean/and.leo @@ -2,10 +2,10 @@ namespace: Compile expectation: Pass input_file: - - input/false_false.in - - input/false_true.in - - input/true_false.in - - input/true_true.in + - inputs/false_false.in + - inputs/false_true.in + - inputs/true_false.in + - inputs/true_true.in */ function main(a: bool, b: bool) -> bool { diff --git a/tests/compiler/boolean/conditional.leo b/tests/compiler/boolean/conditional.leo index c1e9d23606..a5bd201b74 100644 --- a/tests/compiler/boolean/conditional.leo +++ b/tests/compiler/boolean/conditional.leo @@ -2,10 +2,10 @@ namespace: Compile expectation: Pass input_file: - - input/false_false.in - - input/false_true.in - - input/true_false.in - - input/true_true.in + - inputs/false_false.in + - inputs/false_true.in + - inputs/true_false.in + - inputs/true_true.in */ function main(a: bool, b: bool) -> bool { diff --git a/tests/compiler/boolean/equal.leo b/tests/compiler/boolean/equal.leo index f31f34de9b..39531dd5d6 100644 --- a/tests/compiler/boolean/equal.leo +++ b/tests/compiler/boolean/equal.leo @@ -2,10 +2,10 @@ namespace: Compile expectation: Pass input_file: - - input/false_false.in - - input/false_true.in - - input/true_false.in - - input/true_true.in + - inputs/false_false.in + - inputs/false_true.in + - inputs/true_false.in + - inputs/true_true.in */ function main(a: bool, b: bool) -> bool { diff --git a/tests/compiler/boolean/input/false_false.in b/tests/compiler/boolean/inputs/false_false.in similarity index 100% rename from tests/compiler/boolean/input/false_false.in rename to tests/compiler/boolean/inputs/false_false.in diff --git a/tests/compiler/boolean/input/false_true.in b/tests/compiler/boolean/inputs/false_true.in similarity index 100% rename from tests/compiler/boolean/input/false_true.in rename to tests/compiler/boolean/inputs/false_true.in diff --git a/tests/compiler/boolean/input/true_false.in b/tests/compiler/boolean/inputs/true_false.in similarity index 100% rename from tests/compiler/boolean/input/true_false.in rename to tests/compiler/boolean/inputs/true_false.in diff --git a/tests/compiler/boolean/input/true_true.in b/tests/compiler/boolean/inputs/true_true.in similarity index 100% rename from tests/compiler/boolean/input/true_true.in rename to tests/compiler/boolean/inputs/true_true.in diff --git a/tests/compiler/boolean/not_equal.leo b/tests/compiler/boolean/not_equal.leo index 62a1bef945..c0c970fa10 100644 --- a/tests/compiler/boolean/not_equal.leo +++ b/tests/compiler/boolean/not_equal.leo @@ -2,10 +2,10 @@ namespace: Compile expectation: Pass input_file: - - input/false_false.in - - input/false_true.in - - input/true_false.in - - input/true_true.in + - inputs/false_false.in + - inputs/false_true.in + - inputs/true_false.in + - inputs/true_true.in */ function main(a: bool, b: bool) -> bool { diff --git a/tests/compiler/boolean/or.leo b/tests/compiler/boolean/or.leo index 59488b6d98..05dd9325aa 100644 --- a/tests/compiler/boolean/or.leo +++ b/tests/compiler/boolean/or.leo @@ -2,10 +2,10 @@ namespace: Compile expectation: Pass input_file: - - input/false_false.in - - input/false_true.in - - input/true_false.in - - input/true_true.in + - inputs/false_false.in + - inputs/false_true.in + - inputs/true_false.in + - inputs/true_true.in */ function main(a: bool, b: bool) -> bool { diff --git a/disabled_tests/compiler/char/inputs/ascii.in b/tests/compiler/char/inputs/ascii.in similarity index 100% rename from disabled_tests/compiler/char/inputs/ascii.in rename to tests/compiler/char/inputs/ascii.in diff --git a/disabled_tests/compiler/char/inputs/escaped.in b/tests/compiler/char/inputs/escaped.in similarity index 100% rename from disabled_tests/compiler/char/inputs/escaped.in rename to tests/compiler/char/inputs/escaped.in diff --git a/disabled_tests/compiler/char/inputs/escaped_unicode1.in b/tests/compiler/char/inputs/escaped_unicode1.in similarity index 100% rename from disabled_tests/compiler/char/inputs/escaped_unicode1.in rename to tests/compiler/char/inputs/escaped_unicode1.in diff --git a/disabled_tests/compiler/char/inputs/escaped_unicode2.in b/tests/compiler/char/inputs/escaped_unicode2.in similarity index 100% rename from disabled_tests/compiler/char/inputs/escaped_unicode2.in rename to tests/compiler/char/inputs/escaped_unicode2.in diff --git a/disabled_tests/compiler/char/inputs/escaped_unicode3.in b/tests/compiler/char/inputs/escaped_unicode3.in similarity index 100% rename from disabled_tests/compiler/char/inputs/escaped_unicode3.in rename to tests/compiler/char/inputs/escaped_unicode3.in diff --git a/disabled_tests/compiler/char/inputs/escaped_unicode4.in b/tests/compiler/char/inputs/escaped_unicode4.in similarity index 100% rename from disabled_tests/compiler/char/inputs/escaped_unicode4.in rename to tests/compiler/char/inputs/escaped_unicode4.in diff --git a/disabled_tests/compiler/char/inputs/escaped_unicode5.in b/tests/compiler/char/inputs/escaped_unicode5.in similarity index 100% rename from disabled_tests/compiler/char/inputs/escaped_unicode5.in rename to tests/compiler/char/inputs/escaped_unicode5.in diff --git a/disabled_tests/compiler/char/inputs/escaped_unicode6.in b/tests/compiler/char/inputs/escaped_unicode6.in similarity index 100% rename from disabled_tests/compiler/char/inputs/escaped_unicode6.in rename to tests/compiler/char/inputs/escaped_unicode6.in diff --git a/disabled_tests/compiler/char/inputs/hex1.in b/tests/compiler/char/inputs/hex1.in similarity index 100% rename from disabled_tests/compiler/char/inputs/hex1.in rename to tests/compiler/char/inputs/hex1.in diff --git a/disabled_tests/compiler/char/inputs/hex2.in b/tests/compiler/char/inputs/hex2.in similarity index 100% rename from disabled_tests/compiler/char/inputs/hex2.in rename to tests/compiler/char/inputs/hex2.in diff --git a/disabled_tests/compiler/char/inputs/nonprinting.in b/tests/compiler/char/inputs/nonprinting.in similarity index 100% rename from disabled_tests/compiler/char/inputs/nonprinting.in rename to tests/compiler/char/inputs/nonprinting.in diff --git a/disabled_tests/compiler/char/inputs/unicode1.in b/tests/compiler/char/inputs/unicode1.in similarity index 100% rename from disabled_tests/compiler/char/inputs/unicode1.in rename to tests/compiler/char/inputs/unicode1.in diff --git a/disabled_tests/compiler/char/inputs/unicode2.in b/tests/compiler/char/inputs/unicode2.in similarity index 100% rename from disabled_tests/compiler/char/inputs/unicode2.in rename to tests/compiler/char/inputs/unicode2.in diff --git a/disabled_tests/compiler/char/inputs/unicode3.in b/tests/compiler/char/inputs/unicode3.in similarity index 100% rename from disabled_tests/compiler/char/inputs/unicode3.in rename to tests/compiler/char/inputs/unicode3.in diff --git a/disabled_tests/compiler/char/inputs/unicode4.in b/tests/compiler/char/inputs/unicode4.in similarity index 100% rename from disabled_tests/compiler/char/inputs/unicode4.in rename to tests/compiler/char/inputs/unicode4.in diff --git a/disabled_tests/compiler/char/inputs/unicode5.in b/tests/compiler/char/inputs/unicode5.in similarity index 100% rename from disabled_tests/compiler/char/inputs/unicode5.in rename to tests/compiler/char/inputs/unicode5.in diff --git a/disabled_tests/compiler/char/invalid_char.leo b/tests/compiler/char/invalid_char.leo similarity index 100% rename from disabled_tests/compiler/char/invalid_char.leo rename to tests/compiler/char/invalid_char.leo diff --git a/disabled_tests/compiler/char/neq.leo b/tests/compiler/char/neq.leo similarity index 100% rename from disabled_tests/compiler/char/neq.leo rename to tests/compiler/char/neq.leo diff --git a/disabled_tests/compiler/char/out.leo b/tests/compiler/char/out.leo similarity index 100% rename from disabled_tests/compiler/char/out.leo rename to tests/compiler/char/out.leo diff --git a/disabled_tests/compiler/console/assert.leo b/tests/compiler/console/assert.leo similarity index 58% rename from disabled_tests/compiler/console/assert.leo rename to tests/compiler/console/assert.leo index 870ca70b18..39d478c8b8 100644 --- a/disabled_tests/compiler/console/assert.leo +++ b/tests/compiler/console/assert.leo @@ -1,13 +1,7 @@ /* namespace: Compile expectation: Pass -inputs: - - assert.in: | - [main] - a: bool = true; - - [registers] - r0: bool = false; +input_file: inputs/true.in */ function main(a: bool) -> bool { diff --git a/disabled_tests/compiler/console/conditional_assert.leo b/tests/compiler/console/conditional_assert.leo similarity index 53% rename from disabled_tests/compiler/console/conditional_assert.leo rename to tests/compiler/console/conditional_assert.leo index 71bf6ae5ee..2985e81164 100644 --- a/disabled_tests/compiler/console/conditional_assert.leo +++ b/tests/compiler/console/conditional_assert.leo @@ -1,19 +1,17 @@ /* namespace: Compile expectation: Pass -inputs: - - cond.in: | - [main] - a: bool = true; - - cond_2.in: | - [main] - a: bool = false; +input_file: + - inputs/true.in + - inputs/false.in */ -function main(a: bool) { +function main(a: bool) -> bool { if a { console.assert(a == true); } else { console.assert(a == false); } + + return a; } \ No newline at end of file diff --git a/disabled_tests/compiler/console/error.leo b/tests/compiler/console/error.leo similarity index 82% rename from disabled_tests/compiler/console/error.leo rename to tests/compiler/console/error.leo index a2db2fc013..5725b6d16e 100644 --- a/disabled_tests/compiler/console/error.leo +++ b/tests/compiler/console/error.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/dummy.in +input_file: inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/disabled_tests/compiler/console/input/dummy.in b/tests/compiler/console/inputs/dummy.in similarity index 100% rename from disabled_tests/compiler/console/input/dummy.in rename to tests/compiler/console/inputs/dummy.in diff --git a/tests/compiler/console/inputs/false.in b/tests/compiler/console/inputs/false.in new file mode 100644 index 0000000000..c4c35b98a9 --- /dev/null +++ b/tests/compiler/console/inputs/false.in @@ -0,0 +1,5 @@ +[main] +a: bool = false; + +[registers] +r0: bool = false; \ No newline at end of file diff --git a/disabled_tests/compiler/console/input/input_equal.in b/tests/compiler/console/inputs/input_equal.in similarity index 55% rename from disabled_tests/compiler/console/input/input_equal.in rename to tests/compiler/console/inputs/input_equal.in index b9f602b338..8e08698ed1 100644 --- a/disabled_tests/compiler/console/input/input_equal.in +++ b/tests/compiler/console/inputs/input_equal.in @@ -1,6 +1,6 @@ [main] -a: u32 = 1; -b: u32 = 1; +a: u32 = 1u32; +b: u32 = 1u32; [registers] r0: bool = true; diff --git a/disabled_tests/compiler/console/input/input_unequal.in b/tests/compiler/console/inputs/input_unequal.in similarity index 55% rename from disabled_tests/compiler/console/input/input_unequal.in rename to tests/compiler/console/inputs/input_unequal.in index 3320fc7439..17b72b948a 100644 --- a/disabled_tests/compiler/console/input/input_unequal.in +++ b/tests/compiler/console/inputs/input_unequal.in @@ -1,6 +1,6 @@ [main] -a: u32 = 1; -b: u32 = 0; +a: u32 = 1u32; +b: u32 = 0u32; [registers] r0: bool = true; diff --git a/tests/compiler/console/inputs/true.in b/tests/compiler/console/inputs/true.in new file mode 100644 index 0000000000..0a23cb7755 --- /dev/null +++ b/tests/compiler/console/inputs/true.in @@ -0,0 +1,5 @@ +[main] +a: bool = true; + +[registers] +r0: bool = false; \ No newline at end of file diff --git a/disabled_tests/compiler/console/log.leo b/tests/compiler/console/log.leo similarity index 82% rename from disabled_tests/compiler/console/log.leo rename to tests/compiler/console/log.leo index 93b96ca095..1264df33cd 100644 --- a/disabled_tests/compiler/console/log.leo +++ b/tests/compiler/console/log.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/dummy.in +input_file: inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/disabled_tests/compiler/console/log_conditional.leo b/tests/compiler/console/log_conditional.leo similarity index 84% rename from disabled_tests/compiler/console/log_conditional.leo rename to tests/compiler/console/log_conditional.leo index df637bc018..c7d8903deb 100644 --- a/disabled_tests/compiler/console/log_conditional.leo +++ b/tests/compiler/console/log_conditional.leo @@ -2,8 +2,8 @@ namespace: Compile expectation: Pass input_file: - - input/input_unequal.in - - input/input_equal.in + - inputs/input_unequal.in + - inputs/input_equal.in */ // Conditionally add two u32 integers and log the result to the console. diff --git a/disabled_tests/compiler/console/log_fail.leo b/tests/compiler/console/log_fail.leo similarity index 100% rename from disabled_tests/compiler/console/log_fail.leo rename to tests/compiler/console/log_fail.leo diff --git a/disabled_tests/compiler/console/log_input.leo b/tests/compiler/console/log_input.leo similarity index 82% rename from disabled_tests/compiler/console/log_input.leo rename to tests/compiler/console/log_input.leo index 233fd18c47..285ab6eae1 100644 --- a/disabled_tests/compiler/console/log_input.leo +++ b/tests/compiler/console/log_input.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/dummy.in +input_file: inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/disabled_tests/compiler/console/log_parameter.leo b/tests/compiler/console/log_parameter.leo similarity index 82% rename from disabled_tests/compiler/console/log_parameter.leo rename to tests/compiler/console/log_parameter.leo index 6dffd420d1..75536f7b58 100644 --- a/disabled_tests/compiler/console/log_parameter.leo +++ b/tests/compiler/console/log_parameter.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/dummy.in +input_file: inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/disabled_tests/compiler/console/log_parameter_many.leo b/tests/compiler/console/log_parameter_many.leo similarity index 83% rename from disabled_tests/compiler/console/log_parameter_many.leo rename to tests/compiler/console/log_parameter_many.leo index c83bc92cda..ed1e769b82 100644 --- a/disabled_tests/compiler/console/log_parameter_many.leo +++ b/tests/compiler/console/log_parameter_many.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/dummy.in +input_file: inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/disabled_tests/compiler/console/log_parameter_fail_unknown.leo b/tests/compiler/console/log_parameter_unkown_fail.leo similarity index 100% rename from disabled_tests/compiler/console/log_parameter_fail_unknown.leo rename to tests/compiler/console/log_parameter_unkown_fail.leo diff --git a/tests/compiler/definition/input/dummy.in b/tests/compiler/definition/inputs/dummy.in similarity index 100% rename from tests/compiler/definition/input/dummy.in rename to tests/compiler/definition/inputs/dummy.in diff --git a/tests/compiler/definition/out_of_order.leo b/tests/compiler/definition/out_of_order.leo index 3b3a7551f7..77de4f3547 100644 --- a/tests/compiler/definition/out_of_order.leo +++ b/tests/compiler/definition/out_of_order.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/dummy.in +input_file: inputs/dummy.in */ // @test diff --git a/tests/compiler/field/output/register_one.out b/tests/compiler/field/output/register_one.out deleted file mode 100644 index 16556c1c51..0000000000 --- a/tests/compiler/field/output/register_one.out +++ /dev/null @@ -1,2 +0,0 @@ -[registers] -r: field = 1; diff --git a/tests/compiler/field/output/register_zero.out b/tests/compiler/field/output/register_zero.out deleted file mode 100644 index 2ba759ffc8..0000000000 --- a/tests/compiler/field/output/register_zero.out +++ /dev/null @@ -1,2 +0,0 @@ -[registers] -r: field = 0; diff --git a/tests/compiler/function/conditional_return.leo b/tests/compiler/function/conditional_return.leo index 84bdbf7928..2532c1ef0a 100644 --- a/tests/compiler/function/conditional_return.leo +++ b/tests/compiler/function/conditional_return.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/integers.in +input_file: inputs/integers.in */ function main(a: u32) -> u32 { diff --git a/tests/compiler/function/duplicate_definition_fail.leo b/tests/compiler/function/duplicate_definition_fail.leo index 4f3a449a13..6455312b3d 100644 --- a/tests/compiler/function/duplicate_definition_fail.leo +++ b/tests/compiler/function/duplicate_definition_fail.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Fail -input_file: input/dummy.in +input_file: inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/function/duplicate_parameter_fail.leo b/tests/compiler/function/duplicate_parameter_fail.leo index e7badc1613..0f3ad0cb6a 100644 --- a/tests/compiler/function/duplicate_parameter_fail.leo +++ b/tests/compiler/function/duplicate_parameter_fail.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Fail -input_file: input/dummy.in +input_file: inputs/dummy.in */ function main(a: u32, a: u32) -> u32 { diff --git a/tests/compiler/function/input/dummy.in b/tests/compiler/function/inputs/dummy.in similarity index 100% rename from tests/compiler/function/input/dummy.in rename to tests/compiler/function/inputs/dummy.in diff --git a/tests/compiler/function/input/integers.in b/tests/compiler/function/inputs/integers.in similarity index 100% rename from tests/compiler/function/input/integers.in rename to tests/compiler/function/inputs/integers.in diff --git a/tests/compiler/function/iteration.leo b/tests/compiler/function/iteration.leo index c0296b2dee..cf6be01e12 100644 --- a/tests/compiler/function/iteration.leo +++ b/tests/compiler/function/iteration.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/dummy.in +input_file: inputs/dummy.in */ function one() -> u32 { diff --git a/tests/compiler/function/iteration_repeated.leo b/tests/compiler/function/iteration_repeated.leo index 4c79ab5507..813970dcce 100644 --- a/tests/compiler/function/iteration_repeated.leo +++ b/tests/compiler/function/iteration_repeated.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/dummy.in +input_file: inputs/dummy.in */ function iteration() -> u32 { diff --git a/tests/compiler/function/repeated.leo b/tests/compiler/function/repeated.leo index 0bd1f13cf1..c20fc2e8ca 100644 --- a/tests/compiler/function/repeated.leo +++ b/tests/compiler/function/repeated.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/dummy.in +input_file: inputs/dummy.in */ function one() -> bool { diff --git a/tests/compiler/function/return.leo b/tests/compiler/function/return.leo index c6ad8a6366..69233233e8 100644 --- a/tests/compiler/function/return.leo +++ b/tests/compiler/function/return.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/dummy.in +input_file: inputs/dummy.in */ function one() -> u32 { diff --git a/disabled_tests/compiler/function/scope_fail.leo b/tests/compiler/function/scope_fail.leo similarity index 67% rename from disabled_tests/compiler/function/scope_fail.leo rename to tests/compiler/function/scope_fail.leo index 3f183386ac..9315b239df 100644 --- a/disabled_tests/compiler/function/scope_fail.leo +++ b/tests/compiler/function/scope_fail.leo @@ -8,9 +8,9 @@ function foo() -> field { return myGlobal; } -function main() { +function main() -> field { const myGlobal = 42field; const err = foo(); - // TODO: update after field comparison is enabled + return err; } diff --git a/tests/compiler/function/shadow_function_with_input_fail.leo b/tests/compiler/function/shadow_function_with_input_fail.leo new file mode 100644 index 0000000000..c8099b627c --- /dev/null +++ b/tests/compiler/function/shadow_function_with_input_fail.leo @@ -0,0 +1,16 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function hi() -> u8 { + return 0u8; +} + +function tester(hi: u8) -> u8 { + return 0u8; +} + +function main (y: bool) -> bool { + return y; +} \ No newline at end of file diff --git a/tests/compiler/group/add.leo b/tests/compiler/group/add.leo new file mode 100644 index 0000000000..ef133231cc --- /dev/null +++ b/tests/compiler/group/add.leo @@ -0,0 +1,11 @@ +/* +namespace: Compile +expectation: Pass +input_file: inputs/three.in +*/ + +function main(a: group, b: group, c: group) -> bool { + console.assert(a + b == c); + + return a + b == c; +} \ No newline at end of file diff --git a/tests/compiler/group/assert_eq.leo b/tests/compiler/group/assert_eq.leo new file mode 100644 index 0000000000..40d09c087e --- /dev/null +++ b/tests/compiler/group/assert_eq.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Pass +input_file: inputs/eq.in +*/ + +function main(a: group, b: group) -> bool { + console.assert(a == b); + return a == b; +} \ No newline at end of file diff --git a/tests/compiler/group/both_sign_high.leo b/tests/compiler/group/both_sign_high.leo new file mode 100644 index 0000000000..0b00daf25c --- /dev/null +++ b/tests/compiler/group/both_sign_high.leo @@ -0,0 +1,9 @@ +/* +namespace: Compile +expectation: Pass +*/ + +function main() -> bool { + const element: group = (+, +)group; + return true; +} \ No newline at end of file diff --git a/tests/compiler/group/both_sign_inferred.leo b/tests/compiler/group/both_sign_inferred.leo new file mode 100644 index 0000000000..7b41a0a480 --- /dev/null +++ b/tests/compiler/group/both_sign_inferred.leo @@ -0,0 +1,9 @@ +/* +namespace: Compile +expectation: Pass +*/ + +function main() -> bool { + const element: group = (_, _)group; + return true; +} \ No newline at end of file diff --git a/tests/compiler/group/both_sign_low.leo b/tests/compiler/group/both_sign_low.leo new file mode 100644 index 0000000000..88517b55a7 --- /dev/null +++ b/tests/compiler/group/both_sign_low.leo @@ -0,0 +1,9 @@ +/* +namespace: Compile +expectation: Pass +*/ + +function main() -> bool { + const element: group = (-, -)group; + return true; +} \ No newline at end of file diff --git a/tests/compiler/group/eq.leo b/tests/compiler/group/eq.leo new file mode 100644 index 0000000000..40d09c087e --- /dev/null +++ b/tests/compiler/group/eq.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Pass +input_file: inputs/eq.in +*/ + +function main(a: group, b: group) -> bool { + console.assert(a == b); + return a == b; +} \ No newline at end of file diff --git a/tests/compiler/group/input.leo b/tests/compiler/group/input.leo new file mode 100644 index 0000000000..35a99f9ce9 --- /dev/null +++ b/tests/compiler/group/input.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Pass +input_file: inputs/dummy.in +*/ + +function main(a: group, b: group) -> bool { + console.assert(a == b); + return a == b; +} \ No newline at end of file diff --git a/tests/compiler/group/inputs/dummy.in b/tests/compiler/group/inputs/dummy.in new file mode 100644 index 0000000000..e1f298789f --- /dev/null +++ b/tests/compiler/group/inputs/dummy.in @@ -0,0 +1,6 @@ +[main] +a: group = (0, -)group; +b: group = (0, +)group; + +[registers] +r0: bool = true; diff --git a/tests/compiler/group/inputs/eq.in b/tests/compiler/group/inputs/eq.in new file mode 100644 index 0000000000..5471dd7fec --- /dev/null +++ b/tests/compiler/group/inputs/eq.in @@ -0,0 +1,6 @@ +[main] +a: group = (0, -)group; +b: group = (0, -)group; + +[registers] +r0: bool = true; diff --git a/tests/compiler/_group/input/invalid.in b/tests/compiler/group/inputs/invalid.in similarity index 100% rename from tests/compiler/_group/input/invalid.in rename to tests/compiler/group/inputs/invalid.in diff --git a/tests/compiler/_group/input/point.in b/tests/compiler/group/inputs/point.in similarity index 64% rename from tests/compiler/_group/input/point.in rename to tests/compiler/group/inputs/point.in index 9d49d9d847..b9fd95d55d 100644 --- a/tests/compiler/_group/input/point.in +++ b/tests/compiler/group/inputs/point.in @@ -1,2 +1,5 @@ [main] -a: group = (7374112779530666882856915975292384652154477718021969292781165691637980424078, 3435195339177955418892975564890903138308061187980579490487898366607011481796)group; \ No newline at end of file +a: group = (7374112779530666882856915975292384652154477718021969292781165691637980424078, 3435195339177955418892975564890903138308061187980579490487898366607011481796)group; + +[registers] +r0: bool = true; \ No newline at end of file diff --git a/tests/compiler/group/inputs/three.in b/tests/compiler/group/inputs/three.in new file mode 100644 index 0000000000..10e1c0ba28 --- /dev/null +++ b/tests/compiler/group/inputs/three.in @@ -0,0 +1,7 @@ +[main] +a: group = (0, 4)group; +b: group = (4, 0)group; +c: group = (4, 4)group; + +[registers] +r0: bool = true; diff --git a/tests/compiler/group/negate.leo b/tests/compiler/group/negate.leo new file mode 100644 index 0000000000..4b4d3d6b8c --- /dev/null +++ b/tests/compiler/group/negate.leo @@ -0,0 +1,11 @@ +/* +namespace: Compile +expectation: Pass +input_file: inputs/eq.in +*/ + +function main(a: group, b: group) -> bool { + console.assert(-a == b); + + return -a == b; +} \ No newline at end of file diff --git a/tests/compiler/group/no_space_between_literal.leo b/tests/compiler/group/no_space_between_literal.leo new file mode 100644 index 0000000000..f8746c5083 --- /dev/null +++ b/tests/compiler/group/no_space_between_literal.leo @@ -0,0 +1,9 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() -> group { + const g: group = (0,1) group; + return g; +} \ No newline at end of file diff --git a/tests/compiler/group/one.leo b/tests/compiler/group/one.leo new file mode 100644 index 0000000000..cfc643fd88 --- /dev/null +++ b/tests/compiler/group/one.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Pass +*/ + +function main() -> group { + const element: group = 1group; + + return element; +} \ No newline at end of file diff --git a/tests/compiler/group/point.leo b/tests/compiler/group/point.leo new file mode 100644 index 0000000000..01e357eca4 --- /dev/null +++ b/tests/compiler/group/point.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Pass +*/ + +function main() -> group { + const point: group = (7374112779530666882856915975292384652154477718021969292781165691637980424078, 3435195339177955418892975564890903138308061187980579490487898366607011481796)group; + + return point; +} \ No newline at end of file diff --git a/tests/compiler/group/point_input.leo b/tests/compiler/group/point_input.leo new file mode 100644 index 0000000000..30a52c8d55 --- /dev/null +++ b/tests/compiler/group/point_input.leo @@ -0,0 +1,9 @@ +/* +namespace: Compile +expectation: Pass +input_file: inputs/point.in +*/ + +function main(a: group) -> bool { + return a == (7374112779530666882856915975292384652154477718021969292781165691637980424078, 3435195339177955418892975564890903138308061187980579490487898366607011481796)group; +} \ No newline at end of file diff --git a/tests/compiler/group/positive_and_negative.leo b/tests/compiler/group/positive_and_negative.leo new file mode 100644 index 0000000000..7f8d5b2203 --- /dev/null +++ b/tests/compiler/group/positive_and_negative.leo @@ -0,0 +1,17 @@ +/* +namespace: Compile +expectation: Pass +*/ + +function main() -> group { + const pos_element: group = 1group; + const neg_element: group = -1group; + + const pair_x_pos: group = (1, _)group; + const pair_x_neg: group = (-1, _)group; + + const pair_y_pos: group = (_, 1)group; + const pair_y_neg: group = (_, -1)group; + + return pair_x_neg; +} \ No newline at end of file diff --git a/tests/compiler/group/sub.leo b/tests/compiler/group/sub.leo new file mode 100644 index 0000000000..e80ea0061f --- /dev/null +++ b/tests/compiler/group/sub.leo @@ -0,0 +1,11 @@ +/* +namespace: Compile +expectation: Pass +input_file: inputs/three.in +*/ + +function main(a: group, b: group, c: group) -> bool { + console.assert(a - b == c); + + return a - b == c; +} \ No newline at end of file diff --git a/tests/compiler/group/ternary.leo b/tests/compiler/group/ternary.leo new file mode 100644 index 0000000000..f3bf0e0705 --- /dev/null +++ b/tests/compiler/group/ternary.leo @@ -0,0 +1,11 @@ +/* +namespace: Compile +expectation: Pass +input_file: inputs/point.in +*/ + +function main(a: group, b: group, c: group) -> bool { + const r: group = true ? a : b; + + console.assert(r == c); +} \ No newline at end of file diff --git a/tests/compiler/_group/x_and_y.leo b/tests/compiler/group/x_and_y.leo similarity index 100% rename from tests/compiler/_group/x_and_y.leo rename to tests/compiler/group/x_and_y.leo diff --git a/tests/compiler/group/x_sign_high.leo b/tests/compiler/group/x_sign_high.leo new file mode 100644 index 0000000000..329086045c --- /dev/null +++ b/tests/compiler/group/x_sign_high.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Pass +*/ + +function main() -> group { + const element: group = (0, +)group; + + return element; +} \ No newline at end of file diff --git a/tests/compiler/group/x_sign_inferred.leo b/tests/compiler/group/x_sign_inferred.leo new file mode 100644 index 0000000000..b7dfccfbfb --- /dev/null +++ b/tests/compiler/group/x_sign_inferred.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Pass +*/ + +function main() -> group { + const element: group = (0, _)group; + + return element; +} \ No newline at end of file diff --git a/tests/compiler/group/x_sign_low.leo b/tests/compiler/group/x_sign_low.leo new file mode 100644 index 0000000000..759a255a6b --- /dev/null +++ b/tests/compiler/group/x_sign_low.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Pass +*/ + +function main() -> group { + const element: group = (0, -)group; + + return element; +} \ No newline at end of file diff --git a/tests/compiler/group/y_sign_high.leo b/tests/compiler/group/y_sign_high.leo new file mode 100644 index 0000000000..6a56027dae --- /dev/null +++ b/tests/compiler/group/y_sign_high.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Pass +*/ + +function main() -> group { + const element: group = (+, 1)group; + + return element; +} \ No newline at end of file diff --git a/tests/compiler/group/y_sign_inferred.leo b/tests/compiler/group/y_sign_inferred.leo new file mode 100644 index 0000000000..86ab11f5ea --- /dev/null +++ b/tests/compiler/group/y_sign_inferred.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Pass +*/ + +function main() -> group { + const element: group = (_, 1)group; + + return element; +} \ No newline at end of file diff --git a/tests/compiler/group/y_sign_low.leo b/tests/compiler/group/y_sign_low.leo new file mode 100644 index 0000000000..80e233badf --- /dev/null +++ b/tests/compiler/group/y_sign_low.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Pass +*/ + +function main() -> group { + const element: group = (-, 1)group; + + return element; +} \ No newline at end of file diff --git a/tests/compiler/group/zero.leo b/tests/compiler/group/zero.leo new file mode 100644 index 0000000000..2ccbe12068 --- /dev/null +++ b/tests/compiler/group/zero.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Pass +*/ + +function main() -> group { + const element: group = 0group; + + return element; +} \ No newline at end of file diff --git a/tests/compiler/input_files/program_input/input/const_input_non_const.in b/tests/compiler/input_files/program_input/inputs/const_input_non_const.in similarity index 100% rename from tests/compiler/input_files/program_input/input/const_input_non_const.in rename to tests/compiler/input_files/program_input/inputs/const_input_non_const.in diff --git a/tests/compiler/input_files/program_input/input/different_types_const_signed_fail.in b/tests/compiler/input_files/program_input/inputs/different_types_const_signed_fail.in similarity index 100% rename from tests/compiler/input_files/program_input/input/different_types_const_signed_fail.in rename to tests/compiler/input_files/program_input/inputs/different_types_const_signed_fail.in diff --git a/tests/compiler/input_files/program_input/input/different_types_const_unsigned_fail.in b/tests/compiler/input_files/program_input/inputs/different_types_const_unsigned_fail.in similarity index 100% rename from tests/compiler/input_files/program_input/input/different_types_const_unsigned_fail.in rename to tests/compiler/input_files/program_input/inputs/different_types_const_unsigned_fail.in diff --git a/tests/compiler/input_files/program_input/input/different_types_fail_signed.in b/tests/compiler/input_files/program_input/inputs/different_types_fail_signed.in similarity index 100% rename from tests/compiler/input_files/program_input/input/different_types_fail_signed.in rename to tests/compiler/input_files/program_input/inputs/different_types_fail_signed.in diff --git a/tests/compiler/input_files/program_input/input/different_types_unsigned_fail.in b/tests/compiler/input_files/program_input/inputs/different_types_unsigned_fail.in similarity index 100% rename from tests/compiler/input_files/program_input/input/different_types_unsigned_fail.in rename to tests/compiler/input_files/program_input/inputs/different_types_unsigned_fail.in diff --git a/tests/compiler/input_files/program_input/input/main.in b/tests/compiler/input_files/program_input/inputs/main.in similarity index 100% rename from tests/compiler/input_files/program_input/input/main.in rename to tests/compiler/input_files/program_input/inputs/main.in diff --git a/tests/compiler/input_files/program_input/input/main_array.in b/tests/compiler/input_files/program_input/inputs/main_array.in similarity index 100% rename from tests/compiler/input_files/program_input/input/main_array.in rename to tests/compiler/input_files/program_input/inputs/main_array.in diff --git a/tests/compiler/input_files/program_input/input/main_array_fail.in b/tests/compiler/input_files/program_input/inputs/main_array_fail.in similarity index 100% rename from tests/compiler/input_files/program_input/input/main_array_fail.in rename to tests/compiler/input_files/program_input/inputs/main_array_fail.in diff --git a/tests/compiler/input_files/program_input/input/main_char.in b/tests/compiler/input_files/program_input/inputs/main_char.in similarity index 100% rename from tests/compiler/input_files/program_input/input/main_char.in rename to tests/compiler/input_files/program_input/inputs/main_char.in diff --git a/tests/compiler/input_files/program_input/input/main_fail_name.in b/tests/compiler/input_files/program_input/inputs/main_fail_name.in similarity index 100% rename from tests/compiler/input_files/program_input/input/main_fail_name.in rename to tests/compiler/input_files/program_input/inputs/main_fail_name.in diff --git a/tests/compiler/input_files/program_input/input/main_fail_type.in b/tests/compiler/input_files/program_input/inputs/main_fail_type.in similarity index 100% rename from tests/compiler/input_files/program_input/input/main_fail_type.in rename to tests/compiler/input_files/program_input/inputs/main_fail_type.in diff --git a/tests/compiler/input_files/program_input/input/main_field.in b/tests/compiler/input_files/program_input/inputs/main_field.in similarity index 100% rename from tests/compiler/input_files/program_input/input/main_field.in rename to tests/compiler/input_files/program_input/inputs/main_field.in diff --git a/tests/compiler/input_files/program_input/input/main_group.in b/tests/compiler/input_files/program_input/inputs/main_group.in similarity index 100% rename from tests/compiler/input_files/program_input/input/main_group.in rename to tests/compiler/input_files/program_input/inputs/main_group.in diff --git a/tests/compiler/input_files/program_input/input/main_multi_dimension_array.in b/tests/compiler/input_files/program_input/inputs/main_multi_dimension_array.in similarity index 100% rename from tests/compiler/input_files/program_input/input/main_multi_dimension_array.in rename to tests/compiler/input_files/program_input/inputs/main_multi_dimension_array.in diff --git a/tests/compiler/input_files/program_input/input/main_multiple.in b/tests/compiler/input_files/program_input/inputs/main_multiple.in similarity index 100% rename from tests/compiler/input_files/program_input/input/main_multiple.in rename to tests/compiler/input_files/program_input/inputs/main_multiple.in diff --git a/tests/compiler/input_files/program_input/input/main_string.in b/tests/compiler/input_files/program_input/inputs/main_string.in similarity index 100% rename from tests/compiler/input_files/program_input/input/main_string.in rename to tests/compiler/input_files/program_input/inputs/main_string.in diff --git a/tests/compiler/input_files/program_input/input/main_tuple.in b/tests/compiler/input_files/program_input/inputs/main_tuple.in similarity index 100% rename from tests/compiler/input_files/program_input/input/main_tuple.in rename to tests/compiler/input_files/program_input/inputs/main_tuple.in diff --git a/tests/compiler/input_files/program_input/input/main_tuple_fail.in b/tests/compiler/input_files/program_input/inputs/main_tuple_fail.in similarity index 100% rename from tests/compiler/input_files/program_input/input/main_tuple_fail.in rename to tests/compiler/input_files/program_input/inputs/main_tuple_fail.in diff --git a/tests/compiler/input_files/program_input/input/non_const_input_const.in b/tests/compiler/input_files/program_input/inputs/non_const_input_const.in similarity index 100% rename from tests/compiler/input_files/program_input/input/non_const_input_const.in rename to tests/compiler/input_files/program_input/inputs/non_const_input_const.in diff --git a/tests/compiler/input_files/program_input/main.leo b/tests/compiler/input_files/program_input/main.leo index 3a87ed310e..4ecc0cc8d2 100644 --- a/tests/compiler/input_files/program_input/main.leo +++ b/tests/compiler/input_files/program_input/main.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/main.in +input_file: inputs/main.in */ function main(a: bool) -> bool { diff --git a/tests/compiler/input_files/program_input/main_field.leo b/tests/compiler/input_files/program_input/main_field.leo index 12a25103aa..cdcc88b79e 100644 --- a/tests/compiler/input_files/program_input/main_field.leo +++ b/tests/compiler/input_files/program_input/main_field.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/main_field.in +input_file: inputs/main_field.in */ function main(a: field, b: field, y: bool) -> bool { diff --git a/tests/compiler/input_files/program_input/main_group.leo b/tests/compiler/input_files/program_input/main_group.leo index 7ed611cd2a..21a86c3425 100644 --- a/tests/compiler/input_files/program_input/main_group.leo +++ b/tests/compiler/input_files/program_input/main_group.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/main_group.in +input_file: inputs/main_group.in */ function main(a: group, b: group, c: group) -> bool { diff --git a/tests/compiler/input_files/program_input_constants/input/main.in b/tests/compiler/input_files/program_input_constants/inputs/main.in similarity index 100% rename from tests/compiler/input_files/program_input_constants/input/main.in rename to tests/compiler/input_files/program_input_constants/inputs/main.in diff --git a/tests/compiler/input_files/program_input_constants/input/main_array.in b/tests/compiler/input_files/program_input_constants/inputs/main_array.in similarity index 100% rename from tests/compiler/input_files/program_input_constants/input/main_array.in rename to tests/compiler/input_files/program_input_constants/inputs/main_array.in diff --git a/tests/compiler/input_files/program_input_constants/input/main_array_fail.in b/tests/compiler/input_files/program_input_constants/inputs/main_array_fail.in similarity index 100% rename from tests/compiler/input_files/program_input_constants/input/main_array_fail.in rename to tests/compiler/input_files/program_input_constants/inputs/main_array_fail.in diff --git a/tests/compiler/input_files/program_input_constants/input/main_char.in b/tests/compiler/input_files/program_input_constants/inputs/main_char.in similarity index 100% rename from tests/compiler/input_files/program_input_constants/input/main_char.in rename to tests/compiler/input_files/program_input_constants/inputs/main_char.in diff --git a/tests/compiler/input_files/program_input_constants/input/main_fail_name.in b/tests/compiler/input_files/program_input_constants/inputs/main_fail_name.in similarity index 100% rename from tests/compiler/input_files/program_input_constants/input/main_fail_name.in rename to tests/compiler/input_files/program_input_constants/inputs/main_fail_name.in diff --git a/tests/compiler/input_files/program_input_constants/input/main_fail_type.in b/tests/compiler/input_files/program_input_constants/inputs/main_fail_type.in similarity index 100% rename from tests/compiler/input_files/program_input_constants/input/main_fail_type.in rename to tests/compiler/input_files/program_input_constants/inputs/main_fail_type.in diff --git a/tests/compiler/input_files/program_input_constants/input/main_field.in b/tests/compiler/input_files/program_input_constants/inputs/main_field.in similarity index 100% rename from tests/compiler/input_files/program_input_constants/input/main_field.in rename to tests/compiler/input_files/program_input_constants/inputs/main_field.in diff --git a/tests/compiler/input_files/program_input_constants/input/main_group.in b/tests/compiler/input_files/program_input_constants/inputs/main_group.in similarity index 100% rename from tests/compiler/input_files/program_input_constants/input/main_group.in rename to tests/compiler/input_files/program_input_constants/inputs/main_group.in diff --git a/tests/compiler/input_files/program_input_constants/input/main_multi_dimension_array.in b/tests/compiler/input_files/program_input_constants/inputs/main_multi_dimension_array.in similarity index 100% rename from tests/compiler/input_files/program_input_constants/input/main_multi_dimension_array.in rename to tests/compiler/input_files/program_input_constants/inputs/main_multi_dimension_array.in diff --git a/tests/compiler/input_files/program_input_constants/input/main_multiple.in b/tests/compiler/input_files/program_input_constants/inputs/main_multiple.in similarity index 100% rename from tests/compiler/input_files/program_input_constants/input/main_multiple.in rename to tests/compiler/input_files/program_input_constants/inputs/main_multiple.in diff --git a/tests/compiler/input_files/program_input_constants/input/main_string.in b/tests/compiler/input_files/program_input_constants/inputs/main_string.in similarity index 100% rename from tests/compiler/input_files/program_input_constants/input/main_string.in rename to tests/compiler/input_files/program_input_constants/inputs/main_string.in diff --git a/tests/compiler/input_files/program_input_constants/input/main_tuple.in b/tests/compiler/input_files/program_input_constants/inputs/main_tuple.in similarity index 100% rename from tests/compiler/input_files/program_input_constants/input/main_tuple.in rename to tests/compiler/input_files/program_input_constants/inputs/main_tuple.in diff --git a/tests/compiler/input_files/program_input_constants/input/main_tuple_fail.in b/tests/compiler/input_files/program_input_constants/inputs/main_tuple_fail.in similarity index 100% rename from tests/compiler/input_files/program_input_constants/input/main_tuple_fail.in rename to tests/compiler/input_files/program_input_constants/inputs/main_tuple_fail.in diff --git a/tests/compiler/input_files/program_input_constants/main.leo b/tests/compiler/input_files/program_input_constants/main.leo index 2ef2c8df2e..eca171d053 100644 --- a/tests/compiler/input_files/program_input_constants/main.leo +++ b/tests/compiler/input_files/program_input_constants/main.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/main.in +input_file: inputs/main.in */ function main(const a: bool, b: bool) -> bool { diff --git a/tests/compiler/input_files/program_input_constants/main_field.leo b/tests/compiler/input_files/program_input_constants/main_field.leo index fa84edbcdb..8041749ad4 100644 --- a/tests/compiler/input_files/program_input_constants/main_field.leo +++ b/tests/compiler/input_files/program_input_constants/main_field.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/main_field.in +input_file: inputs/main_field.in */ function main(const a: field, const b: field, y: bool) -> bool { diff --git a/tests/compiler/input_files/program_input_constants/main_group.leo b/tests/compiler/input_files/program_input_constants/main_group.leo index c06d7ff87b..1cb68f1b93 100644 --- a/tests/compiler/input_files/program_input_constants/main_group.leo +++ b/tests/compiler/input_files/program_input_constants/main_group.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/main_group.in +input_file: inputs/main_group.in */ function main(const a: group, const b: group, const c: group, y: bool) -> bool { diff --git a/tests/compiler/input_files/program_input_constants/main_multiple.leo b/tests/compiler/input_files/program_input_constants/main_multiple.leo index e06775ea4b..76ffcef96c 100644 --- a/tests/compiler/input_files/program_input_constants/main_multiple.leo +++ b/tests/compiler/input_files/program_input_constants/main_multiple.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/main_multiple.in +input_file: inputs/main_multiple.in */ function main(const a: bool, const b: bool, y: bool) -> bool { diff --git a/tests/compiler/integers/i128/max.leo b/tests/compiler/integers/i128/max.leo index 01ae59f60f..f12d46b39b 100644 --- a/tests/compiler/integers/i128/max.leo +++ b/tests/compiler/integers/i128/max.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/i128/max_fail.leo b/tests/compiler/integers/i128/max_fail.leo new file mode 100644 index 0000000000..694f5455fe --- /dev/null +++ b/tests/compiler/integers/i128/max_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: i128 = 170141183460469231731687303715884105728i128; +} diff --git a/tests/compiler/integers/i128/min.leo b/tests/compiler/integers/i128/min.leo index 9da468eb76..dfc2e62b33 100644 --- a/tests/compiler/integers/i128/min.leo +++ b/tests/compiler/integers/i128/min.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/i128/min_fail.leo b/tests/compiler/integers/i128/min_fail.leo new file mode 100644 index 0000000000..742f72104d --- /dev/null +++ b/tests/compiler/integers/i128/min_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: i128 = -170141183460469231731687303715884105729i128; +} diff --git a/tests/compiler/integers/i128/negate_min.leo b/tests/compiler/integers/i128/negate_min.leo new file mode 100644 index 0000000000..5f19ca45c0 --- /dev/null +++ b/tests/compiler/integers/i128/negate_min.leo @@ -0,0 +1,11 @@ +/* +namespace: Compile +expectation: Pass +input_file: ../inputs/dummy.in +*/ + +function main(y: bool) -> bool{ + const a: i128 = -170141183460469231731687303715884105728i128; + const b: i128 = -a; + return (b == -a) == y; +} diff --git a/tests/compiler/integers/i128/negate_zero.leo b/tests/compiler/integers/i128/negate_zero.leo index 2141798012..6ba1c2bfe6 100644 --- a/tests/compiler/integers/i128/negate_zero.leo +++ b/tests/compiler/integers/i128/negate_zero.leo @@ -2,7 +2,7 @@ namespace: Compile expectation: Pass input_file: - - ../input/dummy.in + - ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/i16/max.leo b/tests/compiler/integers/i16/max.leo index 46b2d72841..2da9885cb3 100644 --- a/tests/compiler/integers/i16/max.leo +++ b/tests/compiler/integers/i16/max.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/i16/max_fail.leo b/tests/compiler/integers/i16/max_fail.leo new file mode 100644 index 0000000000..96f55e241b --- /dev/null +++ b/tests/compiler/integers/i16/max_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: i16 = 32768i16; +} \ No newline at end of file diff --git a/tests/compiler/integers/i16/min.leo b/tests/compiler/integers/i16/min.leo index a3c89b617a..9f3bdecc7b 100644 --- a/tests/compiler/integers/i16/min.leo +++ b/tests/compiler/integers/i16/min.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/i16/min_fail.leo b/tests/compiler/integers/i16/min_fail.leo new file mode 100644 index 0000000000..6067f11c29 --- /dev/null +++ b/tests/compiler/integers/i16/min_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: i16 = -32769i16; +} \ No newline at end of file diff --git a/tests/compiler/integers/i16/negate_min_fail.leo b/tests/compiler/integers/i16/negate_min_fail.leo new file mode 100644 index 0000000000..c54433dc30 --- /dev/null +++ b/tests/compiler/integers/i16/negate_min_fail.leo @@ -0,0 +1,11 @@ +/* +namespace: Compile +expectation: Pass +input_file: ../inputs/dummy.in +*/ + +function main(y: bool) -> bool { + const a: i16 = -32768i16; + const b: i16 = -a; + return (b == -a) == y; +} diff --git a/tests/compiler/integers/i16/negate_zero.leo b/tests/compiler/integers/i16/negate_zero.leo index eb13d912be..bf3eceab02 100644 --- a/tests/compiler/integers/i16/negate_zero.leo +++ b/tests/compiler/integers/i16/negate_zero.leo @@ -2,7 +2,7 @@ namespace: Compile expectation: Pass input_file: - - ../input/dummy.in + - ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/i32/max.leo b/tests/compiler/integers/i32/max.leo index c3e8a3dfeb..6048ffd15a 100644 --- a/tests/compiler/integers/i32/max.leo +++ b/tests/compiler/integers/i32/max.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/i32/max_fail.leo b/tests/compiler/integers/i32/max_fail.leo new file mode 100644 index 0000000000..be6809dd83 --- /dev/null +++ b/tests/compiler/integers/i32/max_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: i32 = 2147483648i32; +} diff --git a/tests/compiler/integers/i32/min.leo b/tests/compiler/integers/i32/min.leo index 709fb4cd22..6d28095607 100644 --- a/tests/compiler/integers/i32/min.leo +++ b/tests/compiler/integers/i32/min.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/i32/min_fail.leo b/tests/compiler/integers/i32/min_fail.leo new file mode 100644 index 0000000000..a36687aea2 --- /dev/null +++ b/tests/compiler/integers/i32/min_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: i32 = -2147483649i32; +} diff --git a/tests/compiler/integers/i32/negate_min.leo b/tests/compiler/integers/i32/negate_min.leo new file mode 100644 index 0000000000..b2ee023ab9 --- /dev/null +++ b/tests/compiler/integers/i32/negate_min.leo @@ -0,0 +1,11 @@ +/* +namespace: Compile +expectation: Pass +input_file: ../inputs/dummy.in +*/ + +function main(y: bool) -> bool{ + const a: i32 = -2147483648i32; + const b: i32 = -a; + return (b == -a) == y; +} diff --git a/tests/compiler/integers/i32/negate_zero.leo b/tests/compiler/integers/i32/negate_zero.leo index df505768d8..23539e51e3 100644 --- a/tests/compiler/integers/i32/negate_zero.leo +++ b/tests/compiler/integers/i32/negate_zero.leo @@ -2,7 +2,7 @@ namespace: Compile expectation: Pass input_file: - - ../input/dummy.in + - ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/i64/max.leo b/tests/compiler/integers/i64/max.leo index 0668d35b0f..7769e27400 100644 --- a/tests/compiler/integers/i64/max.leo +++ b/tests/compiler/integers/i64/max.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/i64/max_fail.leo b/tests/compiler/integers/i64/max_fail.leo new file mode 100644 index 0000000000..fafa225bae --- /dev/null +++ b/tests/compiler/integers/i64/max_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: i64 = 9223372036854775808i64; +} diff --git a/tests/compiler/integers/i64/min.leo b/tests/compiler/integers/i64/min.leo index 0b6181d57c..d3ea694ae6 100644 --- a/tests/compiler/integers/i64/min.leo +++ b/tests/compiler/integers/i64/min.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/i64/min_fail.leo b/tests/compiler/integers/i64/min_fail.leo new file mode 100644 index 0000000000..83f2fe2d4a --- /dev/null +++ b/tests/compiler/integers/i64/min_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: i64 = -9223372036854775809i64; +} diff --git a/tests/compiler/integers/i64/negate_min.leo b/tests/compiler/integers/i64/negate_min.leo new file mode 100644 index 0000000000..a9acff4d0d --- /dev/null +++ b/tests/compiler/integers/i64/negate_min.leo @@ -0,0 +1,11 @@ +/* +namespace: Compile +expectation: Pass +input_file: ../inputs/dummy.in +*/ + +function main(y: bool) -> bool{ + const a: i64 = -9223372036854775808i64; + const b: i64 = -a; + return (b == -a) == y; +} diff --git a/tests/compiler/integers/i64/negate_zero.leo b/tests/compiler/integers/i64/negate_zero.leo index 955e5f954d..2a048c2af6 100644 --- a/tests/compiler/integers/i64/negate_zero.leo +++ b/tests/compiler/integers/i64/negate_zero.leo @@ -2,7 +2,7 @@ namespace: Compile expectation: Pass input_file: - - ../input/dummy.in + - ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/i8/max.leo b/tests/compiler/integers/i8/max.leo index eb0d270741..0fd2a0137e 100644 --- a/tests/compiler/integers/i8/max.leo +++ b/tests/compiler/integers/i8/max.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/i8/max_fail.leo b/tests/compiler/integers/i8/max_fail.leo new file mode 100644 index 0000000000..ce820caf4e --- /dev/null +++ b/tests/compiler/integers/i8/max_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: i8 = 128i8; +} \ No newline at end of file diff --git a/tests/compiler/integers/i8/min.leo b/tests/compiler/integers/i8/min.leo index c5b8827da4..1ffd0cf604 100644 --- a/tests/compiler/integers/i8/min.leo +++ b/tests/compiler/integers/i8/min.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/i8/min_fail.leo b/tests/compiler/integers/i8/min_fail.leo new file mode 100644 index 0000000000..db51dcaa15 --- /dev/null +++ b/tests/compiler/integers/i8/min_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: i8 = -129i8; +} \ No newline at end of file diff --git a/tests/compiler/integers/i8/negate_min.leo b/tests/compiler/integers/i8/negate_min.leo new file mode 100644 index 0000000000..f27e45cab2 --- /dev/null +++ b/tests/compiler/integers/i8/negate_min.leo @@ -0,0 +1,12 @@ +/* +namespace: Compile +expectation: Pass +input_file: ../inputs/dummy.in +*/ + +function main(y: bool) -> bool { + const a: i8 = -128i8; + const b: i8 = -a; + + return (b == -a) == y; +} diff --git a/tests/compiler/integers/i8/negate_zero.leo b/tests/compiler/integers/i8/negate_zero.leo index 70ed6da011..2688c5fe56 100644 --- a/tests/compiler/integers/i8/negate_zero.leo +++ b/tests/compiler/integers/i8/negate_zero.leo @@ -2,7 +2,7 @@ namespace: Compile expectation: Pass input_file: - - ../input/dummy.in + - ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/input/dummy.in b/tests/compiler/integers/inputs/dummy.in similarity index 100% rename from tests/compiler/integers/input/dummy.in rename to tests/compiler/integers/inputs/dummy.in diff --git a/tests/compiler/integers/u128/max.leo b/tests/compiler/integers/u128/max.leo index 430efbf217..425d31b082 100644 --- a/tests/compiler/integers/u128/max.leo +++ b/tests/compiler/integers/u128/max.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/u128/max_fail.leo b/tests/compiler/integers/u128/max_fail.leo new file mode 100644 index 0000000000..17eedb2280 --- /dev/null +++ b/tests/compiler/integers/u128/max_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: u128 = 340282366920938463463374607431768211456u128; +} diff --git a/tests/compiler/integers/u128/min.leo b/tests/compiler/integers/u128/min.leo index 8f87b75c46..abb130957b 100644 --- a/tests/compiler/integers/u128/min.leo +++ b/tests/compiler/integers/u128/min.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool{ diff --git a/tests/compiler/integers/u128/min_fail.leo b/tests/compiler/integers/u128/min_fail.leo new file mode 100644 index 0000000000..846004c4dd --- /dev/null +++ b/tests/compiler/integers/u128/min_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: u128 = -1u128; +} diff --git a/tests/compiler/integers/u16/max.leo b/tests/compiler/integers/u16/max.leo index 284c07ec44..8d66563b89 100644 --- a/tests/compiler/integers/u16/max.leo +++ b/tests/compiler/integers/u16/max.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/u16/max_fail.leo b/tests/compiler/integers/u16/max_fail.leo new file mode 100644 index 0000000000..36da3893a7 --- /dev/null +++ b/tests/compiler/integers/u16/max_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: u16 = 65536u16; +} diff --git a/tests/compiler/integers/u16/min.leo b/tests/compiler/integers/u16/min.leo index 4a0935b6c8..7ea7ddfda1 100644 --- a/tests/compiler/integers/u16/min.leo +++ b/tests/compiler/integers/u16/min.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/u16/min_fail.leo b/tests/compiler/integers/u16/min_fail.leo new file mode 100644 index 0000000000..10b10f0e0c --- /dev/null +++ b/tests/compiler/integers/u16/min_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: u16 = -1u16; +} diff --git a/tests/compiler/integers/u32/max.leo b/tests/compiler/integers/u32/max.leo index c497c853f0..1c6690022f 100644 --- a/tests/compiler/integers/u32/max.leo +++ b/tests/compiler/integers/u32/max.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/u32/max_fail.leo b/tests/compiler/integers/u32/max_fail.leo new file mode 100644 index 0000000000..c4eafaf9f9 --- /dev/null +++ b/tests/compiler/integers/u32/max_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: u32 = 4294967296u32; +} diff --git a/tests/compiler/integers/u32/min.leo b/tests/compiler/integers/u32/min.leo index 9cc5b890d1..b579e3c3bf 100644 --- a/tests/compiler/integers/u32/min.leo +++ b/tests/compiler/integers/u32/min.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/u32/min_fail.leo b/tests/compiler/integers/u32/min_fail.leo new file mode 100644 index 0000000000..86bd325e98 --- /dev/null +++ b/tests/compiler/integers/u32/min_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: u32 = -1u32; +} diff --git a/tests/compiler/integers/u64/max.leo b/tests/compiler/integers/u64/max.leo index 7222518802..bbffbb1ec7 100644 --- a/tests/compiler/integers/u64/max.leo +++ b/tests/compiler/integers/u64/max.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/u64/max_fail.leo b/tests/compiler/integers/u64/max_fail.leo new file mode 100644 index 0000000000..1afe054065 --- /dev/null +++ b/tests/compiler/integers/u64/max_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: u64 = 18446744073709551616u64; +} diff --git a/tests/compiler/integers/u64/min.leo b/tests/compiler/integers/u64/min.leo index bf9f62c6e5..d6812ad0bf 100644 --- a/tests/compiler/integers/u64/min.leo +++ b/tests/compiler/integers/u64/min.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/u64/min_fail.leo b/tests/compiler/integers/u64/min_fail.leo new file mode 100644 index 0000000000..ba4ffa67a1 --- /dev/null +++ b/tests/compiler/integers/u64/min_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: u64 = -1u64; +} diff --git a/tests/compiler/integers/u8/max.leo b/tests/compiler/integers/u8/max.leo index 427f0703b1..c44f0c562e 100644 --- a/tests/compiler/integers/u8/max.leo +++ b/tests/compiler/integers/u8/max.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/integers/u8/max_fail.leo b/tests/compiler/integers/u8/max_fail.leo new file mode 100644 index 0000000000..59f6e707ee --- /dev/null +++ b/tests/compiler/integers/u8/max_fail.leo @@ -0,0 +1,8 @@ +/* +namespace: Compile +expectation: Fail +*/ + +function main() { + const a: u8 = 256u8; +} diff --git a/tests/compiler/integers/u8/min.leo b/tests/compiler/integers/u8/min.leo index 9f88406715..cd74114fad 100644 --- a/tests/compiler/integers/u8/min.leo +++ b/tests/compiler/integers/u8/min.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: ../input/dummy.in +input_file: ../inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/disabled_tests/compiler/integers/i32/no_space_between_literal.leo b/tests/compiler/integers/u8/min_fail.leo similarity index 72% rename from disabled_tests/compiler/integers/i32/no_space_between_literal.leo rename to tests/compiler/integers/u8/min_fail.leo index f3a03890d3..aaea2d9d53 100644 --- a/disabled_tests/compiler/integers/i32/no_space_between_literal.leo +++ b/tests/compiler/integers/u8/min_fail.leo @@ -4,5 +4,5 @@ expectation: Fail */ function main() { - const i = 1 i32; + const a: u8 = -1u8; } diff --git a/tests/compiler/mutability/cond_mut.leo b/tests/compiler/mutability/cond_mut.leo index 33a8179f96..cf488c8304 100644 --- a/tests/compiler/mutability/cond_mut.leo +++ b/tests/compiler/mutability/cond_mut.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/dummy.in +input_file: inputs/dummy.in */ function main(y: bool) -> bool { diff --git a/tests/compiler/mutability/function_input_mut.leo b/tests/compiler/mutability/function_input_mut.leo index bf2ed26078..8ab536faf9 100644 --- a/tests/compiler/mutability/function_input_mut.leo +++ b/tests/compiler/mutability/function_input_mut.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/dummy.in +input_file: inputs/dummy.in */ // Function input are mutable by default. diff --git a/tests/compiler/mutability/input/dummy.in b/tests/compiler/mutability/inputs/dummy.in similarity index 100% rename from tests/compiler/mutability/input/dummy.in rename to tests/compiler/mutability/inputs/dummy.in diff --git a/tests/compiler/mutability/input/index1.in b/tests/compiler/mutability/inputs/index1.in similarity index 100% rename from tests/compiler/mutability/input/index1.in rename to tests/compiler/mutability/inputs/index1.in diff --git a/tests/compiler/mutability/input/index1_tuple.in b/tests/compiler/mutability/inputs/index1_tuple.in similarity index 100% rename from tests/compiler/mutability/input/index1_tuple.in rename to tests/compiler/mutability/inputs/index1_tuple.in diff --git a/tests/compiler/mutability/input/index2.in b/tests/compiler/mutability/inputs/index2.in similarity index 100% rename from tests/compiler/mutability/input/index2.in rename to tests/compiler/mutability/inputs/index2.in diff --git a/tests/compiler/mutability/input/index2_tuple.in b/tests/compiler/mutability/inputs/index2_tuple.in similarity index 100% rename from tests/compiler/mutability/input/index2_tuple.in rename to tests/compiler/mutability/inputs/index2_tuple.in diff --git a/tests/compiler/mutability/let_mut_nested.leo b/tests/compiler/mutability/let_mut_nested.leo index c57fc1af16..0def80befb 100644 --- a/tests/compiler/mutability/let_mut_nested.leo +++ b/tests/compiler/mutability/let_mut_nested.leo @@ -1,7 +1,7 @@ /* namespace: Compile expectation: Pass -input_file: input/dummy.in +input_file: inputs/dummy.in */ function main(a: bool) -> bool { diff --git a/tests/compiler/statements/all_loops.leo b/tests/compiler/statements/all_loops.leo new file mode 100644 index 0000000000..df25a12a61 --- /dev/null +++ b/tests/compiler/statements/all_loops.leo @@ -0,0 +1,29 @@ +/* +namespace: Compile +expectation: Pass +input_file: inputs/dummy.in +*/ + +function main(k: bool) -> bool { + let reverse: u32 = 0u32; + for i: u32 in 9u32..0u32 { + reverse = reverse + i; + } + + let forward: u32 = 0u32; + for x: u32 in 0u32..10u32 { + forward = forward + x; + } + + let reverse_inclusive: u32 = 0u32; + for a: u32 in 10u32..=0u32 { + reverse_inclusive = reverse_inclusive + a; + } + + let forward_inclusive: u32 = 0u32; + for b: u32 in 0u32..=10u32 { + forward_inclusive = forward_inclusive + b; + } + + return (reverse == forward) && (reverse_inclusive == forward_inclusive) && k; +} \ No newline at end of file diff --git a/disabled_tests/compiler/statements/assign_ternary.leo b/tests/compiler/statements/assign_ternary.leo similarity index 74% rename from disabled_tests/compiler/statements/assign_ternary.leo rename to tests/compiler/statements/assign_ternary.leo index ed49709cb4..4fbc98d107 100644 --- a/disabled_tests/compiler/statements/assign_ternary.leo +++ b/tests/compiler/statements/assign_ternary.leo @@ -5,5 +5,5 @@ input_file: inputs/u32_3.in */ function main(x: u32) { - let x = true ? x: true; + let x: bool = true ? x: true; } \ No newline at end of file diff --git a/disabled_tests/compiler/statements/block.leo b/tests/compiler/statements/block.leo similarity index 65% rename from disabled_tests/compiler/statements/block.leo rename to tests/compiler/statements/block.leo index ca1a1abe89..b6cf61d421 100644 --- a/disabled_tests/compiler/statements/block.leo +++ b/tests/compiler/statements/block.leo @@ -5,11 +5,11 @@ input_file: inputs/u32_3.in */ function main(x: u32) -> bool { - let y = x; + let y: u32 = x; { - y += 5u32; + y = y + 5u32; } - return y == 8; + return y == 8u32; } \ No newline at end of file diff --git a/disabled_tests/compiler/statements/duplicate_variable.leo b/tests/compiler/statements/duplicate_variable.leo similarity index 75% rename from disabled_tests/compiler/statements/duplicate_variable.leo rename to tests/compiler/statements/duplicate_variable.leo index 3271a58d7a..134c9e2cdd 100644 --- a/disabled_tests/compiler/statements/duplicate_variable.leo +++ b/tests/compiler/statements/duplicate_variable.leo @@ -5,8 +5,8 @@ input_file: inputs/dummy.in */ function main(k: bool) -> bool { - let x = 1u8; - let x = true; + let x: u8 = 1u8; + let x: bool = true; return k == true; } \ No newline at end of file diff --git a/disabled_tests/compiler/statements/for_loop.leo b/tests/compiler/statements/for_loop.leo similarity index 50% rename from disabled_tests/compiler/statements/for_loop.leo rename to tests/compiler/statements/for_loop.leo index e220e30734..245f4eb7a2 100644 --- a/disabled_tests/compiler/statements/for_loop.leo +++ b/tests/compiler/statements/for_loop.leo @@ -5,15 +5,15 @@ input_file: inputs/u32_3.in */ function main(x: u32) -> bool { - let b = 0u32; + let b: u32 = 0u32; - if x == 3 { - for i in 0..4 { - b += i; + if x == 3u32 { + for i: u32 in 0u32..4u32 { + b = b + i; } } - let r: u32 = x == 3 ? 6 : 0; + let r: u32 = x == 3u32 ? 6u32 : 0u32; return r == b; } diff --git a/disabled_tests/compiler/statements/iteration_basic.leo b/tests/compiler/statements/iteration_basic.leo similarity index 55% rename from disabled_tests/compiler/statements/iteration_basic.leo rename to tests/compiler/statements/iteration_basic.leo index 20ca8f6c5c..c41d94b946 100644 --- a/disabled_tests/compiler/statements/iteration_basic.leo +++ b/tests/compiler/statements/iteration_basic.leo @@ -5,11 +5,11 @@ input_file: inputs/u32_3.in */ function main(x: u32) -> bool { - let y = x; + let y: u32 = x; - for i in 0..3 { - y -= 1; + for i: u32 in 0u32..3u32 { + y = y - 1u32; } - return y == 0; + return y == 0u32; } diff --git a/tests/compiler/statements/iteration_variable.leo b/tests/compiler/statements/iteration_variable.leo new file mode 100644 index 0000000000..c7d1ec9f9a --- /dev/null +++ b/tests/compiler/statements/iteration_variable.leo @@ -0,0 +1,16 @@ +/* +namespace: Compile +expectation: Pass +input_file: inputs/u32_3.in +*/ + +function main(x: u32) -> bool { + const COUNT: u32 = 2u32; + let y: u32 = x; + + for i: u32 in 0u32..COUNT { + y = y - 1u32; + } + + return y == 1u32; +} diff --git a/tests/expectations/compiler/compiler/char/invalid_char.leo.out b/tests/expectations/compiler/compiler/char/invalid_char.leo.out new file mode 100644 index 0000000000..1f6e688849 --- /dev/null +++ b/tests/expectations/compiler/compiler/char/invalid_char.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370026]: Expected a closed char but found `'`." diff --git a/tests/expectations/compiler/compiler/char/neq.leo.out b/tests/expectations/compiler/compiler/char/neq.leo.out new file mode 100644 index 0000000000..ff7a412802 --- /dev/null +++ b/tests/expectations/compiler/compiler/char/neq.leo.out @@ -0,0 +1,22 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: cd2c41435af95147ff1dcd94031e443b93b15ac7b4f65331ef734759006f3c03 + - initial_input_ast: 5e4fd7cfc681e863ed393f7746308d7b962e2b5f9dcd21aa09a26526ce2ea8e3 + - initial_input_ast: 8fcda0e92250e9897bdb8cfb9b1e3046f94f6f6206ecb958d9758e64e5615889 + - initial_input_ast: 41fef97affd26b29428302f519a5e7a7d61158923e6576618c42607f0c16ff4f + - initial_input_ast: 30c56d9a2e096215900942f18b63cf5a96fb9c0b7cf4fea11dafeeabb02a5233 + - initial_input_ast: 076d0f1b70534c15108ea0dc9e74860030d6701ce1ce38b4a3a41e5ba9fe0121 + - initial_input_ast: d3bff6374e68b63bf35fe089bbff0abb31958571b99b9e0251d82895fdc27edd + - initial_input_ast: 9455652735eb74bd67423f9ed2c7d76b1b27e47f62b5331843f8f4975a03cc9a + - initial_input_ast: 3f69c5fdd03605808dfb6ae116cdf860525b494d5d7cac39b667931c282e8c3e + - initial_input_ast: bdc202a836d17bcb974e33b5b938148c0c9b57fd8b779e813c26d8feac915547 + - initial_input_ast: 6e12715d32233251ea63ae7457c7c1d20e82995cf3df02a1adb943ee358a2643 + - initial_input_ast: 6383f20ea72b337521956a9d86608fc1861f8a5e709bb29e88f2022e893d4e59 + - initial_input_ast: e4ba1106bf3425f620578111bd3c63c0178dbc087ab4c90e873c5b9cc790f6bc + - initial_input_ast: 4c7f9b03dd308ff3981127c4c12adcb883fd8b3ce1dbd744cd935750961fc1c4 + - initial_input_ast: 2a5e92af845c8a56375cbc6123e92aa87cf4523e059c02dfcde326970d88f5c2 + initial_ast: 96f468f0e322334f4df9ca1d34402e66718676fd4e3d06c6996f08a4719f1e2a + symbol_table: cf3569155d9961e6cab441ea9a60f5c92d2b18e6cd2ecaa64b1529d1774d3585 diff --git a/tests/expectations/compiler/compiler/char/out.leo.out b/tests/expectations/compiler/compiler/char/out.leo.out new file mode 100644 index 0000000000..9fa63112b6 --- /dev/null +++ b/tests/expectations/compiler/compiler/char/out.leo.out @@ -0,0 +1,22 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: cd2c41435af95147ff1dcd94031e443b93b15ac7b4f65331ef734759006f3c03 + - initial_input_ast: 5e4fd7cfc681e863ed393f7746308d7b962e2b5f9dcd21aa09a26526ce2ea8e3 + - initial_input_ast: 8fcda0e92250e9897bdb8cfb9b1e3046f94f6f6206ecb958d9758e64e5615889 + - initial_input_ast: 41fef97affd26b29428302f519a5e7a7d61158923e6576618c42607f0c16ff4f + - initial_input_ast: 30c56d9a2e096215900942f18b63cf5a96fb9c0b7cf4fea11dafeeabb02a5233 + - initial_input_ast: 076d0f1b70534c15108ea0dc9e74860030d6701ce1ce38b4a3a41e5ba9fe0121 + - initial_input_ast: d3bff6374e68b63bf35fe089bbff0abb31958571b99b9e0251d82895fdc27edd + - initial_input_ast: 9455652735eb74bd67423f9ed2c7d76b1b27e47f62b5331843f8f4975a03cc9a + - initial_input_ast: 3f69c5fdd03605808dfb6ae116cdf860525b494d5d7cac39b667931c282e8c3e + - initial_input_ast: bdc202a836d17bcb974e33b5b938148c0c9b57fd8b779e813c26d8feac915547 + - initial_input_ast: 6e12715d32233251ea63ae7457c7c1d20e82995cf3df02a1adb943ee358a2643 + - initial_input_ast: 6383f20ea72b337521956a9d86608fc1861f8a5e709bb29e88f2022e893d4e59 + - initial_input_ast: e4ba1106bf3425f620578111bd3c63c0178dbc087ab4c90e873c5b9cc790f6bc + - initial_input_ast: 4c7f9b03dd308ff3981127c4c12adcb883fd8b3ce1dbd744cd935750961fc1c4 + - initial_input_ast: 2a5e92af845c8a56375cbc6123e92aa87cf4523e059c02dfcde326970d88f5c2 + initial_ast: b9e8d9b129d27ec2f91d1b4fd811fe6f3e109ecb60af55dea77e8e1832443ac3 + symbol_table: 1cad55eef598e4d05af7c5f88119636a2e6d23d81213bbaad908d66a32906780 diff --git a/tests/expectations/compiler/compiler/console/assert.leo.out b/tests/expectations/compiler/compiler/console/assert.leo.out new file mode 100644 index 0000000000..5b8aa7e44c --- /dev/null +++ b/tests/expectations/compiler/compiler/console/assert.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 204a90b23ba88927aabdc72aed02effa556d73742caf7d370527f79f0b30f621 + initial_ast: 99f1b1c681fe493ac676f44985edbae014d9306038e8e32e08efe0f88f5d588f + symbol_table: f8c971e501487f7a368a50fd1941c3fb70684b041478fe615a91f088796e301b diff --git a/tests/expectations/compiler/compiler/console/conditional_assert.leo.out b/tests/expectations/compiler/compiler/console/conditional_assert.leo.out new file mode 100644 index 0000000000..eb99fa39fc --- /dev/null +++ b/tests/expectations/compiler/compiler/console/conditional_assert.leo.out @@ -0,0 +1,9 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 204a90b23ba88927aabdc72aed02effa556d73742caf7d370527f79f0b30f621 + - initial_input_ast: cbc36a842b21e80aee167b65bd1a59861d59a43e27915b785410f032ae19a570 + initial_ast: 65952133a9c8ae9cdac6ef184e46bc4dacf711243480b40bbfaae81b9f9d9c07 + symbol_table: f4e056be00b25dfd854a5be8197aeb205436bb0ee11cfe06701531ea086e038c diff --git a/tests/expectations/compiler/compiler/console/error.leo.out b/tests/expectations/compiler/compiler/console/error.leo.out new file mode 100644 index 0000000000..a3bed15f99 --- /dev/null +++ b/tests/expectations/compiler/compiler/console/error.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 38e6b369397fcf11fa921808be61baf33a705d4509bc15a46ec69e1a0aaa5031 + initial_ast: 418ad64ad15c2579603ef4dac51d9fd4ae9573d0c5f4b5f00e6529076b56924b + symbol_table: d46f6eb98259f34d32a60788aa178efa34166bcc6ba1058e2ff5f8327a129b9c diff --git a/tests/expectations/compiler/compiler/console/log.leo.out b/tests/expectations/compiler/compiler/console/log.leo.out new file mode 100644 index 0000000000..7df74bec7d --- /dev/null +++ b/tests/expectations/compiler/compiler/console/log.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 38e6b369397fcf11fa921808be61baf33a705d4509bc15a46ec69e1a0aaa5031 + initial_ast: bdee199da499e7bde2a901151c1ff12c16dade415128d678eb752ee5825ebe57 + symbol_table: 559484bc163178bf54b169f5dd573167771566aa993055b6a28f0c1a759339bc diff --git a/tests/expectations/compiler/compiler/console/log_conditional.leo.out b/tests/expectations/compiler/compiler/console/log_conditional.leo.out new file mode 100644 index 0000000000..371ef8e927 --- /dev/null +++ b/tests/expectations/compiler/compiler/console/log_conditional.leo.out @@ -0,0 +1,9 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: b9ca1f9e4746ba9f99375205e309b977a522109054d058039197767b39fa6833 + - initial_input_ast: 398a847f3f6c8826a10942c856b67d9acf37a51bf4ec9109be549b24b2dfff94 + initial_ast: 6c9e14fff56659827d68946ebd96577c5efae2b8b8dba3a12b73f4f9847eea9e + symbol_table: 560afbb790df70bfc770d5c2f966428a37baf94a5c0f5312ad445456d33a2cd9 diff --git a/tests/expectations/compiler/compiler/console/log_fail.leo.out b/tests/expectations/compiler/compiler/console/log_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/console/log_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/console/log_input.leo.out b/tests/expectations/compiler/compiler/console/log_input.leo.out new file mode 100644 index 0000000000..d8d56140e2 --- /dev/null +++ b/tests/expectations/compiler/compiler/console/log_input.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 38e6b369397fcf11fa921808be61baf33a705d4509bc15a46ec69e1a0aaa5031 + initial_ast: 0c4d40a4f5409b6b1d7e4d2f620873148445b231317fd2dad898991374f68c7d + symbol_table: 720c2aafae77c261ed1640d4080f9a73657638baa30e54a5e10e2323b6f6eca0 diff --git a/tests/expectations/compiler/compiler/console/log_parameter.leo.out b/tests/expectations/compiler/compiler/console/log_parameter.leo.out new file mode 100644 index 0000000000..82f62c8ebb --- /dev/null +++ b/tests/expectations/compiler/compiler/console/log_parameter.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 38e6b369397fcf11fa921808be61baf33a705d4509bc15a46ec69e1a0aaa5031 + initial_ast: 20bb81a14e5c144a812f70d1b81dd5a5f16acc3e7d44aac2df43ad003308c7d9 + symbol_table: e5159343ab03573032873783b28058a482dd401d534a0d3af03790a5286ba470 diff --git a/tests/expectations/compiler/compiler/console/log_parameter_fail_unknown.leo.out b/tests/expectations/compiler/compiler/console/log_parameter_fail_unknown.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/console/log_parameter_fail_unknown.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/console/log_parameter_many.leo.out b/tests/expectations/compiler/compiler/console/log_parameter_many.leo.out new file mode 100644 index 0000000000..081cc31697 --- /dev/null +++ b/tests/expectations/compiler/compiler/console/log_parameter_many.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 38e6b369397fcf11fa921808be61baf33a705d4509bc15a46ec69e1a0aaa5031 + initial_ast: 63bcef4c2f9221a32a041d4ce1aa645a795d47dbd7590830fa58202ea36785f8 + symbol_table: 757bb967973b87466c01be1a9dc78d30701964e0d234e0e65d1bbcbd3072370f diff --git a/tests/expectations/compiler/compiler/console/log_parameter_unkown_fail.leo.out b/tests/expectations/compiler/compiler/console/log_parameter_unkown_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/console/log_parameter_unkown_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/function/scope_fail.leo.out b/tests/expectations/compiler/compiler/function/scope_fail.leo.out new file mode 100644 index 0000000000..cf561c6ce6 --- /dev/null +++ b/tests/expectations/compiler/compiler/function/scope_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected : -- got '='\n --> compiler-test:9:20\n |\n 9 | const myGlobal = 42field;\n | ^" diff --git a/tests/expectations/compiler/compiler/function/shadow_function_with_input_fail.leo.out b/tests/expectations/compiler/compiler/function/shadow_function_with_input_fail.leo.out new file mode 100644 index 0000000000..3276ba7de3 --- /dev/null +++ b/tests/expectations/compiler/compiler/function/shadow_function_with_input_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EAST0372014]: function `hi` shadowed\n --> compiler-test:3:1\n |\n 3 | function hi() -> u8 {\n 4 | ...\n 5 | }\n | ^\nError [EAST0372014]: function `hi` shadowed\n --> compiler-test:3:1\n |\n 3 | function hi() -> u8 {\n 4 | ...\n 5 | }\n | ^" diff --git a/tests/expectations/compiler/compiler/group/add.leo.out b/tests/expectations/compiler/compiler/group/add.leo.out new file mode 100644 index 0000000000..53cdfcaa2c --- /dev/null +++ b/tests/expectations/compiler/compiler/group/add.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: ee823464d3be14662261697b47c73a67a47c47558987333869ea6e72d6e34ebf + initial_ast: 64c94034bd1ca4bc616b3be459139ef6d65ec92c90093e247c600c6bfd9d30be + symbol_table: b10964224747af7f8ba12f1b3c0dfa228842b3e08b9b82d785b71def31387144 diff --git a/tests/expectations/compiler/compiler/group/assert_eq.leo.out b/tests/expectations/compiler/compiler/group/assert_eq.leo.out new file mode 100644 index 0000000000..231d0180cb --- /dev/null +++ b/tests/expectations/compiler/compiler/group/assert_eq.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: ecd9a5086d5d85f1794e023ff6c06e68cc0b4ae67e3f9abc88cd1354ed8fdfad + initial_ast: a5bfe7c18f041f12f7adc2fb9726eacd225383207b4d3c355bfffe831769bfae + symbol_table: 584d3ba9f7908f1b2e0c918710e78d0a483c12aa3f4644edada2eac31ac689ca diff --git a/tests/expectations/compiler/compiler/group/both_sign_high.leo.out b/tests/expectations/compiler/compiler/group/both_sign_high.leo.out new file mode 100644 index 0000000000..95eac33b77 --- /dev/null +++ b/tests/expectations/compiler/compiler/group/both_sign_high.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: no input + initial_ast: b14d302e43f9f5d759e3399df9c77d6d44b6297c0da78d7f66cde5f2ba252778 + symbol_table: 9a61702119ebc681917d7cb7e40ecafa00354849326bf1182635f27a28da35e9 diff --git a/tests/expectations/compiler/compiler/group/both_sign_inferred.leo.out b/tests/expectations/compiler/compiler/group/both_sign_inferred.leo.out new file mode 100644 index 0000000000..8ee455d309 --- /dev/null +++ b/tests/expectations/compiler/compiler/group/both_sign_inferred.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: no input + initial_ast: 4450d4bd84a116aa500e82a4768d23193ee97159b5449f0ca7736ea769323e39 + symbol_table: e4a96223c049893c904a90f24d069592b33fc137de0f4816cf92089e63663693 diff --git a/tests/expectations/compiler/compiler/group/both_sign_low.leo.out b/tests/expectations/compiler/compiler/group/both_sign_low.leo.out new file mode 100644 index 0000000000..0f2e90db12 --- /dev/null +++ b/tests/expectations/compiler/compiler/group/both_sign_low.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: no input + initial_ast: 5f5ec502724efe67bbe9d168cbea8a9771aedf8c4f7df65c08f6a12be8995af7 + symbol_table: 1817d91b99941ddc2590c6a2777ad8f7d4ba26a8b2a3baa3932f1a08eb540206 diff --git a/tests/expectations/compiler/compiler/group/eq.leo.out b/tests/expectations/compiler/compiler/group/eq.leo.out new file mode 100644 index 0000000000..231d0180cb --- /dev/null +++ b/tests/expectations/compiler/compiler/group/eq.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: ecd9a5086d5d85f1794e023ff6c06e68cc0b4ae67e3f9abc88cd1354ed8fdfad + initial_ast: a5bfe7c18f041f12f7adc2fb9726eacd225383207b4d3c355bfffe831769bfae + symbol_table: 584d3ba9f7908f1b2e0c918710e78d0a483c12aa3f4644edada2eac31ac689ca diff --git a/tests/expectations/compiler/compiler/group/input.leo.out b/tests/expectations/compiler/compiler/group/input.leo.out new file mode 100644 index 0000000000..25b07ca155 --- /dev/null +++ b/tests/expectations/compiler/compiler/group/input.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 5cce2653606494bd949a7631bb7fe6ab255fbcb1618e5e099875e4f1e9c082aa + initial_ast: a5bfe7c18f041f12f7adc2fb9726eacd225383207b4d3c355bfffe831769bfae + symbol_table: 584d3ba9f7908f1b2e0c918710e78d0a483c12aa3f4644edada2eac31ac689ca diff --git a/tests/expectations/compiler/compiler/group/negate.leo.out b/tests/expectations/compiler/compiler/group/negate.leo.out new file mode 100644 index 0000000000..8b71dac270 --- /dev/null +++ b/tests/expectations/compiler/compiler/group/negate.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: ecd9a5086d5d85f1794e023ff6c06e68cc0b4ae67e3f9abc88cd1354ed8fdfad + initial_ast: 7382760a9540b1f7491ab97b3eda2e7687995d37c0e8368c4ff6464f7dda433e + symbol_table: efa845f46b76b7927005e6e7b8ba6353db6f3a783ec1a8b74993ccc97738eadc diff --git a/tests/expectations/compiler/compiler/group/no_space_between_literal.leo.out b/tests/expectations/compiler/compiler/group/no_space_between_literal.leo.out new file mode 100644 index 0000000000..4a09044a4a --- /dev/null +++ b/tests/expectations/compiler/compiler/group/no_space_between_literal.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370004]: Unexpected white space between terms (0,1) and group\n --> compiler-test:4:24\n |\n 4 | const g: group = (0,1) group;\n | ^" diff --git a/tests/expectations/compiler/compiler/group/one.leo.out b/tests/expectations/compiler/compiler/group/one.leo.out new file mode 100644 index 0000000000..1451ff1c88 --- /dev/null +++ b/tests/expectations/compiler/compiler/group/one.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: no input + initial_ast: 8c730537e1bc9efd6b7004201e49eb37a39931a7e579f7c0dbcfdcf59daac4ba + symbol_table: 1459210791fd0aae2827b2b7c3fd438e7a8315b290e23cbfe365b4214d5cd284 diff --git a/tests/expectations/compiler/compiler/group/point.leo.out b/tests/expectations/compiler/compiler/group/point.leo.out new file mode 100644 index 0000000000..da77e02dbc --- /dev/null +++ b/tests/expectations/compiler/compiler/group/point.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: no input + initial_ast: 8d228887cf0ac8a041bfc2d714a945b31974e632dde21636fffa86cfe6d3da84 + symbol_table: ac8c4425959cf548f2f0edc8aa637b1d827394f11fe2c10ecef366a803fe30a2 diff --git a/tests/expectations/compiler/compiler/group/point_input.leo.out b/tests/expectations/compiler/compiler/group/point_input.leo.out new file mode 100644 index 0000000000..4933ddaceb --- /dev/null +++ b/tests/expectations/compiler/compiler/group/point_input.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: e03c4a2ba40d2e844353081fc62efae967d074fb34a08bd30c99dff1387bd3fd + initial_ast: 3e5e6c4e27849e4d2b56f9145a94cda521fdbee41ff24e15dd41f47b9f9cf8db + symbol_table: 0db35c4a8548b1c37607ad3a7d67be41b7949f6219107f4d5ef8442a75dd2a7a diff --git a/tests/expectations/compiler/compiler/group/positive_and_negative.leo.out b/tests/expectations/compiler/compiler/group/positive_and_negative.leo.out new file mode 100644 index 0000000000..b48f91fc0d --- /dev/null +++ b/tests/expectations/compiler/compiler/group/positive_and_negative.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: no input + initial_ast: 6c150c7f1faa1259c42139186ca5715c96d3c9914e89a426e1d833e91df705d1 + symbol_table: 877713c611c84057862de19fa49429efb7c57a29ed3ef686b59c1ab3696c4117 diff --git a/tests/expectations/compiler/compiler/group/sub.leo.out b/tests/expectations/compiler/compiler/group/sub.leo.out new file mode 100644 index 0000000000..cd95267be1 --- /dev/null +++ b/tests/expectations/compiler/compiler/group/sub.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: ee823464d3be14662261697b47c73a67a47c47558987333869ea6e72d6e34ebf + initial_ast: 7f7134f02b190880606fe76adeb58295b48174dc3fda20551b08e452aa859388 + symbol_table: 8d7179908ac5272f4892b2e374ad5c5401332d4d12d7d0505ba1e51a98ef0d6d diff --git a/tests/expectations/compiler/compiler/group/ternary.leo.out b/tests/expectations/compiler/compiler/group/ternary.leo.out new file mode 100644 index 0000000000..8d7bfe585a --- /dev/null +++ b/tests/expectations/compiler/compiler/group/ternary.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: e03c4a2ba40d2e844353081fc62efae967d074fb34a08bd30c99dff1387bd3fd + initial_ast: 408ea050f4db2d1429d0522efe4f3a7713f52097c26dd9feacd725af866a13bf + symbol_table: 5e96e4138e5643222224de143ab32b6716c4dbaf965318b48eaf9e4ba63f8586 diff --git a/tests/expectations/compiler/compiler/group/x_sign_high.leo.out b/tests/expectations/compiler/compiler/group/x_sign_high.leo.out new file mode 100644 index 0000000000..2bf27526a0 --- /dev/null +++ b/tests/expectations/compiler/compiler/group/x_sign_high.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: no input + initial_ast: d862fe6e0c7824b043d51579e3d928d85dbfb3ceb127cff804cf35ab46a0d27f + symbol_table: 2d0db26fa84f8daad71afd4420718043de1c97757ae4fe4fa78e9874891d1d80 diff --git a/tests/expectations/compiler/compiler/group/x_sign_inferred.leo.out b/tests/expectations/compiler/compiler/group/x_sign_inferred.leo.out new file mode 100644 index 0000000000..37c45db3dd --- /dev/null +++ b/tests/expectations/compiler/compiler/group/x_sign_inferred.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: no input + initial_ast: d9131042766bcda201691ff910702675d9a70a9e8501abe6de2fca13e22dddf9 + symbol_table: c20979f64468655131a488980c1de31384fd7ff35561ed569c3db6f2d0bc19cc diff --git a/tests/expectations/compiler/compiler/group/x_sign_low.leo.out b/tests/expectations/compiler/compiler/group/x_sign_low.leo.out new file mode 100644 index 0000000000..794d042cbc --- /dev/null +++ b/tests/expectations/compiler/compiler/group/x_sign_low.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: no input + initial_ast: 6e20ff0d1d9ff333eb7f56da5a239c09864f5e90d5282e734e9faa2c7ccbc76c + symbol_table: f450d14b0bb862b0bec4a5f8d41eb92f7cf951dee469505fb20dbfa25972eb7b diff --git a/tests/expectations/compiler/compiler/group/y_sign_high.leo.out b/tests/expectations/compiler/compiler/group/y_sign_high.leo.out new file mode 100644 index 0000000000..d12a2b8577 --- /dev/null +++ b/tests/expectations/compiler/compiler/group/y_sign_high.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: no input + initial_ast: de1fa4a91757146bd6c659b1507abad6e4b66f5cee22c8e8523a6cdd1212d6ee + symbol_table: 52760622da95d189f6e707df97fc6bba4216fa59022a4ae79d840b9c05fdf5b1 diff --git a/tests/expectations/compiler/compiler/group/y_sign_inferred.leo.out b/tests/expectations/compiler/compiler/group/y_sign_inferred.leo.out new file mode 100644 index 0000000000..0ce2614aea --- /dev/null +++ b/tests/expectations/compiler/compiler/group/y_sign_inferred.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: no input + initial_ast: d3c56fc45ce1638a11aa840a68f67acbcd6d453fd6ef58ed820c82b852806beb + symbol_table: d3bf69e78619e63bc1c56c1efe49712b226f5d477e1c42491d0b31e24d5a98a7 diff --git a/tests/expectations/compiler/compiler/group/y_sign_low.leo.out b/tests/expectations/compiler/compiler/group/y_sign_low.leo.out new file mode 100644 index 0000000000..8169d59831 --- /dev/null +++ b/tests/expectations/compiler/compiler/group/y_sign_low.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: no input + initial_ast: 6f55711d5640711c72ee76879ba01f9a116e3a42125a6fa88fa8985587cfceb0 + symbol_table: 026430e928e2236167d6587cb1885784f30bbc916f75d3a0f42fa7a3f2c6978b diff --git a/tests/expectations/compiler/compiler/group/zero.leo.out b/tests/expectations/compiler/compiler/group/zero.leo.out new file mode 100644 index 0000000000..632eefac2d --- /dev/null +++ b/tests/expectations/compiler/compiler/group/zero.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: no input + initial_ast: cbdc33ff0e2346a4b205b0fcd945c8948bbc574418a9136760e23f11be47df7e + symbol_table: b181fa2d3c50419dbdaadbe2e91aa4a3e17baa614b0635f9ce6fa7367ead48eb diff --git a/tests/expectations/compiler/compiler/integers/i128/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/i128/max_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i128/max_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i128/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/i128/min_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i128/min_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i128/negate_min.leo.out b/tests/expectations/compiler/compiler/integers/i128/negate_min.leo.out new file mode 100644 index 0000000000..4dfa79f1d8 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i128/negate_min.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 + initial_ast: f25f8ff443e8db19544f294dec594f2121e975a27aa500e794d12e38f8e65413 + symbol_table: 49a0f7957853abe54b078bb95a1091e5262b58ecc5ff8b8e546ff1fe82547e1f diff --git a/tests/expectations/compiler/compiler/integers/i16/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/i16/max_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i16/max_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i16/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/i16/min_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i16/min_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i16/negate_min.leo.out b/tests/expectations/compiler/compiler/integers/i16/negate_min.leo.out new file mode 100644 index 0000000000..e3a3a1a3fe --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i16/negate_min.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 + initial_ast: 87411a2334bb03e186ad8e58cb93ebc5e98dc19c49cc8d25505a0fe5a5a694a2 + symbol_table: cc902d05b8e7171b94fb0335b85ef2147427d0840e15360f6a88c4906ebceaa2 diff --git a/tests/expectations/compiler/compiler/integers/i16/negate_min_fail.leo.out b/tests/expectations/compiler/compiler/integers/i16/negate_min_fail.leo.out new file mode 100644 index 0000000000..e3a3a1a3fe --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i16/negate_min_fail.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 + initial_ast: 87411a2334bb03e186ad8e58cb93ebc5e98dc19c49cc8d25505a0fe5a5a694a2 + symbol_table: cc902d05b8e7171b94fb0335b85ef2147427d0840e15360f6a88c4906ebceaa2 diff --git a/tests/expectations/compiler/compiler/integers/i32/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/i32/max_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i32/max_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i32/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/i32/min_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i32/min_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i32/negate_min.leo.out b/tests/expectations/compiler/compiler/integers/i32/negate_min.leo.out new file mode 100644 index 0000000000..ac7d2ab92a --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i32/negate_min.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 + initial_ast: e85a47fcd2f126fda73b6adb5f4ecd52795a765aabf312b1374dbbb96b3e2bad + symbol_table: 4316835ec95347cdf02c020035e9cb3416318c71618d710108c716ae1554d139 diff --git a/tests/expectations/compiler/compiler/integers/i64/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/i64/max_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i64/max_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i64/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/i64/min_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i64/min_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i64/negate_min.leo.out b/tests/expectations/compiler/compiler/integers/i64/negate_min.leo.out new file mode 100644 index 0000000000..b38aa6bf24 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i64/negate_min.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 + initial_ast: ea34d774b6c7baaf3c789cebc97f3b4ee6bfab3bc780344b58906d419709c435 + symbol_table: 927e4c4f2b53eb922fd507cb7faa00e94d47ccdbf16a2a0afe83b57e31873cb2 diff --git a/tests/expectations/compiler/compiler/integers/i8/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/i8/max_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i8/max_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i8/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/i8/min_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i8/min_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i8/negate_min.leo.out b/tests/expectations/compiler/compiler/integers/i8/negate_min.leo.out new file mode 100644 index 0000000000..c1c3957b04 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i8/negate_min.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 3674d8249023145121ff35eb4d9e59b0ce79cda7e17f9f98b5dbaa6ba4f80cf2 + initial_ast: 79499af29661bd059f4bbd1997f99eb96552b6842e21911d82da6fc5c2e36dd5 + symbol_table: 480e1058cba976845e762dbcc1568635f4940fb87dc8e89da28b568f16febfac diff --git a/tests/expectations/compiler/compiler/integers/u128/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/u128/max_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/u128/max_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u128/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/u128/min_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/u128/min_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u16/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/u16/max_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/u16/max_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u16/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/u16/min_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/u16/min_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u32/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/u32/max_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/u32/max_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u32/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/u32/min_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/u32/min_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u64/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/u64/max_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/u64/max_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u64/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/u64/min_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/u64/min_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u8/max_fail.leo.out b/tests/expectations/compiler/compiler/integers/u8/max_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/u8/max_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u8/min_fail.leo.out b/tests/expectations/compiler/compiler/integers/u8/min_fail.leo.out new file mode 100644 index 0000000000..6072996488 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/u8/min_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/statements/all_loops.leo.out b/tests/expectations/compiler/compiler/statements/all_loops.leo.out new file mode 100644 index 0000000000..0477c00ee5 --- /dev/null +++ b/tests/expectations/compiler/compiler/statements/all_loops.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 0431e7bfd2506632ab038adc1a10c45951fc1f90f1b61930228ed3022006d315 + initial_ast: 81665afabc473c27c41707ed83231dd872813d6c4bcbcb6cb0923261eb9b006c + symbol_table: 3f85b29e75222f03e70b83cbc2399746f23dbbeabd857acaa486db9e8076c03c diff --git a/tests/expectations/compiler/compiler/statements/assign_ternary.leo.out b/tests/expectations/compiler/compiler/statements/assign_ternary.leo.out new file mode 100644 index 0000000000..bc2fcb5fec --- /dev/null +++ b/tests/expectations/compiler/compiler/statements/assign_ternary.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:23\n |\n 3 | function main(x: u32) {\n | ^" diff --git a/tests/expectations/compiler/compiler/statements/block.leo.out b/tests/expectations/compiler/compiler/statements/block.leo.out new file mode 100644 index 0000000000..fdb195b471 --- /dev/null +++ b/tests/expectations/compiler/compiler/statements/block.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 7f5eb67955fff9556d758dea428c97687be661cf6ef33f8acf736e3e77d487f8 + initial_ast: 0ab9aaa950215c96b207e236e15857a4d0f66a137dd2c44071be7d806b0850b6 + symbol_table: ce729d406fca8cbf2bc8fea55010b163168705232be0ce9edaeff1c187269d54 diff --git a/tests/expectations/compiler/compiler/statements/duplicate_variable.leo.out b/tests/expectations/compiler/compiler/statements/duplicate_variable.leo.out new file mode 100644 index 0000000000..f72840a998 --- /dev/null +++ b/tests/expectations/compiler/compiler/statements/duplicate_variable.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EAST0372015]: variable `x` shadowed\n --> compiler-test:4:2\n |\n 4 | \tlet x: u8 = 1u8;\n | ^^^^^^^^^^^^^^^\nError [EAST0372015]: variable `x` shadowed\n --> compiler-test:4:2\n |\n 4 | \tlet x: u8 = 1u8;\n | ^^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/statements/for_loop.leo.out b/tests/expectations/compiler/compiler/statements/for_loop.leo.out new file mode 100644 index 0000000000..2cd458b83e --- /dev/null +++ b/tests/expectations/compiler/compiler/statements/for_loop.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 7f5eb67955fff9556d758dea428c97687be661cf6ef33f8acf736e3e77d487f8 + initial_ast: a3eb3afb0d01504a949f76baa11f119955aa29bc9e57ec0b8823b48c3b1e45e7 + symbol_table: 69da3b565e7a6a957b957fa0726be3d3f849cd1c71d5d1d5bbbcf1c5620b1c07 diff --git a/tests/expectations/compiler/compiler/statements/iteration_basic.leo.out b/tests/expectations/compiler/compiler/statements/iteration_basic.leo.out new file mode 100644 index 0000000000..6dc876466d --- /dev/null +++ b/tests/expectations/compiler/compiler/statements/iteration_basic.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 7f5eb67955fff9556d758dea428c97687be661cf6ef33f8acf736e3e77d487f8 + initial_ast: 63565858ee45b7520a60fd504151e2deb023601da8289a8fa25841488fbe7602 + symbol_table: 210a8b745bd95b8350226242f6b51656f817fadb90c768564b0c6f4f8dcfa706 diff --git a/tests/expectations/compiler/compiler/statements/iteration_variable.leo.out b/tests/expectations/compiler/compiler/statements/iteration_variable.leo.out new file mode 100644 index 0000000000..3fc156ac7a --- /dev/null +++ b/tests/expectations/compiler/compiler/statements/iteration_variable.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 7f5eb67955fff9556d758dea428c97687be661cf6ef33f8acf736e3e77d487f8 + initial_ast: fe85afd83a8a1f1c33be0b8d061ea699b4b250a0c2d4b6a557fe224eaf391c1b + symbol_table: 8b6313fa019dfc473aea778b67ecf00f38110f339c9c0fb416b221994f8f9c7b From b79b961610da1ad0f23300ac28895aa12045a246 Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Thu, 5 May 2022 15:44:33 -0700 Subject: [PATCH 13/16] make new tests --- tests/compiler/field/pow_signed.leo | 11 +++++++++++ tests/compiler/field/pow_unsigned.leo | 11 +++++++++++ tests/compiler/group/inputs/one.in | 5 +++++ tests/compiler/group/mult_by_group_fail.leo | 9 +++++++++ tests/compiler/group/mult_by_scalar.leo | 9 +++++++++ .../compiler/compiler/field/pow_signed.leo.out | 8 ++++++++ .../compiler/compiler/field/pow_unsigned.leo.out | 8 ++++++++ .../compiler/group/mult_by_group_fail.leo.out | 5 +++++ .../compiler/compiler/group/mult_by_scalar.leo.out | 8 ++++++++ 9 files changed, 74 insertions(+) create mode 100644 tests/compiler/field/pow_signed.leo create mode 100644 tests/compiler/field/pow_unsigned.leo create mode 100644 tests/compiler/group/inputs/one.in create mode 100644 tests/compiler/group/mult_by_group_fail.leo create mode 100644 tests/compiler/group/mult_by_scalar.leo create mode 100644 tests/expectations/compiler/compiler/field/pow_signed.leo.out create mode 100644 tests/expectations/compiler/compiler/field/pow_unsigned.leo.out create mode 100644 tests/expectations/compiler/compiler/group/mult_by_group_fail.leo.out create mode 100644 tests/expectations/compiler/compiler/group/mult_by_scalar.leo.out diff --git a/tests/compiler/field/pow_signed.leo b/tests/compiler/field/pow_signed.leo new file mode 100644 index 0000000000..bbf73125e3 --- /dev/null +++ b/tests/compiler/field/pow_signed.leo @@ -0,0 +1,11 @@ +/* +namespace: Compile +expectation: Pass +input_file: + - inputs/fields.in +*/ + +function main(a: field) -> bool { + const negOneField: field = -1field; + return negOneField ** 2i8 == 1field; +} \ No newline at end of file diff --git a/tests/compiler/field/pow_unsigned.leo b/tests/compiler/field/pow_unsigned.leo new file mode 100644 index 0000000000..a1be2ef32f --- /dev/null +++ b/tests/compiler/field/pow_unsigned.leo @@ -0,0 +1,11 @@ +/* +namespace: Compile +expectation: Pass +input_file: + - inputs/fields.in +*/ + +function main(a: field) -> bool { + const negOneField: field = -1field; + return negOneField ** 2u8 == 1field; +} \ No newline at end of file diff --git a/tests/compiler/group/inputs/one.in b/tests/compiler/group/inputs/one.in new file mode 100644 index 0000000000..e346abfd7b --- /dev/null +++ b/tests/compiler/group/inputs/one.in @@ -0,0 +1,5 @@ +[main] +a: group = (7374112779530666882856915975292384652154477718021969292781165691637980424078, 3435195339177955418892975564890903138308061187980579490487898366607011481796)group; + +[registers] +r0: group = (_, _)group; \ No newline at end of file diff --git a/tests/compiler/group/mult_by_group_fail.leo b/tests/compiler/group/mult_by_group_fail.leo new file mode 100644 index 0000000000..6436c3a689 --- /dev/null +++ b/tests/compiler/group/mult_by_group_fail.leo @@ -0,0 +1,9 @@ +/* +namespace: Compile +expectation: Fail +input_file: inputs/one.in +*/ + +function main(a: group) -> group { + return (_, _)group * a; +} \ No newline at end of file diff --git a/tests/compiler/group/mult_by_scalar.leo b/tests/compiler/group/mult_by_scalar.leo new file mode 100644 index 0000000000..ae57bb7c02 --- /dev/null +++ b/tests/compiler/group/mult_by_scalar.leo @@ -0,0 +1,9 @@ +/* +namespace: Compile +expectation: Pass +input_file: inputs/one.in +*/ + +function main(a: group) -> group { + return 1u8 * a; +} \ No newline at end of file diff --git a/tests/expectations/compiler/compiler/field/pow_signed.leo.out b/tests/expectations/compiler/compiler/field/pow_signed.leo.out new file mode 100644 index 0000000000..c1a0ccf2f5 --- /dev/null +++ b/tests/expectations/compiler/compiler/field/pow_signed.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148 + initial_ast: 54e7ff665e23816752eb03e1e93ab90f8348464bac12636baa1d84938e6faccf + symbol_table: c04c06d2f689387637bac27fff30cdaa87ec9b49fc03e1fe56b1e04029b6f925 diff --git a/tests/expectations/compiler/compiler/field/pow_unsigned.leo.out b/tests/expectations/compiler/compiler/field/pow_unsigned.leo.out new file mode 100644 index 0000000000..4e38d23139 --- /dev/null +++ b/tests/expectations/compiler/compiler/field/pow_unsigned.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148 + initial_ast: f5cde73247b7a36bb9021c8c5d60def92773fd994eec0f1ee76738a7a54a8ca0 + symbol_table: 5527b2434b61b94d365ba1e8bd1c2173b9feef5aa21c99440920259fb7df2052 diff --git a/tests/expectations/compiler/compiler/group/mult_by_group_fail.leo.out b/tests/expectations/compiler/compiler/group/mult_by_group_fail.leo.out new file mode 100644 index 0000000000..569024160b --- /dev/null +++ b/tests/expectations/compiler/compiler/group/mult_by_group_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [ETYC0372007]: Expected one type from `i8,i16,i32,i64,i128,u8,u16,u32,u64,u128,`, but got `group`\n --> compiler-test:4:12\n |\n 4 | return (_, _)group * a;\n | ^^^^^^^^^^^^^^^\nError [ETYC0372007]: Expected one type from `i8,i16,i32,i64,i128,u8,u16,u32,u64,u128,`, but got `group`\n --> compiler-test:4:12\n |\n 4 | return (_, _)group * a;\n | ^^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/group/mult_by_scalar.leo.out b/tests/expectations/compiler/compiler/group/mult_by_scalar.leo.out new file mode 100644 index 0000000000..50eb57e79f --- /dev/null +++ b/tests/expectations/compiler/compiler/group/mult_by_scalar.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: e765a6e8209951902a890e711b0ebb6b22dfd84149ae1a69bce43530008c17c3 + initial_ast: c1c65a71052cd2891e9eb519955d47ba33327d8a5c6aabdaa35f1dd312aa656b + symbol_table: 8e39b2bdad6276a42437b673faa0d1dd4f762a9778de1a1e2c8f8edbe5002be4 From ab57ea1d34396454427eb44aaa4f2087e2fe43b5 Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Thu, 5 May 2022 15:49:08 -0700 Subject: [PATCH 14/16] fmt compiler test --- compiler/compiler/src/test.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/compiler/compiler/src/test.rs b/compiler/compiler/src/test.rs index 9511e74e23..72549089ed 100644 --- a/compiler/compiler/src/test.rs +++ b/compiler/compiler/src/test.rs @@ -106,9 +106,7 @@ fn get_input_file_paths(list: &mut Vec, test: &Test, input: &Value) { for name in seq { let mut input_file = input_file.clone(); input_file.push(name.as_str().expect("input_file was not a string")); - list.push( - input_file.clone(), - ); + list.push(input_file.clone()); } } } @@ -124,9 +122,7 @@ fn collect_all_inputs(test: &Test) -> Result, String> { Ok(list) } -fn compile_and_process<'a>( - parsed: &'a mut Compiler<'a>, -) -> Result, LeoError> { +fn compile_and_process<'a>(parsed: &'a mut Compiler<'a>) -> Result, LeoError> { parsed.compiler_stages() } @@ -199,15 +195,12 @@ fn run_test(test: Test, handler: &Handler, err_buf: &BufferEmitter) -> Result Date: Thu, 5 May 2022 15:58:41 -0700 Subject: [PATCH 15/16] missed regening a test --- .../parser/statement/definition_fail.leo.out | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/expectations/parser/parser/statement/definition_fail.leo.out b/tests/expectations/parser/parser/statement/definition_fail.leo.out index d656dcf2e4..48074c2ff5 100644 --- a/tests/expectations/parser/parser/statement/definition_fail.leo.out +++ b/tests/expectations/parser/parser/statement/definition_fail.leo.out @@ -25,23 +25,23 @@ outputs: - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:10\n |\n 1 | let (x,y,,) = ();\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:6\n |\n 1 | let (,x,y) = ();\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:8\n |\n 1 | let (x,,y) = ();\n | ^" - - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool' -- got '['\n --> test:1:8\n |\n 1 | let x: [u8; (2,,)] = [[0,0], [0,0]];\n | ^" - - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool' -- got 'const'\n --> test:1:8\n |\n 1 | let x: const = expr;\n | ^^^^^" - - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool' -- got 'let'\n --> test:1:10\n |\n 1 | const x: let = expr;\n | ^^^" - - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool' -- got 'mut'\n --> test:1:8\n |\n 1 | let x: mut = expr;\n | ^^^" + - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool', 'char' -- got '['\n --> test:1:8\n |\n 1 | let x: [u8; (2,,)] = [[0,0], [0,0]];\n | ^" + - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool', 'char' -- got 'const'\n --> test:1:8\n |\n 1 | let x: const = expr;\n | ^^^^^" + - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool', 'char' -- got 'let'\n --> test:1:10\n |\n 1 | const x: let = expr;\n | ^^^" + - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool', 'char' -- got 'mut'\n --> test:1:8\n |\n 1 | let x: mut = expr;\n | ^^^" - "Error [EPAR0370009]: unexpected string: expected 'ident', got ''\n --> test:1:1\n |\n 1 | let\n | ^^^" - "Error [EPAR0370005]: expected : -- got ''\n --> test:1:5\n |\n 1 | let x\n | ^" - - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool' -- got ''\n --> test:1:6\n |\n 1 | let x:\n | ^" + - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool', 'char' -- got ''\n --> test:1:6\n |\n 1 | let x:\n | ^" - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = (a, y]);\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'ident', got '='\n --> test:1:5\n |\n 1 | let = 1u8;\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'ident', got ';'\n --> test:1:4\n |\n 1 | let;\n | ^" - "Error [EPAR0370005]: expected : -- got '1'\n --> test:1:7\n |\n 1 | let x 1u8;\n | ^" - "Error [EPAR0370005]: expected = -- got ';'\n --> test:1:10\n |\n 1 | let x: u8;\n | ^" - "Error [EPAR0370005]: expected = -- got ''\n --> test:1:8\n |\n 1 | let x: u8\n | ^^" - - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool' -- got '='\n --> test:1:8\n |\n 1 | let x: = 1;\n | ^" - - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool' -- got '['\n --> test:1:8\n |\n 1 | let x: [u8] = 1;\n | ^" - - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool' -- got '['\n --> test:1:8\n |\n 1 | let x: [u8;\n | ^" - - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool' -- got '['\n --> test:1:8\n |\n 1 | let x: [u8; 1u8] = [1,\n | ^" + - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool', 'char' -- got '='\n --> test:1:8\n |\n 1 | let x: = 1;\n | ^" + - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool', 'char' -- got '['\n --> test:1:8\n |\n 1 | let x: [u8] = 1;\n | ^" + - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool', 'char' -- got '['\n --> test:1:8\n |\n 1 | let x: [u8;\n | ^" + - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool', 'char' -- got '['\n --> test:1:8\n |\n 1 | let x: [u8; 1u8] = [1,\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got ']'\n --> test:1:15\n |\n 1 | let dbg: u8 = ];\n | ^" - "Error [EPAR0370030]: Could not lex the following content: `🦀: u8 = 0;`." - "Error [EPAR0370039]: do not put parens around single variable names\n --> test:1:6\n |\n 1 | let (x) = ...;\n | ^\nError [EPAR0370005]: expected : -- got '='\n --> test:1:9\n |\n 1 | let (x) = ...;\n | ^" From 45056ec27b73384a79d3ae4f46cd8ddb2fecb4cb Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Tue, 10 May 2022 11:06:59 -0700 Subject: [PATCH 16/16] spelling --- compiler/passes/src/lib.rs | 2 +- compiler/passes/src/type_checker/checker.rs | 4 ++-- compiler/passes/src/type_checker/mod.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/passes/src/lib.rs b/compiler/passes/src/lib.rs index 4d56f75550..adaebe818d 100644 --- a/compiler/passes/src/lib.rs +++ b/compiler/passes/src/lib.rs @@ -16,7 +16,7 @@ #![doc = include_str!("../README.md")] -// disable +// Temporarily disable canonicalization. /* pub mod canonicalization; pub use canonicalization::*; */ diff --git a/compiler/passes/src/type_checker/checker.rs b/compiler/passes/src/type_checker/checker.rs index c38eebf023..2039a66cdd 100644 --- a/compiler/passes/src/type_checker/checker.rs +++ b/compiler/passes/src/type_checker/checker.rs @@ -27,7 +27,7 @@ pub struct TypeChecker<'a> { pub(crate) negate: bool, } -const ARITHMATIC_TYPES: &[Type] = &[ +const ARITHMETIC_TYPES: &[Type] = &[ Type::Field, Type::Group, Type::IntegerType(IntegerType::I8), @@ -112,7 +112,7 @@ impl<'a> TypeChecker<'a> { } pub(crate) fn assert_arith_type(&self, type_: Option, span: &Span) -> Option { - self.assert_one_of_types(type_, ARITHMATIC_TYPES, span) + self.assert_one_of_types(type_, ARITHMETIC_TYPES, span) } pub(crate) fn assert_field_or_int_type(&self, type_: Option, span: &Span) -> Option { diff --git a/compiler/passes/src/type_checker/mod.rs b/compiler/passes/src/type_checker/mod.rs index 3f9604f275..43d71a09f2 100644 --- a/compiler/passes/src/type_checker/mod.rs +++ b/compiler/passes/src/type_checker/mod.rs @@ -38,7 +38,7 @@ impl<'a> Pass<'a> for TypeChecker<'a> { fn do_pass((ast, symbol_table, handler): Self::Input) -> Self::Output { let mut visitor = VisitorDirector::new(TypeChecker::new(symbol_table, handler)); visitor.visit_program(ast.as_repr()); - // awkward cause last error double prints... + // todo @gluax: awkward cause last error double prints... // but can't os exit or it causes tests to stop. handler.last_err()?;