From c272180a9e022fda137a74aea024804aa51cdf07 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Jul 2022 10:21:03 +0000 Subject: [PATCH 01/37] Bump regex from 1.5.6 to 1.6.0 Bumps [regex](https://github.com/rust-lang/regex) from 1.5.6 to 1.6.0. - [Release notes](https://github.com/rust-lang/regex/releases) - [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/regex/compare/1.5.6...1.6.0) --- updated-dependencies: - dependency-name: regex dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- tests/test-framework/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a37382b0bf..c487116ccb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1839,9 +1839,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.6" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "aho-corasick", "memchr", @@ -1856,9 +1856,9 @@ checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-syntax" -version = "0.6.26" +version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "remove_dir_all" diff --git a/tests/test-framework/Cargo.toml b/tests/test-framework/Cargo.toml index dfef7b4e56..911d322ec5 100644 --- a/tests/test-framework/Cargo.toml +++ b/tests/test-framework/Cargo.toml @@ -45,7 +45,7 @@ path = "../../leo/errors" version = "1.5.3" [dependencies.regex] -version = "1.5" +version = "1.6" [dev-dependencies.criterion] version = "0.3" From 24f38721d6be4ad2f35ae3e9d4dc07aa1c387279 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Fri, 1 Jul 2022 15:55:35 -0700 Subject: [PATCH 02/37] Pull changes to compiler/passes/symbol_table from improved-flattening; remove unused files --- compiler/passes/src/symbol_table/create.rs | 7 +- .../src/symbol_table/function_symbol.rs | 39 +++ compiler/passes/src/symbol_table/mod.rs | 10 +- compiler/passes/src/symbol_table/table.rs | 243 +++++++++++++----- .../passes/src/symbol_table/variable_scope.rs | 78 ------ .../src/symbol_table/variable_symbol.rs | 57 ++-- 6 files changed, 260 insertions(+), 174 deletions(-) create mode 100644 compiler/passes/src/symbol_table/function_symbol.rs delete mode 100644 compiler/passes/src/symbol_table/variable_scope.rs diff --git a/compiler/passes/src/symbol_table/create.rs b/compiler/passes/src/symbol_table/create.rs index aaa85c5e26..059878badd 100644 --- a/compiler/passes/src/symbol_table/create.rs +++ b/compiler/passes/src/symbol_table/create.rs @@ -20,20 +20,17 @@ use leo_errors::emitter::Handler; use crate::SymbolTable; pub struct CreateSymbolTable<'a> { - symbol_table: SymbolTable<'a>, + pub(crate) symbol_table: SymbolTable, handler: &'a Handler, } impl<'a> CreateSymbolTable<'a> { pub fn new(handler: &'a Handler) -> Self { Self { - symbol_table: SymbolTable::default(), + symbol_table: Default::default(), handler, } } - pub fn symbol_table(self) -> SymbolTable<'a> { - self.symbol_table - } } impl<'a> ExpressionVisitor<'a> for CreateSymbolTable<'a> { diff --git a/compiler/passes/src/symbol_table/function_symbol.rs b/compiler/passes/src/symbol_table/function_symbol.rs new file mode 100644 index 0000000000..7123adf53e --- /dev/null +++ b/compiler/passes/src/symbol_table/function_symbol.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 . + +use leo_ast::{Function, FunctionInput, Type}; +use leo_span::Span; + +use crate::SymbolTable; + +#[derive(Clone, Debug)] +pub struct FunctionSymbol { + pub(crate) id: usize, + pub(crate) type_: Type, + pub(crate) span: Span, + pub(crate) input: Vec, +} + +impl SymbolTable { + pub(crate) fn new_function_symbol(id: usize, func: &Function) -> FunctionSymbol { + FunctionSymbol { + id, + type_: func.output, + span: func.span, + input: func.input.clone(), + } + } +} diff --git a/compiler/passes/src/symbol_table/mod.rs b/compiler/passes/src/symbol_table/mod.rs index 67f5727b74..7e3f793e38 100644 --- a/compiler/passes/src/symbol_table/mod.rs +++ b/compiler/passes/src/symbol_table/mod.rs @@ -17,12 +17,12 @@ pub mod create; pub use create::*; +pub mod function_symbol; +pub use function_symbol::*; + pub mod table; pub use table::*; -pub mod variable_scope; -pub use variable_scope::*; - pub mod variable_symbol; pub use variable_symbol::*; @@ -33,13 +33,13 @@ use leo_errors::{emitter::Handler, Result}; impl<'a> Pass for CreateSymbolTable<'a> { type Input = (&'a Ast, &'a Handler); - type Output = Result>; + type Output = Result; fn do_pass((ast, handler): Self::Input) -> Self::Output { let mut visitor = CreateSymbolTable::new(handler); visitor.visit_program(ast.as_repr()); handler.last_err()?; - Ok(visitor.symbol_table()) + Ok(visitor.symbol_table) } } diff --git a/compiler/passes/src/symbol_table/table.rs b/compiler/passes/src/symbol_table/table.rs index 52a1c9cd7a..954923f79f 100644 --- a/compiler/passes/src/symbol_table/table.rs +++ b/compiler/passes/src/symbol_table/table.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use std::fmt::Display; +use std::cell::RefCell; use leo_ast::{Circuit, Function}; use leo_errors::{AstError, Result}; @@ -22,100 +22,207 @@ use leo_span::{Span, Symbol}; use indexmap::IndexMap; -use crate::{VariableScope, VariableSymbol}; +use crate::{Declaration, FunctionSymbol, Value, VariableSymbol}; -#[derive(Clone, Debug, Default, Eq, PartialEq)] -pub struct SymbolTable<'a> { - /// Maps function names to function definitions. +#[derive(Clone, Debug, Default)] +pub struct SymbolTable { + /// The parent scope if it exists. + /// For example if we are in a if block inside a function. + pub(crate) parent: Option>, + /// Functions represents the name of each function mapped to the Ast's function definition. /// This field is populated at a first pass. - functions: IndexMap, + pub functions: IndexMap, /// Maps circuit names to circuit definitions. /// This field is populated at a first pass. - circuits: IndexMap, - /// Variables represents functions variable definitions and input variables. - /// This field is not populated till necessary. - pub(crate) variables: VariableScope<'a>, + pub circuits: IndexMap, + /// The variables defined in a scope. + /// This field is populated as necessary. + pub(crate) variables: IndexMap, + /// The index of the current scope + pub(crate) scope_index: usize, + /// If the block will always be executed when the parent block is executed + pub(crate) is_locally_non_const: bool, + /// The subscopes of this scope + pub(crate) scopes: Vec>, } -impl<'a> SymbolTable<'a> { +impl SymbolTable { pub fn check_shadowing(&self, symbol: Symbol, span: Span) -> Result<()> { - if self.functions.contains_key(&symbol) { + if self.variables.contains_key(&symbol) { + Err(AstError::shadowed_variable(symbol, span).into()) + } else if self.functions.contains_key(&symbol) { Err(AstError::shadowed_function(symbol, span).into()) + } else if let Some(existing) = self.circuits.get(&symbol) { + match existing.is_record { + true => Err(AstError::shadowed_record(symbol, insert.span).into()), + false => Err(AstError::shadowed_circuit(symbol, span).into()) + } + } else if let Some(parent) = self.parent.as_ref() { + parent.check_shadowing(symbol, span) } else { - self.variables.check_shadowing(symbol, span)?; Ok(()) } } - pub fn clear_variables(&mut self) { - self.variables.clear(); + pub fn scope_index(&mut self) -> usize { + let index = self.scope_index; + self.scope_index += 1; + index } - pub fn insert_fn(&mut self, symbol: Symbol, insert: &'a Function) -> Result<()> { + pub fn insert_fn(&mut self, symbol: Symbol, insert: &Function) -> Result<()> { self.check_shadowing(symbol, insert.span)?; - self.functions.insert(symbol, insert); + let id = self.scope_index(); + self.functions.insert(symbol, Self::new_function_symbol(id, insert)); + self.scopes.push(Default::default()); Ok(()) } - pub fn insert_circuit(&mut self, symbol: Symbol, insert: &'a Circuit) -> Result<()> { - if let Some(existing) = self.circuits.get(&symbol) { - // Error if the circuit or record already exists. - let err = if existing.is_record { - AstError::shadowed_record(symbol, insert.span).into() + pub fn insert_circuit(&mut self, symbol: Symbol, insert: &Circuit) -> Result<()> { + self.check_shadowing(symbol, insert.span)?; + self.circuits.insert(symbol, insert.clone()); + Ok(()) + } + + pub fn insert_variable(&mut self, symbol: Symbol, insert: VariableSymbol) -> Result<()> { + self.check_shadowing(symbol, insert.span)?; + self.variables.insert(symbol, insert); + Ok(()) + } + + pub fn insert_block(&mut self, is_locally_non_const: bool) -> usize { + self.scopes.push(RefCell::new(SymbolTable { + is_locally_non_const, + ..Default::default() + })); + self.scope_index() + } + + pub fn lookup_fn(&self, symbol: &Symbol) -> Option<&FunctionSymbol> { + if let Some(func) = self.functions.get(symbol) { + Some(func) + } else if let Some(parent) = self.parent.as_ref() { + parent.lookup_fn(symbol) + } else { + None + } + } + + pub fn lookup_circuit(&self, symbol: &Symbol) -> Option<&Circuit> { + if let Some(circ) = self.circuits.get(symbol) { + Some(circ) + } else if let Some(parent) = self.parent.as_ref() { + parent.lookup_circuit(symbol) + } else { + None + } + } + + pub fn lookup_variable(&self, symbol: &Symbol) -> Option<&VariableSymbol> { + if let Some(var) = self.variables.get(symbol) { + Some(var) + } else if let Some(parent) = self.parent.as_ref() { + parent.lookup_variable(symbol) + } else { + None + } + } + + /// Returns true if the variable exists in the local scope + pub fn variable_in_local_scope(&self, symbol: &Symbol) -> bool { + self.variables.contains_key(symbol) + } + + /// Returns true if the variable exists in any parent scope + pub fn variable_in_parent_scope(&self, symbol: &Symbol) -> bool { + if let Some(parent) = self.parent.as_ref() { + if parent.variables.contains_key(symbol) { + true } else { - AstError::shadowed_circuit(symbol, insert.span).into() + parent.variable_in_parent_scope(symbol) + } + } else { + false + } + } + + pub fn lookup_variable_mut(&mut self, symbol: &Symbol) -> Option<&mut VariableSymbol> { + if let Some(var) = self.variables.get_mut(symbol) { + Some(var) + } else if let Some(parent) = self.parent.as_mut() { + parent.lookup_variable_mut(symbol) + } else { + None + } + } + + /// Finds the variable in the parent scope, then SHADOWS it in most recent non-const scope with a mut const value. + /// returns a boolean for if the variable should be slated for deconstification + pub fn locally_constify_variable(&mut self, symbol: Symbol, value: Value) -> bool { + let mut var = self + .lookup_variable(&symbol) + .unwrap_or_else(|| panic!("attempting to constify non-existent variable `{symbol}`")) + .clone(); + var.declaration = Declaration::Mut(Some(value)); + + let mut st = self; + loop { + let is_in_parent = st.variable_in_parent_scope(&symbol); + let is_in_local = st.variable_in_local_scope(&symbol); + if is_in_local && is_in_parent { + st.variables.insert(symbol, var.clone()); + } else if st.is_locally_non_const && !is_in_parent { + st.variables.insert(symbol, var); + break false; + } else if st.is_locally_non_const && is_in_parent { + st.variables.insert(symbol, var); + break true; + } + + if !st.is_locally_non_const && st.parent.is_some() && is_in_parent { + st = st.parent.as_mut().unwrap() + } else { + break true; + } + } + } + + pub fn set_variable(&mut self, symbol: &Symbol, value: Value) -> bool { + if let Some(var) = self.variables.get_mut(symbol) { + var.declaration = match &var.declaration { + Declaration::Const(_) => Declaration::Const(Some(value)), + Declaration::Mut(_) => Declaration::Mut(Some(value)), + other => other.clone(), }; - return Err(err); + true + } else if let Some(parent) = &mut self.parent { + parent.set_variable(symbol, value) + } else { + false } - self.circuits.insert(symbol, insert); - Ok(()) } - pub fn insert_variable(&mut self, symbol: Symbol, insert: VariableSymbol<'a>) -> Result<()> { - self.check_shadowing(symbol, insert.span)?; - self.variables.variables.insert(symbol, insert); - Ok(()) + /// Finds all previous occurrences of the variable and replaces it with a non-const mutable value + pub fn deconstify_variable(&mut self, symbol: &Symbol) { + if let Some(var) = self.variables.get_mut(symbol) { + var.declaration = Declaration::Mut(None); + } + if let Some(parent) = &mut self.parent { + parent.deconstify_variable(symbol) + } } - pub fn lookup_fn(&self, symbol: Symbol) -> Option<&&'a Function> { - self.functions.get(&symbol) + pub fn get_fn_scope(&self, symbol: &Symbol) -> Option<&RefCell> { + if let Some(func) = self.functions.get(symbol) { + self.scopes.get(func.id) + } else if let Some(parent) = self.parent.as_ref() { + parent.get_fn_scope(symbol) + } else { + None + } } - pub fn lookup_circuit(&self, symbol: &Symbol) -> Option<&&'a Circuit> { - self.circuits.get(symbol) - } - - pub fn lookup_variable(&self, symbol: &Symbol) -> Option<&VariableSymbol<'a>> { - self.variables.lookup_variable(symbol) - } - - pub fn push_variable_scope(&mut self) { - let current_scope = self.variables.clone(); - self.variables = VariableScope { - parent: Some(Box::new(current_scope)), - variables: Default::default(), - }; - } - - pub fn pop_variable_scope(&mut self) { - let parent = self.variables.parent.clone().unwrap(); - - self.variables = *parent; - } -} - -impl Display for SymbolTable<'_> { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "SymbolTable")?; - - for func in self.functions.values() { - write!(f, "{func}")?; - } - - for circ in self.circuits.values() { - write!(f, "{circ}")?; - } - - write!(f, "{}", self.variables) + pub fn get_block_scope(&self, index: usize) -> Option<&RefCell> { + self.scopes.get(index) } } diff --git a/compiler/passes/src/symbol_table/variable_scope.rs b/compiler/passes/src/symbol_table/variable_scope.rs deleted file mode 100644 index 4c8ca8b93f..0000000000 --- a/compiler/passes/src/symbol_table/variable_scope.rs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use std::fmt::Display; - -use indexmap::IndexMap; -use leo_errors::{AstError, Result}; -use leo_span::{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, span: Span) -> Result<()> { - if self.variables.contains_key(&symbol) { - Err(AstError::shadowed_variable(symbol, span).into()) - } else if let Some(parent) = &self.parent { - parent.check_shadowing(symbol, span) - } else { - Ok(()) - } - } - - pub fn clear(&mut self) { - 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> { - 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 c96aaffecb..28812022c4 100644 --- a/compiler/passes/src/symbol_table/variable_symbol.rs +++ b/compiler/passes/src/symbol_table/variable_symbol.rs @@ -14,40 +14,61 @@ // 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 leo_ast::{ParamMode, Type}; +use leo_ast::{Identifier, ParamMode, Type}; +use leo_errors::Result; use leo_span::Span; +use crate::Value; + #[derive(Clone, Debug, Eq, PartialEq)] pub enum Declaration { - Const, - Input(ParamMode), - Mut, + Const(Option), + Input(Type, ParamMode), + Mut(Option), } -impl Display for Declaration { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl Declaration { + pub fn get_as_u128(&self) -> Result> { use Declaration::*; match self { - Const => write!(f, "const var"), - Input(m) => write!(f, "{m} input"), - Mut => write!(f, "mut var"), + Const(Some(value)) => Ok(Some(value.try_into()?)), + Input(_, _) => Ok(None), + _ => Ok(None), + } + } + + pub fn get_type(&self) -> Option { + use Declaration::*; + + match self { + Const(Some(value)) => Some(value.into()), + Input(type_, _) => Some(*type_), + _ => None, } } } -#[derive(Clone, Debug, Eq, PartialEq)] -pub struct VariableSymbol<'a> { - pub type_: &'a Type, +impl AsRef for Declaration { + fn as_ref(&self) -> &Self { + self + } +} + +#[derive(Clone, Debug)] +pub struct VariableSymbol { + pub type_: Type, pub span: Span, pub declaration: Declaration, } -impl<'a> Display for VariableSymbol<'a> { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}: {}", self.declaration, self.type_)?; - Ok(()) +impl VariableSymbol { + pub fn get_const_value(&self, ident: Identifier) -> Option { + use Declaration::*; + match &self.declaration { + Const(Some(v)) | Mut(Some(v)) => Some(v.clone()), + Input(type_, ParamMode::Const) => Some(Value::Input(*type_, ident)), + _ => None, + } } } From bd1b8251c27fc89de33e8b29fc96a403f1a9f0b4 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Fri, 1 Jul 2022 20:01:39 -0700 Subject: [PATCH 03/37] Remove SymbolTable functionality associated with flattening --- .../src/symbol_table/function_symbol.rs | 4 +- compiler/passes/src/symbol_table/table.rs | 67 +------------------ .../src/symbol_table/variable_symbol.rs | 53 +++++---------- 3 files changed, 21 insertions(+), 103 deletions(-) diff --git a/compiler/passes/src/symbol_table/function_symbol.rs b/compiler/passes/src/symbol_table/function_symbol.rs index 7123adf53e..296b79b1db 100644 --- a/compiler/passes/src/symbol_table/function_symbol.rs +++ b/compiler/passes/src/symbol_table/function_symbol.rs @@ -22,7 +22,7 @@ use crate::SymbolTable; #[derive(Clone, Debug)] pub struct FunctionSymbol { pub(crate) id: usize, - pub(crate) type_: Type, + pub(crate) output: Type, pub(crate) span: Span, pub(crate) input: Vec, } @@ -31,7 +31,7 @@ impl SymbolTable { pub(crate) fn new_function_symbol(id: usize, func: &Function) -> FunctionSymbol { FunctionSymbol { id, - type_: func.output, + output: func.output, span: func.span, input: func.input.clone(), } diff --git a/compiler/passes/src/symbol_table/table.rs b/compiler/passes/src/symbol_table/table.rs index 954923f79f..294e55af13 100644 --- a/compiler/passes/src/symbol_table/table.rs +++ b/compiler/passes/src/symbol_table/table.rs @@ -22,7 +22,7 @@ use leo_span::{Span, Symbol}; use indexmap::IndexMap; -use crate::{Declaration, FunctionSymbol, Value, VariableSymbol}; +use crate::{FunctionSymbol, VariableSymbol}; #[derive(Clone, Debug, Default)] pub struct SymbolTable { @@ -40,8 +40,6 @@ pub struct SymbolTable { pub(crate) variables: IndexMap, /// The index of the current scope pub(crate) scope_index: usize, - /// If the block will always be executed when the parent block is executed - pub(crate) is_locally_non_const: bool, /// The subscopes of this scope pub(crate) scopes: Vec>, } @@ -90,11 +88,8 @@ impl SymbolTable { Ok(()) } - pub fn insert_block(&mut self, is_locally_non_const: bool) -> usize { - self.scopes.push(RefCell::new(SymbolTable { - is_locally_non_const, - ..Default::default() - })); + pub fn insert_block(&mut self) -> usize { + self.scopes.push(RefCell::new(Default::default())); self.scope_index() } @@ -156,62 +151,6 @@ impl SymbolTable { } } - /// Finds the variable in the parent scope, then SHADOWS it in most recent non-const scope with a mut const value. - /// returns a boolean for if the variable should be slated for deconstification - pub fn locally_constify_variable(&mut self, symbol: Symbol, value: Value) -> bool { - let mut var = self - .lookup_variable(&symbol) - .unwrap_or_else(|| panic!("attempting to constify non-existent variable `{symbol}`")) - .clone(); - var.declaration = Declaration::Mut(Some(value)); - - let mut st = self; - loop { - let is_in_parent = st.variable_in_parent_scope(&symbol); - let is_in_local = st.variable_in_local_scope(&symbol); - if is_in_local && is_in_parent { - st.variables.insert(symbol, var.clone()); - } else if st.is_locally_non_const && !is_in_parent { - st.variables.insert(symbol, var); - break false; - } else if st.is_locally_non_const && is_in_parent { - st.variables.insert(symbol, var); - break true; - } - - if !st.is_locally_non_const && st.parent.is_some() && is_in_parent { - st = st.parent.as_mut().unwrap() - } else { - break true; - } - } - } - - pub fn set_variable(&mut self, symbol: &Symbol, value: Value) -> bool { - if let Some(var) = self.variables.get_mut(symbol) { - var.declaration = match &var.declaration { - Declaration::Const(_) => Declaration::Const(Some(value)), - Declaration::Mut(_) => Declaration::Mut(Some(value)), - other => other.clone(), - }; - true - } else if let Some(parent) = &mut self.parent { - parent.set_variable(symbol, value) - } else { - false - } - } - - /// Finds all previous occurrences of the variable and replaces it with a non-const mutable value - pub fn deconstify_variable(&mut self, symbol: &Symbol) { - if let Some(var) = self.variables.get_mut(symbol) { - var.declaration = Declaration::Mut(None); - } - if let Some(parent) = &mut self.parent { - parent.deconstify_variable(symbol) - } - } - pub fn get_fn_scope(&self, symbol: &Symbol) -> Option<&RefCell> { if let Some(func) = self.functions.get(symbol) { self.scopes.get(func.id) diff --git a/compiler/passes/src/symbol_table/variable_symbol.rs b/compiler/passes/src/symbol_table/variable_symbol.rs index 28812022c4..f2e8e01474 100644 --- a/compiler/passes/src/symbol_table/variable_symbol.rs +++ b/compiler/passes/src/symbol_table/variable_symbol.rs @@ -14,61 +14,40 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_ast::{Identifier, ParamMode, Type}; -use leo_errors::Result; -use leo_span::Span; +use std::fmt::Display; -use crate::Value; +use leo_ast::{ParamMode, Type}; +use leo_span::Span; #[derive(Clone, Debug, Eq, PartialEq)] pub enum Declaration { - Const(Option), - Input(Type, ParamMode), - Mut(Option), + Const, + Input(ParamMode), + Mut, } -impl Declaration { - pub fn get_as_u128(&self) -> Result> { +impl Display for Declaration { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { use Declaration::*; match self { - Const(Some(value)) => Ok(Some(value.try_into()?)), - Input(_, _) => Ok(None), - _ => Ok(None), - } - } - - pub fn get_type(&self) -> Option { - use Declaration::*; - - match self { - Const(Some(value)) => Some(value.into()), - Input(type_, _) => Some(*type_), - _ => None, + Const => write!(f, "const var"), + Input(m) => write!(f, "{m} input"), + Mut => write!(f, "mut var"), } } } -impl AsRef for Declaration { - fn as_ref(&self) -> &Self { - self - } -} - -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct VariableSymbol { pub type_: Type, pub span: Span, pub declaration: Declaration, } -impl VariableSymbol { - pub fn get_const_value(&self, ident: Identifier) -> Option { - use Declaration::*; - match &self.declaration { - Const(Some(v)) | Mut(Some(v)) => Some(v.clone()), - Input(type_, ParamMode::Const) => Some(Value::Input(*type_, ident)), - _ => None, - } +impl Display for VariableSymbol { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}: {}", self.declaration, self.type_)?; + Ok(()) } } From 2a2a65b4168c6224e3385b4ab9fd230e6676dba9 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Fri, 1 Jul 2022 20:03:19 -0700 Subject: [PATCH 04/37] Make type checking pass compatible with current implementation of SymbolTable --- .../src/type_checker/check_expressions.rs | 16 ++++---- .../passes/src/type_checker/check_program.rs | 18 +++++++-- .../src/type_checker/check_statements.rs | 38 ++++++++++++------- compiler/passes/src/type_checker/checker.rs | 14 ++++--- compiler/passes/src/type_checker/mod.rs | 11 +++--- 5 files changed, 63 insertions(+), 34 deletions(-) diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index e72d894bc0..8137a08a3e 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -56,10 +56,10 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } fn visit_identifier(&mut self, var: &'a Identifier, expected: &Self::AdditionalInput) -> Self::Output { - if let Some(circuit) = self.symbol_table.clone().lookup_circuit(&var.name) { - Some(self.assert_expected_option(Type::Identifier(circuit.identifier), expected, circuit.span())) - } else if let Some(var) = self.symbol_table.clone().lookup_variable(&var.name) { - Some(self.assert_expected_option(*var.type_, expected, var.span)) + if let Some(circuit) = self.symbol_table.borrow().lookup_circuit(&var.name) { + Some(self.assert_expected_option(Type::Identifier(circuit.identifier), expected, var.span)) + } else if let Some(var) = self.symbol_table.borrow().lookup_variable(&var.name) { + Some(self.assert_expected_option(var.type_, expected, var.span)) } else { self.handler .emit_err(TypeCheckerError::unknown_sym("variable", var.name, var.span()).into()); @@ -469,8 +469,9 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { fn visit_call(&mut self, input: &'a CallExpression, expected: &Self::AdditionalInput) -> Self::Output { match &*input.function { Expression::Identifier(ident) => { - if let Some(func) = self.symbol_table.clone().lookup_fn(ident.name) { - let ret = self.assert_expected_option(func.output, expected, func.span()); + let func = self.symbol_table.borrow().lookup_fn(&ident.name).cloned(); + if let Some(func) = func { + let ret = self.assert_expected_option(func.output, expected, func.span); // Check number of function arguments. if func.input.len() != input.arguments.len() { @@ -508,7 +509,8 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { input: &'a CircuitInitExpression, additional: &Self::AdditionalInput, ) -> Self::Output { - if let Some(circ) = self.symbol_table.clone().lookup_circuit(&input.name.name) { + let circ = self.symbol_table.borrow().lookup_circuit(&input.name.name).cloned(); + if let Some(circ) = circ { // Check circuit type name. let ret = self.assert_expected_circuit(circ.identifier, additional, input.name.span()); diff --git a/compiler/passes/src/type_checker/check_program.rs b/compiler/passes/src/type_checker/check_program.rs index 50ba9e8fbd..442528b58f 100644 --- a/compiler/passes/src/type_checker/check_program.rs +++ b/compiler/passes/src/type_checker/check_program.rs @@ -15,26 +15,33 @@ // along with the Leo library. If not, see . use crate::{Declaration, TypeChecker, VariableSymbol}; + use leo_ast::*; use leo_errors::TypeCheckerError; use leo_span::sym; + +use std::cell::RefCell; use std::collections::HashSet; impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { fn visit_function(&mut self, input: &'a Function) { + let prev_st = std::mem::take(&mut self.symbol_table); + self.symbol_table + .swap(prev_st.borrow().get_fn_scope(&input.name()).unwrap()); + self.symbol_table.borrow_mut().parent = Some(Box::new(prev_st.into_inner())); + self.has_return = false; - self.symbol_table.clear_variables(); self.parent = Some(input.name()); input.input.iter().for_each(|i| { let input_var = i.get_variable(); self.check_ident_type(&Some(input_var.type_)); // Check for conflicting variable names. - if let Err(err) = self.symbol_table.insert_variable( + if let Err(err) = self.symbol_table.borrow_mut().insert_variable( input_var.identifier.name, VariableSymbol { - type_: &input_var.type_, + type_: input_var.type_, span: input_var.identifier.span(), declaration: Declaration::Input(input_var.mode()), }, @@ -48,10 +55,15 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { self.handler .emit_err(TypeCheckerError::function_has_no_return(input.name(), input.span()).into()); } + + let prev_st = *self.symbol_table.borrow_mut().parent.take().unwrap(); + self.symbol_table.swap(prev_st.get_fn_scope(&input.name()).unwrap()); + self.symbol_table = RefCell::new(prev_st); } fn visit_circuit(&mut self, input: &'a Circuit) { // Check for conflicting circuit member names. + // TODO: Do we need this check if this is done in shadowing? let mut used = HashSet::new(); if !input.members.iter().all(|member| used.insert(member.name())) { self.handler.emit_err(if input.is_record { diff --git a/compiler/passes/src/type_checker/check_statements.rs b/compiler/passes/src/type_checker/check_statements.rs index e8798553fc..8629f00ce2 100644 --- a/compiler/passes/src/type_checker/check_statements.rs +++ b/compiler/passes/src/type_checker/check_statements.rs @@ -14,10 +14,12 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . +use crate::{Declaration, TypeChecker, VariableSymbol}; + use leo_ast::*; use leo_errors::TypeCheckerError; -use crate::{Declaration, TypeChecker, VariableSymbol}; +use std::cell::RefCell; impl<'a> StatementVisitor<'a> for TypeChecker<'a> { fn visit_return(&mut self, input: &'a ReturnStatement) { @@ -25,7 +27,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { // statements should always have some parent block let parent = self.parent.unwrap(); - let return_type = &self.symbol_table.lookup_fn(parent).map(|f| f.output); + let return_type = &self.symbol_table.borrow().lookup_fn(&parent).map(|f| f.output); self.check_ident_type(return_type); self.has_return = true; @@ -44,10 +46,10 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { self.visit_expression(&input.value, &Some(input.type_)); - if let Err(err) = self.symbol_table.insert_variable( + if let Err(err) = self.symbol_table.borrow_mut().insert_variable( v.identifier.name, VariableSymbol { - type_: &input.type_, + type_: input.type_, span: input.span(), declaration: declaration.clone(), }, @@ -67,7 +69,8 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { } }; - let var_type = if let Some(var) = self.symbol_table.lookup_variable(&var_name.name) { + let var_type = if let Some(var) = self.symbol_table.borrow_mut().lookup_variable(&var_name.name) { + // TODO: Check where this check is moved to in `improved-flattening`. match &var.declaration { Declaration::Const => self .handler @@ -78,7 +81,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { _ => {} } - Some(*var.type_) + Some(var.type_) } else { self.handler .emit_err(TypeCheckerError::unknown_sym("variable", var_name.name, var_name.span).into()); @@ -101,10 +104,13 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { } fn visit_iteration(&mut self, input: &'a IterationStatement) { - if let Err(err) = self.symbol_table.insert_variable( + let iter_type = &Some(input.type_); + self.check_ident_type(iter_type); + + if let Err(err) = self.symbol_table.borrow_mut().insert_variable( input.variable.name, VariableSymbol { - type_: &input.type_, + type_: input.type_, span: input.span(), declaration: Declaration::Const, }, @@ -112,8 +118,6 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { self.handler.emit_err(err); } - let iter_type = &Some(input.type_); - self.check_ident_type(iter_type); self.visit_expression(&input.start, iter_type); self.visit_expression(&input.stop, iter_type); } @@ -130,8 +134,13 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { } fn visit_block(&mut self, input: &'a Block) { - // creates a new sub-scope since we are in a block. - self.symbol_table.push_variable_scope(); + // Creates a new sub-scope since we are in a block. + let scope_index = self.symbol_table.borrow_mut().insert_block(); + let prev_st = std::mem::take(&mut self.symbol_table); + self.symbol_table + .swap(prev_st.borrow().get_block_scope(scope_index).unwrap()); + self.symbol_table.borrow_mut().parent = Some(Box::new(prev_st.into_inner())); + input.statements.iter().for_each(|stmt| { match stmt { Statement::Return(stmt) => self.visit_return(stmt), @@ -143,6 +152,9 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { Statement::Block(stmt) => self.visit_block(stmt), }; }); - self.symbol_table.pop_variable_scope(); + + let prev_st = *self.symbol_table.borrow_mut().parent.take().unwrap(); + self.symbol_table.swap(prev_st.get_block_scope(scope_index).unwrap()); + self.symbol_table = RefCell::new(prev_st); } } diff --git a/compiler/passes/src/type_checker/checker.rs b/compiler/passes/src/type_checker/checker.rs index 4f8670a997..3d864952e9 100644 --- a/compiler/passes/src/type_checker/checker.rs +++ b/compiler/passes/src/type_checker/checker.rs @@ -14,16 +14,18 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use indexmap::IndexSet; +use crate::SymbolTable; + use leo_ast::{Identifier, IntegerType, Node, Type}; use leo_core::*; use leo_errors::{emitter::Handler, TypeCheckerError}; use leo_span::{Span, Symbol}; -use crate::SymbolTable; +use indexmap::IndexSet; +use std::cell::RefCell; pub struct TypeChecker<'a> { - pub(crate) symbol_table: &'a mut SymbolTable<'a>, + pub(crate) symbol_table: RefCell, pub(crate) handler: &'a Handler, pub(crate) parent: Option, pub(crate) has_return: bool, @@ -91,9 +93,9 @@ const FIELD_SCALAR_TYPES: [Type; 2] = [Type::Field, Type::Scalar]; impl<'a> TypeChecker<'a> { /// Returns a new type checker given a symbol table and error handler. - pub fn new(symbol_table: &'a mut SymbolTable<'a>, handler: &'a Handler) -> Self { + pub fn new(symbol_table: SymbolTable, handler: &'a Handler) -> Self { Self { - symbol_table, + symbol_table: RefCell::new(symbol_table), handler, parent: None, has_return: false, @@ -160,7 +162,7 @@ impl<'a> TypeChecker<'a> { } /// Returns the given `actual` type and emits an error if the `expected` type does not match. - pub(crate) fn assert_expected_option(&mut self, actual: Type, expected: &Option, span: Span) -> Type { + pub(crate) fn assert_expected_option(&self, actual: Type, expected: &Option, span: Span) -> Type { if let Some(expected) = expected { if !actual.eq_flat(expected) { self.emit_err(TypeCheckerError::type_should_be(actual, expected, span)); diff --git a/compiler/passes/src/type_checker/mod.rs b/compiler/passes/src/type_checker/mod.rs index fa54c3365b..69dc6bf13a 100644 --- a/compiler/passes/src/type_checker/mod.rs +++ b/compiler/passes/src/type_checker/mod.rs @@ -15,6 +15,7 @@ // along with the Leo library. If not, see . pub mod check_expressions; + pub use check_expressions::*; pub mod check_program; @@ -32,14 +33,14 @@ use leo_ast::{Ast, ProgramVisitor}; use leo_errors::{emitter::Handler, Result}; impl<'a> Pass for TypeChecker<'a> { - type Input = (&'a Ast, &'a mut SymbolTable<'a>, &'a Handler); - type Output = Result<()>; + type Input = (&'a Ast, &'a Handler, SymbolTable); + type Output = Result; - fn do_pass((ast, symbol_table, handler): Self::Input) -> Self::Output { - let mut visitor = TypeChecker::new(symbol_table, handler); + fn do_pass((ast, handler, st): Self::Input) -> Self::Output { + let mut visitor = TypeChecker::new(st, handler); visitor.visit_program(ast.as_repr()); handler.last_err()?; - Ok(()) + Ok(visitor.symbol_table.take()) } } From 027bd24cd535ad84ffcffc8770f7ad6297160db3 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Fri, 1 Jul 2022 20:03:45 -0700 Subject: [PATCH 05/37] Integrate passes into compiler --- compiler/compiler/src/compiler.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/compiler/src/compiler.rs b/compiler/compiler/src/compiler.rs index 3cca1596c3..5ffd81eae4 100644 --- a/compiler/compiler/src/compiler.rs +++ b/compiler/compiler/src/compiler.rs @@ -146,30 +146,30 @@ impl<'a> Compiler<'a> { /// /// Runs the symbol table pass. /// - pub fn symbol_table_pass(&self) -> Result> { + pub fn symbol_table_pass(&self) -> Result { CreateSymbolTable::do_pass((&self.ast, self.handler)) } /// /// Runs the type checker pass. /// - pub fn type_checker_pass(&'a self, symbol_table: &mut SymbolTable<'_>) -> Result<()> { - TypeChecker::do_pass((&self.ast, &mut symbol_table.clone(), self.handler)) + pub fn type_checker_pass(&'a self, symbol_table: SymbolTable) -> Result { + TypeChecker::do_pass((&self.ast, self.handler, symbol_table)) } /// /// Runs the compiler stages. /// - pub fn compiler_stages(&self) -> Result> { - let mut st = self.symbol_table_pass()?; - self.type_checker_pass(&mut st)?; + pub fn compiler_stages(&self) -> Result { + let st = self.symbol_table_pass()?; + let st = self.type_checker_pass(st)?; Ok(st) } /// /// Returns a compiled Leo program. /// - pub fn compile(&mut self) -> Result> { + pub fn compile(&mut self) -> Result { self.parse_program()?; self.compiler_stages() } From 80ff280df7dfc97fd7ed12290066af2c52f895ba Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Sat, 2 Jul 2022 15:01:02 -0700 Subject: [PATCH 06/37] Remove symbol table from OutputItem; clippy --- compiler/compiler/src/test.rs | 12 +++++------- tests/test-framework/benches/leo_compiler.rs | 8 ++++---- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/compiler/compiler/src/test.rs b/compiler/compiler/src/test.rs index 8bdb4a0507..fc8332bfb5 100644 --- a/compiler/compiler/src/test.rs +++ b/compiler/compiler/src/test.rs @@ -102,7 +102,6 @@ struct OutputItem { 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`. @@ -132,9 +131,9 @@ fn collect_all_inputs(test: &Test) -> Result, String> { Ok(list) } -fn compile_and_process<'a>(parsed: &'a mut Compiler<'a>) -> Result, LeoError> { - let mut st = parsed.symbol_table_pass()?; - parsed.type_checker_pass(&mut st)?; +fn compile_and_process<'a>(parsed: &'a mut Compiler<'a>) -> Result { + let st = parsed.symbol_table_pass()?; + let st = parsed.type_checker_pass(st)?; Ok(st) } @@ -198,6 +197,7 @@ fn run_test(test: Test, handler: &Handler, err_buf: &BufferEmitter) -> Result Result Result Date: Sat, 2 Jul 2022 15:45:06 -0700 Subject: [PATCH 07/37] Change duplicate_name_context from Pass to Fail --- tests/compiler/circuits/duplicate_name_context.leo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/compiler/circuits/duplicate_name_context.leo b/tests/compiler/circuits/duplicate_name_context.leo index 01b6deb400..948d4d8b74 100644 --- a/tests/compiler/circuits/duplicate_name_context.leo +++ b/tests/compiler/circuits/duplicate_name_context.leo @@ -1,6 +1,6 @@ /* namespace: Compile -expectation: Pass +expectation: Fail input_file: input/dummy.in */ From 12eafa41742cfa41203f45c6303da031c92a515a Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Sat, 2 Jul 2022 15:53:14 -0700 Subject: [PATCH 08/37] Regenerate test expectations without symbol_table --- compiler/passes/src/symbol_table/table.rs | 2 +- tests/expectations/compiler/compiler/address/binary.out | 1 - tests/expectations/compiler/compiler/address/branch.out | 1 - tests/expectations/compiler/compiler/address/equal.out | 1 - tests/expectations/compiler/compiler/address/ternary.out | 1 - tests/expectations/compiler/compiler/boolean/and.out | 1 - .../expectations/compiler/compiler/boolean/conditional.out | 1 - tests/expectations/compiler/compiler/boolean/equal.out | 1 - tests/expectations/compiler/compiler/boolean/not_equal.out | 1 - .../compiler/compiler/boolean/operator_methods.out | 1 - tests/expectations/compiler/compiler/boolean/or.out | 1 - tests/expectations/compiler/compiler/char/string.out | 1 - .../compiler/compiler/circuits/duplicate_name_context.out | 7 ++----- tests/expectations/compiler/compiler/circuits/inline.out | 1 - .../compiler/compiler/circuits/inline_member_pass.out | 1 - .../compiler/compiler/circuits/member_variable.out | 1 - tests/expectations/compiler/compiler/console/assert.out | 1 - .../compiler/compiler/console/conditional_assert.out | 1 - tests/expectations/compiler/compiler/console/error.out | 1 - tests/expectations/compiler/compiler/console/log.out | 1 - .../compiler/compiler/console/log_conditional.out | 1 - tests/expectations/compiler/compiler/console/log_input.out | 1 - .../compiler/compiler/console/log_parameter.out | 1 - .../compiler/compiler/console/log_parameter_many.out | 1 - .../expectations/compiler/compiler/core/algorithms/bhp.out | 1 - .../compiler/compiler/core/algorithms/pedersen.out | 1 - .../compiler/compiler/core/algorithms/poseidon.out | 1 - .../compiler/compiler/definition/out_of_order.out | 1 - tests/expectations/compiler/compiler/field/add.out | 1 - tests/expectations/compiler/compiler/field/div.out | 1 - tests/expectations/compiler/compiler/field/eq.out | 1 - tests/expectations/compiler/compiler/field/field.out | 1 - tests/expectations/compiler/compiler/field/mul.out | 1 - tests/expectations/compiler/compiler/field/negate.out | 1 - .../compiler/compiler/field/operator_methods.out | 1 - tests/expectations/compiler/compiler/field/pow.out | 1 - tests/expectations/compiler/compiler/field/sub.out | 1 - tests/expectations/compiler/compiler/field/ternary.out | 1 - .../compiler/compiler/function/conditional_return.out | 1 - .../expectations/compiler/compiler/function/iteration.out | 1 - .../compiler/compiler/function/iteration_repeated.out | 1 - tests/expectations/compiler/compiler/function/repeated.out | 1 - tests/expectations/compiler/compiler/function/return.out | 1 - tests/expectations/compiler/compiler/group/add.out | 1 - tests/expectations/compiler/compiler/group/assert_eq.out | 1 - .../compiler/compiler/group/both_sign_high.out | 1 - .../compiler/compiler/group/both_sign_inferred.out | 1 - .../expectations/compiler/compiler/group/both_sign_low.out | 1 - tests/expectations/compiler/compiler/group/eq.out | 1 - tests/expectations/compiler/compiler/group/input.out | 1 - .../compiler/compiler/group/mult_by_scalar.out | 1 - tests/expectations/compiler/compiler/group/negate.out | 1 - tests/expectations/compiler/compiler/group/one.out | 1 - .../compiler/compiler/group/operator_methods.out | 1 - tests/expectations/compiler/compiler/group/point.out | 1 - tests/expectations/compiler/compiler/group/point_input.out | 1 - .../compiler/compiler/group/positive_and_negative.out | 1 - tests/expectations/compiler/compiler/group/sub.out | 1 - tests/expectations/compiler/compiler/group/ternary.out | 1 - tests/expectations/compiler/compiler/group/x_and_y.out | 1 - tests/expectations/compiler/compiler/group/x_sign_high.out | 1 - .../compiler/compiler/group/x_sign_inferred.out | 1 - tests/expectations/compiler/compiler/group/x_sign_low.out | 1 - tests/expectations/compiler/compiler/group/y_sign_high.out | 1 - .../compiler/compiler/group/y_sign_inferred.out | 1 - tests/expectations/compiler/compiler/group/y_sign_low.out | 1 - tests/expectations/compiler/compiler/group/zero.out | 1 - .../compiler/compiler/input_files/program_input/main.out | 1 - .../compiler/input_files/program_input/main_field.out | 1 - .../compiler/input_files/program_input/main_group.out | 1 - .../compiler/input_files/program_input_constants/main.out | 1 - .../input_files/program_input_constants/main_field.out | 1 - .../input_files/program_input_constants/main_group.out | 1 - .../input_files/program_input_constants/main_multiple.out | 1 - tests/expectations/compiler/compiler/integers/i128/add.out | 1 - tests/expectations/compiler/compiler/integers/i128/and.out | 1 - .../compiler/compiler/integers/i128/console_assert.out | 1 - tests/expectations/compiler/compiler/integers/i128/div.out | 1 - tests/expectations/compiler/compiler/integers/i128/eq.out | 1 - tests/expectations/compiler/compiler/integers/i128/ge.out | 1 - tests/expectations/compiler/compiler/integers/i128/gt.out | 1 - tests/expectations/compiler/compiler/integers/i128/le.out | 1 - tests/expectations/compiler/compiler/integers/i128/lt.out | 1 - tests/expectations/compiler/compiler/integers/i128/max.out | 1 - tests/expectations/compiler/compiler/integers/i128/min.out | 1 - tests/expectations/compiler/compiler/integers/i128/mul.out | 1 - tests/expectations/compiler/compiler/integers/i128/ne.out | 1 - .../compiler/compiler/integers/i128/negate.out | 1 - .../compiler/compiler/integers/i128/negate_min.out | 1 - .../compiler/compiler/integers/i128/negate_zero.out | 1 - .../compiler/compiler/integers/i128/operator_methods.out | 1 - tests/expectations/compiler/compiler/integers/i128/or.out | 1 - tests/expectations/compiler/compiler/integers/i128/pow.out | 1 - tests/expectations/compiler/compiler/integers/i128/shl.out | 1 - tests/expectations/compiler/compiler/integers/i128/shr.out | 1 - tests/expectations/compiler/compiler/integers/i128/sub.out | 1 - .../compiler/compiler/integers/i128/ternary.out | 1 - tests/expectations/compiler/compiler/integers/i128/xor.out | 1 - tests/expectations/compiler/compiler/integers/i16/add.out | 1 - tests/expectations/compiler/compiler/integers/i16/and.out | 1 - .../compiler/compiler/integers/i16/console_assert.out | 1 - tests/expectations/compiler/compiler/integers/i16/div.out | 1 - tests/expectations/compiler/compiler/integers/i16/eq.out | 1 - tests/expectations/compiler/compiler/integers/i16/ge.out | 1 - tests/expectations/compiler/compiler/integers/i16/gt.out | 1 - tests/expectations/compiler/compiler/integers/i16/le.out | 1 - tests/expectations/compiler/compiler/integers/i16/lt.out | 1 - tests/expectations/compiler/compiler/integers/i16/max.out | 1 - tests/expectations/compiler/compiler/integers/i16/min.out | 1 - tests/expectations/compiler/compiler/integers/i16/mul.out | 1 - tests/expectations/compiler/compiler/integers/i16/ne.out | 1 - .../expectations/compiler/compiler/integers/i16/negate.out | 1 - .../compiler/compiler/integers/i16/negate_min_fail.out | 1 - .../compiler/compiler/integers/i16/negate_zero.out | 1 - .../compiler/compiler/integers/i16/operator_methods.out | 1 - tests/expectations/compiler/compiler/integers/i16/or.out | 1 - tests/expectations/compiler/compiler/integers/i16/pow.out | 1 - tests/expectations/compiler/compiler/integers/i16/shl.out | 1 - tests/expectations/compiler/compiler/integers/i16/shr.out | 1 - tests/expectations/compiler/compiler/integers/i16/sub.out | 1 - .../compiler/compiler/integers/i16/ternary.out | 1 - tests/expectations/compiler/compiler/integers/i16/xor.out | 1 - tests/expectations/compiler/compiler/integers/i32/add.out | 1 - tests/expectations/compiler/compiler/integers/i32/and.out | 1 - .../compiler/compiler/integers/i32/console_assert.out | 1 - tests/expectations/compiler/compiler/integers/i32/div.out | 1 - tests/expectations/compiler/compiler/integers/i32/eq.out | 1 - tests/expectations/compiler/compiler/integers/i32/ge.out | 1 - tests/expectations/compiler/compiler/integers/i32/gt.out | 1 - tests/expectations/compiler/compiler/integers/i32/le.out | 1 - tests/expectations/compiler/compiler/integers/i32/lt.out | 1 - tests/expectations/compiler/compiler/integers/i32/max.out | 1 - tests/expectations/compiler/compiler/integers/i32/min.out | 1 - tests/expectations/compiler/compiler/integers/i32/mul.out | 1 - tests/expectations/compiler/compiler/integers/i32/ne.out | 1 - .../expectations/compiler/compiler/integers/i32/negate.out | 1 - .../compiler/compiler/integers/i32/negate_min.out | 1 - .../compiler/compiler/integers/i32/negate_zero.out | 1 - .../compiler/compiler/integers/i32/operator_methods.out | 1 - tests/expectations/compiler/compiler/integers/i32/or.out | 1 - tests/expectations/compiler/compiler/integers/i32/pow.out | 1 - tests/expectations/compiler/compiler/integers/i32/shl.out | 1 - tests/expectations/compiler/compiler/integers/i32/shr.out | 1 - tests/expectations/compiler/compiler/integers/i32/sub.out | 1 - .../compiler/compiler/integers/i32/ternary.out | 1 - tests/expectations/compiler/compiler/integers/i32/xor.out | 1 - tests/expectations/compiler/compiler/integers/i64/add.out | 1 - tests/expectations/compiler/compiler/integers/i64/and.out | 1 - .../compiler/compiler/integers/i64/console_assert.out | 1 - tests/expectations/compiler/compiler/integers/i64/div.out | 1 - tests/expectations/compiler/compiler/integers/i64/eq.out | 1 - tests/expectations/compiler/compiler/integers/i64/ge.out | 1 - tests/expectations/compiler/compiler/integers/i64/gt.out | 1 - tests/expectations/compiler/compiler/integers/i64/le.out | 1 - tests/expectations/compiler/compiler/integers/i64/lt.out | 1 - tests/expectations/compiler/compiler/integers/i64/max.out | 1 - tests/expectations/compiler/compiler/integers/i64/min.out | 1 - tests/expectations/compiler/compiler/integers/i64/mul.out | 1 - tests/expectations/compiler/compiler/integers/i64/ne.out | 1 - .../expectations/compiler/compiler/integers/i64/negate.out | 1 - .../compiler/compiler/integers/i64/negate_min.out | 1 - .../compiler/compiler/integers/i64/negate_zero.out | 1 - .../compiler/compiler/integers/i64/operator_methods.out | 1 - tests/expectations/compiler/compiler/integers/i64/or.out | 1 - tests/expectations/compiler/compiler/integers/i64/pow.out | 1 - tests/expectations/compiler/compiler/integers/i64/shl.out | 1 - tests/expectations/compiler/compiler/integers/i64/shr.out | 1 - tests/expectations/compiler/compiler/integers/i64/sub.out | 1 - .../compiler/compiler/integers/i64/ternary.out | 1 - tests/expectations/compiler/compiler/integers/i64/xor.out | 1 - tests/expectations/compiler/compiler/integers/i8/add.out | 1 - tests/expectations/compiler/compiler/integers/i8/and.out | 1 - .../compiler/compiler/integers/i8/console_assert.out | 1 - tests/expectations/compiler/compiler/integers/i8/div.out | 1 - tests/expectations/compiler/compiler/integers/i8/eq.out | 1 - tests/expectations/compiler/compiler/integers/i8/ge.out | 1 - tests/expectations/compiler/compiler/integers/i8/gt.out | 1 - tests/expectations/compiler/compiler/integers/i8/le.out | 1 - tests/expectations/compiler/compiler/integers/i8/lt.out | 1 - tests/expectations/compiler/compiler/integers/i8/max.out | 1 - tests/expectations/compiler/compiler/integers/i8/min.out | 1 - tests/expectations/compiler/compiler/integers/i8/mul.out | 1 - tests/expectations/compiler/compiler/integers/i8/ne.out | 1 - .../expectations/compiler/compiler/integers/i8/negate.out | 1 - .../compiler/compiler/integers/i8/negate_min.out | 1 - .../compiler/compiler/integers/i8/negate_zero.out | 1 - .../compiler/compiler/integers/i8/operator_methods.out | 1 - tests/expectations/compiler/compiler/integers/i8/or.out | 1 - tests/expectations/compiler/compiler/integers/i8/pow.out | 1 - tests/expectations/compiler/compiler/integers/i8/shl.out | 1 - tests/expectations/compiler/compiler/integers/i8/shr.out | 1 - tests/expectations/compiler/compiler/integers/i8/sub.out | 1 - .../expectations/compiler/compiler/integers/i8/ternary.out | 1 - tests/expectations/compiler/compiler/integers/i8/xor.out | 1 - tests/expectations/compiler/compiler/integers/u128/add.out | 1 - tests/expectations/compiler/compiler/integers/u128/and.out | 1 - .../compiler/compiler/integers/u128/console_assert.out | 1 - tests/expectations/compiler/compiler/integers/u128/div.out | 1 - tests/expectations/compiler/compiler/integers/u128/eq.out | 1 - tests/expectations/compiler/compiler/integers/u128/ge.out | 1 - tests/expectations/compiler/compiler/integers/u128/gt.out | 1 - tests/expectations/compiler/compiler/integers/u128/le.out | 1 - tests/expectations/compiler/compiler/integers/u128/lt.out | 1 - tests/expectations/compiler/compiler/integers/u128/max.out | 1 - tests/expectations/compiler/compiler/integers/u128/min.out | 1 - tests/expectations/compiler/compiler/integers/u128/mul.out | 1 - tests/expectations/compiler/compiler/integers/u128/ne.out | 1 - .../compiler/compiler/integers/u128/operator_methods.out | 1 - tests/expectations/compiler/compiler/integers/u128/or.out | 1 - tests/expectations/compiler/compiler/integers/u128/pow.out | 1 - tests/expectations/compiler/compiler/integers/u128/shl.out | 1 - tests/expectations/compiler/compiler/integers/u128/shr.out | 1 - tests/expectations/compiler/compiler/integers/u128/sub.out | 1 - .../compiler/compiler/integers/u128/ternary.out | 1 - tests/expectations/compiler/compiler/integers/u128/xor.out | 1 - tests/expectations/compiler/compiler/integers/u16/add.out | 1 - tests/expectations/compiler/compiler/integers/u16/and.out | 1 - .../compiler/compiler/integers/u16/console_assert.out | 1 - tests/expectations/compiler/compiler/integers/u16/div.out | 1 - tests/expectations/compiler/compiler/integers/u16/eq.out | 1 - tests/expectations/compiler/compiler/integers/u16/ge.out | 1 - tests/expectations/compiler/compiler/integers/u16/gt.out | 1 - tests/expectations/compiler/compiler/integers/u16/le.out | 1 - tests/expectations/compiler/compiler/integers/u16/lt.out | 1 - tests/expectations/compiler/compiler/integers/u16/max.out | 1 - tests/expectations/compiler/compiler/integers/u16/min.out | 1 - tests/expectations/compiler/compiler/integers/u16/mul.out | 1 - tests/expectations/compiler/compiler/integers/u16/ne.out | 1 - .../compiler/compiler/integers/u16/operator_methods.out | 1 - tests/expectations/compiler/compiler/integers/u16/or.out | 1 - tests/expectations/compiler/compiler/integers/u16/pow.out | 1 - tests/expectations/compiler/compiler/integers/u16/shl.out | 1 - tests/expectations/compiler/compiler/integers/u16/shr.out | 1 - tests/expectations/compiler/compiler/integers/u16/sub.out | 1 - .../compiler/compiler/integers/u16/ternary.out | 1 - tests/expectations/compiler/compiler/integers/u16/xor.out | 1 - tests/expectations/compiler/compiler/integers/u32/add.out | 1 - tests/expectations/compiler/compiler/integers/u32/and.out | 1 - .../compiler/compiler/integers/u32/console_assert.out | 1 - tests/expectations/compiler/compiler/integers/u32/div.out | 1 - tests/expectations/compiler/compiler/integers/u32/eq.out | 1 - tests/expectations/compiler/compiler/integers/u32/ge.out | 1 - tests/expectations/compiler/compiler/integers/u32/gt.out | 1 - tests/expectations/compiler/compiler/integers/u32/le.out | 1 - tests/expectations/compiler/compiler/integers/u32/lt.out | 1 - tests/expectations/compiler/compiler/integers/u32/max.out | 1 - tests/expectations/compiler/compiler/integers/u32/min.out | 1 - tests/expectations/compiler/compiler/integers/u32/mul.out | 1 - tests/expectations/compiler/compiler/integers/u32/ne.out | 1 - .../compiler/compiler/integers/u32/operator_methods.out | 1 - tests/expectations/compiler/compiler/integers/u32/or.out | 1 - tests/expectations/compiler/compiler/integers/u32/pow.out | 1 - tests/expectations/compiler/compiler/integers/u32/shl.out | 1 - tests/expectations/compiler/compiler/integers/u32/shr.out | 1 - tests/expectations/compiler/compiler/integers/u32/sub.out | 1 - .../compiler/compiler/integers/u32/ternary.out | 1 - tests/expectations/compiler/compiler/integers/u32/xor.out | 1 - tests/expectations/compiler/compiler/integers/u64/add.out | 1 - tests/expectations/compiler/compiler/integers/u64/and.out | 1 - .../compiler/compiler/integers/u64/console_assert.out | 1 - tests/expectations/compiler/compiler/integers/u64/div.out | 1 - tests/expectations/compiler/compiler/integers/u64/eq.out | 1 - tests/expectations/compiler/compiler/integers/u64/ge.out | 1 - tests/expectations/compiler/compiler/integers/u64/gt.out | 1 - tests/expectations/compiler/compiler/integers/u64/le.out | 1 - tests/expectations/compiler/compiler/integers/u64/lt.out | 1 - tests/expectations/compiler/compiler/integers/u64/max.out | 1 - tests/expectations/compiler/compiler/integers/u64/min.out | 1 - tests/expectations/compiler/compiler/integers/u64/mul.out | 1 - tests/expectations/compiler/compiler/integers/u64/ne.out | 1 - .../compiler/compiler/integers/u64/operator_methods.out | 1 - tests/expectations/compiler/compiler/integers/u64/or.out | 1 - tests/expectations/compiler/compiler/integers/u64/pow.out | 1 - tests/expectations/compiler/compiler/integers/u64/shl.out | 1 - tests/expectations/compiler/compiler/integers/u64/shr.out | 1 - tests/expectations/compiler/compiler/integers/u64/sub.out | 1 - .../compiler/compiler/integers/u64/ternary.out | 1 - tests/expectations/compiler/compiler/integers/u64/xor.out | 1 - tests/expectations/compiler/compiler/integers/u8/add.out | 1 - tests/expectations/compiler/compiler/integers/u8/and.out | 1 - .../compiler/compiler/integers/u8/console_assert.out | 1 - tests/expectations/compiler/compiler/integers/u8/div.out | 1 - tests/expectations/compiler/compiler/integers/u8/eq.out | 1 - tests/expectations/compiler/compiler/integers/u8/ge.out | 1 - tests/expectations/compiler/compiler/integers/u8/gt.out | 1 - tests/expectations/compiler/compiler/integers/u8/le.out | 1 - tests/expectations/compiler/compiler/integers/u8/lt.out | 1 - tests/expectations/compiler/compiler/integers/u8/max.out | 1 - tests/expectations/compiler/compiler/integers/u8/min.out | 1 - tests/expectations/compiler/compiler/integers/u8/mul.out | 1 - tests/expectations/compiler/compiler/integers/u8/ne.out | 1 - .../compiler/compiler/integers/u8/operator_methods.out | 1 - tests/expectations/compiler/compiler/integers/u8/or.out | 1 - tests/expectations/compiler/compiler/integers/u8/pow.out | 1 - tests/expectations/compiler/compiler/integers/u8/shl.out | 1 - tests/expectations/compiler/compiler/integers/u8/shr.out | 1 - tests/expectations/compiler/compiler/integers/u8/sub.out | 1 - .../expectations/compiler/compiler/integers/u8/ternary.out | 1 - tests/expectations/compiler/compiler/integers/u8/xor.out | 1 - .../expectations/compiler/compiler/mutability/cond_mut.out | 1 - .../compiler/compiler/mutability/function_input_mut.out | 1 - .../compiler/compiler/mutability/let_mut_nested.out | 1 - .../expectations/compiler/compiler/records/declaration.out | 1 - .../compiler/compiler/records/init_expression.out | 1 - .../compiler/records/init_expression_shorthand.out | 1 - tests/expectations/compiler/compiler/scalar/add.out | 1 - tests/expectations/compiler/compiler/scalar/cmp.out | 1 - tests/expectations/compiler/compiler/scalar/div.out | 1 - tests/expectations/compiler/compiler/scalar/eq.out | 1 - tests/expectations/compiler/compiler/scalar/group_mul.out | 1 - tests/expectations/compiler/compiler/scalar/mul.out | 1 - .../compiler/compiler/scalar/operator_methods.out | 1 - tests/expectations/compiler/compiler/scalar/scalar.out | 1 - tests/expectations/compiler/compiler/scalar/ternary.out | 1 - .../compiler/compiler/statements/all_loops.out | 1 - tests/expectations/compiler/compiler/statements/block.out | 1 - tests/expectations/compiler/compiler/statements/chain.out | 1 - .../compiler/statements/compare_diff_types_fail.out | 1 - .../expectations/compiler/compiler/statements/for_loop.out | 1 - .../compiler/compiler/statements/iteration_basic.out | 1 - .../compiler/compiler/statements/iteration_variable.out | 1 - .../compiler/compiler/statements/multiple_returns.out | 1 - tests/expectations/compiler/compiler/statements/mutate.out | 1 - .../compiler/statements/ternary_explicit_and_implicit.out | 1 - 324 files changed, 3 insertions(+), 328 deletions(-) diff --git a/compiler/passes/src/symbol_table/table.rs b/compiler/passes/src/symbol_table/table.rs index 294e55af13..9eec03d92c 100644 --- a/compiler/passes/src/symbol_table/table.rs +++ b/compiler/passes/src/symbol_table/table.rs @@ -52,7 +52,7 @@ impl SymbolTable { Err(AstError::shadowed_function(symbol, span).into()) } else if let Some(existing) = self.circuits.get(&symbol) { match existing.is_record { - true => Err(AstError::shadowed_record(symbol, insert.span).into()), + true => Err(AstError::shadowed_record(symbol, span).into()), false => Err(AstError::shadowed_circuit(symbol, span).into()) } } else if let Some(parent) = self.parent.as_ref() { diff --git a/tests/expectations/compiler/compiler/address/binary.out b/tests/expectations/compiler/compiler/address/binary.out index 9a30245b0d..7c3aa8ed12 100644 --- a/tests/expectations/compiler/compiler/address/binary.out +++ b/tests/expectations/compiler/compiler/address/binary.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: fe880c907d0257c9fc8314b8b98cabd8a8282b587d2d618408cc3cd8e528fda5 initial_ast: d2bf8199011f00bef93c6cec36528966c69908982ea4a6f2e515c98c258edf25 - symbol_table: dc40d8435dfe2399cda1bb0c53eb941b4719e40a7e9a2f038b98d7613d538b4e diff --git a/tests/expectations/compiler/compiler/address/branch.out b/tests/expectations/compiler/compiler/address/branch.out index fe2c82a3bf..a1cd88e0fa 100644 --- a/tests/expectations/compiler/compiler/address/branch.out +++ b/tests/expectations/compiler/compiler/address/branch.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 00f5aba05e4efae5a125eb52f02f16400132085b8a34919d910aa40c6c405a22 initial_ast: d9baeb1448040c61f5e7f779270eb767a29b5f2fd23a60a680aad138327999e7 - symbol_table: e8029086f943767e4f98014b3991bff8336cb6472c2d2dc3d51b4b13e5c72ea5 diff --git a/tests/expectations/compiler/compiler/address/equal.out b/tests/expectations/compiler/compiler/address/equal.out index 39d0fd8e37..2c227aae42 100644 --- a/tests/expectations/compiler/compiler/address/equal.out +++ b/tests/expectations/compiler/compiler/address/equal.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 03e9df3bd1409f4af9e2a7f55130bc52f27d41f32a624ffa27f0ab114bf6fbf4 initial_ast: ea3c9a73110ccc7684863543cf563ec78349402c460a75317b776af11d46f781 - symbol_table: 25f09247dfa86534ff321b8e1b2ca1666c92751d37a611d62e56b8cfac96261d diff --git a/tests/expectations/compiler/compiler/address/ternary.out b/tests/expectations/compiler/compiler/address/ternary.out index ced58171cf..2eb04b98a6 100644 --- a/tests/expectations/compiler/compiler/address/ternary.out +++ b/tests/expectations/compiler/compiler/address/ternary.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: ec3cfeb93ea66a530150a5c5e2bd396688b3ef9b9fb0bcb961c62dac4daa064e - initial_input_ast: cb1d48114c10b2b732ad47a46fc8d05bf7a3e783da89e7f00065244bfc8d15c8 initial_ast: 1bbe35b9a1a767668b4ff0d689873caded5d92ea7886aad2355a404511d76199 - symbol_table: 5fddde57167344769d00e423fb56692291d57ac8c953c512b82a4626bbdcb6c9 diff --git a/tests/expectations/compiler/compiler/boolean/and.out b/tests/expectations/compiler/compiler/boolean/and.out index 3af03f955b..6f3005422b 100644 --- a/tests/expectations/compiler/compiler/boolean/and.out +++ b/tests/expectations/compiler/compiler/boolean/and.out @@ -8,4 +8,3 @@ outputs: - initial_input_ast: 4c5eeffd0306b20c8deece509782b81ea8583245f650e40a4a300d517f6ed5f4 - initial_input_ast: a56b3f9908dec2acaed302691d4fe0c2cf046f0deb8f188f617e042e75502f71 initial_ast: 8e4ab3450ec4ffbdba78fc0e1450c319bf538fd716af967419c8ce116ccd3d0e - symbol_table: f36863240edb9fb5fb852c212a9ae1db491ee8243d0469fc155592964595e7d0 diff --git a/tests/expectations/compiler/compiler/boolean/conditional.out b/tests/expectations/compiler/compiler/boolean/conditional.out index dc5428dc6c..6be8e75ba1 100644 --- a/tests/expectations/compiler/compiler/boolean/conditional.out +++ b/tests/expectations/compiler/compiler/boolean/conditional.out @@ -8,4 +8,3 @@ outputs: - initial_input_ast: 7a1c39dec2388ab801496ceb17ca85665d2f515269929925b7cc9018e14297ea - initial_input_ast: 650984ca5077d11a815889421656b7735b4c6bd320bdf68b4deb87dfc0f49388 initial_ast: d84cf01e1fddeb09983dc4f7e868ae999b7b9ab4dff9d4286108f81aefe80677 - symbol_table: 4fd4e476609947028fbffe357ffb9d962e96c30a9abe3677d75675ae37b12587 diff --git a/tests/expectations/compiler/compiler/boolean/equal.out b/tests/expectations/compiler/compiler/boolean/equal.out index 5959e6aacc..cc7ba139e9 100644 --- a/tests/expectations/compiler/compiler/boolean/equal.out +++ b/tests/expectations/compiler/compiler/boolean/equal.out @@ -8,4 +8,3 @@ outputs: - initial_input_ast: 4c5eeffd0306b20c8deece509782b81ea8583245f650e40a4a300d517f6ed5f4 - initial_input_ast: a56b3f9908dec2acaed302691d4fe0c2cf046f0deb8f188f617e042e75502f71 initial_ast: d135ca0877ca63f6c31be572178a69508de9cfb81e258c4aec425861241f84c3 - symbol_table: c8dd46774e298ef70fc87f89ecb8b5f23f63b1f2401f337fc97ad83b54e85871 diff --git a/tests/expectations/compiler/compiler/boolean/not_equal.out b/tests/expectations/compiler/compiler/boolean/not_equal.out index 7d127ddc38..359ec5342e 100644 --- a/tests/expectations/compiler/compiler/boolean/not_equal.out +++ b/tests/expectations/compiler/compiler/boolean/not_equal.out @@ -8,4 +8,3 @@ outputs: - initial_input_ast: 4c5eeffd0306b20c8deece509782b81ea8583245f650e40a4a300d517f6ed5f4 - initial_input_ast: a56b3f9908dec2acaed302691d4fe0c2cf046f0deb8f188f617e042e75502f71 initial_ast: 42cf44d6821d7bd9d2c0222d2a673df9ff9c199f583e79a8b15b8eec53e2aea0 - symbol_table: 8ed9a73e996562abfe75837cfbf2103a4d9213291298206f4f63a7dac808cbc1 diff --git a/tests/expectations/compiler/compiler/boolean/operator_methods.out b/tests/expectations/compiler/compiler/boolean/operator_methods.out index 11cbd28baa..c7eb2311fb 100644 --- a/tests/expectations/compiler/compiler/boolean/operator_methods.out +++ b/tests/expectations/compiler/compiler/boolean/operator_methods.out @@ -8,4 +8,3 @@ outputs: - initial_input_ast: 19f1be52a19445695f23724e1979b362dd3fcf31aace997c829e2206dc1cccbe - initial_input_ast: d2fc1992beaf062678bbf6c3e862820dbbea39926589afcdc46c19c8669f0e37 initial_ast: b8707d1d3f6c111db2515d4093d15b4739765bfb9e114ed345ebedce0c04024d - symbol_table: e73ad99357809180c0f1290a435d566d56110b8599a1ef2ec2a17d78b21628a8 diff --git a/tests/expectations/compiler/compiler/boolean/or.out b/tests/expectations/compiler/compiler/boolean/or.out index 3a29a54e42..a144f56053 100644 --- a/tests/expectations/compiler/compiler/boolean/or.out +++ b/tests/expectations/compiler/compiler/boolean/or.out @@ -8,4 +8,3 @@ outputs: - initial_input_ast: 4c5eeffd0306b20c8deece509782b81ea8583245f650e40a4a300d517f6ed5f4 - initial_input_ast: a56b3f9908dec2acaed302691d4fe0c2cf046f0deb8f188f617e042e75502f71 initial_ast: 6738dda9dfa2cce86f92f9d28e0e0750870156f6b5d6146d063baa221f88df3f - symbol_table: 91630eda77eaf1e355744e663ceba26a0c3f860d3f69e8e46b03f5464d16950f diff --git a/tests/expectations/compiler/compiler/char/string.out b/tests/expectations/compiler/compiler/char/string.out index 87094000d3..fa29d30ff4 100644 --- a/tests/expectations/compiler/compiler/char/string.out +++ b/tests/expectations/compiler/compiler/char/string.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: f1af7e79dff9ede0d2a1c88d5d22801cb3dfe3a9fb34e93bca646e29a61e9f65 initial_ast: 80124fe1a7297907bc27330cfe87117bee204a9f2b8acce053b0778568415a31 - symbol_table: 4a29c4b5af2ad1879798454b95b7dd04ae7ecd48289c5f3e7a1e19eaf3921c3b diff --git a/tests/expectations/compiler/compiler/circuits/duplicate_name_context.out b/tests/expectations/compiler/compiler/circuits/duplicate_name_context.out index 33e3541a0c..0b332c10bf 100644 --- a/tests/expectations/compiler/compiler/circuits/duplicate_name_context.out +++ b/tests/expectations/compiler/compiler/circuits/duplicate_name_context.out @@ -1,8 +1,5 @@ --- namespace: Compile -expectation: Pass +expectation: Fail outputs: - - output: - - initial_input_ast: acb54d555ee391d519919827f5949bf1600d18004ce461097d062f91108563ba - initial_ast: 2fd04130d93c29b06f1288c682dd1ce37731ef0762f8e8d70d994aa97fa55c1e - symbol_table: 862016bdb0f3f5516b1c9311b674207d4fc2a533066ef43e2a80e413119eeab7 + - "Error [EAST0372015]: circuit `Bar` shadowed by\n --> compiler-test:8:5\n |\n 8 | const Bar: u32 = 66u32;\n | ^^^^^^^^^^^^^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/compiler/circuits/inline.out b/tests/expectations/compiler/compiler/circuits/inline.out index 9f669ec379..94d4418f77 100644 --- a/tests/expectations/compiler/compiler/circuits/inline.out +++ b/tests/expectations/compiler/compiler/circuits/inline.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 8507cd1753f4d2a835fa34d3d784487d89d595ea415d51145dd7291a839159c2 - symbol_table: e6f85704fccd0ca0f0461ae54cb604159a5f41a2175aad6b76bd534166f1bc6b diff --git a/tests/expectations/compiler/compiler/circuits/inline_member_pass.out b/tests/expectations/compiler/compiler/circuits/inline_member_pass.out index 4a2d7cd5d0..2ba0ef792f 100644 --- a/tests/expectations/compiler/compiler/circuits/inline_member_pass.out +++ b/tests/expectations/compiler/compiler/circuits/inline_member_pass.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 9489ab9b78bd31ac516e1674a83c6b35708238174df88374a7b19cef3d4a8e8a - symbol_table: 53d31f0d39f8ceb7cf079812e6e3a00e0bdb507ca9c11a1c0158433d8d25a476 diff --git a/tests/expectations/compiler/compiler/circuits/member_variable.out b/tests/expectations/compiler/compiler/circuits/member_variable.out index fa0b0c1b30..059608050c 100644 --- a/tests/expectations/compiler/compiler/circuits/member_variable.out +++ b/tests/expectations/compiler/compiler/circuits/member_variable.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 29f6139d908d390f890f04d8ee620757d29b7f71cd48c46ff65bc1e70aae840c initial_ast: 630995cc22fb6ec613f02e3aaa18392770158b2bbaf5aa1736c0bf71dd7357ce - symbol_table: dc48ad542739351f7ab87e4add0f0a3e3fcc500195bdfa7d2eb3e79e29ef0916 diff --git a/tests/expectations/compiler/compiler/console/assert.out b/tests/expectations/compiler/compiler/console/assert.out index 5035b55965..81e99457b7 100644 --- a/tests/expectations/compiler/compiler/console/assert.out +++ b/tests/expectations/compiler/compiler/console/assert.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 15a1f00a6c0ca8141202e45e534b7afd196e9391c184a4efd94f0d0ccf04a59d initial_ast: 0ef8a9cfc447ad3fd1cb0275e91b1d005b7f230a02bf87e0f8ad56be86daa23e - symbol_table: f8c971e501487f7a368a50fd1941c3fb70684b041478fe615a91f088796e301b diff --git a/tests/expectations/compiler/compiler/console/conditional_assert.out b/tests/expectations/compiler/compiler/console/conditional_assert.out index 265ee26b83..fb7f20e2db 100644 --- a/tests/expectations/compiler/compiler/console/conditional_assert.out +++ b/tests/expectations/compiler/compiler/console/conditional_assert.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 8b94c0dbc84f44bd29c614b87947e625ad136549ea29ff18233ba5b01ce63c9b - initial_input_ast: a62874e75304ab81d487909be1c6b1efa2e5756a2980b46e3bb1368586c3ee83 initial_ast: 487dcbee6a433329c15b3cd0b23ecc259d4df455906438f3e6cf348ebd63ee02 - symbol_table: f4e056be00b25dfd854a5be8197aeb205436bb0ee11cfe06701531ea086e038c diff --git a/tests/expectations/compiler/compiler/console/error.out b/tests/expectations/compiler/compiler/console/error.out index 38b6dc501d..2f6bbd33c7 100644 --- a/tests/expectations/compiler/compiler/console/error.out +++ b/tests/expectations/compiler/compiler/console/error.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 14cd2c781b154a9037de84e945cfb348e9c587cef94d3e1f3be83e4306f92a0e initial_ast: d718de3086bc78a00a392e3c2b46dfa8f76084909bad3c98a5a6759df73efb27 - symbol_table: d46f6eb98259f34d32a60788aa178efa34166bcc6ba1058e2ff5f8327a129b9c diff --git a/tests/expectations/compiler/compiler/console/log.out b/tests/expectations/compiler/compiler/console/log.out index 7e0d8e7f73..3cebd2ca3c 100644 --- a/tests/expectations/compiler/compiler/console/log.out +++ b/tests/expectations/compiler/compiler/console/log.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: fd19d82c3aba921f01b37174e3eb7fb603438506fe511657e21235b9fb3647d2 initial_ast: 2a99ef2515c58607e4b617f93c74838b6f2afed28e9e2c2eed658cea6d729b2d - symbol_table: 559484bc163178bf54b169f5dd573167771566aa993055b6a28f0c1a759339bc diff --git a/tests/expectations/compiler/compiler/console/log_conditional.out b/tests/expectations/compiler/compiler/console/log_conditional.out index 7394a5cf52..b310f78b73 100644 --- a/tests/expectations/compiler/compiler/console/log_conditional.out +++ b/tests/expectations/compiler/compiler/console/log_conditional.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 06fad995841b833ef5074920ae270b93bf82ad60b6c8b440c66b8bc5018aaa72 - initial_input_ast: 34bd981451bdeb915a2de749b969c8804c06e44a9f4473f36d6efac7617baead initial_ast: f8315b82b0a05e0e69fb8b0342b46cbee976ec20d62e0edd2f066bf51acd81d6 - symbol_table: 560afbb790df70bfc770d5c2f966428a37baf94a5c0f5312ad445456d33a2cd9 diff --git a/tests/expectations/compiler/compiler/console/log_input.out b/tests/expectations/compiler/compiler/console/log_input.out index 56c0979ce5..a33183e252 100644 --- a/tests/expectations/compiler/compiler/console/log_input.out +++ b/tests/expectations/compiler/compiler/console/log_input.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 0961f603812e241567b6e3ef5adb458309f1829eb2c08a216efccb17bea89faf initial_ast: 3602c929b2256f4ed5cec2ba9d3e967b029a7dc9717a371b32a356425cf9892b - symbol_table: 720c2aafae77c261ed1640d4080f9a73657638baa30e54a5e10e2323b6f6eca0 diff --git a/tests/expectations/compiler/compiler/console/log_parameter.out b/tests/expectations/compiler/compiler/console/log_parameter.out index c3199bd444..fc2bab2a30 100644 --- a/tests/expectations/compiler/compiler/console/log_parameter.out +++ b/tests/expectations/compiler/compiler/console/log_parameter.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: f18a0e019ca4719c4c4ef5b7313f562c3bc9581819d161d84566e706f3765249 initial_ast: f319125731635279a198fb2df8c0446475024c70829e9de32fa5f43c38079862 - symbol_table: e5159343ab03573032873783b28058a482dd401d534a0d3af03790a5286ba470 diff --git a/tests/expectations/compiler/compiler/console/log_parameter_many.out b/tests/expectations/compiler/compiler/console/log_parameter_many.out index f1e2fc1653..d7d15bfa13 100644 --- a/tests/expectations/compiler/compiler/console/log_parameter_many.out +++ b/tests/expectations/compiler/compiler/console/log_parameter_many.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 16910a94cf1f803ae6425ae6bee9422b01651c2c243b5e46807dc3191d169e64 initial_ast: 52824ac2e84097578faf0ff92f7ca840d2de30e8454a540886123a2cf79192ae - symbol_table: 757bb967973b87466c01be1a9dc78d30701964e0d234e0e65d1bbcbd3072370f diff --git a/tests/expectations/compiler/compiler/core/algorithms/bhp.out b/tests/expectations/compiler/compiler/core/algorithms/bhp.out index d5e55b5329..679ddae844 100644 --- a/tests/expectations/compiler/compiler/core/algorithms/bhp.out +++ b/tests/expectations/compiler/compiler/core/algorithms/bhp.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: fc0f2558100be5c1216c0d56e8be51be6ad4f51e47e42f89b96d1b9bae0ae34d - symbol_table: 00e1ab10d05676c51e65671158712d7041de760ca226f74a2314f1cef9740402 diff --git a/tests/expectations/compiler/compiler/core/algorithms/pedersen.out b/tests/expectations/compiler/compiler/core/algorithms/pedersen.out index 87ae40db6f..54cb9846c3 100644 --- a/tests/expectations/compiler/compiler/core/algorithms/pedersen.out +++ b/tests/expectations/compiler/compiler/core/algorithms/pedersen.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 8c3b9cf2aad8ba67eb351b67ed4642caa64a7ff83a2dcdc48f05413bba7ba81f - symbol_table: 4a439652db94447b85f87bdd262953b6b6233e2d5f22c562215fd792f59f04d3 diff --git a/tests/expectations/compiler/compiler/core/algorithms/poseidon.out b/tests/expectations/compiler/compiler/core/algorithms/poseidon.out index 4d4b746471..231c78c0c3 100644 --- a/tests/expectations/compiler/compiler/core/algorithms/poseidon.out +++ b/tests/expectations/compiler/compiler/core/algorithms/poseidon.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 0a7abaad3d4eb543b09e8664f8b274714f742bec62c45fe56dd6bece0a19161e - symbol_table: 43835e3ddb0a6a15f6ace2186576a1a51de6ad7251d29ff13302546bf1b46a42 diff --git a/tests/expectations/compiler/compiler/definition/out_of_order.out b/tests/expectations/compiler/compiler/definition/out_of_order.out index ea07b9bcc9..06bda2dadd 100644 --- a/tests/expectations/compiler/compiler/definition/out_of_order.out +++ b/tests/expectations/compiler/compiler/definition/out_of_order.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: b649852fa2fd7eda05bd0ba261f01dcee93b6b825d5d30fddb8dd5c5710081ca initial_ast: 13b0f0680422f4f647cb4da2fef412662f35b745ba788ce147add5eeccb2edaa - symbol_table: 66779461e33acc9c5c732509637db91bd72aff3e9dae6aee0c137d0537446878 diff --git a/tests/expectations/compiler/compiler/field/add.out b/tests/expectations/compiler/compiler/field/add.out index 4bb748992f..80a593c1af 100644 --- a/tests/expectations/compiler/compiler/field/add.out +++ b/tests/expectations/compiler/compiler/field/add.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 3f35e74d282a1e5281e7f283d1e572a3dc75dea1a5ef1a0f8c7f46412ef946a7 initial_ast: 0aebc18388f6ceed8c1d813152ec6392bf687a814d3ae6d63ae10b50420c1a43 - symbol_table: d666098c1c0d7c670730cfa6548d47fa89d9a1dd33642f8021b0622f9abc0e5e diff --git a/tests/expectations/compiler/compiler/field/div.out b/tests/expectations/compiler/compiler/field/div.out index 8de47cc72e..490f6960af 100644 --- a/tests/expectations/compiler/compiler/field/div.out +++ b/tests/expectations/compiler/compiler/field/div.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 4e3882d83c8044e40258f8414966b09c715b00e08bc3383030cecf2c4a825c60 initial_ast: 924a3905b44bfea2a10118e4c0336a596b6981a7b06ea39f71daac7000e5cf9c - symbol_table: 38cbfecf35fb5189618a9767d3245d02e133d59ce2a0fc0f3aba37a8fa14fe8e diff --git a/tests/expectations/compiler/compiler/field/eq.out b/tests/expectations/compiler/compiler/field/eq.out index 5b04ac6803..94b5701268 100644 --- a/tests/expectations/compiler/compiler/field/eq.out +++ b/tests/expectations/compiler/compiler/field/eq.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: eeba130bda3ee24f2a4bf92f67fb555ab849173910a647096e28729c2ebd71c2 initial_ast: 3546a10b24a6a53ee07d298e7dbbed5122bd9d0c973613296a94189d9e57f246 - symbol_table: 0879cd6e4cc609ecdbdfc87ff0f08b4f3ae54367e0a1c02116304eb1411d2c23 diff --git a/tests/expectations/compiler/compiler/field/field.out b/tests/expectations/compiler/compiler/field/field.out index d22f08c022..961e64b25c 100644 --- a/tests/expectations/compiler/compiler/field/field.out +++ b/tests/expectations/compiler/compiler/field/field.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 3a510480221eb323713b4b10cc374ba357f130e8ac2b07bf1c69ad5d8c936f12 initial_ast: ff341146cdbb78e4a5bffd47c109cc9987dd3b7cea8224e0ef3668394d1c7a90 - symbol_table: 7e1d351a3c008868527f780c7d643e848c26b786b786ba24dd5771c8639416da diff --git a/tests/expectations/compiler/compiler/field/mul.out b/tests/expectations/compiler/compiler/field/mul.out index a15c855380..0ce7d7a6bb 100644 --- a/tests/expectations/compiler/compiler/field/mul.out +++ b/tests/expectations/compiler/compiler/field/mul.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 3f35e74d282a1e5281e7f283d1e572a3dc75dea1a5ef1a0f8c7f46412ef946a7 initial_ast: c05e588dae9e5f6e7e1c2d16d08629af8d287b453796b21de89b25d40970ec1b - symbol_table: 47782aad84b54a835bead341b6113b471712ddd6d19005040d16c5d199a0920a diff --git a/tests/expectations/compiler/compiler/field/negate.out b/tests/expectations/compiler/compiler/field/negate.out index adb87bc09c..4d5347e101 100644 --- a/tests/expectations/compiler/compiler/field/negate.out +++ b/tests/expectations/compiler/compiler/field/negate.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 9206742d7f18345efbd4d9077cd1aca0855d43a2436be0697ec22954650e3737 initial_ast: c2122be4da96294b4ce4bca5d239176c6bb98765248c767dd41352b6b95888c8 - symbol_table: c1972a6cda7ceae22c2efcf9fbb23065899f6ded0f295d2ca52789ccfb916e75 diff --git a/tests/expectations/compiler/compiler/field/operator_methods.out b/tests/expectations/compiler/compiler/field/operator_methods.out index 34df01747d..c0ad217a0a 100644 --- a/tests/expectations/compiler/compiler/field/operator_methods.out +++ b/tests/expectations/compiler/compiler/field/operator_methods.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 047866515f4dc74cd9966242734984b53e72f87afc21f7171b118e6defa1f166 initial_ast: 49b4956c647eb7f6e1ae496ce2e5c4ff238493d9cbc9d20d6f0f3fee09dee4f4 - symbol_table: d2086bca43b5a4ee965064ad79ef70496bfc2e89d6cb76f0d68d3e29c515af0a diff --git a/tests/expectations/compiler/compiler/field/pow.out b/tests/expectations/compiler/compiler/field/pow.out index c83772093b..f1a45f2135 100644 --- a/tests/expectations/compiler/compiler/field/pow.out +++ b/tests/expectations/compiler/compiler/field/pow.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 5e0a61d909d2e94dfbc95775e4c5c356adb61375ceef2d583a5ab927b3b6342e initial_ast: ecf60185d2eda458885b00f1daa586132dfbfc560b0565c1659bb4bfed3cb19d - symbol_table: 2aef6303c5f4e1c08e7ef101bb47063e28bda7e17a320ae2ce73c4859fa62a19 diff --git a/tests/expectations/compiler/compiler/field/sub.out b/tests/expectations/compiler/compiler/field/sub.out index 69bccff962..c51054ede0 100644 --- a/tests/expectations/compiler/compiler/field/sub.out +++ b/tests/expectations/compiler/compiler/field/sub.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 4e3882d83c8044e40258f8414966b09c715b00e08bc3383030cecf2c4a825c60 initial_ast: 44033abf4e0e2d174cc770b32f903b8a1d4505ee4cbfdcfca3ad1f885071123e - symbol_table: f601b6a1652f79ac2853737ecf09f4e5f23c05873e2bb3967137a7b2b0085b04 diff --git a/tests/expectations/compiler/compiler/field/ternary.out b/tests/expectations/compiler/compiler/field/ternary.out index 3578ff50da..47d53e7b9c 100644 --- a/tests/expectations/compiler/compiler/field/ternary.out +++ b/tests/expectations/compiler/compiler/field/ternary.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: e19dcac0064fed4ec8293b9b40ec70cb94b5fdb05f1081fc29f46a023bf79b09 initial_ast: 8efd26ef8db8c5c793450a368ec66d7a3fe3b363145655192344af4a8c2b4d81 - symbol_table: 5bb0a34e488683807eef29093f204fb2f1cfe8da3c2e2370d61e427a109a2d4a diff --git a/tests/expectations/compiler/compiler/function/conditional_return.out b/tests/expectations/compiler/compiler/function/conditional_return.out index 1e03c69fc1..6eaaf724e0 100644 --- a/tests/expectations/compiler/compiler/function/conditional_return.out +++ b/tests/expectations/compiler/compiler/function/conditional_return.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: f4c81e7647e3b7cb29e8faf5456878989cbc81cb49097acf5bc9aaafc9092b6b initial_ast: ed69198e934ac7f6a604adb37a4b27ad593909930029904db802c1895d7269c9 - symbol_table: 577abb859b2f33b9e81c5e94c82b559601f44025143fa7a6757561b47e78efa5 diff --git a/tests/expectations/compiler/compiler/function/iteration.out b/tests/expectations/compiler/compiler/function/iteration.out index 8af241984f..8972765c1d 100644 --- a/tests/expectations/compiler/compiler/function/iteration.out +++ b/tests/expectations/compiler/compiler/function/iteration.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 1febcc333f69e7f5ea2e8b9e915c66a23f4e195c6106a31cffb1adb81b90f0e4 initial_ast: 7df50863de140cd6033391d929212b91180ff90737c536e631f977ddf9eb9d91 - symbol_table: 6754c028b1d3793f022a7da93be8510a6844da8a2e45f5dcaa9566252e418ee2 diff --git a/tests/expectations/compiler/compiler/function/iteration_repeated.out b/tests/expectations/compiler/compiler/function/iteration_repeated.out index 9b7e526abe..d4e41b329d 100644 --- a/tests/expectations/compiler/compiler/function/iteration_repeated.out +++ b/tests/expectations/compiler/compiler/function/iteration_repeated.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: ae87aca959c3d818c9259be6ca73eca6ada9633312e81a4df172d833f40c78e9 initial_ast: 24bdae47f1154abc4c7f8dbe30dde72ae25779e4464e8942968c7fd36f602d42 - symbol_table: c45d23aa877641cbf1853709cc103d389f3e3105b5c873f8bb90c3a0c48bd2ff diff --git a/tests/expectations/compiler/compiler/function/repeated.out b/tests/expectations/compiler/compiler/function/repeated.out index f6b347af4b..a2f1234269 100644 --- a/tests/expectations/compiler/compiler/function/repeated.out +++ b/tests/expectations/compiler/compiler/function/repeated.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 6b8596d250b3c42a0ff9856eb4a94d28c72b2953313d594f13a5d3f1de6f072f initial_ast: a21fe86230689152fbfcf3529c818c0ef25fe9f3117de260f85ae84cc535c503 - symbol_table: 7c82d098d4b483b968c5b928f68a4a6f040bf961bbf5192bf323ddabbe592da8 diff --git a/tests/expectations/compiler/compiler/function/return.out b/tests/expectations/compiler/compiler/function/return.out index c1e0c39e8a..ba3a854867 100644 --- a/tests/expectations/compiler/compiler/function/return.out +++ b/tests/expectations/compiler/compiler/function/return.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: d11a4218606717322234d8ea4c4786d6edce90f07abde9e120d597cb0e838ce0 initial_ast: 9a7092fce407db3067a8ed1a90dbd5613dff7d581d2df73ce7f6701ff64e5e0b - symbol_table: 8bddbedba52c66dc7a86530a2df470eb3222992c10b75842431a82afc7e936d4 diff --git a/tests/expectations/compiler/compiler/group/add.out b/tests/expectations/compiler/compiler/group/add.out index 6bb4083f26..87b59e38db 100644 --- a/tests/expectations/compiler/compiler/group/add.out +++ b/tests/expectations/compiler/compiler/group/add.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: a28b88dc36ace78ed0de93b56db7274f16521597ccf1e820a17fdb60a1e3d92a initial_ast: 7109d173cdd239abf5f0f717e669e300cf7bd4b3bde2158a17d1f16c1b154276 - symbol_table: b10964224747af7f8ba12f1b3c0dfa228842b3e08b9b82d785b71def31387144 diff --git a/tests/expectations/compiler/compiler/group/assert_eq.out b/tests/expectations/compiler/compiler/group/assert_eq.out index 2d8b2214d6..2ba63dcb51 100644 --- a/tests/expectations/compiler/compiler/group/assert_eq.out +++ b/tests/expectations/compiler/compiler/group/assert_eq.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 00c3cc87ce3c30894ad6b6874ce6dacfa02c9f2bc171615ff627f06f2e201997 initial_ast: b6e75e27703bf6b6af69de95f9c22ef2033db46227f5658a9f2e88c33a169b1d - symbol_table: 584d3ba9f7908f1b2e0c918710e78d0a483c12aa3f4644edada2eac31ac689ca diff --git a/tests/expectations/compiler/compiler/group/both_sign_high.out b/tests/expectations/compiler/compiler/group/both_sign_high.out index c76de034f9..7f24766d1d 100644 --- a/tests/expectations/compiler/compiler/group/both_sign_high.out +++ b/tests/expectations/compiler/compiler/group/both_sign_high.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 7631f3258e3f0f288fd21a0470c43f636b96bbe0f3643dad29353e9b48c63ee6 - symbol_table: 9a61702119ebc681917d7cb7e40ecafa00354849326bf1182635f27a28da35e9 diff --git a/tests/expectations/compiler/compiler/group/both_sign_inferred.out b/tests/expectations/compiler/compiler/group/both_sign_inferred.out index ebb310e40c..0a6abffb37 100644 --- a/tests/expectations/compiler/compiler/group/both_sign_inferred.out +++ b/tests/expectations/compiler/compiler/group/both_sign_inferred.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 97c27f26fd8d201623b1cbb19474a2cb6934c6bda8d4b363c831b0a3193e75ec - symbol_table: e4a96223c049893c904a90f24d069592b33fc137de0f4816cf92089e63663693 diff --git a/tests/expectations/compiler/compiler/group/both_sign_low.out b/tests/expectations/compiler/compiler/group/both_sign_low.out index 9f76e6c3b2..e1c407c92f 100644 --- a/tests/expectations/compiler/compiler/group/both_sign_low.out +++ b/tests/expectations/compiler/compiler/group/both_sign_low.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 772357946f6febbf75a72e8f706975abc242cc805368babdac1e3d047a1d0dc8 - symbol_table: 1817d91b99941ddc2590c6a2777ad8f7d4ba26a8b2a3baa3932f1a08eb540206 diff --git a/tests/expectations/compiler/compiler/group/eq.out b/tests/expectations/compiler/compiler/group/eq.out index 2d8b2214d6..2ba63dcb51 100644 --- a/tests/expectations/compiler/compiler/group/eq.out +++ b/tests/expectations/compiler/compiler/group/eq.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 00c3cc87ce3c30894ad6b6874ce6dacfa02c9f2bc171615ff627f06f2e201997 initial_ast: b6e75e27703bf6b6af69de95f9c22ef2033db46227f5658a9f2e88c33a169b1d - symbol_table: 584d3ba9f7908f1b2e0c918710e78d0a483c12aa3f4644edada2eac31ac689ca diff --git a/tests/expectations/compiler/compiler/group/input.out b/tests/expectations/compiler/compiler/group/input.out index aeabc43751..2f9c18728d 100644 --- a/tests/expectations/compiler/compiler/group/input.out +++ b/tests/expectations/compiler/compiler/group/input.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c93f9fd667509aa0aa3896c261cb48c7d579d9856d0a14b96e9b2c7e04566a0a initial_ast: b6e75e27703bf6b6af69de95f9c22ef2033db46227f5658a9f2e88c33a169b1d - symbol_table: 584d3ba9f7908f1b2e0c918710e78d0a483c12aa3f4644edada2eac31ac689ca diff --git a/tests/expectations/compiler/compiler/group/mult_by_scalar.out b/tests/expectations/compiler/compiler/group/mult_by_scalar.out index 22a3cbb30c..b68f5b687d 100644 --- a/tests/expectations/compiler/compiler/group/mult_by_scalar.out +++ b/tests/expectations/compiler/compiler/group/mult_by_scalar.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 7b0236b04ad9caa4039a989b91e7f49021a9daf09a495a9cdad7c371ee196761 initial_ast: 99e25dcd781ee8514ca93fdb34430f05caf429ed46dafa3189c3d835d680d7df - symbol_table: ac787ea8268badd26320c55d7d1b808ca7bfdaac3994570a28e605d637f1cdaf diff --git a/tests/expectations/compiler/compiler/group/negate.out b/tests/expectations/compiler/compiler/group/negate.out index 2c2471e033..ab3c24e6ac 100644 --- a/tests/expectations/compiler/compiler/group/negate.out +++ b/tests/expectations/compiler/compiler/group/negate.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 5e1e23855cb6841ee210c8a24e11cc819e91ce3b087a8c961035c574baa1784b initial_ast: 491aa1b9665527f07687444cb882f1ae5d363ca3b024f9cc3de36027ec37fce4 - symbol_table: 0884500a6ca9407b647feb8c0257cf2785412a051f1d0e0fad5ca54e40008243 diff --git a/tests/expectations/compiler/compiler/group/one.out b/tests/expectations/compiler/compiler/group/one.out index d9e59d7ef5..dcc452de87 100644 --- a/tests/expectations/compiler/compiler/group/one.out +++ b/tests/expectations/compiler/compiler/group/one.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 5a4b6b18074e63ba98467539a224838675ea3f08b945b554c23df2f22f730181 - symbol_table: 1459210791fd0aae2827b2b7c3fd438e7a8315b290e23cbfe365b4214d5cd284 diff --git a/tests/expectations/compiler/compiler/group/operator_methods.out b/tests/expectations/compiler/compiler/group/operator_methods.out index 1c90674bef..9f118e0a28 100644 --- a/tests/expectations/compiler/compiler/group/operator_methods.out +++ b/tests/expectations/compiler/compiler/group/operator_methods.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: a60503e3f83fbee658d02fb3806b3a3326fc6d4f4e43ac05bce7b16ac0552edb initial_ast: 07af6f05d46a6cd91085fb1aaf8a0fcb9cb2c05ccf60fd5fad5449e9fbf079b4 - symbol_table: 411b2d036a4603e77f6fe4479d6d35cbe7d82a718010b1a759e4bf6ac24687fd diff --git a/tests/expectations/compiler/compiler/group/point.out b/tests/expectations/compiler/compiler/group/point.out index 290500e5a0..b07290161b 100644 --- a/tests/expectations/compiler/compiler/group/point.out +++ b/tests/expectations/compiler/compiler/group/point.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 7031bc0fd844a95ff14f558d113c6c5701834489713c2e9050d42b80e32fa2d0 - symbol_table: ac8c4425959cf548f2f0edc8aa637b1d827394f11fe2c10ecef366a803fe30a2 diff --git a/tests/expectations/compiler/compiler/group/point_input.out b/tests/expectations/compiler/compiler/group/point_input.out index a6e9102a9a..9de59b1a68 100644 --- a/tests/expectations/compiler/compiler/group/point_input.out +++ b/tests/expectations/compiler/compiler/group/point_input.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 1b5330a3356c437ddc09afc027d1365eedb24c56777772fd83b9167cfebb4435 initial_ast: c90971ebee1da3c277fef3288af860eeca4997ba9807a8038a3d1bd03200d277 - symbol_table: 0db35c4a8548b1c37607ad3a7d67be41b7949f6219107f4d5ef8442a75dd2a7a diff --git a/tests/expectations/compiler/compiler/group/positive_and_negative.out b/tests/expectations/compiler/compiler/group/positive_and_negative.out index 1756493b9b..603b22b781 100644 --- a/tests/expectations/compiler/compiler/group/positive_and_negative.out +++ b/tests/expectations/compiler/compiler/group/positive_and_negative.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 32f2a58463cce89611be1ef90aa7f109f3c86c8c2ad87b11c4ab62127ac8c969 - symbol_table: 7e69e6875d7b047f525e435533e6b299da0779cd28edbf4190f2b701c79d74fb diff --git a/tests/expectations/compiler/compiler/group/sub.out b/tests/expectations/compiler/compiler/group/sub.out index cedc80c02b..49e75f451a 100644 --- a/tests/expectations/compiler/compiler/group/sub.out +++ b/tests/expectations/compiler/compiler/group/sub.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: a28b88dc36ace78ed0de93b56db7274f16521597ccf1e820a17fdb60a1e3d92a initial_ast: 97ab784d4cdbb80329f8284003c821fa956e5b4913277813136217849815200d - symbol_table: 8d7179908ac5272f4892b2e374ad5c5401332d4d12d7d0505ba1e51a98ef0d6d diff --git a/tests/expectations/compiler/compiler/group/ternary.out b/tests/expectations/compiler/compiler/group/ternary.out index 091cb695a7..251a0b6d32 100644 --- a/tests/expectations/compiler/compiler/group/ternary.out +++ b/tests/expectations/compiler/compiler/group/ternary.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: d12e492b73a208051457ad2ce9ed8dbbb5a8096f32f52d697c41972ba8b88d35 initial_ast: 5d6e9ede195a3cfc06f7a91b47937247e6ffc237b57e37859a6d0e5cc966b762 - symbol_table: 35465ba1d734747d0265a3b89c9cee8fe0beda4cfb42b477010c902472e57cc1 diff --git a/tests/expectations/compiler/compiler/group/x_and_y.out b/tests/expectations/compiler/compiler/group/x_and_y.out index 2714817136..b3a7a9bf4e 100644 --- a/tests/expectations/compiler/compiler/group/x_and_y.out +++ b/tests/expectations/compiler/compiler/group/x_and_y.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 3cf73b90d40fce8273b69ccf99424ad3b5f8fce2999d06bb1413428280f17f7d - symbol_table: f33f5b0c84aac58327880b146c570d74ed3118e93247b4a05680ae2c451db5b1 diff --git a/tests/expectations/compiler/compiler/group/x_sign_high.out b/tests/expectations/compiler/compiler/group/x_sign_high.out index 4a6dbe9466..d8238469aa 100644 --- a/tests/expectations/compiler/compiler/group/x_sign_high.out +++ b/tests/expectations/compiler/compiler/group/x_sign_high.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 0ae122eb2bd121db2f072a8d79afbe3d0ad1023e7a4aaee2e4e9f4ba5c1a3c36 - symbol_table: 2d0db26fa84f8daad71afd4420718043de1c97757ae4fe4fa78e9874891d1d80 diff --git a/tests/expectations/compiler/compiler/group/x_sign_inferred.out b/tests/expectations/compiler/compiler/group/x_sign_inferred.out index 456342cc4e..e7e03ae81c 100644 --- a/tests/expectations/compiler/compiler/group/x_sign_inferred.out +++ b/tests/expectations/compiler/compiler/group/x_sign_inferred.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 81f062d4ca72bbfb62d447cfe23d0658b3b40a4caf3ca1fd37db833a3a6ba9f5 - symbol_table: c20979f64468655131a488980c1de31384fd7ff35561ed569c3db6f2d0bc19cc diff --git a/tests/expectations/compiler/compiler/group/x_sign_low.out b/tests/expectations/compiler/compiler/group/x_sign_low.out index 0ca7dfa48e..60fb907a2a 100644 --- a/tests/expectations/compiler/compiler/group/x_sign_low.out +++ b/tests/expectations/compiler/compiler/group/x_sign_low.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 2b60be6820f8dc537b2ab9ec70e4981d93d0c68ebdc71d9437345e57c66505bf - symbol_table: f450d14b0bb862b0bec4a5f8d41eb92f7cf951dee469505fb20dbfa25972eb7b diff --git a/tests/expectations/compiler/compiler/group/y_sign_high.out b/tests/expectations/compiler/compiler/group/y_sign_high.out index 78d10e6df4..c8f623e367 100644 --- a/tests/expectations/compiler/compiler/group/y_sign_high.out +++ b/tests/expectations/compiler/compiler/group/y_sign_high.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: c92281b28b5166cfa0cb458bb6f21dcc71d67dfe1f8bb757945c575cbb92a549 - symbol_table: 52760622da95d189f6e707df97fc6bba4216fa59022a4ae79d840b9c05fdf5b1 diff --git a/tests/expectations/compiler/compiler/group/y_sign_inferred.out b/tests/expectations/compiler/compiler/group/y_sign_inferred.out index a33a378e69..8f7b4c9c71 100644 --- a/tests/expectations/compiler/compiler/group/y_sign_inferred.out +++ b/tests/expectations/compiler/compiler/group/y_sign_inferred.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: b5c2ab86061f7dcae809f6a707559c1738a0f0a2352270ca3ff91a3242d70af3 - symbol_table: d3bf69e78619e63bc1c56c1efe49712b226f5d477e1c42491d0b31e24d5a98a7 diff --git a/tests/expectations/compiler/compiler/group/y_sign_low.out b/tests/expectations/compiler/compiler/group/y_sign_low.out index b4cfaada3d..50fa715c80 100644 --- a/tests/expectations/compiler/compiler/group/y_sign_low.out +++ b/tests/expectations/compiler/compiler/group/y_sign_low.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 1d5f67161857e1ef3195099a1a04370ddf33dc3eebade9e1a5e0f6266c495a75 - symbol_table: 026430e928e2236167d6587cb1885784f30bbc916f75d3a0f42fa7a3f2c6978b diff --git a/tests/expectations/compiler/compiler/group/zero.out b/tests/expectations/compiler/compiler/group/zero.out index 23ab78f3d9..78584cda00 100644 --- a/tests/expectations/compiler/compiler/group/zero.out +++ b/tests/expectations/compiler/compiler/group/zero.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 31edb6eef4b9fa47acfb94f0f8f7ec9f50667501c7dc6bb5c643a65be90cbfb7 - symbol_table: b181fa2d3c50419dbdaadbe2e91aa4a3e17baa614b0635f9ce6fa7367ead48eb diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main.out b/tests/expectations/compiler/compiler/input_files/program_input/main.out index 4e87605e35..5384e83339 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 23e62412d2a9377334d90aaeb6629b73c77e045ce87f23bd6ae2e2cd242e70f0 initial_ast: 62a908a53573e228fec4b308f637909227856abaf327f527c23dd63e739d77d7 - symbol_table: 00f652a7b8e969478d433c749951ee63b97343691ff9ade7e1e9288757814ef6 diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_field.out b/tests/expectations/compiler/compiler/input_files/program_input/main_field.out index 867b9c17fc..cd11030288 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_field.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_field.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 2b6bc4ade2305a65746066befacf6a0a18382f754d4d7911d0c6e0abef682114 initial_ast: 4d5c44da11b6644f95211ba6ebac1a6ca45ffbc63248fbc42a92a26e109cb63f - symbol_table: a3dad989c81fa120b3092919ca6bd0cc90221424459f5691b7f172e5564ba1ae diff --git a/tests/expectations/compiler/compiler/input_files/program_input/main_group.out b/tests/expectations/compiler/compiler/input_files/program_input/main_group.out index 0b363183f8..7644cdd560 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input/main_group.out +++ b/tests/expectations/compiler/compiler/input_files/program_input/main_group.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 4001f721e97052bdea8fafe39846356011e335e40281e0082c0b406cd6a85947 initial_ast: 947309cb1c78f8b954bd55ccb34e84ce39f7988991c9f6c2ae6408257c979665 - symbol_table: 3b68eff86b45e4f940b0a1031e19a64178b0bf802acb59f3b743e664f3010876 diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main.out index 908bd74a39..d1dea74e1e 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: e626f055978f5125bc292065d74aab5b679229a5364f150ccbe1f07d0c167c3d initial_ast: 22df0e8dcc96e127df94438ebdd1111070afb5f2fede13534a9aeb0d20885246 - symbol_table: 0c159f2d4019e8ce09298ed85f51214a307e72e2e0cbfae36ff844e54221f6f3 diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.out index 36c7b4b9c9..375fe9469a 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_field.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 3eaa98274698edacf455de40418ea012234a1355d5b50b9063ee0e06d3d26709 initial_ast: b1647dfd919968219b01ee5ff48ba97b155d8d40702498a69ff712b59c4a908f - symbol_table: 876b01cb4c834949c3a9bae4d6ebc2a675c5c6d8f0d44738ad3624be693169d5 diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_group.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_group.out index 38211a5118..8863d1cbf4 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_group.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_group.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 4efe3ae5f2d6a95663ca302b60d4e430b63bcb7c5a19d638ec7613b7dc099825 initial_ast: f88e91c98500ea74503f284eb75e2e25857d9092257166716025bc9a95584b9d - symbol_table: 5b4e625f4a8684ff3dbfce2fb03cd8e64d1f22f1397b8106aee9e13034bef0ac diff --git a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multiple.out b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multiple.out index b96f2cdb00..b279e5d35a 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multiple.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_constants/main_multiple.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: e7173f6b8aa8aa40bcb167fa4de0b5d5a7f1b6d245a78dcb5ad70a73b53ef7de initial_ast: 314c2343d15bc5676eb5669e9a7a193936ce32ea4f2c7a1ab10719202314e4ee - symbol_table: cbab89bb481942bafb0524e8228ea50c64926bdec2bb8c75a13f1733515459f4 diff --git a/tests/expectations/compiler/compiler/integers/i128/add.out b/tests/expectations/compiler/compiler/integers/i128/add.out index 06768ba1a8..45faf1211c 100644 --- a/tests/expectations/compiler/compiler/integers/i128/add.out +++ b/tests/expectations/compiler/compiler/integers/i128/add.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: ca7500628480432228743b9eff2cac69e433bc0a9da6ce007cae38ef9c2b57a6 initial_ast: 07374055a6d078ecbf9f3c76a3c63cef7b529a583333afc655d1f7b22c8fd054 - symbol_table: 26e29ab43161625435a7de57fba18feffa2ca86b908d3720a652c8fabc1a6adf diff --git a/tests/expectations/compiler/compiler/integers/i128/and.out b/tests/expectations/compiler/compiler/integers/i128/and.out index 71b92f74dd..26f4716946 100644 --- a/tests/expectations/compiler/compiler/integers/i128/and.out +++ b/tests/expectations/compiler/compiler/integers/i128/and.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: ca7500628480432228743b9eff2cac69e433bc0a9da6ce007cae38ef9c2b57a6 initial_ast: 210dcc0f1e9522a7a7ada3b633f1ce0401f8c53ad0acf3e59f60772b51f35899 - symbol_table: f398fd041dc330aa49abf58328dd175e5bb927bf3e36e16559e79eb0d4461a77 diff --git a/tests/expectations/compiler/compiler/integers/i128/console_assert.out b/tests/expectations/compiler/compiler/integers/i128/console_assert.out index d4f8e49043..5dbfd1b4db 100644 --- a/tests/expectations/compiler/compiler/integers/i128/console_assert.out +++ b/tests/expectations/compiler/compiler/integers/i128/console_assert.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 86fc147511a8405918da9d9f5e40b2daccb441e80b793287203d30b21bb5600a initial_ast: e684deb39dd4d7d41b1d5062f5f025df84d1998d16a59871d53f211dd9d9cce2 - symbol_table: 6f25f2987af24695b2fb70fb856a108c3d185a98289e796f5af4cb60c0de946a diff --git a/tests/expectations/compiler/compiler/integers/i128/div.out b/tests/expectations/compiler/compiler/integers/i128/div.out index 748ee643eb..da99e4c620 100644 --- a/tests/expectations/compiler/compiler/integers/i128/div.out +++ b/tests/expectations/compiler/compiler/integers/i128/div.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 8562aec00f8be8367748af8197e2add488cbae2e0931674b68581744dbaafe61 initial_ast: ae2ef5614de8c31c25df7bb8cea87eb00ac8c154fb4a0ead71dfc306dc836b66 - symbol_table: 13298cf22dc30ccc0e18f787e657068fd0531e71e9b29155541503bf7209801b diff --git a/tests/expectations/compiler/compiler/integers/i128/eq.out b/tests/expectations/compiler/compiler/integers/i128/eq.out index bd3ac0371e..ebe94d282f 100644 --- a/tests/expectations/compiler/compiler/integers/i128/eq.out +++ b/tests/expectations/compiler/compiler/integers/i128/eq.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: a4d1618b78d6f649f06d5f58f5ae0bb45135717abf3feea0541698ddb0212ec6 initial_ast: 44bd05c77cfb936ae6363fd532803e6939b0893d887d4e85b205ab3517ecfefa - symbol_table: e354ff29052ba6cf646dc2a940fb2489c740245554aa81f4a9b71c314f431618 diff --git a/tests/expectations/compiler/compiler/integers/i128/ge.out b/tests/expectations/compiler/compiler/integers/i128/ge.out index e4fa8b18fe..476866b76b 100644 --- a/tests/expectations/compiler/compiler/integers/i128/ge.out +++ b/tests/expectations/compiler/compiler/integers/i128/ge.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 14e51b70ecee1d7bbdd5c37abf0d03f2c620fc9d31d68135108e241d78f738a6 - initial_input_ast: d5462c67471a54461a3e8bdca815ec0700534c47e89ee9adc34f1243c53d1f11 initial_ast: 190357900b121a5278ca1cd8174bc13a092dd3babf9727c03fd27ab51066ba29 - symbol_table: a0b9f85aee4a145dd4f5a8f6488b4d50a627e317601a523b63b13cc969325401 diff --git a/tests/expectations/compiler/compiler/integers/i128/gt.out b/tests/expectations/compiler/compiler/integers/i128/gt.out index 6a6f01495c..dcb3ed70fb 100644 --- a/tests/expectations/compiler/compiler/integers/i128/gt.out +++ b/tests/expectations/compiler/compiler/integers/i128/gt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: dfdb458d96c001da809b9b656e1f32b1b3936303033136bb8fd8c99d9732dde3 - initial_input_ast: 8687bd99746f218264adc45a810fb6e16cf8ead9f64d63faa7b376e4e3907f84 initial_ast: 1b01fc5c167c9957c4f631fcf1e494444822f748f3abcc977d13263a0a74cb9f - symbol_table: 96ff00c92d164363ceb1fee06485b451062e76798f4381afa4141d60b2e88c96 diff --git a/tests/expectations/compiler/compiler/integers/i128/le.out b/tests/expectations/compiler/compiler/integers/i128/le.out index 53bc1941ca..d6c8f3c70e 100644 --- a/tests/expectations/compiler/compiler/integers/i128/le.out +++ b/tests/expectations/compiler/compiler/integers/i128/le.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 14e51b70ecee1d7bbdd5c37abf0d03f2c620fc9d31d68135108e241d78f738a6 - initial_input_ast: e34798d157f456fecf7ceed2e406c6b76e0b1bcda3a7110f56de0df10472b3c4 initial_ast: 3396a4771011467bf2f248f6346e7c2c5dae8dc8b14eddc39a58d180538a506d - symbol_table: 4beca34f91e3bb4fbb997a1851b3fefb933c47d1e24f6a2e6258d4075c01918a diff --git a/tests/expectations/compiler/compiler/integers/i128/lt.out b/tests/expectations/compiler/compiler/integers/i128/lt.out index 7103f1dd39..894a172a3d 100644 --- a/tests/expectations/compiler/compiler/integers/i128/lt.out +++ b/tests/expectations/compiler/compiler/integers/i128/lt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 8ed1bfd98e5df545f33dfc3b622573a028950b9f44a6038d84d903839ce6b226 - initial_input_ast: bc33c98fd9b5eba7bd68ca76eea533e137e786f4b75b79421de10134b56585df initial_ast: 66cb035a3d249a394e8dbbe19cbc02f5cddb844a78bc80c838c7cab191fe9701 - symbol_table: ad21c0cb65fd2f4f2360ed81da1bf608b83a0865801d2b569035eb1e36a7676a diff --git a/tests/expectations/compiler/compiler/integers/i128/max.out b/tests/expectations/compiler/compiler/integers/i128/max.out index 2d579e002c..34c8c23fee 100644 --- a/tests/expectations/compiler/compiler/integers/i128/max.out +++ b/tests/expectations/compiler/compiler/integers/i128/max.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: a2ab6a89c5952a113fbecdeb630917b4699c38dcda5971528ab35cdd5e92c216 initial_ast: 76fb816766ffe11700b4c2a7ebf8502f09b7a5ca9f616fcfb1fbfc083d70b91e - symbol_table: b9f23cb88072c4321465b95ec69bba96f8fb225616244266e05a9e6eeb99da5b diff --git a/tests/expectations/compiler/compiler/integers/i128/min.out b/tests/expectations/compiler/compiler/integers/i128/min.out index 702ed82286..129af93309 100644 --- a/tests/expectations/compiler/compiler/integers/i128/min.out +++ b/tests/expectations/compiler/compiler/integers/i128/min.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 1480b753150538db3f133e6491506ee264d39be8d1c0dab484cd81a20f24cdd8 initial_ast: 03f31393c00a98648f946675297b0c1bcefb2660ec10f96a955eec09fcdefecb - symbol_table: 9738fdb5ac2d311d0ad30f5e9fad6752b6a938c5d92fde015da71f5d57a90ed7 diff --git a/tests/expectations/compiler/compiler/integers/i128/mul.out b/tests/expectations/compiler/compiler/integers/i128/mul.out index 6ad2a612aa..9f96106379 100644 --- a/tests/expectations/compiler/compiler/integers/i128/mul.out +++ b/tests/expectations/compiler/compiler/integers/i128/mul.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 42fddcefe5cf53169d184a40cd71b49276704e081253906c01f79604ade70767 initial_ast: 275429c58b52b8d80540eeeffe81ea7182132b42bbcbf9314eb6d87cedf769e7 - symbol_table: c0c0cbcbbb0b8aa5351b8c74dec4bc556103902ca0f1ebcee2067768c553fd83 diff --git a/tests/expectations/compiler/compiler/integers/i128/ne.out b/tests/expectations/compiler/compiler/integers/i128/ne.out index 0116560342..3464abe049 100644 --- a/tests/expectations/compiler/compiler/integers/i128/ne.out +++ b/tests/expectations/compiler/compiler/integers/i128/ne.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 63066c216028b02a42d2eac61498268917858ed1821c2ae0e58717b82d7bbf8d - initial_input_ast: 7446cc6978fba2a498bc55383084c51e05a9bdba1eb03ddb311d523be65585ce initial_ast: c9f475f9bad29101a941423e97e83757441cc28efa410434f9ae27839f07bafa - symbol_table: ee72f930a06f9409bfa70e2c08cb9453f255bd8ecf13470383dd7592fada8a93 diff --git a/tests/expectations/compiler/compiler/integers/i128/negate.out b/tests/expectations/compiler/compiler/integers/i128/negate.out index aa12d5fd72..43f89ae728 100644 --- a/tests/expectations/compiler/compiler/integers/i128/negate.out +++ b/tests/expectations/compiler/compiler/integers/i128/negate.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: b7ef231f7dd6bc63f301a57ffd5da98fae92d14999aaf72c94c85aa28ee66ab1 - initial_input_ast: cfe2ed866172bc2b8ed033f9e5086dc5e518e7305631123537e5e7ce2697ec25 initial_ast: fbb42eff2dd3ea8ef4e74f998d10ba76ea3dfb4f5789484fc876bc54c8b582f9 - symbol_table: 683bec1b0f422d75012bf3361f4072afb660049e8daf18df7eeb7c9d2bdf7dda diff --git a/tests/expectations/compiler/compiler/integers/i128/negate_min.out b/tests/expectations/compiler/compiler/integers/i128/negate_min.out index e38daac44d..08cc6784e5 100644 --- a/tests/expectations/compiler/compiler/integers/i128/negate_min.out +++ b/tests/expectations/compiler/compiler/integers/i128/negate_min.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: d2117e2d504b1c95edd7f81c2fb111787aba0b797e0f076fbb473971dc0d3639 initial_ast: 656d8d0ee36bd258a452ad524cf0761e432dc5e39ff990dd8c1aff5246cfd81a - symbol_table: ed9b4802f55237805a1aa7e4dc7c63ee8c6c0f4bc9bde9b8d3156928fe72882f diff --git a/tests/expectations/compiler/compiler/integers/i128/negate_zero.out b/tests/expectations/compiler/compiler/integers/i128/negate_zero.out index 05cd228541..d07878bbc4 100644 --- a/tests/expectations/compiler/compiler/integers/i128/negate_zero.out +++ b/tests/expectations/compiler/compiler/integers/i128/negate_zero.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 34fcde78f661247ade77dd607c349139ab960d39b6a5e10efb7102e0f52aa9de initial_ast: 679872f43b04fdcfeb4cc560f3e2f95831adde9a40dea1cdaf28b73ce08aba90 - symbol_table: 7a5303bcdd8ba6c33d456d9c3964846c1b548bf7a495e81c9dcbb9b69d34994f diff --git a/tests/expectations/compiler/compiler/integers/i128/operator_methods.out b/tests/expectations/compiler/compiler/integers/i128/operator_methods.out index 921078f883..b715129d91 100644 --- a/tests/expectations/compiler/compiler/integers/i128/operator_methods.out +++ b/tests/expectations/compiler/compiler/integers/i128/operator_methods.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 7a421e06f3d56a5ff35cde69dfc10576b6c08f46a54ba24a666faa06e05d22a6 initial_ast: e7106189c908d27971e18c74d402859225869a735452ee6546d5c0958e459575 - symbol_table: dc44a4fb48e9c3d14d34968bc560fc44da8ac9e5a587a7d171b25175f440f630 diff --git a/tests/expectations/compiler/compiler/integers/i128/or.out b/tests/expectations/compiler/compiler/integers/i128/or.out index 2c8aa8b14b..793cdc3f77 100644 --- a/tests/expectations/compiler/compiler/integers/i128/or.out +++ b/tests/expectations/compiler/compiler/integers/i128/or.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: ca7500628480432228743b9eff2cac69e433bc0a9da6ce007cae38ef9c2b57a6 initial_ast: da3f6e496c8765a7fd3bc91bac882ad9ff142b05b78d437161de77cfa9e93d77 - symbol_table: 728fe50c11a4d6d659fd7e4cf90dbd3d10bae7840dc964b5d8fedc421bdcb6e3 diff --git a/tests/expectations/compiler/compiler/integers/i128/pow.out b/tests/expectations/compiler/compiler/integers/i128/pow.out index ff16fcea22..82e73075e6 100644 --- a/tests/expectations/compiler/compiler/integers/i128/pow.out +++ b/tests/expectations/compiler/compiler/integers/i128/pow.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: a2ddf46a6ab6a9ae23438bad4a04a03e699f74cf478054017008197940e1c816 initial_ast: 40f8374b33869991660bf29065ce5a7bda015b3860e1d4d122ab47d6c9d8c527 - symbol_table: 73c5ff4d01c67dd5942b335f7aabeec35224b504b1184f1bc8fe37b7a9016804 diff --git a/tests/expectations/compiler/compiler/integers/i128/shl.out b/tests/expectations/compiler/compiler/integers/i128/shl.out index 9a5dc0f31f..7fb1e0e826 100644 --- a/tests/expectations/compiler/compiler/integers/i128/shl.out +++ b/tests/expectations/compiler/compiler/integers/i128/shl.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: ee62d8508ac57ff5e421f4524903e8a65375db4e08db14fcaf0cec4f11974ce6 initial_ast: 48cf3da6026d7c545126575a39d3210415f1fcb1732d668c6d22cdd7c88878cc - symbol_table: 53a587f0c8d750df7bff8464a68ca63826436f54d4ce7579f3f84e4e7847119f diff --git a/tests/expectations/compiler/compiler/integers/i128/shr.out b/tests/expectations/compiler/compiler/integers/i128/shr.out index 439ca434b9..9178045814 100644 --- a/tests/expectations/compiler/compiler/integers/i128/shr.out +++ b/tests/expectations/compiler/compiler/integers/i128/shr.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: ee62d8508ac57ff5e421f4524903e8a65375db4e08db14fcaf0cec4f11974ce6 initial_ast: a1995d34c2fc6bec480cef2270472ffed393936d5f6f6f72bf3d720d65336b20 - symbol_table: 814ec2270161da6d5756a05ae7045b6392503caf47ab9112868c4c5fa9b06402 diff --git a/tests/expectations/compiler/compiler/integers/i128/sub.out b/tests/expectations/compiler/compiler/integers/i128/sub.out index 2a14cf795d..7dba3a9d5b 100644 --- a/tests/expectations/compiler/compiler/integers/i128/sub.out +++ b/tests/expectations/compiler/compiler/integers/i128/sub.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 4b489f1abc0cef5123b21e23de7a754ec616820ece226c08584e511216a9bda1 initial_ast: e4c37027d24f38f95598bdc92a184b6ac411eb63addfecc5869b5d241f5732d5 - symbol_table: e071ae07079f92ae418d648b75b982c8294698178699e138c3abfe2341d5b3fc diff --git a/tests/expectations/compiler/compiler/integers/i128/ternary.out b/tests/expectations/compiler/compiler/integers/i128/ternary.out index eb0c19ae01..f349b02fa1 100644 --- a/tests/expectations/compiler/compiler/integers/i128/ternary.out +++ b/tests/expectations/compiler/compiler/integers/i128/ternary.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 79fd283874b08961452d9a787c30439a1e551a2866a636368f4d17f8e88985de - initial_input_ast: 31e8d186f6c363350a67a31ede99b55c376ffc7a2ae779dcf0aedb43cb94979e initial_ast: 4de7b18747a3626dc77775180ad482caff806b2a6cf88318956471407bf000a7 - symbol_table: 940d5266f13724648ceb54c883bd73b737d83b14d2925fed8b0fcdaa6d77294b diff --git a/tests/expectations/compiler/compiler/integers/i128/xor.out b/tests/expectations/compiler/compiler/integers/i128/xor.out index 3558fcb548..e6e06b2439 100644 --- a/tests/expectations/compiler/compiler/integers/i128/xor.out +++ b/tests/expectations/compiler/compiler/integers/i128/xor.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 24836b073b76f7a0d3248569022711039180676965e828443fa77db4ca49de81 initial_ast: 67682b0f37d8433be92c854d4a66d7d48b55d50143af3dae7880c3520ae7bde0 - symbol_table: c4cbad3fd769b40ffaec90bf0b3b184b1e952024e24951a53b582599adbc7249 diff --git a/tests/expectations/compiler/compiler/integers/i16/add.out b/tests/expectations/compiler/compiler/integers/i16/add.out index b20bd6c77c..e775707fe7 100644 --- a/tests/expectations/compiler/compiler/integers/i16/add.out +++ b/tests/expectations/compiler/compiler/integers/i16/add.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: ca6ab55d11bc84ae5e5442cbc17ecf2f2ff6d31041d98a43c9710c2e3a7f7ff9 initial_ast: b869cd86791b366b69f05ea45ea7d37bf002fbbee22a6b08b319f9be9bf43597 - symbol_table: c0f4ce3ef2a4953e653c50d9adbccfc069c2047c6adda1830646d92934d66726 diff --git a/tests/expectations/compiler/compiler/integers/i16/and.out b/tests/expectations/compiler/compiler/integers/i16/and.out index e511358102..64b82c7530 100644 --- a/tests/expectations/compiler/compiler/integers/i16/and.out +++ b/tests/expectations/compiler/compiler/integers/i16/and.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: ca6ab55d11bc84ae5e5442cbc17ecf2f2ff6d31041d98a43c9710c2e3a7f7ff9 initial_ast: 809452097bde742b77243261863cd9d5b404f9e87f271ff0c3a51d024d7a3277 - symbol_table: e51d6ae9c0815787d64cbbeb954645ca8764e2eba3f20d363c7b274cdc073ea9 diff --git a/tests/expectations/compiler/compiler/integers/i16/console_assert.out b/tests/expectations/compiler/compiler/integers/i16/console_assert.out index dd98cca9e8..2f2cd3e106 100644 --- a/tests/expectations/compiler/compiler/integers/i16/console_assert.out +++ b/tests/expectations/compiler/compiler/integers/i16/console_assert.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 71d4c15605c3975991ba51378ef4148d6863656fdb491a93573bfc03dae3dc62 initial_ast: d24648724406b90c1de2b9361bd80216082a2d7bc08613861cd84718c82f1b5f - symbol_table: 4ba20f16852ff2fe7616b71c2d07aeadaed53777e2f304ded7c449948fe2f853 diff --git a/tests/expectations/compiler/compiler/integers/i16/div.out b/tests/expectations/compiler/compiler/integers/i16/div.out index 2244bb2fa6..fa7691fc4b 100644 --- a/tests/expectations/compiler/compiler/integers/i16/div.out +++ b/tests/expectations/compiler/compiler/integers/i16/div.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 17f36a9515beff0798792f878b29efd08dd2b9b1b34b08592dbf49709f48260c initial_ast: 22557d30c694c0b0e91c73a967422e8f8ec668125008e1157d49cda1bf5558bd - symbol_table: 0e193ca48f95a41e91fe8b791ba0bcee677e3fb5edf1af8659aaa4f16607c122 diff --git a/tests/expectations/compiler/compiler/integers/i16/eq.out b/tests/expectations/compiler/compiler/integers/i16/eq.out index 829823a43e..998f79ae60 100644 --- a/tests/expectations/compiler/compiler/integers/i16/eq.out +++ b/tests/expectations/compiler/compiler/integers/i16/eq.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 7c88546226f65808e9be3e925c8272f9583fbde6ae8b308116819664af8d9dd2 initial_ast: edbc2daca6bb579a2f1b35b86eebd5f9e39768f8e3cc5ee4c92f2a2dd672af3d - symbol_table: 8f43f463b85046218c11afbd5aa39021ba131f2b7474f2f9e1743e5b4b617d49 diff --git a/tests/expectations/compiler/compiler/integers/i16/ge.out b/tests/expectations/compiler/compiler/integers/i16/ge.out index 008fe34201..f0798d704e 100644 --- a/tests/expectations/compiler/compiler/integers/i16/ge.out +++ b/tests/expectations/compiler/compiler/integers/i16/ge.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 671dbf588ac06c9aaa98a0b93ae310030698c4459bcc8f5007d0b34e7f5a2fe7 - initial_input_ast: 1fae972c153c7e83794ba4f2b497e92499b793ef1a746da5be203b6d31a06d46 initial_ast: 8e3ffdad6178e550dc0cb3fb8b8591555c16f536b00015ede86e6f0540d3e610 - symbol_table: 23916724e149d291045330b89d96b60889a0fc778c31ae92c3a39b8ac7453285 diff --git a/tests/expectations/compiler/compiler/integers/i16/gt.out b/tests/expectations/compiler/compiler/integers/i16/gt.out index a5956fdb59..16693acfea 100644 --- a/tests/expectations/compiler/compiler/integers/i16/gt.out +++ b/tests/expectations/compiler/compiler/integers/i16/gt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 39fc24fd87f4bf15d0567508034c57f4de17a407812a715e62dc635b9b91dd8e - initial_input_ast: c5ffa1915a34f65b23e03c634e1941e89527338cd149ee5e4b9d0b4c0f36ba68 initial_ast: e050abc2d6e8a404b96d2abea06aab386991334de50f563f48e14ca24f163000 - symbol_table: 78d0d78e216325ced3f912e92935818dc7e24065690b5d9d560b7997ca29eacd diff --git a/tests/expectations/compiler/compiler/integers/i16/le.out b/tests/expectations/compiler/compiler/integers/i16/le.out index 15922aa558..4acc87d7c1 100644 --- a/tests/expectations/compiler/compiler/integers/i16/le.out +++ b/tests/expectations/compiler/compiler/integers/i16/le.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 671dbf588ac06c9aaa98a0b93ae310030698c4459bcc8f5007d0b34e7f5a2fe7 - initial_input_ast: 22a419208eeb7a661a55a2b61d7a3a9896af73320d4899320df9c830b3bb814a initial_ast: e8ac37ec0185965b13ba25b6b43d6a2068cca9af6b2860dcdcf1fdbc462528ce - symbol_table: bf2a96b0ab9d2587f3b5bd9b6a4b33d2839e61219f68828a79fb40788190ca1a diff --git a/tests/expectations/compiler/compiler/integers/i16/lt.out b/tests/expectations/compiler/compiler/integers/i16/lt.out index 2dea001bfe..9669f0010b 100644 --- a/tests/expectations/compiler/compiler/integers/i16/lt.out +++ b/tests/expectations/compiler/compiler/integers/i16/lt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: c1eedaa7c6583b87a4e6bfd9d3698ce378f3fbbed0a87419549f5e4124ce9d40 - initial_input_ast: 7b40e77aec02ca9b383339c98fb220828a90859f46c18b24a32ad22fc2884d35 initial_ast: e6a44b63da2e6d70110b81ffad2b2ee38814f9baae5a19893bbd2bd12a0107c6 - symbol_table: 7b9a0a38448dc4a3bc8670c59d350d3ef11176a8965827ff5e7cac73afe4b7ad diff --git a/tests/expectations/compiler/compiler/integers/i16/max.out b/tests/expectations/compiler/compiler/integers/i16/max.out index fae2804f06..d83788bc93 100644 --- a/tests/expectations/compiler/compiler/integers/i16/max.out +++ b/tests/expectations/compiler/compiler/integers/i16/max.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 940d740ba40284a1d3c3cf8737facd1e98968224dd93999dbcb336cb3f4ce571 initial_ast: e29f17572c095f5b8d230666be1a5cb70204f6442b238e11e3751779eb9d12ba - symbol_table: bff54d1345b964af7d0d8caa2e69b103810988c8acdd599f7843498255b52d69 diff --git a/tests/expectations/compiler/compiler/integers/i16/min.out b/tests/expectations/compiler/compiler/integers/i16/min.out index 202ee46e8e..60f46f4169 100644 --- a/tests/expectations/compiler/compiler/integers/i16/min.out +++ b/tests/expectations/compiler/compiler/integers/i16/min.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 142f86218cc646677bedd5bdf510ff537782d7e60967de7ebe9fb1fb50d7026d initial_ast: 3a12a3a89691c3f0fac7474e27a76c5b9827ec7eb99eac99787d82208d7a0c82 - symbol_table: 66c6adb606262fd92b38a807d982fe49530f40f0d9fc83c07c17204021049cc6 diff --git a/tests/expectations/compiler/compiler/integers/i16/mul.out b/tests/expectations/compiler/compiler/integers/i16/mul.out index d50a656796..6309d9b10c 100644 --- a/tests/expectations/compiler/compiler/integers/i16/mul.out +++ b/tests/expectations/compiler/compiler/integers/i16/mul.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 745a2b9284f3287f347d81001af05f7aeb8b713cdc357bc5845f1827dcd8fd7f initial_ast: 3ab1c6f4b724ebd5775fdb29630b9c5b976961d41d215ce31a1a90ca1c949c6d - symbol_table: 6ef3c6f53b59ccfacd7d3590250bf4f383dead38eb6403e278dced621c9a924c diff --git a/tests/expectations/compiler/compiler/integers/i16/ne.out b/tests/expectations/compiler/compiler/integers/i16/ne.out index d10c123572..9f29db251b 100644 --- a/tests/expectations/compiler/compiler/integers/i16/ne.out +++ b/tests/expectations/compiler/compiler/integers/i16/ne.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 0f4ec75d633030e364406d8e84674688511acd657b3e40614f54e8af9bc7fa8d - initial_input_ast: f5ba26c4f397d3678ad4296f5149592d1310e4d94bc52a274601ec8454dac549 initial_ast: e471222556c892e1fe10660f24a793473d5d2975ca0151ab705804b6b360a84c - symbol_table: d06cab633083be51c77f53df2cfe0bce8137fcb17aac03346d885adc9c4b9be3 diff --git a/tests/expectations/compiler/compiler/integers/i16/negate.out b/tests/expectations/compiler/compiler/integers/i16/negate.out index 8c7aea0356..072855bea6 100644 --- a/tests/expectations/compiler/compiler/integers/i16/negate.out +++ b/tests/expectations/compiler/compiler/integers/i16/negate.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 664f047973ba9818641a3c6a85834963a8e757af1a449f6a797b9562a8b138de - initial_input_ast: 6efaf882a26d26eb45f16ca255bcb648f018f647dd15ed158e26e543836fb6cd initial_ast: e6d527f134ba45e580a248e9dae401f7f71eaa5dd3c41548600fd10a8ac830ca - symbol_table: 2e0e98a5fac9ba3ca75e9c933d8049a64d6bc005f6c7279eb73afa8aa692124a diff --git a/tests/expectations/compiler/compiler/integers/i16/negate_min_fail.out b/tests/expectations/compiler/compiler/integers/i16/negate_min_fail.out index ffd2014c44..2b0abe2d96 100644 --- a/tests/expectations/compiler/compiler/integers/i16/negate_min_fail.out +++ b/tests/expectations/compiler/compiler/integers/i16/negate_min_fail.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 7643261a1792f68251258ad1b6be18e95528a86816b3772140d130b2784736cb initial_ast: d36246adcfdf393eecf1ad64aecf858e960e22ba69c87369d53347392cbfb4a4 - symbol_table: 2bb653c064d9dfe406f0580236962cc4a6ad4a3deb858ac7e0c9494644145a5c diff --git a/tests/expectations/compiler/compiler/integers/i16/negate_zero.out b/tests/expectations/compiler/compiler/integers/i16/negate_zero.out index 480fecf6f1..4e622626ca 100644 --- a/tests/expectations/compiler/compiler/integers/i16/negate_zero.out +++ b/tests/expectations/compiler/compiler/integers/i16/negate_zero.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 76a0fe2199754831329d9b089d2c02f73d7457aaed6548372169318675b85f48 initial_ast: b748784d3716f6dd8f82c2d42ea826ec857a3f681756cac9ccd9b8c6e0c0a841 - symbol_table: cc4cba69dded9bd3d0eeafb120e2609cc024ebe1043d5d1ce7c1e82ea18f2c09 diff --git a/tests/expectations/compiler/compiler/integers/i16/operator_methods.out b/tests/expectations/compiler/compiler/integers/i16/operator_methods.out index 0d1623c7ac..0fd53bc9d2 100644 --- a/tests/expectations/compiler/compiler/integers/i16/operator_methods.out +++ b/tests/expectations/compiler/compiler/integers/i16/operator_methods.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 1919858036addddfaeec6f7f5c06b8d4aad4e18f0167d9da1c61a7704dd51fe5 initial_ast: 8b4dd434c9a8fde0e845bffa9a82369172093a71ce41c32b9fc98da93b1a1db5 - symbol_table: 0f2f16de4cdef272f5e023dabbdc99f724b7d1d77a4a1f5acc4585d437a5b143 diff --git a/tests/expectations/compiler/compiler/integers/i16/or.out b/tests/expectations/compiler/compiler/integers/i16/or.out index a334d61577..bd42993f2a 100644 --- a/tests/expectations/compiler/compiler/integers/i16/or.out +++ b/tests/expectations/compiler/compiler/integers/i16/or.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: ca6ab55d11bc84ae5e5442cbc17ecf2f2ff6d31041d98a43c9710c2e3a7f7ff9 initial_ast: 50e3321589352a7adf53fee57319185cc20f0acaa43282637b79baab19b4f6a8 - symbol_table: 31382a7c67eebf9bc3285e3214586ead4d73682f8917537437533c7502200faf diff --git a/tests/expectations/compiler/compiler/integers/i16/pow.out b/tests/expectations/compiler/compiler/integers/i16/pow.out index 1ba6b3ffdf..359d43de40 100644 --- a/tests/expectations/compiler/compiler/integers/i16/pow.out +++ b/tests/expectations/compiler/compiler/integers/i16/pow.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 1c847e4cf1052419262e993cc6f50a0a8d49a4a219bef07de6916a788e2dbac3 initial_ast: 716c8440a95e3b5c34f745dba8673afd75414a9e2350eebde49ae661ee42083d - symbol_table: 4f30ba9a761bc13a5bd41ee2f70b760f08520c3dbd6d20df7d30c33c85af7531 diff --git a/tests/expectations/compiler/compiler/integers/i16/shl.out b/tests/expectations/compiler/compiler/integers/i16/shl.out index 1906d90535..4135ea3d0f 100644 --- a/tests/expectations/compiler/compiler/integers/i16/shl.out +++ b/tests/expectations/compiler/compiler/integers/i16/shl.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: d147db0bf287fc9f96e67ec89e3839ffe5ee498b2d2e1c055df938d64fe9db59 initial_ast: b08570e62709b72faf734d27cd4569de7b33605716fb4320cc141a02c35c43fc - symbol_table: c2a089c590c6094b4a0460787278b6a32a881e26879d7dfa66ad0f9e700e73ee diff --git a/tests/expectations/compiler/compiler/integers/i16/shr.out b/tests/expectations/compiler/compiler/integers/i16/shr.out index 3e087e565c..cb47893ce2 100644 --- a/tests/expectations/compiler/compiler/integers/i16/shr.out +++ b/tests/expectations/compiler/compiler/integers/i16/shr.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: d147db0bf287fc9f96e67ec89e3839ffe5ee498b2d2e1c055df938d64fe9db59 initial_ast: c8a29025afc34fcb2dc833f9534adbfff15358e4d0f0b392218e8e84e0891705 - symbol_table: 280b85d99d89738a6f79d6fbe3618b2865257eb0ea5a714fd4baab3c0c3c5610 diff --git a/tests/expectations/compiler/compiler/integers/i16/sub.out b/tests/expectations/compiler/compiler/integers/i16/sub.out index 57a4b8232e..ec20bd0aec 100644 --- a/tests/expectations/compiler/compiler/integers/i16/sub.out +++ b/tests/expectations/compiler/compiler/integers/i16/sub.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: b7ad97cd1531c1826eadf4c9c2b96d4d92ca02d158be18f4ebe1746ed99153aa initial_ast: 3f1690cb0dc84ce45dfa66417c90c9be57369288de1c83ec6bbaf7575feae55b - symbol_table: b04bbcf2084fb6c4abf70b9c36361dfac8cc78ac8f1004453b3020f7106b8378 diff --git a/tests/expectations/compiler/compiler/integers/i16/ternary.out b/tests/expectations/compiler/compiler/integers/i16/ternary.out index 6f33affbc7..cc2dda491f 100644 --- a/tests/expectations/compiler/compiler/integers/i16/ternary.out +++ b/tests/expectations/compiler/compiler/integers/i16/ternary.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 41317d43452e14f1a4cdaefef0a9bb53149a3fde47bca46f2352dbd43c9ab881 - initial_input_ast: 56b6de335469ea51e45abf216b593b72fff3010892504485016a893f0a8ae182 initial_ast: 36d350451b3be6c9b38f3b095fc7a0f7a4d11e4b3c007a14fd350e6cd032b323 - symbol_table: b92b41fc1f57be0e19b7ae98c07f01811e2400472c7577bd2facabfe011b2418 diff --git a/tests/expectations/compiler/compiler/integers/i16/xor.out b/tests/expectations/compiler/compiler/integers/i16/xor.out index 5c62bb7018..4bc02f7bcd 100644 --- a/tests/expectations/compiler/compiler/integers/i16/xor.out +++ b/tests/expectations/compiler/compiler/integers/i16/xor.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 3166a0fdadb4026ed5652f84a4b701b19532a4c19904ad075455ec9a6fb2c724 initial_ast: 3ea0d125b5c5aac27684dad2c55608ef8372c98964ec5c9c9d04ff4e9b648aeb - symbol_table: c885973a061d22cf50766c9e076599c927ddfe168e9e4c38b069aac951f4ca61 diff --git a/tests/expectations/compiler/compiler/integers/i32/add.out b/tests/expectations/compiler/compiler/integers/i32/add.out index df625e0bb7..2b961ebc20 100644 --- a/tests/expectations/compiler/compiler/integers/i32/add.out +++ b/tests/expectations/compiler/compiler/integers/i32/add.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c3f745ae09f3550b07ee1d548a4080fa602c77c54c8339d190755e61c041d9d0 initial_ast: 1b3646ec051ebdd0571a6cc5e54dd88b494c24cd2c197045c413894dadcad587 - symbol_table: ae5ef5cfb1044cbd8c7efa5be8935eb1742fc65c72b7f8aba9d9f7fb72f8556b diff --git a/tests/expectations/compiler/compiler/integers/i32/and.out b/tests/expectations/compiler/compiler/integers/i32/and.out index 5b2d7c82de..adb9538768 100644 --- a/tests/expectations/compiler/compiler/integers/i32/and.out +++ b/tests/expectations/compiler/compiler/integers/i32/and.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c3f745ae09f3550b07ee1d548a4080fa602c77c54c8339d190755e61c041d9d0 initial_ast: 58eae139e14d45468ac3f8aa2de8eebec731aca1649fb9249ac572f0400c9f4b - symbol_table: 325b554fac6d970dd4dc4a25b89154545fc9bfe72a59730e99bf5787e7d83eb6 diff --git a/tests/expectations/compiler/compiler/integers/i32/console_assert.out b/tests/expectations/compiler/compiler/integers/i32/console_assert.out index 24530b371a..bf0493b0d1 100644 --- a/tests/expectations/compiler/compiler/integers/i32/console_assert.out +++ b/tests/expectations/compiler/compiler/integers/i32/console_assert.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 18e0670d3bdd1b94387381965ed18bb2f52da2fd25ed26303079ddd2ad532ec7 initial_ast: f10907e6afbcd4f39d9c6397f684fb9e461d9b95863f22a177784121d3f79fdd - symbol_table: e7e8be510bca7adc0598527ef337c1938d3f5c8666448cafe2831594e553d39e diff --git a/tests/expectations/compiler/compiler/integers/i32/div.out b/tests/expectations/compiler/compiler/integers/i32/div.out index 081e6a006c..500a637271 100644 --- a/tests/expectations/compiler/compiler/integers/i32/div.out +++ b/tests/expectations/compiler/compiler/integers/i32/div.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: f4861b2879e1a7a0787897c313e56f53cf05f4ef416c1db99d650a7f50c0169c initial_ast: 7cfd4cf2770cc577919934a24a8741844c365c2662852da408fb2b48536cd601 - symbol_table: 088e7adb11ab06a554256c44b806f86c2c1f13273e00be2a80b8c8e797e51eb2 diff --git a/tests/expectations/compiler/compiler/integers/i32/eq.out b/tests/expectations/compiler/compiler/integers/i32/eq.out index 652cd199d3..5b9c8d82a3 100644 --- a/tests/expectations/compiler/compiler/integers/i32/eq.out +++ b/tests/expectations/compiler/compiler/integers/i32/eq.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 2310cea3660b80b688fc47915171d9804aea93a8e3a160020df15b78f2c44e92 initial_ast: 4da18080cbf0f3f41dc8b853c4ee55e8020fbfe248c0c292ba4f8d043118baae - symbol_table: 7a2619dfcf2d5f5132253f84196ad0d3ab6ee0ab95df55062240dd92cca23e0b diff --git a/tests/expectations/compiler/compiler/integers/i32/ge.out b/tests/expectations/compiler/compiler/integers/i32/ge.out index 137bb1b0be..d42f0d21da 100644 --- a/tests/expectations/compiler/compiler/integers/i32/ge.out +++ b/tests/expectations/compiler/compiler/integers/i32/ge.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: d8b075a0c14b12b53de228108da7cf61ba2e7892b134075063684769996a7e45 - initial_input_ast: c12a655964529a33ba9795df3794474b3f6a9b9f5fe121fe688345d40d65bf00 initial_ast: 99a0a40dcdc605b5a28d1ad78de6d98d81222b4fa70a50d4b907a7c454fec166 - symbol_table: b599133b42cb178b6ecc71beee98b33229ba1bbb58282ace5b20faef31637bbb diff --git a/tests/expectations/compiler/compiler/integers/i32/gt.out b/tests/expectations/compiler/compiler/integers/i32/gt.out index bab22ee354..bfee94a903 100644 --- a/tests/expectations/compiler/compiler/integers/i32/gt.out +++ b/tests/expectations/compiler/compiler/integers/i32/gt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: a83eaf3c244972c04e15c0c911e9fb46ba56556d3ecfd5ec3561dd7d42341138 - initial_input_ast: fa3b9cb73dc9a270ba1167643daf66562ed80880be98fa7a0e34175792bea230 initial_ast: 2011bf78585b33d3e4cf6d15c2f5e78cbe560164de5500498ccdb1992057189f - symbol_table: 547e049dec4bad4d2e354d568151fc102474caffb82551bb5630c0b8906230c2 diff --git a/tests/expectations/compiler/compiler/integers/i32/le.out b/tests/expectations/compiler/compiler/integers/i32/le.out index e82303ce26..d3821a0707 100644 --- a/tests/expectations/compiler/compiler/integers/i32/le.out +++ b/tests/expectations/compiler/compiler/integers/i32/le.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: d8b075a0c14b12b53de228108da7cf61ba2e7892b134075063684769996a7e45 - initial_input_ast: c4310c1bdce965b70f52ba768a13f976e0611adcec05feaffc3530c03dbcd8b5 initial_ast: e3aecaf6a5adfcd4f82cde7fa2360ae63738141788c8de35eabedecf7da26dde - symbol_table: 2471d7a0f956f30747d5bd8c5d03e8a47c628ac64766d2f19caaf3dadd7f1c06 diff --git a/tests/expectations/compiler/compiler/integers/i32/lt.out b/tests/expectations/compiler/compiler/integers/i32/lt.out index 7e6f40ecaa..6b84731f8d 100644 --- a/tests/expectations/compiler/compiler/integers/i32/lt.out +++ b/tests/expectations/compiler/compiler/integers/i32/lt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 30d30fdd6bab9733171c511d47c8617b4a54fd50c701260d2b7843635e4c734f - initial_input_ast: d3105d0be6b536c10caeff8d036665f6ca6b7f3fddc25d5fad126a82ba7a7ce9 initial_ast: baeb8485c3dd4abc78da1a07b1847933d49d68a0628b86e94efb72f41caf77ca - symbol_table: 688fa40d541217369a9c952f52de9be090829cb3c6d08e98d6312fcdfbd90d63 diff --git a/tests/expectations/compiler/compiler/integers/i32/max.out b/tests/expectations/compiler/compiler/integers/i32/max.out index 8e46feb785..dde154adb8 100644 --- a/tests/expectations/compiler/compiler/integers/i32/max.out +++ b/tests/expectations/compiler/compiler/integers/i32/max.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 76a0fe2199754831329d9b089d2c02f73d7457aaed6548372169318675b85f48 initial_ast: 65641e2f97d65daaa4cb8b2ce4e64b36cf5df1d817877e4e4d93da09ae1377a2 - symbol_table: e4eff856d1f884c746d9549c80e05a6d7ef3c23cab40a056f6be96cedcf093b5 diff --git a/tests/expectations/compiler/compiler/integers/i32/min.out b/tests/expectations/compiler/compiler/integers/i32/min.out index 2fba176166..787539205e 100644 --- a/tests/expectations/compiler/compiler/integers/i32/min.out +++ b/tests/expectations/compiler/compiler/integers/i32/min.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: e6e80b1d0e3a62b708072dee54289625035fb2a2ad6f2128a4688166e1f2c830 initial_ast: cc34252c82189a05725700a7ca8b244bc62516cae0e0f36818f2c23e144471a6 - symbol_table: fb28404a7809431c27a4763b79ad7eed3cb06c149e0f5ea2668588cdb26dcbf5 diff --git a/tests/expectations/compiler/compiler/integers/i32/mul.out b/tests/expectations/compiler/compiler/integers/i32/mul.out index d1aaea1d02..acf197b1ee 100644 --- a/tests/expectations/compiler/compiler/integers/i32/mul.out +++ b/tests/expectations/compiler/compiler/integers/i32/mul.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 27614bbc1bce86a65fab168ceb3b6109b70aa5cdcd9d47fbccc665de98a8a8fa initial_ast: 5e07edbe3d9d0cb4a197c0d3f50728c6749389efae49b82f4a026a8c104a8bc2 - symbol_table: 7c31808962cf3c6fa13611d89e6edc2a3b6c5d1fb7c1913a337f436412cc5a34 diff --git a/tests/expectations/compiler/compiler/integers/i32/ne.out b/tests/expectations/compiler/compiler/integers/i32/ne.out index 86d7623785..11d1fd6788 100644 --- a/tests/expectations/compiler/compiler/integers/i32/ne.out +++ b/tests/expectations/compiler/compiler/integers/i32/ne.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 713c1cedf6fd5178e71d0fa26662b09e0ade6971c3587f89fc5a8e03a756e981 - initial_input_ast: 95e799eeb1e1cbc6c3f6fcd5c7a361d1c6476ae66a5ff09c0f5ad423129ff0b2 initial_ast: acbc9b1bc845f51e1fab0706653740f027b1f921d4a2df8eb4ba7025040550a0 - symbol_table: 86eb824aa5a8d1e3d8f4c4682aaabc503e02680c5c4ab6ab6500ff971ae21879 diff --git a/tests/expectations/compiler/compiler/integers/i32/negate.out b/tests/expectations/compiler/compiler/integers/i32/negate.out index f08588be0e..98d5eeff3f 100644 --- a/tests/expectations/compiler/compiler/integers/i32/negate.out +++ b/tests/expectations/compiler/compiler/integers/i32/negate.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 8b9feb5e8f0718841d67d61ff8add7ea9b6570873b6c4f404bf58c6da9e23c9c - initial_input_ast: 78e3a8bf17a0abcdc7dedd89d596366b20931da74e85add4ee8478e3086242e5 initial_ast: 1487e617ff9efe4c253eb92d4157ed1dc0ec05f382ecc1c284f68054b039f3f1 - symbol_table: cc06e0a39266b8a5f6c75059e6e9029f6eb0f5ce941d34bdb4396cfad2797759 diff --git a/tests/expectations/compiler/compiler/integers/i32/negate_min.out b/tests/expectations/compiler/compiler/integers/i32/negate_min.out index 615f480023..c4726c4201 100644 --- a/tests/expectations/compiler/compiler/integers/i32/negate_min.out +++ b/tests/expectations/compiler/compiler/integers/i32/negate_min.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: bdf7f8a6f92b7acd8c798becc30b2f6a8cf6b0ed714c168c5a9e5559988b2185 initial_ast: 23557f6f914cfc80fc44061787663ccfda3e5e4a0c2d7d84fab1bf17dbed6bcf - symbol_table: 870615e30919ad0ca9047cf6b5c3c03f3b6662eac8b607a02aaac14985852e54 diff --git a/tests/expectations/compiler/compiler/integers/i32/negate_zero.out b/tests/expectations/compiler/compiler/integers/i32/negate_zero.out index 908b924902..5b97629ba4 100644 --- a/tests/expectations/compiler/compiler/integers/i32/negate_zero.out +++ b/tests/expectations/compiler/compiler/integers/i32/negate_zero.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 76a0fe2199754831329d9b089d2c02f73d7457aaed6548372169318675b85f48 initial_ast: 71719649303efd4e908d722f9b11a29a0839ef0ee607e43c0258077ca8f250ae - symbol_table: 418a805878b7e447081b1aa7f1f2fc194135a281b950f572d9f43edea2f169fb diff --git a/tests/expectations/compiler/compiler/integers/i32/operator_methods.out b/tests/expectations/compiler/compiler/integers/i32/operator_methods.out index b556c71187..a56b286703 100644 --- a/tests/expectations/compiler/compiler/integers/i32/operator_methods.out +++ b/tests/expectations/compiler/compiler/integers/i32/operator_methods.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: baa9efa368cc52d60f6299586aa61afe1d88ddd2c80a289da7e5599765a9399c initial_ast: 66b84e1d00a4a3f0d1b5f9d31b87164601ed43d42d53af7af93f2cc46ed7e015 - symbol_table: 08f90416e81900e2cedcce1370444727ec0f90a3a9196895cfdc80343395ac3d diff --git a/tests/expectations/compiler/compiler/integers/i32/or.out b/tests/expectations/compiler/compiler/integers/i32/or.out index 135a62b1d3..a8861da559 100644 --- a/tests/expectations/compiler/compiler/integers/i32/or.out +++ b/tests/expectations/compiler/compiler/integers/i32/or.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c3f745ae09f3550b07ee1d548a4080fa602c77c54c8339d190755e61c041d9d0 initial_ast: b4cb63dabed4bfc41eef6b18928a7daa040c785a7b492322b71d88262a6277a5 - symbol_table: 8d9f09b9bf8f24b12f7f5f57021b1c811b20b6450746966eab9ffbbdff8d5b3b diff --git a/tests/expectations/compiler/compiler/integers/i32/pow.out b/tests/expectations/compiler/compiler/integers/i32/pow.out index 16e41c6111..ead2902794 100644 --- a/tests/expectations/compiler/compiler/integers/i32/pow.out +++ b/tests/expectations/compiler/compiler/integers/i32/pow.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: db7a1f929101bb73938127dcaebc78bf1fd13c0b1f29b49c143c652c76513869 initial_ast: a1201c174a83b160b07adad2ca0f5d454c272d3b3bf3dfbeeb6f46704906fc30 - symbol_table: a0e31dcc9142c9e2fbed31fd9d7425bfeb726b67025e2b8424b8b2264b920f54 diff --git a/tests/expectations/compiler/compiler/integers/i32/shl.out b/tests/expectations/compiler/compiler/integers/i32/shl.out index 43a9455821..1f3bbb24e8 100644 --- a/tests/expectations/compiler/compiler/integers/i32/shl.out +++ b/tests/expectations/compiler/compiler/integers/i32/shl.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 3bc0aa0df75ae0548bec6bec2193fe1f94319ecb8d99f3d7367cd1ec29ee0519 initial_ast: f5ff0fbfc9790c0c98e1191d737f01655ca758cdd7aa87be3eede353a9bb6728 - symbol_table: 109272a3cabfe1200af24d990b300ed7e330ec80a1cf46f1936fd0ad2affbed7 diff --git a/tests/expectations/compiler/compiler/integers/i32/shr.out b/tests/expectations/compiler/compiler/integers/i32/shr.out index 944c9a2ad4..22b7dec4f3 100644 --- a/tests/expectations/compiler/compiler/integers/i32/shr.out +++ b/tests/expectations/compiler/compiler/integers/i32/shr.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 3bc0aa0df75ae0548bec6bec2193fe1f94319ecb8d99f3d7367cd1ec29ee0519 initial_ast: 18f423e7006efa104ac7d3ea5b2022c8836829e331de264f52752ee567b5a3ce - symbol_table: bf97aca4642d4b7aac7c025495c5e067fda777b1d11d951c54b037b5f82f269f diff --git a/tests/expectations/compiler/compiler/integers/i32/sub.out b/tests/expectations/compiler/compiler/integers/i32/sub.out index 6e1b16f2c9..238e659b2f 100644 --- a/tests/expectations/compiler/compiler/integers/i32/sub.out +++ b/tests/expectations/compiler/compiler/integers/i32/sub.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 65a577110ee76e6af14d3ee0ba6d8b3d43238bf40f0bf17ce5fb0d7db958c468 initial_ast: ad55d6d9e395b2def76a7e6189ec3a600abbbc12b65878b668f869e44e9ade4a - symbol_table: 5b6a8a1708a2047863f813b4b029c22fd49de20abf5a16bb667954c4c5ee2a23 diff --git a/tests/expectations/compiler/compiler/integers/i32/ternary.out b/tests/expectations/compiler/compiler/integers/i32/ternary.out index e1bffa2867..c209ec60e4 100644 --- a/tests/expectations/compiler/compiler/integers/i32/ternary.out +++ b/tests/expectations/compiler/compiler/integers/i32/ternary.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 496933437ac1f680efb3cf8c373ad409750a55f0587f1c9cd5ae89a3ff2fa9d7 - initial_input_ast: 26c16da9f3d023c364aceae392e4772d61d7c6e168b1b69df55ccb937e2f9b8b initial_ast: 3c335651b8022514466d79e85c6c500f0abacfe9582bd407857789cd11e7bb45 - symbol_table: d69acacea66b05b7cb30053a47a32453810be97b933908e014f68d8cb046ee6d diff --git a/tests/expectations/compiler/compiler/integers/i32/xor.out b/tests/expectations/compiler/compiler/integers/i32/xor.out index 1943132f4d..89eb731d3d 100644 --- a/tests/expectations/compiler/compiler/integers/i32/xor.out +++ b/tests/expectations/compiler/compiler/integers/i32/xor.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 782064ee84e1826a4cf4a19b4c68964e8f901a3fa86ad68f13fbee8b8d79fc5f initial_ast: ccddbd9586431df0bd57644bdfaa123af18aef55d6257a802d06ee1b63555f10 - symbol_table: b5bf095fe36aeda12ee1969f595276b24ab3f61ded6a738b104a5c30365435db diff --git a/tests/expectations/compiler/compiler/integers/i64/add.out b/tests/expectations/compiler/compiler/integers/i64/add.out index f5163425e3..3c2c3c7088 100644 --- a/tests/expectations/compiler/compiler/integers/i64/add.out +++ b/tests/expectations/compiler/compiler/integers/i64/add.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 816e4f653059a71bcad0180283b41156a125963a270269574ccc2a89fa4db47d initial_ast: a4aaa16ad2f02dde089066fe74a78413a372672a563e9cd63503c274e355660a - symbol_table: d819410bf10134f81bb62eb4e11ff16ef2ee5d3aed52c328514db13cc79c9385 diff --git a/tests/expectations/compiler/compiler/integers/i64/and.out b/tests/expectations/compiler/compiler/integers/i64/and.out index 29627f6c37..19ad367032 100644 --- a/tests/expectations/compiler/compiler/integers/i64/and.out +++ b/tests/expectations/compiler/compiler/integers/i64/and.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 816e4f653059a71bcad0180283b41156a125963a270269574ccc2a89fa4db47d initial_ast: e1fb9bd3be54e70a0856609f8843c639bd83cd4d8abda812d3b2fb229582fb2f - symbol_table: c4f32d137a3f7fc1816299469359ce8dbb0d2ce52d293c1c529c06c9be1a3e52 diff --git a/tests/expectations/compiler/compiler/integers/i64/console_assert.out b/tests/expectations/compiler/compiler/integers/i64/console_assert.out index 7d960b09bf..f541176d19 100644 --- a/tests/expectations/compiler/compiler/integers/i64/console_assert.out +++ b/tests/expectations/compiler/compiler/integers/i64/console_assert.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 00d45fcaa517eaee18db545e00d5b07769a572368255b8300a14998d72601c18 initial_ast: 09ec608f41abd9d671935f29c1cd7e201f33215833e4183f55a2fe79cf9afc21 - symbol_table: fbeac8715fd60fea0f3ef8db7373e8ec195887ff4ba92bb7af7346181db2164d diff --git a/tests/expectations/compiler/compiler/integers/i64/div.out b/tests/expectations/compiler/compiler/integers/i64/div.out index 7d87aa9c5f..1789a50954 100644 --- a/tests/expectations/compiler/compiler/integers/i64/div.out +++ b/tests/expectations/compiler/compiler/integers/i64/div.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c2344cdff713dd1a5cdf911aa4586bafdb97a243fd34f3d719410013b47f4b2c initial_ast: 4b98bdfa2620aaa5b98c134919ed5337914cc9f51855e162270f304c3509dfc8 - symbol_table: 00f270ed9ebe98ec0543be83c941aef7d465c6c79780eacac64a8b09120dd09b diff --git a/tests/expectations/compiler/compiler/integers/i64/eq.out b/tests/expectations/compiler/compiler/integers/i64/eq.out index f0baf7ec26..d4e9f744dc 100644 --- a/tests/expectations/compiler/compiler/integers/i64/eq.out +++ b/tests/expectations/compiler/compiler/integers/i64/eq.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c682c45660fd69afe580acd3988f4329d87c63e43d553c36642a4e0ef6b210e3 initial_ast: 8557928254d8c21c7e2058ae0d413a3565b37ce582ef10bbaee610c5b5c126c2 - symbol_table: fe562696dece608fab527d7894d61a1bbccbcdd2ddf7fcb5cc52a0d596fcaff3 diff --git a/tests/expectations/compiler/compiler/integers/i64/ge.out b/tests/expectations/compiler/compiler/integers/i64/ge.out index d2535f9460..df403d91f7 100644 --- a/tests/expectations/compiler/compiler/integers/i64/ge.out +++ b/tests/expectations/compiler/compiler/integers/i64/ge.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 6857878da12ffbcc4376888a5b0a47e72cc06de198bf8b3581c462f6ac31dc5c - initial_input_ast: 7e434642385a187243e3e5753d8fbdde3fcd867e9243ffc54edc524b41737544 initial_ast: f7f13ba671fd5c76a7ddaeb88e92b2ad524ab8068a1873d328ec3e118a304175 - symbol_table: ecc8f2f906379f321b5babf4982047f1a42f03456c2624eeeafe8d0a9198e3d5 diff --git a/tests/expectations/compiler/compiler/integers/i64/gt.out b/tests/expectations/compiler/compiler/integers/i64/gt.out index 3483ae6c9b..5485ad8d2b 100644 --- a/tests/expectations/compiler/compiler/integers/i64/gt.out +++ b/tests/expectations/compiler/compiler/integers/i64/gt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 2b0b85dc45e03a920d2bfbdbc540abe18b61f4435eea735300bfbbf1f5f3d8ea - initial_input_ast: 3fd4444b24b8e16c62ecf0b00fc49d32c65db6d13ed37bec5fbfe04848c9e6d1 initial_ast: 3d74f258de200191d6ca014f3ebf770f84eb80733bc5e15297ace778ba7465c4 - symbol_table: e089bc1a3f005ed33b1f676a2ffff71fa6ec2f119f23e2537ca763bad3d56837 diff --git a/tests/expectations/compiler/compiler/integers/i64/le.out b/tests/expectations/compiler/compiler/integers/i64/le.out index 5a1595d1f2..0776413852 100644 --- a/tests/expectations/compiler/compiler/integers/i64/le.out +++ b/tests/expectations/compiler/compiler/integers/i64/le.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 6857878da12ffbcc4376888a5b0a47e72cc06de198bf8b3581c462f6ac31dc5c - initial_input_ast: 99afc178f7cdcbad22602eb65284213301656250e2210a665de43395fef85784 initial_ast: c447a346374098a1f6c333904d3b42525fb51b165561996dfa24a2108680096b - symbol_table: b186c6e3067b7544d334caa51380a5ddfcfb4d5a2efc6dc1acbe42282ef4cc60 diff --git a/tests/expectations/compiler/compiler/integers/i64/lt.out b/tests/expectations/compiler/compiler/integers/i64/lt.out index 90530188b2..66a2b6df8c 100644 --- a/tests/expectations/compiler/compiler/integers/i64/lt.out +++ b/tests/expectations/compiler/compiler/integers/i64/lt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 6eecc6aa76c05b3cee492e00a5c7411070cfc056d6c96e29d4c87bddf049909b - initial_input_ast: f59d4a5626491f759e85846d2770353b534d95a1d2caed3fe97c029b3dfd848a initial_ast: 0639333eba431ee73648e8d9a802db5e10cae59258e0bd3c157fe457213a6ca8 - symbol_table: 40cf3641e69402664d36e3da2fc574fb909d73cb15a7a253c678d61076da6d1d diff --git a/tests/expectations/compiler/compiler/integers/i64/max.out b/tests/expectations/compiler/compiler/integers/i64/max.out index 0c700e960b..d880971a13 100644 --- a/tests/expectations/compiler/compiler/integers/i64/max.out +++ b/tests/expectations/compiler/compiler/integers/i64/max.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 632ec5f14f9e070c225d727c5fb5e6dd16d0f47d3ea0b408acb66142ed5eb233 initial_ast: 441eb9e20bd64b6826895ad65408bb0bcf3fb9aa3041c5c582b8cb829ee5e3c5 - symbol_table: d7d7a90af5b30ced5d014e0f7539fe023299e3050aac61c26ebfbffd00997991 diff --git a/tests/expectations/compiler/compiler/integers/i64/min.out b/tests/expectations/compiler/compiler/integers/i64/min.out index fd39941f85..fea78cd234 100644 --- a/tests/expectations/compiler/compiler/integers/i64/min.out +++ b/tests/expectations/compiler/compiler/integers/i64/min.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: ad738add6c03b6224ccba9d8d735b6645444f9c16f3b652ec4c0903fa4bb33aa initial_ast: 1c37a6c11db9dc5ff7c2be6cb87d1900ea2302aecd66eb396cd1f768804a99da - symbol_table: 06ea44aaf5372e4506a6184435d0d8351ed328959ccd0e46a0d0a1e9562088c2 diff --git a/tests/expectations/compiler/compiler/integers/i64/mul.out b/tests/expectations/compiler/compiler/integers/i64/mul.out index 2f134bbc2a..e8069da548 100644 --- a/tests/expectations/compiler/compiler/integers/i64/mul.out +++ b/tests/expectations/compiler/compiler/integers/i64/mul.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: f84b0604594bcebf725f53c7dae3609f276f916ecc9ada555d6984df08f2b13a initial_ast: df201d064de97f5159dc972b93ff4b84206047722c9ce25554b7eef548a0a244 - symbol_table: e10e8f60976d59b92f39cb8402580330f13bf9d04cd7afdbf844c0c718897ecb diff --git a/tests/expectations/compiler/compiler/integers/i64/ne.out b/tests/expectations/compiler/compiler/integers/i64/ne.out index 175eeb0c94..0fe540a847 100644 --- a/tests/expectations/compiler/compiler/integers/i64/ne.out +++ b/tests/expectations/compiler/compiler/integers/i64/ne.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 53f7088f9b1246b2a5a4888f773a137266abcab7f86139e17ded34d7dfd8bad6 - initial_input_ast: d2e3ace89dca587a3f27a36d6ef8736dd713b541923835f2ac7ea5d4acd68c6d initial_ast: f115cf62490b73b195fc75ac977786c450be243c2fddab88ef4435631b05a0c1 - symbol_table: cf15aab8ab6a6a35f3a7ae1c3827b7a1dd32be924cb0ea6b7febc46b60d5b449 diff --git a/tests/expectations/compiler/compiler/integers/i64/negate.out b/tests/expectations/compiler/compiler/integers/i64/negate.out index ca5f593278..c7869545d4 100644 --- a/tests/expectations/compiler/compiler/integers/i64/negate.out +++ b/tests/expectations/compiler/compiler/integers/i64/negate.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 5ac05e1cc879d60426482c7baa8678d1fb55ef8ac0900a901d6c2b7cddc30308 - initial_input_ast: d3ff584044e6a8a943927df5c394d0c8e776e1c99dcbcb24f15218edab344452 initial_ast: 7e734992a702686fe2fc22ff9fac91c0b4db8ea4be9b54ac37f7e6ad161152dc - symbol_table: 88b218915a99b4c20c07d1cc0efa4bf2c21cc4a661ade7e42788731f7807ca6f diff --git a/tests/expectations/compiler/compiler/integers/i64/negate_min.out b/tests/expectations/compiler/compiler/integers/i64/negate_min.out index dbc30d5237..ad9194c8a2 100644 --- a/tests/expectations/compiler/compiler/integers/i64/negate_min.out +++ b/tests/expectations/compiler/compiler/integers/i64/negate_min.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: d0a6313f717ff07413b8ba9109b9d055e1b4e12f56422335f82ba410137d2c00 initial_ast: 13e221038b63fa5bdf940834c4cad59be102a27efa80faf50d9f15d94b580453 - symbol_table: bda12fc3895c52e17a0993624665beedf13584d725a03881fabbb6664e017790 diff --git a/tests/expectations/compiler/compiler/integers/i64/negate_zero.out b/tests/expectations/compiler/compiler/integers/i64/negate_zero.out index d0c5ab994c..de26ea18f2 100644 --- a/tests/expectations/compiler/compiler/integers/i64/negate_zero.out +++ b/tests/expectations/compiler/compiler/integers/i64/negate_zero.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 76a0fe2199754831329d9b089d2c02f73d7457aaed6548372169318675b85f48 initial_ast: 45f4fc4debc5356e399c0d3a2f6386bd7b6c9a9e656ab85e031e3dfc2a3999f3 - symbol_table: 63479470072cfd23e3eb49c0120c2a506f458d2b0b5fb4cb2ef1af788dc5dfdf diff --git a/tests/expectations/compiler/compiler/integers/i64/operator_methods.out b/tests/expectations/compiler/compiler/integers/i64/operator_methods.out index 3a1b67f08a..58a6182440 100644 --- a/tests/expectations/compiler/compiler/integers/i64/operator_methods.out +++ b/tests/expectations/compiler/compiler/integers/i64/operator_methods.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 5e5277b920b7ba4bcffaa670a86bb6c45998ecc3540fa7392446bc050db795f4 initial_ast: 6c43a1ad5bc369f5cd506e8609361278b9f07020b098f2d2e040e10b48e5b78e - symbol_table: 0dac818d373234418ab25ea60d23ad81f8809e78d2ec75945b7856dcabe07ffe diff --git a/tests/expectations/compiler/compiler/integers/i64/or.out b/tests/expectations/compiler/compiler/integers/i64/or.out index c76d3a9476..35613010be 100644 --- a/tests/expectations/compiler/compiler/integers/i64/or.out +++ b/tests/expectations/compiler/compiler/integers/i64/or.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 816e4f653059a71bcad0180283b41156a125963a270269574ccc2a89fa4db47d initial_ast: c64fc87cc51f5307039246c26df461e6cb7e5d0a656f30bfdbce8fb4333dac87 - symbol_table: db5db74ef905b2fa828c463d5002ba746cab81ff31cf4388a04439b44b16c71d diff --git a/tests/expectations/compiler/compiler/integers/i64/pow.out b/tests/expectations/compiler/compiler/integers/i64/pow.out index aa90e06454..145275d8f9 100644 --- a/tests/expectations/compiler/compiler/integers/i64/pow.out +++ b/tests/expectations/compiler/compiler/integers/i64/pow.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 45ec89924eb54df73ffff462969863faebc2cae4f8c23fa42fa4a37796212bed initial_ast: 4bfb62750517d6a76c99ae8101c9823bcbfdffc6fe8a221b152e7b5e47a14dad - symbol_table: 9d539ed3af3517ae288977c36e5b74a1143bc1d6bf0d941157f52dbec6616ca6 diff --git a/tests/expectations/compiler/compiler/integers/i64/shl.out b/tests/expectations/compiler/compiler/integers/i64/shl.out index 159b1a8804..f9797e4e31 100644 --- a/tests/expectations/compiler/compiler/integers/i64/shl.out +++ b/tests/expectations/compiler/compiler/integers/i64/shl.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: a6ff55c9144f97d22d9d2565f4f6501bdd12db6393c12af8765415175a8d4369 initial_ast: e9b1d7e5a0c714dd6c8e4462b6da5226e1852805533f76df6ee8740eecc4f57e - symbol_table: 161471196dc08e301f0f8a59f6afc68284c63c91a97e62de8c5284437b912a37 diff --git a/tests/expectations/compiler/compiler/integers/i64/shr.out b/tests/expectations/compiler/compiler/integers/i64/shr.out index 165fdfe7d7..5e8649e35c 100644 --- a/tests/expectations/compiler/compiler/integers/i64/shr.out +++ b/tests/expectations/compiler/compiler/integers/i64/shr.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: a6ff55c9144f97d22d9d2565f4f6501bdd12db6393c12af8765415175a8d4369 initial_ast: 62b4f3dcf7dd80633c305b8f271dcc96c006a533426de9372aabc38e02494b1b - symbol_table: 02818dcfd1b39d13d5e2ac91b0d180e232d69b8255f6f755f605906394a49f60 diff --git a/tests/expectations/compiler/compiler/integers/i64/sub.out b/tests/expectations/compiler/compiler/integers/i64/sub.out index adde6b7165..0b1d507fb5 100644 --- a/tests/expectations/compiler/compiler/integers/i64/sub.out +++ b/tests/expectations/compiler/compiler/integers/i64/sub.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 22e2a316ce039bd533d9624c4eeaa3a34ea4ef1fb53943386696048b8ab1411a initial_ast: 04066970593aa644ae37df5e12ab27f199bf9c49985d74f9cefba65eb87a5b64 - symbol_table: fdaa2856fba7667905480b9477e3aa08c41c722ec9c51b5f75209420f502ae0d diff --git a/tests/expectations/compiler/compiler/integers/i64/ternary.out b/tests/expectations/compiler/compiler/integers/i64/ternary.out index c90a9f397c..928d3eca4a 100644 --- a/tests/expectations/compiler/compiler/integers/i64/ternary.out +++ b/tests/expectations/compiler/compiler/integers/i64/ternary.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 6e699c3a8f606d3dd85482128f5e1e9cdc1358657e9ce54b409966398c1719fa - initial_input_ast: 2a79896e2d6dc7c1c8ebd14ef9e00db1c124810f2c8e3fbbe23aed75ed1c0f44 initial_ast: 33a63f44654f1d38cc148f07fb7e3d31371e26eefc50fc8b9a8e202ad9f3668a - symbol_table: c4cb362b056cea8c44ef71fbd260c067c8025b66d9000f1bfd72a0a2caf34b8f diff --git a/tests/expectations/compiler/compiler/integers/i64/xor.out b/tests/expectations/compiler/compiler/integers/i64/xor.out index a7d000c841..16e4a7217c 100644 --- a/tests/expectations/compiler/compiler/integers/i64/xor.out +++ b/tests/expectations/compiler/compiler/integers/i64/xor.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: afccd04ee03ff51a876dc0a22f1b0a330abdc5fc4f8399925121cf295f9ac97a initial_ast: a96600037f54ccf79db839041ab69bd393839711d1fb238652b15d50df56bf3f - symbol_table: 130ddbb90843a682166efe4b7cb0be9c3004d8a574a791d49dcf2557c1185839 diff --git a/tests/expectations/compiler/compiler/integers/i8/add.out b/tests/expectations/compiler/compiler/integers/i8/add.out index 7f8d5f4c17..e60e042400 100644 --- a/tests/expectations/compiler/compiler/integers/i8/add.out +++ b/tests/expectations/compiler/compiler/integers/i8/add.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 418ca183b24a932ac3abf2861e019adc5050583c575b453b43ab155704f425ce initial_ast: 63e2aafe9fb89024ad67fb1718bb06769c34704d5980f6ef641c895fedc11782 - symbol_table: 0d30cbd5adc20ac5b03559dcd90334ac82572a3d5a195325d49ee681b4597089 diff --git a/tests/expectations/compiler/compiler/integers/i8/and.out b/tests/expectations/compiler/compiler/integers/i8/and.out index afc210b27a..a1706662c5 100644 --- a/tests/expectations/compiler/compiler/integers/i8/and.out +++ b/tests/expectations/compiler/compiler/integers/i8/and.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 418ca183b24a932ac3abf2861e019adc5050583c575b453b43ab155704f425ce initial_ast: 22143f41f383a6b56f36b26ea4bf59a204dd083cd7ba7746ae6089b68b506cbb - symbol_table: 058095edd0b1a1a737e1293da9d8cbae32534b368ae9118ae353f6c64459b97c diff --git a/tests/expectations/compiler/compiler/integers/i8/console_assert.out b/tests/expectations/compiler/compiler/integers/i8/console_assert.out index 571911e606..950daa125f 100644 --- a/tests/expectations/compiler/compiler/integers/i8/console_assert.out +++ b/tests/expectations/compiler/compiler/integers/i8/console_assert.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: df994f50ec870c32faab82a33e242eb013d207ebd7646a04ebfe21f3f5715cd3 initial_ast: 6b4636bdff1da74783315f0599c5c0b70f224fe56dd6dc44dfaf498862ea49d2 - symbol_table: 94888e7a3878be6164b483f223840d704e815d8f29e1d90d04130e0f363c21d0 diff --git a/tests/expectations/compiler/compiler/integers/i8/div.out b/tests/expectations/compiler/compiler/integers/i8/div.out index ba5dc4be13..5db6ca29a5 100644 --- a/tests/expectations/compiler/compiler/integers/i8/div.out +++ b/tests/expectations/compiler/compiler/integers/i8/div.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: a2921e14c8159b911edd438049c7f2b1d85dfce9b4420abaa60049b687367e65 initial_ast: a4c4475f9596674ad4ce8103520ed08e9f73d2d7aa8308fca18cae283782de32 - symbol_table: 856843c2915ab5599b921ca4c73e2be480e792d719ba89f86425195ece44a654 diff --git a/tests/expectations/compiler/compiler/integers/i8/eq.out b/tests/expectations/compiler/compiler/integers/i8/eq.out index e4b8bb8205..beebda3646 100644 --- a/tests/expectations/compiler/compiler/integers/i8/eq.out +++ b/tests/expectations/compiler/compiler/integers/i8/eq.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 7a7da641486797f409636f344cbe4980b3bc61434b10e9666d5c173385e17373 initial_ast: 9afabff955660379d53c088500039f578752a8c1871616a2d3992611dae70372 - symbol_table: 7814b27104ef5de9ad3357bc67b519cf5642a0960e054e7419d46786fa6b4f08 diff --git a/tests/expectations/compiler/compiler/integers/i8/ge.out b/tests/expectations/compiler/compiler/integers/i8/ge.out index 529a9ae465..d8981efff9 100644 --- a/tests/expectations/compiler/compiler/integers/i8/ge.out +++ b/tests/expectations/compiler/compiler/integers/i8/ge.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: e35cd317b5834dad614daf0af362b96312bb2bc34c3ee3e4143530935351a9fc - initial_input_ast: d874a35e98cadeb480fbdbeffb5233394cba9406f9dfde4c638ddd34861ee0da initial_ast: f61e842aa2128a10eac6eab0893e43e289b3fb32aba206da43668c7e6d04ad58 - symbol_table: 653d6411a2d15feb4fce54c8f2ca038d0a5cc0e09226aa59d0a991228a438ec7 diff --git a/tests/expectations/compiler/compiler/integers/i8/gt.out b/tests/expectations/compiler/compiler/integers/i8/gt.out index 6867d3bf25..6a7d845cc4 100644 --- a/tests/expectations/compiler/compiler/integers/i8/gt.out +++ b/tests/expectations/compiler/compiler/integers/i8/gt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: e63b31415b8dcf4698a24700cdcc3669d89f860ed11f6c84923cd8f4d6bb527e - initial_input_ast: e0350ec947989025f7b5cd685b0cedcb493a58cd79b3da90553962ac33cefbf4 initial_ast: 80a5075332b01642b12161eb2e7389d63b4756ab38cf4f1ea184fa58103152a2 - symbol_table: 93a2e7caea996e9ab13b40a775adc500eba4f3a329b617cc2e0759179b783ab1 diff --git a/tests/expectations/compiler/compiler/integers/i8/le.out b/tests/expectations/compiler/compiler/integers/i8/le.out index 7b8b6ed7ae..c0ea80ac7e 100644 --- a/tests/expectations/compiler/compiler/integers/i8/le.out +++ b/tests/expectations/compiler/compiler/integers/i8/le.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: e35cd317b5834dad614daf0af362b96312bb2bc34c3ee3e4143530935351a9fc - initial_input_ast: 1f482c22510f50d78c14b5d94b21ae05e514dec423caf02561297898b416c109 initial_ast: 1fda31b30dffff030098220fd53e5e2811a2235aa49d93bb9cc9159b458a7da4 - symbol_table: be6d3bc2c850155455878c8f4faa8089372643e126a5241892437882cadbc7cc diff --git a/tests/expectations/compiler/compiler/integers/i8/lt.out b/tests/expectations/compiler/compiler/integers/i8/lt.out index d0d948b7af..275476d9f7 100644 --- a/tests/expectations/compiler/compiler/integers/i8/lt.out +++ b/tests/expectations/compiler/compiler/integers/i8/lt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 19169cbb3c5a59a1e5490bd2bda1fdb09104022b499b31c3645c24ea109e9aa8 - initial_input_ast: 70185fa43618a91a29ca84dfc2d422c69a4a5da2e9055d7de54a13cdb5d4231a initial_ast: 87fca23168c5112f92f906213d7c04d41da2f9e69f0c9b5f2bd2803e9c511597 - symbol_table: 4728ccd7dbbdc653e78c0ccfce8ad81762caf0ba516da7b9603a2543f0b89498 diff --git a/tests/expectations/compiler/compiler/integers/i8/max.out b/tests/expectations/compiler/compiler/integers/i8/max.out index 30a51bc64f..663e07587e 100644 --- a/tests/expectations/compiler/compiler/integers/i8/max.out +++ b/tests/expectations/compiler/compiler/integers/i8/max.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c7cfa681865a1c0623cfd356162d0c6750f3e06fb72126585eace0aeb21bae77 initial_ast: 142c791a86d2da044a635ff809795467c0fe56fddab2da461701b86c962f24ba - symbol_table: 66106e69fbd949ea2dbfd4416f5d1c9227684eff438d1625c93d6bb4f8573ce9 diff --git a/tests/expectations/compiler/compiler/integers/i8/min.out b/tests/expectations/compiler/compiler/integers/i8/min.out index bf48cd4114..0e1df12e4f 100644 --- a/tests/expectations/compiler/compiler/integers/i8/min.out +++ b/tests/expectations/compiler/compiler/integers/i8/min.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: bdf7f8a6f92b7acd8c798becc30b2f6a8cf6b0ed714c168c5a9e5559988b2185 initial_ast: 1f4036acfcc74868d883a3a476bb7f0d2aaf54c0ea507f1afaefe03074479965 - symbol_table: 6c72df510f3b07dd271c999a638c45bc937425bbfb5e6f9cf1911b088234cc01 diff --git a/tests/expectations/compiler/compiler/integers/i8/mul.out b/tests/expectations/compiler/compiler/integers/i8/mul.out index 23a32922d6..aedf59076a 100644 --- a/tests/expectations/compiler/compiler/integers/i8/mul.out +++ b/tests/expectations/compiler/compiler/integers/i8/mul.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: f94c9c57a09035126762720835869947bf4abb61f29f9e6ae15bed04e399338a initial_ast: 1379ff6afd8de96e5215bd72dbedfd66c70514aa943a792b931e3133cd897416 - symbol_table: a5a3bb7ed8ca56503ecd767a1ca1a997d5f5b3a06106dedfbe78d04700d70052 diff --git a/tests/expectations/compiler/compiler/integers/i8/ne.out b/tests/expectations/compiler/compiler/integers/i8/ne.out index 24b42a33dd..5f7c947f8a 100644 --- a/tests/expectations/compiler/compiler/integers/i8/ne.out +++ b/tests/expectations/compiler/compiler/integers/i8/ne.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: b1cd26a625c709bb94ee5913524afc6b1b83a8c1515922ba8b14dda385e0ca68 - initial_input_ast: 671b2b3f086c62570bf29a08fe2e5adc48f71725317b0e3803acebe92dc846d8 initial_ast: a9aa58a0fe6c81df3487e38da263ed454ed0a1ce4dc47a9ba68d7b04c3c96588 - symbol_table: 4fb6658a07bb0a63f1da45790682548f3a9eea88a6453f4dc12971d80766f89c diff --git a/tests/expectations/compiler/compiler/integers/i8/negate.out b/tests/expectations/compiler/compiler/integers/i8/negate.out index 78eba16c0a..8ec3b713cc 100644 --- a/tests/expectations/compiler/compiler/integers/i8/negate.out +++ b/tests/expectations/compiler/compiler/integers/i8/negate.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 0e496fab37ba66e63b3906e0fbb11dd2449210b056394c910f90fb02c7c35ec2 - initial_input_ast: cc84f02e75bbc4ff7389b2e60e3fc598ebc32c9eaac36a43f8a4687a1ee5f1be initial_ast: 5fb5076e1a8680b6c35c60533c57f33c7b05afe5a18cc467c03f26d308e341c7 - symbol_table: b6f8e60076526e25091ee9a3afbd45d2aca9db0a5bfff494618666878f196ce2 diff --git a/tests/expectations/compiler/compiler/integers/i8/negate_min.out b/tests/expectations/compiler/compiler/integers/i8/negate_min.out index 18dfaa931e..ce967091d4 100644 --- a/tests/expectations/compiler/compiler/integers/i8/negate_min.out +++ b/tests/expectations/compiler/compiler/integers/i8/negate_min.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: a1bd925fa2e13279fba1cf269924a81f2dc45c5dff42f62c3d6a4f1e7a368613 initial_ast: 5bdc65e289dac3fab12e24fe51e16b4a773b805e1034e9180e6b7275ec585a8e - symbol_table: aba7a0684a28a46330bc74e6d62edd3a16ea6d48f124e7fd1b1ea70840fd3ef0 diff --git a/tests/expectations/compiler/compiler/integers/i8/negate_zero.out b/tests/expectations/compiler/compiler/integers/i8/negate_zero.out index 3bdf856ad7..f7fbfaab9e 100644 --- a/tests/expectations/compiler/compiler/integers/i8/negate_zero.out +++ b/tests/expectations/compiler/compiler/integers/i8/negate_zero.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 2f8bdfd57bd177ef6ba420992c9b8246f27a332126ed41021cf718db1f89fce2 initial_ast: 2e23e03a7908ff1bc84c11ddf13945d7fd25fc5084f5c60f1b9d5d95978714f8 - symbol_table: 6a9de079f7b8e99c6a09ebdc05869d05c37dc7cfaa87c84f2f12e6aa1693bb17 diff --git a/tests/expectations/compiler/compiler/integers/i8/operator_methods.out b/tests/expectations/compiler/compiler/integers/i8/operator_methods.out index d4d149f34b..3c172b74e6 100644 --- a/tests/expectations/compiler/compiler/integers/i8/operator_methods.out +++ b/tests/expectations/compiler/compiler/integers/i8/operator_methods.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 15ad88e6dd28c72e4202ecef608cf1b1db73eceba4024607a1ece070f7f31942 initial_ast: 6e44db0cf93401d21372b7dd688b0826efcb01036ff50b54862d12235201446e - symbol_table: 917ffc517d196baaa856b3a37754649da5a09e5f5df89f158b02a4d180280b19 diff --git a/tests/expectations/compiler/compiler/integers/i8/or.out b/tests/expectations/compiler/compiler/integers/i8/or.out index 8f8e39585f..7efedce49d 100644 --- a/tests/expectations/compiler/compiler/integers/i8/or.out +++ b/tests/expectations/compiler/compiler/integers/i8/or.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 418ca183b24a932ac3abf2861e019adc5050583c575b453b43ab155704f425ce initial_ast: 18cfbf8e9f363d7477ee0c7509fd909c7f4929ffa2b4c2f46113d85c0f2b481d - symbol_table: 9c6f7d090fd5d4974e073829eb834545366cc95c3ec90c77b072e3f641d37539 diff --git a/tests/expectations/compiler/compiler/integers/i8/pow.out b/tests/expectations/compiler/compiler/integers/i8/pow.out index 0fa1c08bdd..eec0df85fe 100644 --- a/tests/expectations/compiler/compiler/integers/i8/pow.out +++ b/tests/expectations/compiler/compiler/integers/i8/pow.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: fce55063674f3154f8ddb6d64c4fcdb82203cd3e19017c797e5509e75227d226 initial_ast: b616f39c56d8c281d96a690906c8ba6bbc81831a653a2803cf92477bff148621 - symbol_table: 4f2017d12bc5bf32a9b2618b37290c8cd53bed6fdf28ca52e4e8fb52537b4488 diff --git a/tests/expectations/compiler/compiler/integers/i8/shl.out b/tests/expectations/compiler/compiler/integers/i8/shl.out index a6ed27422a..a9159ad6f3 100644 --- a/tests/expectations/compiler/compiler/integers/i8/shl.out +++ b/tests/expectations/compiler/compiler/integers/i8/shl.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 46761fa9dc62c5871413b18e0da193bb98f1401ebf32e057eb7afe369fddcc1a initial_ast: 0e3218faca332771d9e3b01ec42562dfa4738b2452a97dbe0eba14c4ac22ca42 - symbol_table: de92aa58f0932810275073210ac781588355cef4c9bc361f04e3ca4be3dcc164 diff --git a/tests/expectations/compiler/compiler/integers/i8/shr.out b/tests/expectations/compiler/compiler/integers/i8/shr.out index 7dd5df18bb..51671d76e4 100644 --- a/tests/expectations/compiler/compiler/integers/i8/shr.out +++ b/tests/expectations/compiler/compiler/integers/i8/shr.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 46761fa9dc62c5871413b18e0da193bb98f1401ebf32e057eb7afe369fddcc1a initial_ast: 6ae8451b1b11dfaa8bcafd29c398c14ce99b3ee4a39f6d9758c9bbca5453c44d - symbol_table: 40134a5c12d846ac2a81b94332a568c9b6851dd788c536dcd4359aff0a79221e diff --git a/tests/expectations/compiler/compiler/integers/i8/sub.out b/tests/expectations/compiler/compiler/integers/i8/sub.out index 1fe7458212..c40136cc95 100644 --- a/tests/expectations/compiler/compiler/integers/i8/sub.out +++ b/tests/expectations/compiler/compiler/integers/i8/sub.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: d6ff175d17561f3b4a70c3b7b2dc6232593c77a2614e2161eeebe72d96cf9843 initial_ast: f8bcaa0b34d642cb37c8be5ab7eb226dc565a5802d69795eb197e8b1e5b45d0c - symbol_table: 49ac09363ff46f225d86ff3aa73dc48ee921cf2f4c096ce111832903da6a9e97 diff --git a/tests/expectations/compiler/compiler/integers/i8/ternary.out b/tests/expectations/compiler/compiler/integers/i8/ternary.out index 2d223ccee8..8d1cf6377a 100644 --- a/tests/expectations/compiler/compiler/integers/i8/ternary.out +++ b/tests/expectations/compiler/compiler/integers/i8/ternary.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: d9c9f985b366f3218f7a382946e2e661652a62c6cbd1c210e4bf283e9e45a0e4 - initial_input_ast: 9dddec9d0f1cac8c804a46cded65f8902bf28e181149c73bf6c4d5be8fe6e21f initial_ast: fbeeedb9bf32f4014d27172da623e262db55ae27ad367d09e31cb71bc4b974cc - symbol_table: 64f5be13cd1e5bad65c85910f051acff84a21cc1483dc8d013a70d4f274fd419 diff --git a/tests/expectations/compiler/compiler/integers/i8/xor.out b/tests/expectations/compiler/compiler/integers/i8/xor.out index e7ddd4212b..98103bf68e 100644 --- a/tests/expectations/compiler/compiler/integers/i8/xor.out +++ b/tests/expectations/compiler/compiler/integers/i8/xor.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 049a158cda473ea574f3a1a41b7b12044d952feaffcd7fe391507fbb542a51a9 initial_ast: 8a8881ec1d45699722c00fb217887df56d7c5f6ba997c126829e9e2047592a60 - symbol_table: bb99d76d1e6416da7953ce3b931bed8f009ade3ad4136adf4f52f6ab2f130ebc diff --git a/tests/expectations/compiler/compiler/integers/u128/add.out b/tests/expectations/compiler/compiler/integers/u128/add.out index f42490ce58..cc60359fb6 100644 --- a/tests/expectations/compiler/compiler/integers/u128/add.out +++ b/tests/expectations/compiler/compiler/integers/u128/add.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 0b4b4bf798b6f2dfcf78b0d4f72c37c8c8c240ba2668fcbbcaa29fff825a4cee initial_ast: c09bcbdf96f73f93cdf12a30fcb17f317f484279ef95a405ac024b497d89e2ff - symbol_table: 94c3952749ff384b298cc1bddaae404acf571029e7f6489b4eef469f19f62238 diff --git a/tests/expectations/compiler/compiler/integers/u128/and.out b/tests/expectations/compiler/compiler/integers/u128/and.out index 2d40c436d3..43bd6d1c90 100644 --- a/tests/expectations/compiler/compiler/integers/u128/and.out +++ b/tests/expectations/compiler/compiler/integers/u128/and.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 0b4b4bf798b6f2dfcf78b0d4f72c37c8c8c240ba2668fcbbcaa29fff825a4cee initial_ast: d09e17e06ecf81563bcf4cd91f0b1ff31683f7e76717aa9dbae3a38b6b0093cc - symbol_table: 079d77609c20c5c8077d55e597bc8e386422f34a6cff7aad5ea03f32e199b23b diff --git a/tests/expectations/compiler/compiler/integers/u128/console_assert.out b/tests/expectations/compiler/compiler/integers/u128/console_assert.out index f88c3084c3..fd95452fee 100644 --- a/tests/expectations/compiler/compiler/integers/u128/console_assert.out +++ b/tests/expectations/compiler/compiler/integers/u128/console_assert.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: d33717e99abedf3d3ad1ca7e18212fafc940639a0005c934ee43b7ec10131e94 initial_ast: c7ec9e92e0ac15c17db0c5d40b53c394d4da748f7f37ff2fee74baaa956165ad - symbol_table: 505948f27498d87c22e63417f71cf1f3047085a4cdb257ef7aedf3c86b238ebe diff --git a/tests/expectations/compiler/compiler/integers/u128/div.out b/tests/expectations/compiler/compiler/integers/u128/div.out index 292f20fa49..8e0da2312d 100644 --- a/tests/expectations/compiler/compiler/integers/u128/div.out +++ b/tests/expectations/compiler/compiler/integers/u128/div.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 312caa259bb60c26c8e61169dcfa1dc94174d1a50c35a6d889ef1eed7880532e initial_ast: 470aa930cedf15168fea1fcddd49d7cedd5410599ae372c5bea9948aef2bd7f0 - symbol_table: 678f356035aea39bec07a37d127fab99dfb8f8aaa118bf1454f3fb40e2943c2c diff --git a/tests/expectations/compiler/compiler/integers/u128/eq.out b/tests/expectations/compiler/compiler/integers/u128/eq.out index ea1261cef7..733dd1d0c2 100644 --- a/tests/expectations/compiler/compiler/integers/u128/eq.out +++ b/tests/expectations/compiler/compiler/integers/u128/eq.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: ed076eaaf99eeab4483cbe3f371ca5bead0ebb316e7b9e02708bf35dfdcc15e0 initial_ast: fa1d49c14840d8af2266f95e90b0c7534afb43af6c8365a96796b88a1069f9f8 - symbol_table: 59a92879cd9e8632b6ad1780ce4f687f9b9b0b142c38b31586578918c41690e7 diff --git a/tests/expectations/compiler/compiler/integers/u128/ge.out b/tests/expectations/compiler/compiler/integers/u128/ge.out index 9293e0e19b..7f0fbc1247 100644 --- a/tests/expectations/compiler/compiler/integers/u128/ge.out +++ b/tests/expectations/compiler/compiler/integers/u128/ge.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 114a06e1bb4a0c3728adc7668365d8deea159ccffc14b1977ba2bba2b05f3987 - initial_input_ast: c8fc11e4265deb71385cf129d8cac917eecdc35c993f569bc339e49fc26e0dab initial_ast: 22866aca009cd492205eb33e5de776e410d245afad2b944536236fc5ffc7becc - symbol_table: d62e5ca69883dfd4f502dd4b8ab0436e677a9871322a3cc33c0d51f3138760be diff --git a/tests/expectations/compiler/compiler/integers/u128/gt.out b/tests/expectations/compiler/compiler/integers/u128/gt.out index 9b355c7fd3..24610b78ab 100644 --- a/tests/expectations/compiler/compiler/integers/u128/gt.out +++ b/tests/expectations/compiler/compiler/integers/u128/gt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 490a83da761d8daffa5b10e1d9785fe301129b18eaa8b4be8550a1037c92e037 - initial_input_ast: a9fbdd31d60c3b135c46eb07ffc291d906e61283f66b5ddda81080adb1b72c4d initial_ast: 97e1caf8274c2e27e34f2218ab5aadd7a14ce8e518e7adc021c5763b7ea3de42 - symbol_table: 4b855a9a384880ddddc5d93d16ae4e34c5b85a506426f89f3c545314cd58d86f diff --git a/tests/expectations/compiler/compiler/integers/u128/le.out b/tests/expectations/compiler/compiler/integers/u128/le.out index d757406803..7968b3aace 100644 --- a/tests/expectations/compiler/compiler/integers/u128/le.out +++ b/tests/expectations/compiler/compiler/integers/u128/le.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 114a06e1bb4a0c3728adc7668365d8deea159ccffc14b1977ba2bba2b05f3987 - initial_input_ast: d86e46eff4d53385160f9e227d120be02cff1d0bd25359f7dcd99cd98a7b6689 initial_ast: aac1210ac91250cf116e6b8c4af27d042526704975d394f694b875ee7c7bdca4 - symbol_table: 3d7f361f2ce4e99acbc47dfef2480dec0ce298a27a34769ddb8c1813b6581024 diff --git a/tests/expectations/compiler/compiler/integers/u128/lt.out b/tests/expectations/compiler/compiler/integers/u128/lt.out index eb0528290e..3530391015 100644 --- a/tests/expectations/compiler/compiler/integers/u128/lt.out +++ b/tests/expectations/compiler/compiler/integers/u128/lt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 81a226fee5bd7855328403195937bf7dbad374f94e29afa8b750b5b1a3aa47dd - initial_input_ast: d68bda01a4ba78c58809ac0c8286b56fafeb17702abf7a6cb9a7195a3aef8317 initial_ast: 6e319b6448230333f01fcbc23928f2d07a7d52ecf356c42ba5a9f17f85030c6d - symbol_table: 3209a6ec1b0ac01f379965c80861af6d65fae8dfa0f20a726dfaf89e0ccb1cf5 diff --git a/tests/expectations/compiler/compiler/integers/u128/max.out b/tests/expectations/compiler/compiler/integers/u128/max.out index 138b3e7871..5d42ff29e8 100644 --- a/tests/expectations/compiler/compiler/integers/u128/max.out +++ b/tests/expectations/compiler/compiler/integers/u128/max.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: a2ab6a89c5952a113fbecdeb630917b4699c38dcda5971528ab35cdd5e92c216 initial_ast: f74810c683ca376b62ab74f8c03d59de896c3463a348a2e7c83c2891fe11d235 - symbol_table: 4edd22a9c1a03a2c2bd62bb1d7d907e8afe5cdae6dbe0f8ac4711fd69bb5407b diff --git a/tests/expectations/compiler/compiler/integers/u128/min.out b/tests/expectations/compiler/compiler/integers/u128/min.out index c7ffd77c7c..09bf4375c3 100644 --- a/tests/expectations/compiler/compiler/integers/u128/min.out +++ b/tests/expectations/compiler/compiler/integers/u128/min.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 886b77241861e32ee76414a8f86e04b86943325113b6b28e9d6805ee61c936ef initial_ast: c4ed389c216c8febadfda804cdfd5f84de0ed16592ad293434304819fcde32c2 - symbol_table: bf6b5da28a9adbc7dfb1b3b5aef006a6c040bb8eb94e142262611a131fcbec5e diff --git a/tests/expectations/compiler/compiler/integers/u128/mul.out b/tests/expectations/compiler/compiler/integers/u128/mul.out index 1c99d2b8a9..0856454e36 100644 --- a/tests/expectations/compiler/compiler/integers/u128/mul.out +++ b/tests/expectations/compiler/compiler/integers/u128/mul.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 55275f9363fdc61c58cf22cc7fea6f1c5314bf2d1c31866a9609b83b050983a3 initial_ast: 5d6b4ef63ae8e4fe01ee2d19ca2de4f3183af25a84b9d9aa47c4759f9119e3a8 - symbol_table: dd0098712d873cf92c367f89af907dad778d2b2b2f2e251d0eda2237be727c6c diff --git a/tests/expectations/compiler/compiler/integers/u128/ne.out b/tests/expectations/compiler/compiler/integers/u128/ne.out index 62686dda70..23e64a8ec4 100644 --- a/tests/expectations/compiler/compiler/integers/u128/ne.out +++ b/tests/expectations/compiler/compiler/integers/u128/ne.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 6092164adf1cbb62c9bc7b5c9615deb73f2d4ca73eca6ae6fa732f7e8a2d6fae - initial_input_ast: 0a73021a07d37a00e70a521b9271d9849c871e4df9395fd866009d3770fc8b9e initial_ast: 401daa77a0b0589d3eb44f7de5efd367afa3c2626463363aab1fde57eb5d90d2 - symbol_table: b6d4ce61a5c1ee27261f3609a47c6b27daa5b5206e1bff4d50fa5d53c283aad4 diff --git a/tests/expectations/compiler/compiler/integers/u128/operator_methods.out b/tests/expectations/compiler/compiler/integers/u128/operator_methods.out index f0d3891190..71a345188a 100644 --- a/tests/expectations/compiler/compiler/integers/u128/operator_methods.out +++ b/tests/expectations/compiler/compiler/integers/u128/operator_methods.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 90091db06f755dc2e8c920d26390f0dd6a9f7f5401148ab01e46dc77a3900582 initial_ast: eb4bcc4d57f7f83b382b706f040d3a032a956cb9b262491d42ddfa39caada74b - symbol_table: bdc0b891cf1f06faf7864c0566c3aac7780882db3429a1ba4b7301426e9ee628 diff --git a/tests/expectations/compiler/compiler/integers/u128/or.out b/tests/expectations/compiler/compiler/integers/u128/or.out index fe8f01109e..898960aa4b 100644 --- a/tests/expectations/compiler/compiler/integers/u128/or.out +++ b/tests/expectations/compiler/compiler/integers/u128/or.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 0b4b4bf798b6f2dfcf78b0d4f72c37c8c8c240ba2668fcbbcaa29fff825a4cee initial_ast: 6532d8f436c711698a26f08331718f5cb61dfe1e3d41120d91b4039a5b7db683 - symbol_table: f880fd9b94c1f5109a40449187812c7c27a439fd029231d708254777df906d74 diff --git a/tests/expectations/compiler/compiler/integers/u128/pow.out b/tests/expectations/compiler/compiler/integers/u128/pow.out index df57fe8893..0ca351073d 100644 --- a/tests/expectations/compiler/compiler/integers/u128/pow.out +++ b/tests/expectations/compiler/compiler/integers/u128/pow.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: 736df282a3b5ffff601dd67e443891125ca67486745f642c1a629df51f139651 - symbol_table: 6ac4ba69b944d9f4310367f37a76e8be551abc3e2118e37133281ddde3c1ad25 diff --git a/tests/expectations/compiler/compiler/integers/u128/shl.out b/tests/expectations/compiler/compiler/integers/u128/shl.out index d1bfe48efb..eb3bbae2ea 100644 --- a/tests/expectations/compiler/compiler/integers/u128/shl.out +++ b/tests/expectations/compiler/compiler/integers/u128/shl.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 7c048b2df7402d5ae82869bf59ed5e8e37dc37b297e6da315414cdf92f3fe47e initial_ast: 8c4b9d867aa5af79625cf321b0fa23ba73d6903c50dcb0ef8a9793a30fdb6948 - symbol_table: 7c4e398266fb7fe8824e0271ee5051217e9597030d9fc77259c6706d952d853c diff --git a/tests/expectations/compiler/compiler/integers/u128/shr.out b/tests/expectations/compiler/compiler/integers/u128/shr.out index 5f617ec35b..9831afda99 100644 --- a/tests/expectations/compiler/compiler/integers/u128/shr.out +++ b/tests/expectations/compiler/compiler/integers/u128/shr.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 7c048b2df7402d5ae82869bf59ed5e8e37dc37b297e6da315414cdf92f3fe47e initial_ast: 7a81a139806e719f879fe3f93c6e2af93128c2fc36dda6650ae435ad18b36d99 - symbol_table: 53ed1cbe20f6f1d99edb061fa4922e169923aeba8a32aadd38938af81554b0ff diff --git a/tests/expectations/compiler/compiler/integers/u128/sub.out b/tests/expectations/compiler/compiler/integers/u128/sub.out index 1e7e8a3c11..849b809998 100644 --- a/tests/expectations/compiler/compiler/integers/u128/sub.out +++ b/tests/expectations/compiler/compiler/integers/u128/sub.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 423b332f76b482591a7a7c3003662aea94e81ac3341e384e6ab510287a33fcd8 initial_ast: f18ff230b4a7482f58667af30686b4010d20b119db1e3875d912efd8ffd83b4b - symbol_table: f5fc54506951419ceced5b81e17531ffe879b8665f340165ce00ee93a6375b0f diff --git a/tests/expectations/compiler/compiler/integers/u128/ternary.out b/tests/expectations/compiler/compiler/integers/u128/ternary.out index f0b2194cbc..f9034ba35e 100644 --- a/tests/expectations/compiler/compiler/integers/u128/ternary.out +++ b/tests/expectations/compiler/compiler/integers/u128/ternary.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: f8a5839bc3ebd5a43da88b4956a763ab9ab3bc2a08cce1e63b4bed90a372cc29 - initial_input_ast: 7791bee70cecfb5adf16a8d4e309a9cde2802bb110f038ded316b751d904e37d initial_ast: 73d43529cae30694437cb5762150833c654639587f2e24df0a93312afc1e5b1a - symbol_table: c9775810bca18ac5d6894681231f4bdf595c637c970dbc90a23d32c8407ccd5f diff --git a/tests/expectations/compiler/compiler/integers/u128/xor.out b/tests/expectations/compiler/compiler/integers/u128/xor.out index d5d959314f..c9953e8681 100644 --- a/tests/expectations/compiler/compiler/integers/u128/xor.out +++ b/tests/expectations/compiler/compiler/integers/u128/xor.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 9994d676560e6f9ddec4a1b225e6fd50646f1b236db21dcf7dc04771bd2cafaa initial_ast: f4d4a7bd9cdc74592091682ae635a0c6e34ce98fec41dc193f4353dca9840974 - symbol_table: 0bbbf19de7bdb542de61564aefab097e4c5b3d93df3a7754f8df0f7cef8e9e7c diff --git a/tests/expectations/compiler/compiler/integers/u16/add.out b/tests/expectations/compiler/compiler/integers/u16/add.out index 02004b77bf..03b8186fd0 100644 --- a/tests/expectations/compiler/compiler/integers/u16/add.out +++ b/tests/expectations/compiler/compiler/integers/u16/add.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 645d8b76a8e35f3c5c40b8a8d7edaf61869ba567db8856ff407c6c6ca93e15ab initial_ast: 0efce2048d443bc625ffe58dbc7af9d7cfcba635825a8dd3480708cc660ab57a - symbol_table: b773a3747693ac625d3346f79cc3787d155e81da2eef74e8961fa5c0b6beda9c diff --git a/tests/expectations/compiler/compiler/integers/u16/and.out b/tests/expectations/compiler/compiler/integers/u16/and.out index 1614b0b7f6..7e7d860814 100644 --- a/tests/expectations/compiler/compiler/integers/u16/and.out +++ b/tests/expectations/compiler/compiler/integers/u16/and.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 645d8b76a8e35f3c5c40b8a8d7edaf61869ba567db8856ff407c6c6ca93e15ab initial_ast: 520b6831317851ecf843501a2d1424b63829404ea50b0318b96045fda54bef1c - symbol_table: 4ed193c7cf2f2d876c67c8584147da9e18b3a6f4440428c3fd489819a4cd00d2 diff --git a/tests/expectations/compiler/compiler/integers/u16/console_assert.out b/tests/expectations/compiler/compiler/integers/u16/console_assert.out index e4c3f27462..6e6d2416de 100644 --- a/tests/expectations/compiler/compiler/integers/u16/console_assert.out +++ b/tests/expectations/compiler/compiler/integers/u16/console_assert.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 93f0939fa8d2a71a8de2232636f6fbed581078acf2d6350b551a85b68d3a35f3 initial_ast: 68df919b5fb7b992c5e900b16a3c02ef9e2fe737d0ec61d67859c5b22a3630c9 - symbol_table: 31ea54152de57df0f234b406c8f78d84cc20dc9b998f4712ce4ac733f22b9a45 diff --git a/tests/expectations/compiler/compiler/integers/u16/div.out b/tests/expectations/compiler/compiler/integers/u16/div.out index 9088191ef8..001d1e2d9b 100644 --- a/tests/expectations/compiler/compiler/integers/u16/div.out +++ b/tests/expectations/compiler/compiler/integers/u16/div.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c5d860d9e16d54ba0e74b3d163c409c5ed8228f0716d439faca960550b23941c initial_ast: f72e0c7991f49f2d668f6693a50615eec8a2ddf54f1a92e51f84c34be6b4b240 - symbol_table: 52e163bd2142999e83b8c807c5f05d8f6dcff305472c4a4ad16c82d78be9823a diff --git a/tests/expectations/compiler/compiler/integers/u16/eq.out b/tests/expectations/compiler/compiler/integers/u16/eq.out index 5128239e4a..118a6396c0 100644 --- a/tests/expectations/compiler/compiler/integers/u16/eq.out +++ b/tests/expectations/compiler/compiler/integers/u16/eq.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: aacc264ea8f875d044fe9d32dc074877f55b566fe3f5a95a1bbf7193797aa520 initial_ast: d8ec08bd1f7422819148f21816252bb209fe01589464ac91d6129d459b27ddd7 - symbol_table: 2f35e5aa4269f54adddaa53477d4bd09d1e4a5d81068e61f5b6b5db001f5e316 diff --git a/tests/expectations/compiler/compiler/integers/u16/ge.out b/tests/expectations/compiler/compiler/integers/u16/ge.out index de7619e76e..eae08c2674 100644 --- a/tests/expectations/compiler/compiler/integers/u16/ge.out +++ b/tests/expectations/compiler/compiler/integers/u16/ge.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: a0711a6ed49dec13228ba659a9b314d9ce6676d662813bd195dad9137ff9bc5b - initial_input_ast: c44e22bafbeb5729fbdbbfdce638ff6bccbcebb1ef4958a578915665a9251de9 initial_ast: aaa4dc4173cb9fb0c05876f6fdee19e4a81d0c5afc82f7a8b488b0cdfc1e69ae - symbol_table: 19060c1c44e418ecc282948f304fd19959c49857d1cd93dcd2d9bf423e250f2f diff --git a/tests/expectations/compiler/compiler/integers/u16/gt.out b/tests/expectations/compiler/compiler/integers/u16/gt.out index 655f0affc4..1cd35dc2f9 100644 --- a/tests/expectations/compiler/compiler/integers/u16/gt.out +++ b/tests/expectations/compiler/compiler/integers/u16/gt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: bbcfb719bb3775418cdc7eacc87fea6bb4b463a8ee5baf1ca448115098de0442 - initial_input_ast: baaf3113b1461d0808023e5bcc59d482aa451aa5bff5815bdca2249c1a75515e initial_ast: a142b4368f83dc792a96dfa115f4d8527acb2f87530b5693e26a40efcc9f1c8e - symbol_table: e832ccf84a5e5dd9881b57a5c31de1d81ccd04e6d5c260db71d7f951ce57bc55 diff --git a/tests/expectations/compiler/compiler/integers/u16/le.out b/tests/expectations/compiler/compiler/integers/u16/le.out index a75d40eb0f..498844d1eb 100644 --- a/tests/expectations/compiler/compiler/integers/u16/le.out +++ b/tests/expectations/compiler/compiler/integers/u16/le.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: a0711a6ed49dec13228ba659a9b314d9ce6676d662813bd195dad9137ff9bc5b - initial_input_ast: da98deac955107d3b01e18edeaa906c66b216e029e09959f12a02c64c8b64259 initial_ast: cccd56dfff8508f810dc3acae53bac2d3e03afaec697f83bf45cd922ad5a3a63 - symbol_table: 25b8f9d647642615b54428c2f0ce4e483459712ca7d82329a680b49e4ae7f22f diff --git a/tests/expectations/compiler/compiler/integers/u16/lt.out b/tests/expectations/compiler/compiler/integers/u16/lt.out index 47f6b406bc..50dfa2bb8c 100644 --- a/tests/expectations/compiler/compiler/integers/u16/lt.out +++ b/tests/expectations/compiler/compiler/integers/u16/lt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 9383a4837a0adb9b494229de1f4fd4cb519a0afcf273d83dbd78c25c568fada5 - initial_input_ast: 7bb6ab59dd3331f3e0121a736939323f73be4053f91859d186c620fd0e14244c initial_ast: 811b1d04a4474b7f3b943caebe9e5fcca1f9fe7e77cc84e6fb85d40d0d66cb55 - symbol_table: ef70c4f5b504ad5c38821e26a2d6be275e2de4148dfec29b73d3b1eaba5044b1 diff --git a/tests/expectations/compiler/compiler/integers/u16/max.out b/tests/expectations/compiler/compiler/integers/u16/max.out index 49e30fde29..9cc2221707 100644 --- a/tests/expectations/compiler/compiler/integers/u16/max.out +++ b/tests/expectations/compiler/compiler/integers/u16/max.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 940d740ba40284a1d3c3cf8737facd1e98968224dd93999dbcb336cb3f4ce571 initial_ast: 09d4426d341f39c8164181d9793ffc37acc5a43f2148d5f0d646f146c24d00fb - symbol_table: 69f776332dcb4ed2daf222bb7796116d60df76d7bba3686891fa352fcfbe1fcc diff --git a/tests/expectations/compiler/compiler/integers/u16/min.out b/tests/expectations/compiler/compiler/integers/u16/min.out index c212934b3c..7e9f3bd43e 100644 --- a/tests/expectations/compiler/compiler/integers/u16/min.out +++ b/tests/expectations/compiler/compiler/integers/u16/min.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c7cfa681865a1c0623cfd356162d0c6750f3e06fb72126585eace0aeb21bae77 initial_ast: 4dcfa3acfc7cf76ebcdb36fcb337052b62b0f5855559845cd1ed70942a89dc64 - symbol_table: 406df287bf9772b5916e8effb291efe4c4c7b182f25e9ffdc8d8a99abcd96d85 diff --git a/tests/expectations/compiler/compiler/integers/u16/mul.out b/tests/expectations/compiler/compiler/integers/u16/mul.out index 1c8aa12eb9..ec879e6607 100644 --- a/tests/expectations/compiler/compiler/integers/u16/mul.out +++ b/tests/expectations/compiler/compiler/integers/u16/mul.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 2189415cb99cd7a07d28f5b9fd1f3d5e0da2150942d12da98fe8109c4988b6a3 initial_ast: 56f9a8d2c0275f7dfd5894d5a5511a528bef0c016fc5569030c8f83d31fb76a6 - symbol_table: f7142c34960bdd46528d63022dc60428b00ff0183d2c480ef72a8c8b61a13127 diff --git a/tests/expectations/compiler/compiler/integers/u16/ne.out b/tests/expectations/compiler/compiler/integers/u16/ne.out index ddc18d6c39..fd9f703071 100644 --- a/tests/expectations/compiler/compiler/integers/u16/ne.out +++ b/tests/expectations/compiler/compiler/integers/u16/ne.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: c044ccf036223e8e8de1b69ffc11755c88021eb7d6fe33f1f51afafeb8b88999 - initial_input_ast: 1927266ff190c94fb9739e2a59c73f17d4ad9cd9b47ef4022c9905087dbe8eac initial_ast: 142411669f9231a6caf241a77f9b0382d071adb97f38057cef33152035bd8d57 - symbol_table: 1d5a378efa184ef720922e0431978a779b5258838d7daaa4447d773de74b5726 diff --git a/tests/expectations/compiler/compiler/integers/u16/operator_methods.out b/tests/expectations/compiler/compiler/integers/u16/operator_methods.out index 9960880b14..698c9dbdb9 100644 --- a/tests/expectations/compiler/compiler/integers/u16/operator_methods.out +++ b/tests/expectations/compiler/compiler/integers/u16/operator_methods.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: fd9e082741dbeb3963fd5ef3d4fd4c242176c66b4e502b71e92a0832ec5afb43 initial_ast: f600a9703875417713535777834d9185aa0423dc52202d8509a47c24a3ff0845 - symbol_table: 6150ed7bf09e13bcce430ecdd3bcd2660ff95e25f911825adc95bd2cc446ce5e diff --git a/tests/expectations/compiler/compiler/integers/u16/or.out b/tests/expectations/compiler/compiler/integers/u16/or.out index 434946b159..b31088880b 100644 --- a/tests/expectations/compiler/compiler/integers/u16/or.out +++ b/tests/expectations/compiler/compiler/integers/u16/or.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 645d8b76a8e35f3c5c40b8a8d7edaf61869ba567db8856ff407c6c6ca93e15ab initial_ast: b4885ba3ede33a33d77dd109dadd3eeedb830964f2c2be6342e1181b7a91642c - symbol_table: 9937296cdbaac9c23e21a914d1cd4a8c4b0f7b582b631a8adae4482fc8b9b244 diff --git a/tests/expectations/compiler/compiler/integers/u16/pow.out b/tests/expectations/compiler/compiler/integers/u16/pow.out index ff881ae5ae..f2cf7fbd4e 100644 --- a/tests/expectations/compiler/compiler/integers/u16/pow.out +++ b/tests/expectations/compiler/compiler/integers/u16/pow.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 2c0abac302ea0ac78650b87145d06eef89469d5fa6234bddc566bc5e918863d3 initial_ast: 70419a837c7fe4db7f045518fa2ae6be9f4dd22a2db46d3385f91c2ac22f9952 - symbol_table: 8eea911929a2531a62b9a3fb32d811580da42ac64d82e9946f506382c0264d22 diff --git a/tests/expectations/compiler/compiler/integers/u16/shl.out b/tests/expectations/compiler/compiler/integers/u16/shl.out index 6a9df60864..4f27d1e014 100644 --- a/tests/expectations/compiler/compiler/integers/u16/shl.out +++ b/tests/expectations/compiler/compiler/integers/u16/shl.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: a84132ffbda80301c620b10a61957c60ff0cf52c846824353d74deb4b8fb95aa initial_ast: 4c9bdb19e63c3defb3b2217d2aecf610702dc309860a3a28af4fc26ea2b32e95 - symbol_table: f43322fecb288e3d649f480e067202e95c703e51d80969df35ace39134293990 diff --git a/tests/expectations/compiler/compiler/integers/u16/shr.out b/tests/expectations/compiler/compiler/integers/u16/shr.out index e2b3ad0ea7..83f9a026f5 100644 --- a/tests/expectations/compiler/compiler/integers/u16/shr.out +++ b/tests/expectations/compiler/compiler/integers/u16/shr.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: a84132ffbda80301c620b10a61957c60ff0cf52c846824353d74deb4b8fb95aa initial_ast: 6397eb7568ea82b82d5a91f7ea15e15d393418d756ae018d855bf09246261986 - symbol_table: 4b8d8ec0e050a1c2a3ed58f2c93e003fa34be2160a4a9b1759c6b52d68a36bec diff --git a/tests/expectations/compiler/compiler/integers/u16/sub.out b/tests/expectations/compiler/compiler/integers/u16/sub.out index f2ad648ada..5b97426fea 100644 --- a/tests/expectations/compiler/compiler/integers/u16/sub.out +++ b/tests/expectations/compiler/compiler/integers/u16/sub.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 6fb34b6b6c6597f200d98d39d7ec66d5026257323f6e11cea02a2c07d3a482bd initial_ast: ec2e2b4718488d2d07cbe5758260ae2d9d68c827177bd76cc1e5457f65017566 - symbol_table: bc40ab38ded0949abbd0d2b28ad41957043f09fadcd1522424674bc795fc4027 diff --git a/tests/expectations/compiler/compiler/integers/u16/ternary.out b/tests/expectations/compiler/compiler/integers/u16/ternary.out index ce7e584d3e..49b14c90bc 100644 --- a/tests/expectations/compiler/compiler/integers/u16/ternary.out +++ b/tests/expectations/compiler/compiler/integers/u16/ternary.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: d61da749e968cb3fb5ff715944606a2fbfe0e9e82a5505eb6de502b12061612d - initial_input_ast: 6058927814d865491ab33221eebd68e6b860e154845faf69e17ccca306817367 initial_ast: 80358eaf5d798403150ea7b58b5b45cf3d3a42f1f37152450d359afe309f2b31 - symbol_table: df9448449a94c3bc09affc5870c1749d4826072037d1fbe156feab39438a7bec diff --git a/tests/expectations/compiler/compiler/integers/u16/xor.out b/tests/expectations/compiler/compiler/integers/u16/xor.out index fb67f342f1..761d984d62 100644 --- a/tests/expectations/compiler/compiler/integers/u16/xor.out +++ b/tests/expectations/compiler/compiler/integers/u16/xor.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c3ec83ed5d2dac98587cbb57952a6dec4a77fe4079c02d69813b75e4c7688dd9 initial_ast: 8fa7fafe1a99b406cc460d5ef0e6c50ea4397c25e7c36997db4cc23810ef4465 - symbol_table: 22224bb8aeb3dd1f0c49bfa786938a64dc83c0ae270dbc07c08d9b317faf5c92 diff --git a/tests/expectations/compiler/compiler/integers/u32/add.out b/tests/expectations/compiler/compiler/integers/u32/add.out index b9827ff91a..b0161a6d7f 100644 --- a/tests/expectations/compiler/compiler/integers/u32/add.out +++ b/tests/expectations/compiler/compiler/integers/u32/add.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 24ab39bf0500a015a0573619c40908da20bfbd3bfd4546bb65b6332033c44ac5 initial_ast: fc9b2c59dcc3901aa963eb618fc50a6d32f778010863b35e1b06a63d15fb695d - symbol_table: 25778e3ab23f629380da9c2cdb6f1e865643e9361fd650eabdf6768375fc0717 diff --git a/tests/expectations/compiler/compiler/integers/u32/and.out b/tests/expectations/compiler/compiler/integers/u32/and.out index c691ce2122..c23906b557 100644 --- a/tests/expectations/compiler/compiler/integers/u32/and.out +++ b/tests/expectations/compiler/compiler/integers/u32/and.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 24ab39bf0500a015a0573619c40908da20bfbd3bfd4546bb65b6332033c44ac5 initial_ast: daa2a43799f16cb796d6b97c170c600e42b550ac37a9494edc30b52612843358 - symbol_table: be9d4fcea45712daf817888d9002459e0206f8a96fbf2d8ce2e5f959ce1a46e3 diff --git a/tests/expectations/compiler/compiler/integers/u32/console_assert.out b/tests/expectations/compiler/compiler/integers/u32/console_assert.out index 438fac63c3..3a6aece283 100644 --- a/tests/expectations/compiler/compiler/integers/u32/console_assert.out +++ b/tests/expectations/compiler/compiler/integers/u32/console_assert.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 03bbcc62085e4dd3fea97b5ab55d5a69ee2195c016c5142a591e2c560e531cf7 initial_ast: 09903ab2024e24699030dd6f922b1cc87885a491ebe86bb1d59d157380233f9a - symbol_table: 8f03b54e860293c2c5fd9b3bb1199e1691e582712f7f5e5f462c1f7a2fb0d5d1 diff --git a/tests/expectations/compiler/compiler/integers/u32/div.out b/tests/expectations/compiler/compiler/integers/u32/div.out index 230559ee36..88cee9ceb4 100644 --- a/tests/expectations/compiler/compiler/integers/u32/div.out +++ b/tests/expectations/compiler/compiler/integers/u32/div.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 6087c103d4a36793c6956bbc15e83d950a3dfd699a67af67371b24b5eb4f54ca initial_ast: e6a1184fcf21d1fb2539eeacaabeebfbb8c99e8b588f0c09ae95b6fa60ba77fa - symbol_table: 48c50aee2e6f9f2e525cb743866ce2fc9119566076cd63d30cdb0398f328a4ba diff --git a/tests/expectations/compiler/compiler/integers/u32/eq.out b/tests/expectations/compiler/compiler/integers/u32/eq.out index 3a01863b25..7ed2669342 100644 --- a/tests/expectations/compiler/compiler/integers/u32/eq.out +++ b/tests/expectations/compiler/compiler/integers/u32/eq.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: d1acfd7d802258ef14c025fc36ff6a50cd2d47b9ebca5a6bfb6c9050a343ca5b initial_ast: 3930060cab3cda894f9b46576de10b68e7413c6a1779df7f89d4a825d8c33dfa - symbol_table: e081f2d0bc92a375a18466c9298d728d8d2ae35a67fbedeb733ea4cd5a12409d diff --git a/tests/expectations/compiler/compiler/integers/u32/ge.out b/tests/expectations/compiler/compiler/integers/u32/ge.out index 8613262fb4..de6d292a16 100644 --- a/tests/expectations/compiler/compiler/integers/u32/ge.out +++ b/tests/expectations/compiler/compiler/integers/u32/ge.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: d153359c184e6f986eca5f61efb1e108490d7cdc3243494aa38c099ccdfe9a23 - initial_input_ast: a256bf07a585892d533066903adb8ad5052c091f8075646f85301faac29269bd initial_ast: e061368c428c10ca120d110797fa08fd3b1a5e38a272ee6d5c1da7e9da39cb4d - symbol_table: 5ad082f22aed2d221d142cb3538a67c5814214bdd549b3514a369dec0b8b7922 diff --git a/tests/expectations/compiler/compiler/integers/u32/gt.out b/tests/expectations/compiler/compiler/integers/u32/gt.out index 3326d25a3e..d0c66a86e2 100644 --- a/tests/expectations/compiler/compiler/integers/u32/gt.out +++ b/tests/expectations/compiler/compiler/integers/u32/gt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: c23e9a8097d2aef46d355bb51082c0160068704c7116cc887e28293d14ea69b8 - initial_input_ast: 2ac67c7a3a56989674505fd4862927415cbc16cdefb72d7d3eb3e6ac1d7ad43f initial_ast: a9de078a8c6ea3a6ad5543eb56b15f866207d25faddbd8b0240aa37da2d45749 - symbol_table: 6a754bcc8e62a2b8e6e27fbe48a36cb72c99d81ce09e594ebc3125e402f08d0c diff --git a/tests/expectations/compiler/compiler/integers/u32/le.out b/tests/expectations/compiler/compiler/integers/u32/le.out index ea2f3b081d..17a343199e 100644 --- a/tests/expectations/compiler/compiler/integers/u32/le.out +++ b/tests/expectations/compiler/compiler/integers/u32/le.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: d153359c184e6f986eca5f61efb1e108490d7cdc3243494aa38c099ccdfe9a23 - initial_input_ast: f51ca874221687df1657767748ac98387250608d7f0e5c8102d944dbafbbee34 initial_ast: 3d9967a1c55dfea678430b673ef71f117719a2d239f170843a6ead8d5c6a61db - symbol_table: e621662548365800e2cad034bcad6541940af5f5acc36dfa477554c1e72acc4f diff --git a/tests/expectations/compiler/compiler/integers/u32/lt.out b/tests/expectations/compiler/compiler/integers/u32/lt.out index bf175fe981..77730627fd 100644 --- a/tests/expectations/compiler/compiler/integers/u32/lt.out +++ b/tests/expectations/compiler/compiler/integers/u32/lt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 6af82ba7cfaa60ee0dfa8db6a145d2459bb5255acb4e175329a31d16723b58eb - initial_input_ast: 7d3520f07675ac488044c92eec0b2ee1dc38cfe2f9ec850fe020aea60eeb7a3b initial_ast: 7111e358e69cfc0bf425c821b892ed379ddeb7e704053f660a7149b633f09f18 - symbol_table: 92fe7f7727a3bd4d14e36b28ec549f7348b898845534e872faaba4e362902f0b diff --git a/tests/expectations/compiler/compiler/integers/u32/max.out b/tests/expectations/compiler/compiler/integers/u32/max.out index 92b32c57bb..dfdc5c54fd 100644 --- a/tests/expectations/compiler/compiler/integers/u32/max.out +++ b/tests/expectations/compiler/compiler/integers/u32/max.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 76a0fe2199754831329d9b089d2c02f73d7457aaed6548372169318675b85f48 initial_ast: c05447aab11b1d797ac4b137dd2a62b15cf2473d296c70c3bf4b0e39ad943cff - symbol_table: 6cb33ae7380c96471000854378fc11a0ac0986e2f0cc82d0b67157ea1f66375e diff --git a/tests/expectations/compiler/compiler/integers/u32/min.out b/tests/expectations/compiler/compiler/integers/u32/min.out index 0fe7c0a1dc..b46a45ab9b 100644 --- a/tests/expectations/compiler/compiler/integers/u32/min.out +++ b/tests/expectations/compiler/compiler/integers/u32/min.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c7cfa681865a1c0623cfd356162d0c6750f3e06fb72126585eace0aeb21bae77 initial_ast: 84a1b63182db76d7e1ecf8bf85011f71337b4c756abc57f4eed16d6ccd7404f7 - symbol_table: ae53f8e2991eb6e1c5411e9323fe1f0a0362ed74ded446743ac7cc7b6472c685 diff --git a/tests/expectations/compiler/compiler/integers/u32/mul.out b/tests/expectations/compiler/compiler/integers/u32/mul.out index 41cd0ebd52..a3db93650c 100644 --- a/tests/expectations/compiler/compiler/integers/u32/mul.out +++ b/tests/expectations/compiler/compiler/integers/u32/mul.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: f8b5b2b0523a7b105beca036d64e7faafd2f3565269eed4ab47b57a4552f803b initial_ast: 445a52143c5561473e614674752bbfc1f0ab670b799713d2006989dece28d8d5 - symbol_table: a361156a49b7611d0e4b3e231b073210bc8a19a6255b966c59d3b5e1d2f51f06 diff --git a/tests/expectations/compiler/compiler/integers/u32/ne.out b/tests/expectations/compiler/compiler/integers/u32/ne.out index b97ed90c28..81bffa7f26 100644 --- a/tests/expectations/compiler/compiler/integers/u32/ne.out +++ b/tests/expectations/compiler/compiler/integers/u32/ne.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: c36a3ceeb3e7d90b2bf76e7cbce130286c71a0cb86e6671f64bffa99f48e6491 - initial_input_ast: 8c66de958fbaa62572701b17e8fee53c7c5a51473c5deabd7d3279a73b271f21 initial_ast: a2fce2693c1000822f5e3841994646404df0ffa0f343354362ab19d1da92ce22 - symbol_table: 737d38e0113d508ac46829d2233125443e36a78e22ff8614769821b64eb16227 diff --git a/tests/expectations/compiler/compiler/integers/u32/operator_methods.out b/tests/expectations/compiler/compiler/integers/u32/operator_methods.out index f39e23ede7..383a8fd3db 100644 --- a/tests/expectations/compiler/compiler/integers/u32/operator_methods.out +++ b/tests/expectations/compiler/compiler/integers/u32/operator_methods.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: ea9df7ef3cc00db98b36855cf13c1091b7d8270ac2b9fe72b36bb7001e93e807 initial_ast: 21b59fe60396056673a2f23d87a7544ec9be134f4a5ec02a922a6a0c3ee120ff - symbol_table: 45e6225e0d8fa30d1694518a06d87217f2a1d01ba1194a23dd3297f0b5f13fbb diff --git a/tests/expectations/compiler/compiler/integers/u32/or.out b/tests/expectations/compiler/compiler/integers/u32/or.out index d6e401646f..b32b08b3ae 100644 --- a/tests/expectations/compiler/compiler/integers/u32/or.out +++ b/tests/expectations/compiler/compiler/integers/u32/or.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 24ab39bf0500a015a0573619c40908da20bfbd3bfd4546bb65b6332033c44ac5 initial_ast: 135d3a6df58371792424ff8dc87d24b7938aef33f4e13cb016a39de0c9aba20f - symbol_table: 08f67fe8ad9edc075b7d7159b6c8b31c2becbe738caf1e90d4a81e91e3c8a1fb diff --git a/tests/expectations/compiler/compiler/integers/u32/pow.out b/tests/expectations/compiler/compiler/integers/u32/pow.out index bb9e041798..7756ada02a 100644 --- a/tests/expectations/compiler/compiler/integers/u32/pow.out +++ b/tests/expectations/compiler/compiler/integers/u32/pow.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 1b21a26a6e63949b68f60b4d8d5aceddd14582b1e7a97b8170c0575ec9b8c62d initial_ast: 2daddd8a1b6d1fc3bd84b9b72a59f711fe6e2afaed0bf248796ad4f967f8a6bf - symbol_table: f8d3efaeea5c7156f3f2f7fd22474c1a01dfb056ca650cf6f974c114b5d83baf diff --git a/tests/expectations/compiler/compiler/integers/u32/shl.out b/tests/expectations/compiler/compiler/integers/u32/shl.out index 887c262aca..4c5758d6d2 100644 --- a/tests/expectations/compiler/compiler/integers/u32/shl.out +++ b/tests/expectations/compiler/compiler/integers/u32/shl.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 0942fc3a0aaa64dd019acd4dcd23a548b11ad692ed1af1703201286bf3474552 initial_ast: fe46e8d2f3a5f44c9e0298175ee1a9afdea56eb55cc7d959be20dba5cabf5c04 - symbol_table: 387e9ea031cf473577ed4d5cef1c9e093a7d540156abefdc8fbb80da0743f98e diff --git a/tests/expectations/compiler/compiler/integers/u32/shr.out b/tests/expectations/compiler/compiler/integers/u32/shr.out index db74bd8e4d..fc0ce334cb 100644 --- a/tests/expectations/compiler/compiler/integers/u32/shr.out +++ b/tests/expectations/compiler/compiler/integers/u32/shr.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 0942fc3a0aaa64dd019acd4dcd23a548b11ad692ed1af1703201286bf3474552 initial_ast: 9289596bee932cb6a10e55ecf4f8fae109c4ee8f1b450c212546d9887014e618 - symbol_table: 8ad932710cb514ed5c86a54a77d33b55fe10898f76edbb327367af1cc17f18d0 diff --git a/tests/expectations/compiler/compiler/integers/u32/sub.out b/tests/expectations/compiler/compiler/integers/u32/sub.out index 1d6b640682..39eb6d9b13 100644 --- a/tests/expectations/compiler/compiler/integers/u32/sub.out +++ b/tests/expectations/compiler/compiler/integers/u32/sub.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 8bea12e1a0f364a123045ecb496654c9448a99278cc875dae01f17b2d9fb3485 initial_ast: dbd7ac04b429e55feb60410fa01f02152ca2b763ee1a6d7d3324314991838072 - symbol_table: 7b6d3ffaf2dba4eb24b64929c9a2c756e966e822f3d3f45a05113963f22d76fd diff --git a/tests/expectations/compiler/compiler/integers/u32/ternary.out b/tests/expectations/compiler/compiler/integers/u32/ternary.out index 573713402b..e24d2b2e91 100644 --- a/tests/expectations/compiler/compiler/integers/u32/ternary.out +++ b/tests/expectations/compiler/compiler/integers/u32/ternary.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 27f7025a824f61583d50487c11fc97bd272d7dd79c002f0123252457885d7aef - initial_input_ast: ee9d28f19ee516c2adbca501a7e239df0a8c55189994a7480fabfa1baa79cb54 initial_ast: a501d6b24248229cc476db3c38556aacb27ad8a2aa6398569a13c2fc87cb122b - symbol_table: 2f27d6dc05c17715b3c45e9ee6e501bfaec046241110fee1209904c92b2aa434 diff --git a/tests/expectations/compiler/compiler/integers/u32/xor.out b/tests/expectations/compiler/compiler/integers/u32/xor.out index 6a87ff80a0..1b99ce2a75 100644 --- a/tests/expectations/compiler/compiler/integers/u32/xor.out +++ b/tests/expectations/compiler/compiler/integers/u32/xor.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 7c48dc804dbb838ac85e31f9d913f494e82e941e19a7d0488f8017aa5b421d43 initial_ast: 1a2b553b70b259e98ab8a4ec91d4b9561894f243239b881cc05a5b25243d6363 - symbol_table: aa53ac478a280069dae42d20ac15467e68d0e595c6e3f742b3f3a85fa8fc5718 diff --git a/tests/expectations/compiler/compiler/integers/u64/add.out b/tests/expectations/compiler/compiler/integers/u64/add.out index 93ba539d08..4ba34021cb 100644 --- a/tests/expectations/compiler/compiler/integers/u64/add.out +++ b/tests/expectations/compiler/compiler/integers/u64/add.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: b50fe7e5fcca4c73fff46b376e3eedec9ae02e15ca9f2d4f33f3a1b77b3f9168 initial_ast: 340164d2eb54080cf67f584148ece7d5873c20a570a6bb0173d2d7fe8512e97b - symbol_table: c1c13f861658664abf92e0a1fc7bdc65c51458a53b7bc3810fd624bc3893d5ff diff --git a/tests/expectations/compiler/compiler/integers/u64/and.out b/tests/expectations/compiler/compiler/integers/u64/and.out index bdfff7e654..2f08874eaa 100644 --- a/tests/expectations/compiler/compiler/integers/u64/and.out +++ b/tests/expectations/compiler/compiler/integers/u64/and.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: b50fe7e5fcca4c73fff46b376e3eedec9ae02e15ca9f2d4f33f3a1b77b3f9168 initial_ast: 17d5fbf0845373e1b8b4dad54571cfc95015715414cb1b11e89ec0b3e2e2116d - symbol_table: 635abc201777b2d77911925dae7f165832b3752e0e37b0995fc5fa93c8accd46 diff --git a/tests/expectations/compiler/compiler/integers/u64/console_assert.out b/tests/expectations/compiler/compiler/integers/u64/console_assert.out index 7241a5c7ae..0f2a422195 100644 --- a/tests/expectations/compiler/compiler/integers/u64/console_assert.out +++ b/tests/expectations/compiler/compiler/integers/u64/console_assert.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 3d51bf3df58d2d1681a5d016d678cc89b339975bd257812cd4cd60160fb433ee initial_ast: 5b3f45f81f96fd2606f09a1936b302b896a610c3f72f4d1549648cf506fe65b4 - symbol_table: 7753ab45670bf14beb7642f47b735da9c08b49839bc42ea6827bcdf965cfe1ed diff --git a/tests/expectations/compiler/compiler/integers/u64/div.out b/tests/expectations/compiler/compiler/integers/u64/div.out index 9ce9c0322a..0f8619f1cf 100644 --- a/tests/expectations/compiler/compiler/integers/u64/div.out +++ b/tests/expectations/compiler/compiler/integers/u64/div.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: beeb0a9eacf523f7e10c566f746ffb272b789646ba1a471cea54faeeeb535464 initial_ast: a79fed9ce5b7424f09ebfab59dc874c2b43cc71955d4c8d0d8c1f9277288d5be - symbol_table: 96d922c665c2723cb7ca22f4f416dbf9d2d76f07ce2d4ce7b3c1becc41ebc9b6 diff --git a/tests/expectations/compiler/compiler/integers/u64/eq.out b/tests/expectations/compiler/compiler/integers/u64/eq.out index 9b8150d474..a8e4b02884 100644 --- a/tests/expectations/compiler/compiler/integers/u64/eq.out +++ b/tests/expectations/compiler/compiler/integers/u64/eq.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 1e05ac8daa4ebb9edbb2929a2a30db4a0f38a0bce1498d8b3a2983566ba73f2a initial_ast: 0b87059e5a0ea16416c02be3dbf974dadaa25fcb273aa5095300bb86eb9c9a14 - symbol_table: 89b3e14b1880e4d3ce547087df3229f7c0b20a40c6c55130b9af3f17af90fc01 diff --git a/tests/expectations/compiler/compiler/integers/u64/ge.out b/tests/expectations/compiler/compiler/integers/u64/ge.out index dd26eb0a0e..2c98ebc635 100644 --- a/tests/expectations/compiler/compiler/integers/u64/ge.out +++ b/tests/expectations/compiler/compiler/integers/u64/ge.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: c93814cf63d02ad8a937f8b60f81eae00e522352861e2fd10a2188a0384646d4 - initial_input_ast: 2d62b4fb5f26898f99626d4ed69d0b4a24ee08262caf04bcbb1867b462f451f9 initial_ast: c7c41443c2274ec7eab0282ab90404692aabe60fb959d9797f5ed93295740ac8 - symbol_table: 8f6927e31fdde67cc1f67d8f2d214bf456a1fce6ebee106656b33f717aa770f7 diff --git a/tests/expectations/compiler/compiler/integers/u64/gt.out b/tests/expectations/compiler/compiler/integers/u64/gt.out index a67192cf76..24cf46662a 100644 --- a/tests/expectations/compiler/compiler/integers/u64/gt.out +++ b/tests/expectations/compiler/compiler/integers/u64/gt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 9ee8856bfaf5e7fc4d635092b4f7ea9501e3ce319694acebe8cbcaa3783e866c - initial_input_ast: 2430f4c73831f48ad743c32463ad9a84e3e9039bec5ff8332dcc98932363fd66 initial_ast: 2fddc57755bd974f2e5a7e605edbcca484741fdd7e04b9eb4c661e848c1f728d - symbol_table: d3fbb159afcf5d889f310c0b277b588def80246861c318632d9416532c84901e diff --git a/tests/expectations/compiler/compiler/integers/u64/le.out b/tests/expectations/compiler/compiler/integers/u64/le.out index 1cc5c4ee1e..a3de59285f 100644 --- a/tests/expectations/compiler/compiler/integers/u64/le.out +++ b/tests/expectations/compiler/compiler/integers/u64/le.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: c93814cf63d02ad8a937f8b60f81eae00e522352861e2fd10a2188a0384646d4 - initial_input_ast: 9fdfa77c361e0f36264bdc79549782e5c4accc35538700d984cd89863f9e2683 initial_ast: 8324cc493c146c4b8265d86573e0c5d6ca185040fc0dd24398f43711d43839cd - symbol_table: 9c75212ccddfab209e82ced0636610b9c0b225af3a17badeb6d12b03200f9aa0 diff --git a/tests/expectations/compiler/compiler/integers/u64/lt.out b/tests/expectations/compiler/compiler/integers/u64/lt.out index 1ebda9defb..071c46603a 100644 --- a/tests/expectations/compiler/compiler/integers/u64/lt.out +++ b/tests/expectations/compiler/compiler/integers/u64/lt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 7f5c6e459e8b00635226d3719b7d729913c93525e47053278a015fd24079c37d - initial_input_ast: 35ef77a451dbc9df83934e68b1407ab2f8fe9014a8a59704475ec3c3942ef89f initial_ast: fa31b24abd921d4af729dc4d00df07a76b4eba1b58c83d68287c1dc4fd3effce - symbol_table: 22be10247e5c5f58c07b5ea7ed1dd2093561a57ef3a0c54e26799398d2dd8740 diff --git a/tests/expectations/compiler/compiler/integers/u64/max.out b/tests/expectations/compiler/compiler/integers/u64/max.out index 23f11e6da5..3ede96b564 100644 --- a/tests/expectations/compiler/compiler/integers/u64/max.out +++ b/tests/expectations/compiler/compiler/integers/u64/max.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: ad738add6c03b6224ccba9d8d735b6645444f9c16f3b652ec4c0903fa4bb33aa initial_ast: ed6f4f209a48619099bbc178763027c1cb6de50f7e4eb7db9ec359e917b67322 - symbol_table: a7e47aec9a839e089b64e17d3dac5e110bccdf3b97b69d5e8a1a64e4a32138b2 diff --git a/tests/expectations/compiler/compiler/integers/u64/min.out b/tests/expectations/compiler/compiler/integers/u64/min.out index d321c38ec0..72392385c6 100644 --- a/tests/expectations/compiler/compiler/integers/u64/min.out +++ b/tests/expectations/compiler/compiler/integers/u64/min.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c7cfa681865a1c0623cfd356162d0c6750f3e06fb72126585eace0aeb21bae77 initial_ast: 12ba9963cb5250d4d1d98a9fee0b7dd116e5065f8a83f5e79cdd623bf24307aa - symbol_table: 9579cc0870b2c20e1ce3e47deecb81a0925d4e883403626870b125c10eceb59c diff --git a/tests/expectations/compiler/compiler/integers/u64/mul.out b/tests/expectations/compiler/compiler/integers/u64/mul.out index 20b1d19cf1..ab5fe28d10 100644 --- a/tests/expectations/compiler/compiler/integers/u64/mul.out +++ b/tests/expectations/compiler/compiler/integers/u64/mul.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 0758dc997baa1ce2e35b7680289f58b145801d64671f55b98a163d84b76982a2 initial_ast: 7d318ef8d005392a4bc79f3316f5847ead2d452787a5ad0c057b0b48e150baa3 - symbol_table: 77c0adeb4d9f6bb7562a9eaf09c84d5fb4459ac432fffb77c71510cb77991662 diff --git a/tests/expectations/compiler/compiler/integers/u64/ne.out b/tests/expectations/compiler/compiler/integers/u64/ne.out index dc86dd382e..6a425d2870 100644 --- a/tests/expectations/compiler/compiler/integers/u64/ne.out +++ b/tests/expectations/compiler/compiler/integers/u64/ne.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 2c6f07fb52fcadfd42be53ab06838ce4ddc609995c7f4cbc3799f6daf92cc32b - initial_input_ast: a090b0a76971eb5a83b3460b0e9ad051e293b1adc169b8a59eece9a7bcda4e56 initial_ast: 824860fcd0efb5e8f59935166bd2c810068f6bffa23e5e0c02d6d95b6d88ec21 - symbol_table: 3243923d5a69e9bd20a247e6749255adaca834c5277061df09a8777ae0f34d2d diff --git a/tests/expectations/compiler/compiler/integers/u64/operator_methods.out b/tests/expectations/compiler/compiler/integers/u64/operator_methods.out index e01567d441..ff0fc73679 100644 --- a/tests/expectations/compiler/compiler/integers/u64/operator_methods.out +++ b/tests/expectations/compiler/compiler/integers/u64/operator_methods.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: e5791e3381c49b3897104d9715a9e452f7009eb7fe621d5a63280dbbe50b3c54 initial_ast: 25d05cdcdbaf148b060a54daa3de4b7d87a1b7189d667b0831bdb12cd0a28af3 - symbol_table: ad59543f383553d65403e731ab269ae46d0386b6ade2537a63e08a7e77170890 diff --git a/tests/expectations/compiler/compiler/integers/u64/or.out b/tests/expectations/compiler/compiler/integers/u64/or.out index f985922e08..0fbcd6c85a 100644 --- a/tests/expectations/compiler/compiler/integers/u64/or.out +++ b/tests/expectations/compiler/compiler/integers/u64/or.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: b50fe7e5fcca4c73fff46b376e3eedec9ae02e15ca9f2d4f33f3a1b77b3f9168 initial_ast: f9763d0d8b774b35e807316ae6dd33dbe858881d7e4c45f80d05639c4c0c46bb - symbol_table: 96feb0d523f261168d2994b45c10fcc3c488a6eb093a2841256603076a8f2f26 diff --git a/tests/expectations/compiler/compiler/integers/u64/pow.out b/tests/expectations/compiler/compiler/integers/u64/pow.out index 8139d03499..60d8e0c043 100644 --- a/tests/expectations/compiler/compiler/integers/u64/pow.out +++ b/tests/expectations/compiler/compiler/integers/u64/pow.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 21f494ba0942bd81a0971d1c7d591585cb72d198a89963e561baf0a1b007ac87 initial_ast: 8fb5e2247aeac433dd36ae4239d96120b5720ab6d95670531b020b5c0d5ca1dc - symbol_table: 617ab5d9c3341387b8b74c7cf0c66d189f8fb2b13e662f1909e1641974a4d9d6 diff --git a/tests/expectations/compiler/compiler/integers/u64/shl.out b/tests/expectations/compiler/compiler/integers/u64/shl.out index 4e87843f1f..66bd178f9c 100644 --- a/tests/expectations/compiler/compiler/integers/u64/shl.out +++ b/tests/expectations/compiler/compiler/integers/u64/shl.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 429335969b6c3ba968362b30d24c4aac270bc21f7675ac64235e979c324549b3 initial_ast: 6886e667f1d6755f4de7173442beb567647c923e341a8d2be04557b6c6c951ef - symbol_table: d7e4ccc91fa0f303c955b615cc10c13c6bd862b143aecbae58a9ab0811934820 diff --git a/tests/expectations/compiler/compiler/integers/u64/shr.out b/tests/expectations/compiler/compiler/integers/u64/shr.out index 01d5d10369..ee9dbeaa9d 100644 --- a/tests/expectations/compiler/compiler/integers/u64/shr.out +++ b/tests/expectations/compiler/compiler/integers/u64/shr.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 429335969b6c3ba968362b30d24c4aac270bc21f7675ac64235e979c324549b3 initial_ast: bf9740eebdc55fe0c35c7ec027c0ef328ab92e2a5228489a20911bbbe7deab37 - symbol_table: 00ab26a93503fcb96729f136fd4d77b50df5f996886882513d0913d2496d3ecd diff --git a/tests/expectations/compiler/compiler/integers/u64/sub.out b/tests/expectations/compiler/compiler/integers/u64/sub.out index f083453f9a..a7174469fb 100644 --- a/tests/expectations/compiler/compiler/integers/u64/sub.out +++ b/tests/expectations/compiler/compiler/integers/u64/sub.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 083ead671da49260e9309556752e7e3bed665ae954c744b8d067a9919fb01222 initial_ast: d5e74554cc310acf5a55a5d5a1bdd53eb03af925ea01be634ee8afe84639a505 - symbol_table: 48f44fca9b490df0387ccac24c8e4805e634896b968559d35645288cdd720562 diff --git a/tests/expectations/compiler/compiler/integers/u64/ternary.out b/tests/expectations/compiler/compiler/integers/u64/ternary.out index 557093fdfc..59fd86535d 100644 --- a/tests/expectations/compiler/compiler/integers/u64/ternary.out +++ b/tests/expectations/compiler/compiler/integers/u64/ternary.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: c016901c75fdf8a1f458788af0598e582030b2957dd8c630b74148e2f3c908f6 - initial_input_ast: 1d4cb77c5bba30e598cca54089f1530603af93a6feebc53229a968978036eb1c initial_ast: ece173da72d8938a75fc6b467b37c3e2345ebe5fb679292bc256067c06011a34 - symbol_table: 3e3b389b28b166b85423e398f80698529dbb1174326b121bb67ca4921c714aa4 diff --git a/tests/expectations/compiler/compiler/integers/u64/xor.out b/tests/expectations/compiler/compiler/integers/u64/xor.out index c6714686f2..74d9b633de 100644 --- a/tests/expectations/compiler/compiler/integers/u64/xor.out +++ b/tests/expectations/compiler/compiler/integers/u64/xor.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: f76d83befbe9326bc314867d02931b7ad78ca30ffcb9031997dfda28bfd5133e initial_ast: 9a85f40d0e502c8e4cb423ba9ae2806a015ae0c46f1fce4f888898029707b461 - symbol_table: 869c2d43295d09a06d478f3604415eff717a148e056c65050165b9eb0f81be35 diff --git a/tests/expectations/compiler/compiler/integers/u8/add.out b/tests/expectations/compiler/compiler/integers/u8/add.out index 9f7cadd67a..a03dd32099 100644 --- a/tests/expectations/compiler/compiler/integers/u8/add.out +++ b/tests/expectations/compiler/compiler/integers/u8/add.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: b568f017162b4870af580492723986dac02d17b61cec3cec52cc8651e7d4dec8 initial_ast: 754c6fc632d72724bb2447829ea6470d444fda41b7f4677635839184bd39e658 - symbol_table: b49bebf927e5e92ff081f5c76a421532e86ac349fe85391e838879928e58c9e7 diff --git a/tests/expectations/compiler/compiler/integers/u8/and.out b/tests/expectations/compiler/compiler/integers/u8/and.out index f3dfb86c9a..c3d6c2154b 100644 --- a/tests/expectations/compiler/compiler/integers/u8/and.out +++ b/tests/expectations/compiler/compiler/integers/u8/and.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: b568f017162b4870af580492723986dac02d17b61cec3cec52cc8651e7d4dec8 initial_ast: 988ae827a3cfcadeb7c89bf40a4c2c37f78ed97fe9e76dfb3aa74270f056b8ea - symbol_table: 03b259e2f510f28b0ccbbef352d6a94ece6981110a0f04b9dd18b876843938be diff --git a/tests/expectations/compiler/compiler/integers/u8/console_assert.out b/tests/expectations/compiler/compiler/integers/u8/console_assert.out index 5eafed60e2..a2464b1e74 100644 --- a/tests/expectations/compiler/compiler/integers/u8/console_assert.out +++ b/tests/expectations/compiler/compiler/integers/u8/console_assert.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 8dd4987c574614c5154b47c61e6eafec80b878d6c4949bc95d8ee2eb96170add initial_ast: b3a25f9933cbba508f01723126eba657c8317c2bc235d659c30fc9d9ec66f58f - symbol_table: c57bb0b106be07bd5f495f1623ebeb3c455437f59d583d3790cf036253a8e363 diff --git a/tests/expectations/compiler/compiler/integers/u8/div.out b/tests/expectations/compiler/compiler/integers/u8/div.out index d75bcc62fd..2baec7e291 100644 --- a/tests/expectations/compiler/compiler/integers/u8/div.out +++ b/tests/expectations/compiler/compiler/integers/u8/div.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 09d9e73603d60f95eb727839ce98545e429b63ca34293d14ffaac126d6dd381e initial_ast: 0d9ff3ac45a9e6fd5e03221953a7e07500f93d3245e90b94145bcf2970e24070 - symbol_table: 8f1027beea373169e2bb06491736fd4099425a4f4d3f8fcb612462982cdb0d05 diff --git a/tests/expectations/compiler/compiler/integers/u8/eq.out b/tests/expectations/compiler/compiler/integers/u8/eq.out index 52e5d0027d..07bf3b5f6e 100644 --- a/tests/expectations/compiler/compiler/integers/u8/eq.out +++ b/tests/expectations/compiler/compiler/integers/u8/eq.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: a4cd0750e35f81754a218922dd8a55d208009d236296668eaafa6aa8d60fdcb4 initial_ast: afcc42569de04d0b1672a244a675e13b9ad998991488da9fa986860fb0468dc1 - symbol_table: 16076a22d3c0df71ab90df94e1ecb26ad330c02fe2536f0b5a5d1fc8a11e05c5 diff --git a/tests/expectations/compiler/compiler/integers/u8/ge.out b/tests/expectations/compiler/compiler/integers/u8/ge.out index 37d36a1f3b..817be0e9ac 100644 --- a/tests/expectations/compiler/compiler/integers/u8/ge.out +++ b/tests/expectations/compiler/compiler/integers/u8/ge.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: d0e7d4b75881411834839b3822bf80914e6018ba2729ff717c851ce34aa7eead - initial_input_ast: 8eedbf6e59fef91aeee2f91f13799ccb1d990cc041268bdf7f7be526fd4c0b87 initial_ast: 0387eb47ffc2188fee255556743ac7030b4a61ef5afc2b9bc4d13818d8d08740 - symbol_table: 1cf9efe37c13b89e2528c0257225192259dabdbb7df99c98d4ae31e74681eefe diff --git a/tests/expectations/compiler/compiler/integers/u8/gt.out b/tests/expectations/compiler/compiler/integers/u8/gt.out index a37dc8ad86..1bdf699bf4 100644 --- a/tests/expectations/compiler/compiler/integers/u8/gt.out +++ b/tests/expectations/compiler/compiler/integers/u8/gt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: be7952b3d9074f7a048ca1e95dc8749bb9fe03c3c1f4d1666cc81e16eaaed3dd - initial_input_ast: e2a63d49a7e6c95f5f8eb00440e098d690e4223244b80b8790b5593be295e612 initial_ast: 246b63815a2edb7ad0e09567170205f09ed8b805924efc8665d427ad575ae1d4 - symbol_table: 0f19f2bdf03fa3f98d3b1b849195dee1ee2e23c968c8beab1d1106e2be74da19 diff --git a/tests/expectations/compiler/compiler/integers/u8/le.out b/tests/expectations/compiler/compiler/integers/u8/le.out index 496906daed..1853bf6c70 100644 --- a/tests/expectations/compiler/compiler/integers/u8/le.out +++ b/tests/expectations/compiler/compiler/integers/u8/le.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: d0e7d4b75881411834839b3822bf80914e6018ba2729ff717c851ce34aa7eead - initial_input_ast: e83f3d1b68e9e42f5f4ef9ac8fa11c9f048661148dffd1f2337ec7a4fe7c7b70 initial_ast: c77395e7a7c11b5e29249ff2e0458d8e0a3ddb160510522ec37c9679433587f7 - symbol_table: 23d6582231481f7fe9071618585c6e81ff6f7571059cc4a2fc6deab71292ed43 diff --git a/tests/expectations/compiler/compiler/integers/u8/lt.out b/tests/expectations/compiler/compiler/integers/u8/lt.out index d4a2c498cd..da380bf49b 100644 --- a/tests/expectations/compiler/compiler/integers/u8/lt.out +++ b/tests/expectations/compiler/compiler/integers/u8/lt.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 1b0305de2d2ddda28ff605bd26a4f6dd8edaaa1dd3db97f00ad53a4cd3cceb23 - initial_input_ast: 9033a0de0826b7e572951e2dcf8e83f4f6515205058b7432ccff29a065cc2a49 initial_ast: e80f2965d7b6bc3f51e6115f53f20968b14276fc1920428f458ff998032676bc - symbol_table: 929c17fba43bfee01ec4b836cbbd8bd610e30bdf4294ececb75f247fdc8f2bcc diff --git a/tests/expectations/compiler/compiler/integers/u8/max.out b/tests/expectations/compiler/compiler/integers/u8/max.out index de466b98d8..9ba2c76738 100644 --- a/tests/expectations/compiler/compiler/integers/u8/max.out +++ b/tests/expectations/compiler/compiler/integers/u8/max.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c7cfa681865a1c0623cfd356162d0c6750f3e06fb72126585eace0aeb21bae77 initial_ast: 76d2cd4e27f5746d6ab065808ae83a73e60b4798d30181e8a12ff9ae20194c94 - symbol_table: 9ff7adccc170c1428f3844c390027a8f9641c9f8a76ce5f0024b2c9140f45d93 diff --git a/tests/expectations/compiler/compiler/integers/u8/min.out b/tests/expectations/compiler/compiler/integers/u8/min.out index 11cf2fe298..d6aa9e50b3 100644 --- a/tests/expectations/compiler/compiler/integers/u8/min.out +++ b/tests/expectations/compiler/compiler/integers/u8/min.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 13720f61f86be3462e6829a230cb85abd2ea7a3e406c03bad349c0580839fd1b initial_ast: 8c02652cea84f945daccc6578e4cb7ac701ab8c80ede22f74a441d04cb8be1a0 - symbol_table: 2dd055524a0d6eefa18c3248f40c0b7934080c4ea0f8052c2da2191408d2fea1 diff --git a/tests/expectations/compiler/compiler/integers/u8/mul.out b/tests/expectations/compiler/compiler/integers/u8/mul.out index a15a546c21..69bcb61580 100644 --- a/tests/expectations/compiler/compiler/integers/u8/mul.out +++ b/tests/expectations/compiler/compiler/integers/u8/mul.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 1a47105e4a0a77e18f9e0109084a0c0b81cbf04bf4e449a86d0f9a214bbe297b initial_ast: e70485ca8bf749103e8706c3d5df55005794f1fcb49ccd81487e7f8796c20290 - symbol_table: 89129eab1ef21cc91784b4c5d81e68012f35800778eac358efb24d56c20ef295 diff --git a/tests/expectations/compiler/compiler/integers/u8/ne.out b/tests/expectations/compiler/compiler/integers/u8/ne.out index 4f61a967e4..4eac71727d 100644 --- a/tests/expectations/compiler/compiler/integers/u8/ne.out +++ b/tests/expectations/compiler/compiler/integers/u8/ne.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: c40e8d5ce21623a727dc9b6404c0d7f6f251d36f82d30b9ba4f1f2804531a2a7 - initial_input_ast: 699f3079ce1ae41896a7817fc10cba7d28e3ad1445c47f7a892a4867cd597be0 initial_ast: af6fd0946705136e76fff48bc531292c128bf3d6f534b85129da2fceb2f153cc - symbol_table: 299fff014274a3fef18437e73adb0f912b453399e6149db11763f4495c735b23 diff --git a/tests/expectations/compiler/compiler/integers/u8/operator_methods.out b/tests/expectations/compiler/compiler/integers/u8/operator_methods.out index a5cb676cd1..438630eaf9 100644 --- a/tests/expectations/compiler/compiler/integers/u8/operator_methods.out +++ b/tests/expectations/compiler/compiler/integers/u8/operator_methods.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 746d49d0a4fc6fd3bf0b001693187c5a4986b06b5e257fdb30778862abdd51fa initial_ast: d498ddf01de9af370a6db1d6bc5f981e558d51ad6cab51ebb6cf50d2ccaef3d2 - symbol_table: 2e34d31685bcdaec75e3b1be117a72703abecabf8aa8ed34b7f786dc8136af45 diff --git a/tests/expectations/compiler/compiler/integers/u8/or.out b/tests/expectations/compiler/compiler/integers/u8/or.out index 8403d5c18d..f11f6e360e 100644 --- a/tests/expectations/compiler/compiler/integers/u8/or.out +++ b/tests/expectations/compiler/compiler/integers/u8/or.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: b568f017162b4870af580492723986dac02d17b61cec3cec52cc8651e7d4dec8 initial_ast: a45e30bb089e822608fa0c82be0139e781161e182dfe0e526b5d3aa4f74fb3e6 - symbol_table: 17e102cba58429d91fc19ed6b97c6e300da2ebfd14c64161b7cefd17fa92a9d0 diff --git a/tests/expectations/compiler/compiler/integers/u8/pow.out b/tests/expectations/compiler/compiler/integers/u8/pow.out index a898e32fcc..9ca29dc992 100644 --- a/tests/expectations/compiler/compiler/integers/u8/pow.out +++ b/tests/expectations/compiler/compiler/integers/u8/pow.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 9b6010040efa42a21face2e7a08f92bb764fc497738c0211887c06d195a41d16 initial_ast: a397579f1ed7d54e9d6a2be47a517abaef1e751598c3c0d975f2e1811c8db72e - symbol_table: 14d4e271dea1ce6137aef7a5be87f5468e38112dec0caa9e0d0d81d69c02e384 diff --git a/tests/expectations/compiler/compiler/integers/u8/shl.out b/tests/expectations/compiler/compiler/integers/u8/shl.out index 3c19fdbbba..ca79553d76 100644 --- a/tests/expectations/compiler/compiler/integers/u8/shl.out +++ b/tests/expectations/compiler/compiler/integers/u8/shl.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 122462c0f087ef8b63c453544666f10f38e2cce33fbd6f4d84b9585177077077 initial_ast: 0bfbbd577c1680dc314a933dd553c5b8f923a6500b993641aa289d09e6fa7b2d - symbol_table: a63308d74de098bc955cdbea3928f9dae7a8df976291f9201db20256eb6a0fa7 diff --git a/tests/expectations/compiler/compiler/integers/u8/shr.out b/tests/expectations/compiler/compiler/integers/u8/shr.out index a664e44b90..41f12d306f 100644 --- a/tests/expectations/compiler/compiler/integers/u8/shr.out +++ b/tests/expectations/compiler/compiler/integers/u8/shr.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 122462c0f087ef8b63c453544666f10f38e2cce33fbd6f4d84b9585177077077 initial_ast: b310c8d522c70768838543087c884a8785081de31ef2302a20176dd697d57914 - symbol_table: db918b3c7bf9846123a20b8f9045597e79dd7aa96c9b28674bf032d01817d563 diff --git a/tests/expectations/compiler/compiler/integers/u8/sub.out b/tests/expectations/compiler/compiler/integers/u8/sub.out index 427007713c..ad3ba55e97 100644 --- a/tests/expectations/compiler/compiler/integers/u8/sub.out +++ b/tests/expectations/compiler/compiler/integers/u8/sub.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: e0a14c313387c27690fe95a691990d9a82c0d189ebe6510a209984a817907fb0 initial_ast: 9b629c94d7ea45e415591d9dda63fbff07a93ec777b9b99be437ba2aff883bd1 - symbol_table: ebe63398d3809fedaa38f4ada4fe18022296680cdc7d30fbcd16aa491134749c diff --git a/tests/expectations/compiler/compiler/integers/u8/ternary.out b/tests/expectations/compiler/compiler/integers/u8/ternary.out index 6931ad115b..6672b00311 100644 --- a/tests/expectations/compiler/compiler/integers/u8/ternary.out +++ b/tests/expectations/compiler/compiler/integers/u8/ternary.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 92a421ad9700284ef509658bad78166f5931b333e9f838bb141501a617e49cc7 - initial_input_ast: c6e61d82e8081ec02c9363b22a0b5496a417885254c4e178d21597c39de6d95a initial_ast: 9ed0471710e7c1109adac89e209ea157c5c0cb642661bb24bfd109537159b2e6 - symbol_table: e80a26d28a4f36e79f1a113fc74cfc7bcf32cd54e21ba5af553b738a906de381 diff --git a/tests/expectations/compiler/compiler/integers/u8/xor.out b/tests/expectations/compiler/compiler/integers/u8/xor.out index 45a395edd5..61ac7e22c5 100644 --- a/tests/expectations/compiler/compiler/integers/u8/xor.out +++ b/tests/expectations/compiler/compiler/integers/u8/xor.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: f3f4106ac9259a15289bec28ed917f5781227eb13d1e0eafb3e9f8644727e119 initial_ast: 79255bfd6845fac131d7d3ea97624ef9a0076305ddeb40447e531c38044357d9 - symbol_table: c4247fbbef732ee428ab5b1ba128f332c69a4b368b1e8307540128b64900bbaf diff --git a/tests/expectations/compiler/compiler/mutability/cond_mut.out b/tests/expectations/compiler/compiler/mutability/cond_mut.out index 0ceba7d229..bc847a27a2 100644 --- a/tests/expectations/compiler/compiler/mutability/cond_mut.out +++ b/tests/expectations/compiler/compiler/mutability/cond_mut.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 4450d380390e4b22d69c9b44ee782266384b84ba991347c0f96e8f624d6512e7 initial_ast: 2d05e70558b1a34ac0778929dc306c177ae344de02feca3f1ed7be554f3da944 - symbol_table: 2945f5477f1985cd91fc0238eda0d96ee5b5e064b5579af5e37cb8d676dbc3cb diff --git a/tests/expectations/compiler/compiler/mutability/function_input_mut.out b/tests/expectations/compiler/compiler/mutability/function_input_mut.out index 1403f83cb5..878104cd6d 100644 --- a/tests/expectations/compiler/compiler/mutability/function_input_mut.out +++ b/tests/expectations/compiler/compiler/mutability/function_input_mut.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: f8e3ad3747d61bdfd59afdc58ad9f7bfb6ffba275f9c5f22e12e1607bb06af85 initial_ast: 5647851e72bb49bf865c8025c525333f4ea4751e1b8f9e68b72660aa91e8c435 - symbol_table: 27a1e162691d8e54a3c88d50628e4d865bba598acdc5916aed7edf60d79e68d1 diff --git a/tests/expectations/compiler/compiler/mutability/let_mut_nested.out b/tests/expectations/compiler/compiler/mutability/let_mut_nested.out index 9fc94db05b..1b6a02ce32 100644 --- a/tests/expectations/compiler/compiler/mutability/let_mut_nested.out +++ b/tests/expectations/compiler/compiler/mutability/let_mut_nested.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 0ef14a72e85eff8a241f34061899762d2fee7906cc3505475f0dac47b9458f8a initial_ast: e25b363c3583b46fa1a8e10eef94717ca4b87128c8578a4b44ad344ff113eef8 - symbol_table: 31926a79e803f137c80e1ee8698b50261c831ee6e83f1b09895e3d2c2b09113f diff --git a/tests/expectations/compiler/compiler/records/declaration.out b/tests/expectations/compiler/compiler/records/declaration.out index bedc8d5f3f..d211d59a8e 100644 --- a/tests/expectations/compiler/compiler/records/declaration.out +++ b/tests/expectations/compiler/compiler/records/declaration.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: ed6dbb2a60da9a91da4b3845e3919b0520666cf4d7223e5634e1e8e38dd9243d - symbol_table: c49906bcded430e36886bfabc35c5740e4657ac82761b80b871f6d19ec6d9dda diff --git a/tests/expectations/compiler/compiler/records/init_expression.out b/tests/expectations/compiler/compiler/records/init_expression.out index c16c2e576c..97d133aee1 100644 --- a/tests/expectations/compiler/compiler/records/init_expression.out +++ b/tests/expectations/compiler/compiler/records/init_expression.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: cc9fdc5ee476d5c8930260c5fc50c968915434892180f0084f15cd69b905dc20 - symbol_table: 926c2f494fbb7914574e7b95bedd8992eaf028143e19bebcdcdf474fcb5eb1c5 diff --git a/tests/expectations/compiler/compiler/records/init_expression_shorthand.out b/tests/expectations/compiler/compiler/records/init_expression_shorthand.out index 19d440e4b8..909857c5a5 100644 --- a/tests/expectations/compiler/compiler/records/init_expression_shorthand.out +++ b/tests/expectations/compiler/compiler/records/init_expression_shorthand.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: no input initial_ast: c765de9e29d4ca9bd9ba2f7a5ee72c2e4c8278948d32a6c9a441f5eacde564ea - symbol_table: de1844db50840db6655f51a2903da4287d51c03a6e693843bdd6be95c6d627f8 diff --git a/tests/expectations/compiler/compiler/scalar/add.out b/tests/expectations/compiler/compiler/scalar/add.out index 841cfc2569..9abb7e9862 100644 --- a/tests/expectations/compiler/compiler/scalar/add.out +++ b/tests/expectations/compiler/compiler/scalar/add.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c528268c53f01e78fbbc8af3ed5e0dc1d4e9b9f28644c597167971edef764cf0 initial_ast: 5b3ef7dce7c2ffe2777c5b2a9545daead2f38e2b8707477db03e87faec6da7d2 - symbol_table: 892d93d278cb7a474cdf2dfd4a40294a748165ebeeb47cba6dbee3f31d7fd586 diff --git a/tests/expectations/compiler/compiler/scalar/cmp.out b/tests/expectations/compiler/compiler/scalar/cmp.out index 083136a9e8..b52102aabe 100644 --- a/tests/expectations/compiler/compiler/scalar/cmp.out +++ b/tests/expectations/compiler/compiler/scalar/cmp.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 8b51ce00d3448cda6f763ac1fbc6d14a2588dc0bc0d24eb423b5f417029b28c5 initial_ast: 95590d79b6c281e99c71474d30c610d1f455254ad478a8c12f83e76bb624424e - symbol_table: 240729bf3dd32b0ff548d132bc74bc91e42a8677f98d5fa1e388259e6a407d95 diff --git a/tests/expectations/compiler/compiler/scalar/div.out b/tests/expectations/compiler/compiler/scalar/div.out index 686d8c776b..1974b6032c 100644 --- a/tests/expectations/compiler/compiler/scalar/div.out +++ b/tests/expectations/compiler/compiler/scalar/div.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 3a7c59d773f33e6827986b770fb0a3434917ccb094cab158d5ae8dead74fa8c2 initial_ast: 8cc7803f72770ff9c129a32350e365aa18958bf0ef991cb2a7793075b90da062 - symbol_table: eef6184d8de08329af65525b860dea76d00957bbd099b98cb35cc9e22a5c568c diff --git a/tests/expectations/compiler/compiler/scalar/eq.out b/tests/expectations/compiler/compiler/scalar/eq.out index 765b0d9c9d..ccc78b91bf 100644 --- a/tests/expectations/compiler/compiler/scalar/eq.out +++ b/tests/expectations/compiler/compiler/scalar/eq.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: fbb9f33bc5cf7fd11341e6dc1d12d4899274f3bee34dd64590ffd3c9438a61a5 initial_ast: 110f00451cdf3af4c1befda6c1a97f4b09fa1d1656ac037f225249e3a3e6000e - symbol_table: 08cd46bf33b7d8cc59bb80d5716911598c0479cd25e30e00a1b47b175d8e7c0f diff --git a/tests/expectations/compiler/compiler/scalar/group_mul.out b/tests/expectations/compiler/compiler/scalar/group_mul.out index 265ba25494..82338f84f6 100644 --- a/tests/expectations/compiler/compiler/scalar/group_mul.out +++ b/tests/expectations/compiler/compiler/scalar/group_mul.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: cb1157ee8277e48e0316befc327c4f0504659c2fd64e6efeedb7dcd9722c7a7e initial_ast: e1964446af946d772d62558a03503a43f8ddc7a1c6e517ee30e7305a140c09db - symbol_table: cb5c8eb4006c52c0092effc2219dbd03b90ab1baf39f345f838ada8a57d1158c diff --git a/tests/expectations/compiler/compiler/scalar/mul.out b/tests/expectations/compiler/compiler/scalar/mul.out index 8a752083cb..a264363a5a 100644 --- a/tests/expectations/compiler/compiler/scalar/mul.out +++ b/tests/expectations/compiler/compiler/scalar/mul.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c528268c53f01e78fbbc8af3ed5e0dc1d4e9b9f28644c597167971edef764cf0 initial_ast: 9ebc007363e99914d5b5ab3519ee40d49fabb61db7ae8a68395a5ff25afc3a1a - symbol_table: 1c43e99020a8214e8a0a8ff037a79dc12b597c0801642f5a564e8e4b3e42b679 diff --git a/tests/expectations/compiler/compiler/scalar/operator_methods.out b/tests/expectations/compiler/compiler/scalar/operator_methods.out index 838881530d..6dcdbe210d 100644 --- a/tests/expectations/compiler/compiler/scalar/operator_methods.out +++ b/tests/expectations/compiler/compiler/scalar/operator_methods.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 351e1f9f8fc577b89a037d3e52eddc9c932782274c1b19b090efb266439d7ab5 initial_ast: ad1ba77e3c854d91bfa578b068a35036f3043e8312ebf9c86db6104c4d25e0c9 - symbol_table: 5426ebe4460c12cdb674a3b87e7b244321461d8df75e06bd27c322ab42b92df3 diff --git a/tests/expectations/compiler/compiler/scalar/scalar.out b/tests/expectations/compiler/compiler/scalar/scalar.out index 425e906e8d..25e40a9976 100644 --- a/tests/expectations/compiler/compiler/scalar/scalar.out +++ b/tests/expectations/compiler/compiler/scalar/scalar.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 28228b87fcb43040ca2c4a6c9e6539642323a9f64d837a6de7f579b17ceb1da4 initial_ast: 501cd588698e4c37e5e5f2ed272903f6e2277ec865c059df1a2a4526a35ccfcd - symbol_table: 85a8380cbcefab3e365d6d3f7acbb54125afedb9b8ff98e4513b147ffe0ccf14 diff --git a/tests/expectations/compiler/compiler/scalar/ternary.out b/tests/expectations/compiler/compiler/scalar/ternary.out index 37ce9af0ef..f84108ed64 100644 --- a/tests/expectations/compiler/compiler/scalar/ternary.out +++ b/tests/expectations/compiler/compiler/scalar/ternary.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: fbb9f33bc5cf7fd11341e6dc1d12d4899274f3bee34dd64590ffd3c9438a61a5 initial_ast: 6b5149b93e9b42a66dabf3a1e041f6fa506c41d7c37eb14d7699c33abdac247b - symbol_table: 3044db73279e2416a04d470427a0f319f13ac1dfbe36706b238e1fa2fb068538 diff --git a/tests/expectations/compiler/compiler/statements/all_loops.out b/tests/expectations/compiler/compiler/statements/all_loops.out index 57fd557b01..835fd8db4e 100644 --- a/tests/expectations/compiler/compiler/statements/all_loops.out +++ b/tests/expectations/compiler/compiler/statements/all_loops.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 2f21b4d5dc1058106889da0975de69c33e29bb184dace42559ad3e4da5140d21 initial_ast: 72d72a8e2719419f4fde8b2ef6b4600d9056efe736df419c8c426e9279dfe807 - symbol_table: bcf9d66217a3cbfc92d16af68089c9644a316cfb072e3bfd6bd76b5ccea0fc18 diff --git a/tests/expectations/compiler/compiler/statements/block.out b/tests/expectations/compiler/compiler/statements/block.out index 89a2cd0c6a..15abdae716 100644 --- a/tests/expectations/compiler/compiler/statements/block.out +++ b/tests/expectations/compiler/compiler/statements/block.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 198eb7d80bc19a6592fb460e0cebcbe3f5078d54990fffc59c7df12b184b7f45 initial_ast: cf7ed47dfec89e9218f8ccb717a749c9477392dbfc53de8f32627490312ff7cb - symbol_table: ce729d406fca8cbf2bc8fea55010b163168705232be0ce9edaeff1c187269d54 diff --git a/tests/expectations/compiler/compiler/statements/chain.out b/tests/expectations/compiler/compiler/statements/chain.out index b7f51251b0..7af3db9192 100644 --- a/tests/expectations/compiler/compiler/statements/chain.out +++ b/tests/expectations/compiler/compiler/statements/chain.out @@ -7,4 +7,3 @@ outputs: - initial_input_ast: 96ab541d4a0830d109dd74d3f3bff3b1e50a1ecea05334bb6042b71a6f15cf94 - initial_input_ast: f2d89f71957ad254e7693b39d829d0728443e2fe3a2664295fa83fe97bda12ca initial_ast: 932158cc78956ff54049a8372c266737c8eb0ea98268a818691877412739d59a - symbol_table: 68eae40307674c0cfac9f10f03becf84fbfe9da68c0cac435d54b775e0c4618a diff --git a/tests/expectations/compiler/compiler/statements/compare_diff_types_fail.out b/tests/expectations/compiler/compiler/statements/compare_diff_types_fail.out index 84548bfb70..b752c331a9 100644 --- a/tests/expectations/compiler/compiler/statements/compare_diff_types_fail.out +++ b/tests/expectations/compiler/compiler/statements/compare_diff_types_fail.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: fb915314d9b78be969b79981f55977bf7ef662c72c93184cf0e60788575f763a initial_ast: 0a313845582b4929789b314c5b8ac3f516b1aa01e34f1ec6009c0dc144f92616 - symbol_table: b540c20c8c220bbb4f24673453e69af2ab0a59dc5e885810a45786cf904f7a29 diff --git a/tests/expectations/compiler/compiler/statements/for_loop.out b/tests/expectations/compiler/compiler/statements/for_loop.out index b8f5649e4a..d0836a69dc 100644 --- a/tests/expectations/compiler/compiler/statements/for_loop.out +++ b/tests/expectations/compiler/compiler/statements/for_loop.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: 9fe934b08244cf726123179e290ddfd645bb8b283579741664055ea576b4800f initial_ast: 59e060022eb735e5e9c9391f9da56dd48c463ed1b2c0b14ec89d6db80859d2ac - symbol_table: 69da3b565e7a6a957b957fa0726be3d3f849cd1c71d5d1d5bbbcf1c5620b1c07 diff --git a/tests/expectations/compiler/compiler/statements/iteration_basic.out b/tests/expectations/compiler/compiler/statements/iteration_basic.out index 54c049d1ec..14d5114a54 100644 --- a/tests/expectations/compiler/compiler/statements/iteration_basic.out +++ b/tests/expectations/compiler/compiler/statements/iteration_basic.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: a07781bcb6b37246cd6b048878a0951cc90bb0f2a4fc05e2fb36b0e16928f37f initial_ast: c7a14971408cb0fff82d8c45417c93dfa2d36254b21c1b55610a3527a49f6afe - symbol_table: 210a8b745bd95b8350226242f6b51656f817fadb90c768564b0c6f4f8dcfa706 diff --git a/tests/expectations/compiler/compiler/statements/iteration_variable.out b/tests/expectations/compiler/compiler/statements/iteration_variable.out index a61a8270c4..c24c057927 100644 --- a/tests/expectations/compiler/compiler/statements/iteration_variable.out +++ b/tests/expectations/compiler/compiler/statements/iteration_variable.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: c918ce1ffc15cd823113a571123910dde670829e3fd04a22ca6f3fed8fd16eb4 initial_ast: 3ff81ead4edb3474008c23b7c146d12138cd4c19d3bb6479fe2e45965ea12eb7 - symbol_table: 8b6313fa019dfc473aea778b67ecf00f38110f339c9c0fb416b221994f8f9c7b diff --git a/tests/expectations/compiler/compiler/statements/multiple_returns.out b/tests/expectations/compiler/compiler/statements/multiple_returns.out index 127b6903cc..9193685f78 100644 --- a/tests/expectations/compiler/compiler/statements/multiple_returns.out +++ b/tests/expectations/compiler/compiler/statements/multiple_returns.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 198eb7d80bc19a6592fb460e0cebcbe3f5078d54990fffc59c7df12b184b7f45 - initial_input_ast: e8c168b68e9259dd1cbe1810a54c0523005878e57bbeaa9d4493191347d62fe2 initial_ast: 00624c4b4091d0e5812c3682e44b6973f327a74df02482434edbda0b10f71371 - symbol_table: a57230e14da3882433b1b2f0cfa8abd32f38a6b4bd207fd87fdfbea34fc5e71d diff --git a/tests/expectations/compiler/compiler/statements/mutate.out b/tests/expectations/compiler/compiler/statements/mutate.out index cd50ecef23..afb4371e2b 100644 --- a/tests/expectations/compiler/compiler/statements/mutate.out +++ b/tests/expectations/compiler/compiler/statements/mutate.out @@ -6,4 +6,3 @@ outputs: - initial_input_ast: 1616955974a4cb7c759158043772f241d043e67ed0063818c456aa1fae054b0c - initial_input_ast: 9ebf6d54b77d669ce67d3574d054a2bab06b159b077cb1b30e9014575badbc3b initial_ast: 62081a8f0aba9dae78c9baae1b8333743581880f37eb051147b48789d929551b - symbol_table: 6d82dfb1fcb0a50b6b18e771919dad3622d102b53b63ffa2186bc50bc0aa743c diff --git a/tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.out b/tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.out index ab4d2e1ddf..88c9a9ad9c 100644 --- a/tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.out +++ b/tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.out @@ -5,4 +5,3 @@ outputs: - output: - initial_input_ast: ecc54967dfe1b2c067baa1fe6d2dfababe2a728338906c482b6582c25dd5cb0f initial_ast: 2810ef0ebe18a03a525672e448d6ed0d949fd9f3b2ddaea971f1785537d7ca4b - symbol_table: ea61603fdb0d2d3f9ed43f0b8fd044438c4f662ae0cfb97e95505b741a82ce0b From 9b7d9a96b7f680e72c449ec0c757c015f446ce78 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Wed, 6 Jul 2022 16:16:19 -0700 Subject: [PATCH 09/37] Fmt, clippy --- build.rs | 13 +++++++------ compiler/passes/src/symbol_table/table.rs | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/build.rs b/build.rs index 2bf51d40ab..6bcdcf8f46 100644 --- a/build.rs +++ b/build.rs @@ -43,16 +43,17 @@ fn compare_license_text(path: &Path, expected_lines: &[&str]) { let reader = BufReader::new(file); for (i, (file_line, expected_line)) in reader.lines().zip(expected_lines).enumerate() { - let file_line = file_line.expect(&format!("Can't read line {} in file \"{}\"!", i + 1, path.display())); - - assert!( - &file_line == expected_line, + let file_line = + file_line.unwrap_or_else(|_| panic!("Can't read line {} in file \"{}\"!", i + 1, path.display())); + assert_eq!( + &file_line, + expected_line, "Line {} in file \"{}\" was expected to contain the license text \"{}\", but contains \"{}\" instead! \ Consult the expected license text in \".resources/license_header\"", i + 1, path.display(), expected_line, - file_line, + file_line ); } } @@ -75,7 +76,7 @@ fn check_file_licenses>(path: P) { // Check all files with the ".rs" extension. if entry_type.is_file() && entry.file_name().to_str().unwrap_or("").ends_with(".rs") { - compare_license_text(&entry.path(), &license_lines); + compare_license_text(entry.path(), &license_lines); } } diff --git a/compiler/passes/src/symbol_table/table.rs b/compiler/passes/src/symbol_table/table.rs index 9eec03d92c..31c3b570aa 100644 --- a/compiler/passes/src/symbol_table/table.rs +++ b/compiler/passes/src/symbol_table/table.rs @@ -53,7 +53,7 @@ impl SymbolTable { } else if let Some(existing) = self.circuits.get(&symbol) { match existing.is_record { true => Err(AstError::shadowed_record(symbol, span).into()), - false => Err(AstError::shadowed_circuit(symbol, span).into()) + false => Err(AstError::shadowed_circuit(symbol, span).into()), } } else if let Some(parent) = self.parent.as_ref() { parent.check_shadowing(symbol, span) From 52671c9328ee6226d44f68d1780fc531ce59fcf5 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Wed, 6 Jul 2022 17:10:18 -0700 Subject: [PATCH 10/37] Documentation for SymbolTable pass --- compiler/passes/src/pass.rs | 3 ++- compiler/passes/src/symbol_table/create.rs | 5 +++++ .../src/symbol_table/function_symbol.rs | 5 +++++ compiler/passes/src/symbol_table/mod.rs | 1 + compiler/passes/src/symbol_table/table.rs | 20 ++++++++++++++++--- .../src/symbol_table/variable_symbol.rs | 5 +++++ 6 files changed, 35 insertions(+), 4 deletions(-) diff --git a/compiler/passes/src/pass.rs b/compiler/passes/src/pass.rs index b35445767e..202c112b30 100644 --- a/compiler/passes/src/pass.rs +++ b/compiler/passes/src/pass.rs @@ -14,10 +14,11 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -/// A pass consuming a `Program` and possibly returning an `Ast`. +/// A compiler pass consuming `Self::Input` and returning `Self::Output`. pub trait Pass { type Input; type Output; + /// Runs the compiler pass. fn do_pass(input: Self::Input) -> Self::Output; } diff --git a/compiler/passes/src/symbol_table/create.rs b/compiler/passes/src/symbol_table/create.rs index 059878badd..5a4224ca46 100644 --- a/compiler/passes/src/symbol_table/create.rs +++ b/compiler/passes/src/symbol_table/create.rs @@ -19,8 +19,13 @@ use leo_errors::emitter::Handler; use crate::SymbolTable; +/// A compiler pass during which the `SymbolTable` is created. +/// Note that this pass only creates the initial entries for functions and circuits. +/// The table is populated further during the type checking pass. pub struct CreateSymbolTable<'a> { + /// The `SymbolTable` constructed by this compiler pass. pub(crate) symbol_table: SymbolTable, + /// The error handler. handler: &'a Handler, } diff --git a/compiler/passes/src/symbol_table/function_symbol.rs b/compiler/passes/src/symbol_table/function_symbol.rs index 296b79b1db..8b5b6efad0 100644 --- a/compiler/passes/src/symbol_table/function_symbol.rs +++ b/compiler/passes/src/symbol_table/function_symbol.rs @@ -19,11 +19,16 @@ use leo_span::Span; use crate::SymbolTable; +/// An entry for a function in the symbol table. #[derive(Clone, Debug)] pub struct FunctionSymbol { + /// The index associated with the scope in the parent symbol table. pub(crate) id: usize, + /// The output type of the function. pub(crate) output: Type, + /// The `Span` associated with the function. pub(crate) span: Span, + /// The inputs to the function. pub(crate) input: Vec, } diff --git a/compiler/passes/src/symbol_table/mod.rs b/compiler/passes/src/symbol_table/mod.rs index 7e3f793e38..67353426a1 100644 --- a/compiler/passes/src/symbol_table/mod.rs +++ b/compiler/passes/src/symbol_table/mod.rs @@ -35,6 +35,7 @@ impl<'a> Pass for CreateSymbolTable<'a> { type Input = (&'a Ast, &'a Handler); type Output = Result; + /// Runs the compiler pass. fn do_pass((ast, handler): Self::Input) -> Self::Output { let mut visitor = CreateSymbolTable::new(handler); visitor.visit_program(ast.as_repr()); diff --git a/compiler/passes/src/symbol_table/table.rs b/compiler/passes/src/symbol_table/table.rs index 31c3b570aa..8f94d2f743 100644 --- a/compiler/passes/src/symbol_table/table.rs +++ b/compiler/passes/src/symbol_table/table.rs @@ -29,7 +29,7 @@ pub struct SymbolTable { /// The parent scope if it exists. /// For example if we are in a if block inside a function. pub(crate) parent: Option>, - /// Functions represents the name of each function mapped to the Ast's function definition. + /// Functions represents the name of each function mapped to the AST's function definition. /// This field is populated at a first pass. pub functions: IndexMap, /// Maps circuit names to circuit definitions. @@ -38,13 +38,15 @@ pub struct SymbolTable { /// The variables defined in a scope. /// This field is populated as necessary. pub(crate) variables: IndexMap, - /// The index of the current scope + /// The index of the current scope. pub(crate) scope_index: usize, - /// The subscopes of this scope + /// The sub-scopes of this scope. pub(crate) scopes: Vec>, } impl SymbolTable { + /// Recursively checks if the symbol table contains an entry for the given symbol. + /// Leo does not allow any variable shadowing or overlap between different symbols. pub fn check_shadowing(&self, symbol: Symbol, span: Span) -> Result<()> { if self.variables.contains_key(&symbol) { Err(AstError::shadowed_variable(symbol, span).into()) @@ -62,12 +64,15 @@ impl SymbolTable { } } + /// Returns the current scope index. + /// Increments the scope index. pub fn scope_index(&mut self) -> usize { let index = self.scope_index; self.scope_index += 1; index } + /// Inserts a function into the symbol table. pub fn insert_fn(&mut self, symbol: Symbol, insert: &Function) -> Result<()> { self.check_shadowing(symbol, insert.span)?; let id = self.scope_index(); @@ -76,23 +81,27 @@ impl SymbolTable { Ok(()) } + /// Inserts a circuit into the symbol table. pub fn insert_circuit(&mut self, symbol: Symbol, insert: &Circuit) -> Result<()> { self.check_shadowing(symbol, insert.span)?; self.circuits.insert(symbol, insert.clone()); Ok(()) } + /// Inserts a variable into the symbol table. pub fn insert_variable(&mut self, symbol: Symbol, insert: VariableSymbol) -> Result<()> { self.check_shadowing(symbol, insert.span)?; self.variables.insert(symbol, insert); Ok(()) } + /// Creates a new scope for the block and stores it in the symbol table. pub fn insert_block(&mut self) -> usize { self.scopes.push(RefCell::new(Default::default())); self.scope_index() } + /// Attempts to lookup a function in the symbol table. pub fn lookup_fn(&self, symbol: &Symbol) -> Option<&FunctionSymbol> { if let Some(func) = self.functions.get(symbol) { Some(func) @@ -103,6 +112,7 @@ impl SymbolTable { } } + /// Attempts to lookup a circuit in the symbol table. pub fn lookup_circuit(&self, symbol: &Symbol) -> Option<&Circuit> { if let Some(circ) = self.circuits.get(symbol) { Some(circ) @@ -113,6 +123,7 @@ impl SymbolTable { } } + /// Attempts to lookup a variable in the symbol table. pub fn lookup_variable(&self, symbol: &Symbol) -> Option<&VariableSymbol> { if let Some(var) = self.variables.get(symbol) { Some(var) @@ -141,6 +152,7 @@ impl SymbolTable { } } + /// Returns a mutable reference to the `VariableSymbol` if it exists in the symbol table. pub fn lookup_variable_mut(&mut self, symbol: &Symbol) -> Option<&mut VariableSymbol> { if let Some(var) = self.variables.get_mut(symbol) { Some(var) @@ -151,6 +163,7 @@ impl SymbolTable { } } + /// Returns the scope associated with the function symbol, if it exists in the symbol table. pub fn get_fn_scope(&self, symbol: &Symbol) -> Option<&RefCell> { if let Some(func) = self.functions.get(symbol) { self.scopes.get(func.id) @@ -161,6 +174,7 @@ impl SymbolTable { } } + /// Returns the scope associated with `index`, if it exists in the symbol table. pub fn get_block_scope(&self, index: usize) -> Option<&RefCell> { self.scopes.get(index) } diff --git a/compiler/passes/src/symbol_table/variable_symbol.rs b/compiler/passes/src/symbol_table/variable_symbol.rs index f2e8e01474..733477d69b 100644 --- a/compiler/passes/src/symbol_table/variable_symbol.rs +++ b/compiler/passes/src/symbol_table/variable_symbol.rs @@ -19,6 +19,7 @@ use std::fmt::Display; use leo_ast::{ParamMode, Type}; use leo_span::Span; +/// An enumeration of the different types of declarations. #[derive(Clone, Debug, Eq, PartialEq)] pub enum Declaration { Const, @@ -38,10 +39,14 @@ impl Display for Declaration { } } +/// An entry for a variable in the symbol table. #[derive(Clone, Debug, Eq, PartialEq)] pub struct VariableSymbol { + /// The `Type` of the variable. pub type_: Type, + /// The `Span` associated with the variable. pub span: Span, + /// The type of declaration for the variable. pub declaration: Declaration, } From 3136a6cccae630d132904e848bfc577e18f461fe Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Wed, 6 Jul 2022 17:29:57 -0700 Subject: [PATCH 11/37] Remove TODO --- compiler/passes/src/type_checker/check_program.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/passes/src/type_checker/check_program.rs b/compiler/passes/src/type_checker/check_program.rs index 442528b58f..5db32a1f1c 100644 --- a/compiler/passes/src/type_checker/check_program.rs +++ b/compiler/passes/src/type_checker/check_program.rs @@ -62,8 +62,7 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { } fn visit_circuit(&mut self, input: &'a Circuit) { - // Check for conflicting circuit member names. - // TODO: Do we need this check if this is done in shadowing? + // Check for conflicting circuit/record member names. let mut used = HashSet::new(); if !input.members.iter().all(|member| used.insert(member.name())) { self.handler.emit_err(if input.is_record { From 16fab683e06612749488d522899f8f4faf53de61 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Jul 2022 10:17:30 +0000 Subject: [PATCH 12/37] Bump criterion from 0.3.5 to 0.3.6 Bumps [criterion](https://github.com/bheisler/criterion.rs) from 0.3.5 to 0.3.6. - [Release notes](https://github.com/bheisler/criterion.rs/releases) - [Changelog](https://github.com/bheisler/criterion.rs/blob/master/CHANGELOG.md) - [Commits](https://github.com/bheisler/criterion.rs/compare/0.3.5...0.3.6) --- updated-dependencies: - dependency-name: criterion dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a37382b0bf..0889c936ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -335,6 +335,12 @@ dependencies = [ "rustc_version", ] +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + [[package]] name = "cc" version = "1.0.73" @@ -497,12 +503,12 @@ dependencies = [ [[package]] name = "criterion" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1604dafd25fba2fe2d5895a9da139f8dc9b319a5fe5354ca137cbbce4e178d10" +checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" dependencies = [ "atty", - "cast", + "cast 0.3.0", "clap 2.34.0", "criterion-plot", "csv", @@ -527,7 +533,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57" dependencies = [ - "cast", + "cast 0.2.7", "itertools", ] From f892fe1a57aba1a4d4a237a42d765a35d85368cf Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Thu, 7 Jul 2022 12:20:34 -0700 Subject: [PATCH 13/37] refactor type checker for removal of Copy trait --- Cargo.lock | 1 + compiler/passes/Cargo.toml | 3 + .../src/type_checker/check_expressions.rs | 64 ++-- compiler/passes/src/type_checker/checker.rs | 325 +++++++++++------- examples/hello-world/src/main.leo | 24 +- examples/hello-world/src/token.leo | 23 ++ 6 files changed, 259 insertions(+), 181 deletions(-) create mode 100644 examples/hello-world/src/token.leo diff --git a/Cargo.lock b/Cargo.lock index a37382b0bf..068cc991a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1231,6 +1231,7 @@ name = "leo-passes" version = "1.5.3" dependencies = [ "indexmap", + "itertools", "leo-ast", "leo-core", "leo-errors", diff --git a/compiler/passes/Cargo.toml b/compiler/passes/Cargo.toml index 7da2bfe33d..7f8f5fdd93 100644 --- a/compiler/passes/Cargo.toml +++ b/compiler/passes/Cargo.toml @@ -43,3 +43,6 @@ version = "1.5.3" [dependencies.leo-core] path = "../core" version = "1.5.3" + +[dependencies.itertools] +version = "0.10.3" \ No newline at end of file diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index e72d894bc0..67ff118f22 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -57,9 +57,9 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { fn visit_identifier(&mut self, var: &'a Identifier, expected: &Self::AdditionalInput) -> Self::Output { if let Some(circuit) = self.symbol_table.clone().lookup_circuit(&var.name) { - Some(self.assert_expected_option(Type::Identifier(circuit.identifier), expected, circuit.span())) + Some(self.check_expected_option(Type::Identifier(circuit.identifier), expected, circuit.span())) } else if let Some(var) = self.symbol_table.clone().lookup_variable(&var.name) { - Some(self.assert_expected_option(*var.type_, expected, var.span)) + Some(self.check_expected_option(*var.type_, expected, var.span)) } else { self.handler .emit_err(TypeCheckerError::unknown_sym("variable", var.name, var.span()).into()); @@ -69,9 +69,9 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { fn visit_literal(&mut self, input: &'a LiteralExpression, expected: &Self::AdditionalInput) -> Self::Output { Some(match input { - LiteralExpression::Address(_, _) => self.assert_expected_option(Type::Address, expected, input.span()), - LiteralExpression::Boolean(_, _) => self.assert_expected_option(Type::Boolean, expected, input.span()), - LiteralExpression::Field(_, _) => self.assert_expected_option(Type::Field, expected, input.span()), + LiteralExpression::Address(_, _) => self.check_expected_option(Type::Address, expected, input.span()), + LiteralExpression::Boolean(_, _) => self.check_expected_option(Type::Boolean, expected, input.span()), + LiteralExpression::Field(_, _) => self.check_expected_option(Type::Field, expected, input.span()), LiteralExpression::Integer(type_, str_content, _) => { match type_ { IntegerType::I8 => { @@ -151,11 +151,11 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { .emit_err(TypeCheckerError::invalid_int_value(str_content, "u128", input.span()).into()), _ => {} } - self.assert_expected_option(Type::IntegerType(*type_), expected, input.span()) + self.check_expected_option(Type::IntegerType(*type_), expected, input.span()) } - LiteralExpression::Group(_) => self.assert_expected_option(Type::Group, expected, input.span()), - LiteralExpression::Scalar(_, _) => self.assert_expected_option(Type::Scalar, expected, input.span()), - LiteralExpression::String(_, _) => self.assert_expected_option(Type::String, expected, input.span()), + LiteralExpression::Group(_) => self.check_expected_option(Type::Group, expected, input.span()), + LiteralExpression::Scalar(_, _) => self.check_expected_option(Type::Scalar, expected, input.span()), + LiteralExpression::String(_, _) => self.check_expected_option(Type::String, expected, input.span()), }) } @@ -164,7 +164,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { match input { AccessExpression::AssociatedFunction(access) => { // Check core circuit name and function. - if let Some(core_instruction) = self.assert_core_circuit_call(&access.ty, &access.name) { + if let Some(core_instruction) = self.check_core_circuit_call(&access.ty, &access.name) { // Check num input arguments. if core_instruction.num_args() != access.args.len() { self.handler.emit_err( @@ -190,7 +190,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } // Check return type. - Some(self.assert_expected_option(core_instruction.return_type(), expected, access.span())) + Some(self.check_expected_option(core_instruction.return_type(), expected, access.span())) } else { self.handler .emit_err(TypeCheckerError::invalid_access_expression(access, access.span()).into()); @@ -205,7 +205,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { match input.op { BinaryOperation::And | BinaryOperation::Or | BinaryOperation::Nand | BinaryOperation::Nor => { // Assert equal boolean types. - self.assert_expected_option(Type::Boolean, destination, input.span()); + self.check_expected_option(Type::Boolean, destination, input.span()); let t1 = self.visit_expression(&input.left, destination); let t2 = self.visit_expression(&input.right, destination); @@ -245,12 +245,12 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { // Allow `group` * `scalar` multiplication. match (t1, t2) { (Some(Type::Group), other) => { - self.assert_expected_type(&other, Type::Scalar, input.right.span()); - Some(self.assert_expected_type(destination, Type::Group, input.span())) + self.check_expected_type(&other, Type::Scalar, input.right.span()); + Some(self.check_expected_type(destination, Type::Group, input.span())) } (other, Some(Type::Group)) => { - self.assert_expected_type(&other, Type::Scalar, input.left.span()); - Some(self.assert_expected_type(destination, Type::Group, input.span())) + self.check_expected_type(&other, Type::Scalar, input.left.span()); + Some(self.check_expected_type(destination, Type::Group, input.span())) } (t1, t2) => { // Assert equal field or integer types. @@ -279,17 +279,17 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { // Allow field * field. match (t1, t2) { (Some(Type::Field), type_) => { - self.assert_expected_type(&type_, Type::Field, input.right.span()); - Some(self.assert_expected_type(destination, Type::Field, input.span())) + self.check_expected_type(&type_, Type::Field, input.right.span()); + Some(self.check_expected_type(destination, Type::Field, input.span())) } (type_, Some(Type::Field)) => { - self.assert_expected_type(&type_, Type::Field, input.left.span()); - Some(self.assert_expected_type(destination, Type::Field, input.span())) + self.check_expected_type(&type_, Type::Field, input.left.span()); + Some(self.check_expected_type(destination, Type::Field, input.span())) } (Some(t1), t2) => { // Allow integer t2 magnitude (u8, u16, u32) self.assert_magnitude_type(&t2, input.right.span()); - Some(self.assert_expected_type(destination, t1, input.span())) + Some(self.check_expected_type(destination, t1, input.span())) } (None, t2) => { // Allow integer t2 magnitude (u8, u16, u32) @@ -313,12 +313,12 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { self.assert_int_type(&t1, input.right.span()); } (t1, t2) => { - self.assert_eq_types(t1, t2, input.span()); + self.check_eq_types(&t1, &t2, input.span()); } } // Assert destination is boolean. - Some(self.assert_expected_type(destination, Type::Boolean, input.span())) + Some(self.check_expected_type(destination, Type::Boolean, input.span())) } BinaryOperation::Lt | BinaryOperation::Gt | BinaryOperation::Lte | BinaryOperation::Gte => { // Assert left and right are equal field, scalar, or integer types. @@ -333,19 +333,19 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } (Some(Type::Field), t2) => { // Assert rhs is field. - self.assert_expected_type(&t2, Type::Field, input.left.span()); + self.check_expected_type(&t2, Type::Field, input.left.span()); } (t1, Some(Type::Field)) => { // Assert lhs is field. - self.assert_expected_type(&t1, Type::Field, input.right.span()); + self.check_expected_type(&t1, Type::Field, input.right.span()); } (Some(Type::Scalar), t2) => { // Assert rhs is scalar. - self.assert_expected_type(&t2, Type::Scalar, input.left.span()); + self.check_expected_type(&t2, Type::Scalar, input.left.span()); } (t1, Some(Type::Scalar)) => { // Assert lhs is scalar. - self.assert_expected_type(&t1, Type::Scalar, input.right.span()); + self.check_expected_type(&t1, Type::Scalar, input.right.span()); } (Some(Type::IntegerType(_)), t2) => { // Assert rhs is integer. @@ -361,7 +361,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } // Assert destination is boolean. - Some(self.assert_expected_type(destination, Type::Boolean, input.span())) + Some(self.check_expected_type(destination, Type::Boolean, input.span())) } BinaryOperation::AddWrapped | BinaryOperation::SubWrapped @@ -411,7 +411,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } UnaryOperation::Inverse => { // Assert field type only. - self.assert_expected_type(destination, Type::Field, input.span()); + self.check_expected_type(destination, Type::Field, input.span()); self.visit_expression(&input.receiver, destination) } UnaryOperation::Negate => { @@ -446,7 +446,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } UnaryOperation::Square => { // Assert field type only. - self.assert_expected_type(destination, Type::Field, input.span()); + self.check_expected_type(destination, Type::Field, input.span()); self.visit_expression(&input.receiver, destination) } UnaryOperation::SquareRoot => { @@ -470,7 +470,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { match &*input.function { Expression::Identifier(ident) => { if let Some(func) = self.symbol_table.clone().lookup_fn(ident.name) { - let ret = self.assert_expected_option(func.output, expected, func.span()); + let ret = self.check_expected_option(func.output, expected, func.span()); // Check number of function arguments. if func.input.len() != input.arguments.len() { @@ -510,7 +510,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { ) -> Self::Output { if let Some(circ) = self.symbol_table.clone().lookup_circuit(&input.name.name) { // Check circuit type name. - let ret = self.assert_expected_circuit(circ.identifier, additional, input.name.span()); + let ret = self.check_expected_circuit(circ.identifier, additional, input.name.span()); // Check number of circuit members. if circ.members.len() != input.members.len() { diff --git a/compiler/passes/src/type_checker/checker.rs b/compiler/passes/src/type_checker/checker.rs index 4f8670a997..586a8b74d8 100644 --- a/compiler/passes/src/type_checker/checker.rs +++ b/compiler/passes/src/type_checker/checker.rs @@ -14,13 +14,14 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use indexmap::IndexSet; +use crate::SymbolTable; use leo_ast::{Identifier, IntegerType, Node, Type}; use leo_core::*; use leo_errors::{emitter::Handler, TypeCheckerError}; use leo_span::{Span, Symbol}; -use crate::SymbolTable; +use indexmap::IndexSet; +use itertools::Itertools; pub struct TypeChecker<'a> { pub(crate) symbol_table: &'a mut SymbolTable<'a>, @@ -32,6 +33,18 @@ pub struct TypeChecker<'a> { pub(crate) algorithms_types: IndexSet, } +const ADDRESS_TYPE: Type = Type::Address; + +const BOOLEAN_TYPE: Type = Type::Boolean; + +const FIELD_TYPE: Type = Type::Field; + +const GROUP_TYPE: Type = Type::Group; + +const SCALAR_TYPE: Type = Type::Scalar; + +const STRING_TYPE: Type = Type::String; + const INT_TYPES: [Type; 10] = [ Type::IntegerType(IntegerType::I8), Type::IntegerType(IntegerType::I16), @@ -59,36 +72,6 @@ const MAGNITUDE_TYPES: [Type; 3] = [ Type::IntegerType(IntegerType::U32), ]; -const fn create_type_superset( - subset: [Type; S], - additional: [Type; A], -) -> [Type; O] { - let mut superset: [Type; O] = [Type::IntegerType(IntegerType::U8); O]; - let mut i = 0; - while i < S { - superset[i] = subset[i]; - i += 1; - } - let mut j = 0; - while j < A { - superset[i + j] = additional[j]; - j += 1; - } - superset -} - -const BOOL_INT_TYPES: [Type; 11] = create_type_superset(INT_TYPES, [Type::Boolean]); - -const FIELD_INT_TYPES: [Type; 11] = create_type_superset(INT_TYPES, [Type::Field]); - -const FIELD_GROUP_INT_TYPES: [Type; 12] = create_type_superset(FIELD_INT_TYPES, [Type::Group]); - -const FIELD_GROUP_SCALAR_INT_TYPES: [Type; 13] = create_type_superset(FIELD_GROUP_INT_TYPES, [Type::Scalar]); - -const FIELD_GROUP_TYPES: [Type; 2] = [Type::Field, Type::Group]; - -const FIELD_SCALAR_TYPES: [Type; 2] = [Type::Field, Type::Scalar]; - impl<'a> TypeChecker<'a> { /// Returns a new type checker given a symbol table and error handler. pub fn new(symbol_table: &'a mut SymbolTable<'a>, handler: &'a Handler) -> Self { @@ -108,18 +91,185 @@ impl<'a> TypeChecker<'a> { self.handler.emit_err(err.into()); } - /// Emits an error if the given type conflicts with a core library type. - pub(crate) fn check_ident_type(&self, type_: &Option) { - if let Some(Type::Identifier(ident)) = type_ { - if self.account_types.contains(&ident.name) || self.algorithms_types.contains(&ident.name) { - self.emit_err(TypeCheckerError::core_type_name_conflict(&ident.name, ident.span())); + /// Emits an error if the two given types are not equal. + pub(crate) fn check_eq_types(&self, t1: &Option, t2: &Option, span: Span) { + match (t1, t2) { + (Some(t1), Some(t2)) if t1 != t2 => self.emit_err(TypeCheckerError::type_should_be(t1, t2, span)), + (Some(type_), None) | (None, Some(type_)) => { + self.emit_err(TypeCheckerError::type_should_be("no type", type_, span)) + } + _ => {} + } + } + + /// Emits an error to the handler if the `expected` type is not equal to the `actual` type. + /// Use this method when you know the expected type. + /// `span` should be the location of the expected type. + pub(crate) fn check_expected_type(&mut self, actual: &Option, expected: Type, span: Span) -> Type { + if let Some(actual) = actual { + if !actual.eq_flat(&expected) { + self.emit_err(TypeCheckerError::type_should_be(actual, expected, span)); + } + } + + expected + } + + /// Emits an error to the handler if the `expected` type is not equal to the `actual` type. + /// Use this method when you know the actual type. + pub(crate) fn check_expected_option(&mut self, actual: Type, expected: &Option, span: Span) -> Type { + if let Some(expected) = expected { + if !actual.eq_flat(expected) { + self.emit_err(TypeCheckerError::type_should_be(actual, expected, span)); + } + } + + actual + } + + /// Emits an error to the handler if the given type is invalid. + fn check_type( + &self, + is_valid: impl Fn(&Type) -> bool, + error_string: String, + type_: &Option, + span: Span, + ) { + if let Some(type_) = type_ { + if !is_valid(type_) { + self.emit_err( + TypeCheckerError::expected_one_type_of( + error_string, + type_, + span + ) + ); } } } + /// Emits an error to the error handler if the given type is not equal to any of the expected types. + pub(crate) fn assert_one_of_types(&self, type_: &Option, expected: &[Type], span: Span) { + self.check_type( + | type_: &Type | expected.iter().any(|t: &Type| t == type_), + types_string(expected), + type_, + span + ) + } + + /// Emits an error to the handler if the given type is not an integer. + pub(crate) fn assert_int_type(&self, type_: &Option, span: Span) { + self.check_type( + | type_: &Type | INT_TYPES.contains(type_), + types_string(&INT_TYPES), + type_, + span, + ) + } + + /// Emits an error to the handler if the given type is not a signed integer. + pub(crate) fn assert_signed_int_type(&self, type_: &Option, span: Span) { + self.check_type( + | type_: &Type | SIGNED_INT_TYPES.contains(type_), + types_string(&SIGNED_INT_TYPES), + type_, + span, + ) + } + + /// Emits an error to the handler if the given type is not a magnitude (u8, u16, u32). + pub(crate) fn assert_magnitude_type(&self, type_: &Option, span: Span) { + self.check_type( + | type_: &Type | MAGNITUDE_TYPES.contains(type_), + types_string(&MAGNITUDE_TYPES), + type_, + span, + ) + } + + /// Emits an error to the handler if the given type is not a boolean or an integer. + pub(crate) fn assert_bool_int_type(&self, type_: &Option, span: Span) { + self.check_type( + | type_: &Type | BOOLEAN_TYPE.eq(type_) | INT_TYPES.contains(type_), + format!("{}, {}", BOOLEAN_TYPE, types_string(&INT_TYPES)), + type_, + span, + ) + } + + + /// Emits an error to the handler if the given type is not a field or integer. + pub(crate) fn assert_field_int_type(&self, type_: &Option, span: Span) { + self.check_type( + | type_: &Type | FIELD_TYPE.eq(type_) | INT_TYPES.contains(type_), + format!("{}, {}", FIELD_TYPE, types_string(&INT_TYPES)), + type_, + span, + ) + } + + /// Emits an error to the handler if the given type is not a field or group. + pub(crate) fn assert_field_group_type(&self, type_: &Option, span: Span) { + self.check_type( + | type_: &Type | FIELD_TYPE.eq(type_) | GROUP_TYPE.eq(type_), + format!("{}, {}", FIELD_TYPE, GROUP_TYPE), + type_, + span, + ) + } + + /// Emits an error to the handler if the given type is not a field or scalar. + pub(crate) fn assert_field_scalar_type(&self, type_: &Option, span: Span) { + self.check_type( + | type_: &Type | FIELD_TYPE.eq(type_) | SCALAR_TYPE.eq(type_), + format!("{}, {}", FIELD_TYPE, SCALAR_TYPE), + type_, + span, + ) + } + + /// Emits an error to the handler if the given type is not a field, group, or integer. + pub(crate) fn assert_field_group_int_type(&self, type_: &Option, span: Span) { + self.check_type( + | type_: &Type | + FIELD_TYPE.eq(type_) + | GROUP_TYPE.eq(type_) + | INT_TYPES.contains(type_), + format!( + "{}, {}, {}", + FIELD_TYPE, + GROUP_TYPE, + types_string(&INT_TYPES), + ), + type_, + span, + ) + } + + /// Emits an error to the handler if the given type is not a field, group, scalar or integer. + pub(crate) fn assert_field_group_scalar_int_type(&self, type_: &Option, span: Span) { + self.check_type( + | type_: &Type | + FIELD_TYPE.eq(type_) + | GROUP_TYPE.eq(type_) + | SCALAR_TYPE.eq(type_) + | INT_TYPES.contains(type_), + format!( + "{}, {}, {}, {}", + FIELD_TYPE, + GROUP_TYPE, + SCALAR_TYPE, + types_string(&INT_TYPES), + ), + type_, + span, + ) + } + /// Emits an error if the `circuit` is not a core library circuit. /// Emits an error if the `function` is not supported by the circuit. - pub(crate) fn assert_core_circuit_call(&self, circuit: &Type, function: &Identifier) -> Option { + pub(crate) fn check_core_circuit_call(&self, circuit: &Type, function: &Identifier) -> Option { if let Type::Identifier(ident) = circuit { // Lookup core circuit match CoreInstruction::from_symbols(ident.name, function.name) { @@ -137,19 +287,8 @@ impl<'a> TypeChecker<'a> { None } - /// Emits an error if the two given types are not equal. - pub(crate) fn assert_eq_types(&self, t1: Option, t2: Option, span: Span) { - match (t1, t2) { - (Some(t1), Some(t2)) if t1 != t2 => self.emit_err(TypeCheckerError::type_should_be(t1, t2, span)), - (Some(type_), None) | (None, Some(type_)) => { - self.emit_err(TypeCheckerError::type_should_be("no type", type_, span)) - } - _ => {} - } - } - /// Returns the `circuit` type and emits an error if the `expected` type does not match. - pub(crate) fn assert_expected_circuit(&mut self, circuit: Identifier, expected: &Option, span: Span) -> Type { + pub(crate) fn check_expected_circuit(&mut self, circuit: Identifier, expected: &Option, span: Span) -> Type { if let Some(Type::Identifier(expected)) = expected { if !circuit.matches(expected) { self.emit_err(TypeCheckerError::type_should_be(circuit.name, expected.name, span)); @@ -159,84 +298,16 @@ impl<'a> TypeChecker<'a> { Type::Identifier(circuit) } - /// Returns the given `actual` type and emits an error if the `expected` type does not match. - pub(crate) fn assert_expected_option(&mut self, actual: Type, expected: &Option, span: Span) -> Type { - if let Some(expected) = expected { - if !actual.eq_flat(expected) { - self.emit_err(TypeCheckerError::type_should_be(actual, expected, span)); + /// Emits an error if the given type conflicts with a core library type. + pub(crate) fn check_ident_type(&self, type_: &Option) { // todo: deprecate this method. + if let Some(Type::Identifier(ident)) = type_ { + if self.account_types.contains(&ident.name) || self.algorithms_types.contains(&ident.name) { + self.emit_err(TypeCheckerError::core_type_name_conflict(&ident.name, ident.span())); } } - - actual - } - - /// Returns the given `expected` type and emits an error if the `actual` type does not match. - /// `span` should be the location of the expected type. - pub(crate) fn assert_expected_type(&mut self, actual: &Option, expected: Type, span: Span) -> Type { - if let Some(actual) = actual { - if !actual.eq_flat(&expected) { - self.emit_err(TypeCheckerError::type_should_be(actual, expected, span)); - } - } - - expected - } - - /// Emits an error to the error handler if the given type is not equal to any of the expected types. - pub(crate) fn assert_one_of_types(&self, type_: &Option, expected: &[Type], span: Span) { - if let Some(type_) = type_ { - if !expected.iter().any(|t: &Type| t == type_) { - self.emit_err(TypeCheckerError::expected_one_type_of( - expected.iter().map(|t| t.to_string() + ",").collect::(), - type_, - span, - )); - } - } - } - - /// Emits an error to the handler if the given type is not a boolean or an integer. - pub(crate) fn assert_bool_int_type(&self, type_: &Option, span: Span) { - self.assert_one_of_types(type_, &BOOL_INT_TYPES, span) - } - - /// Emits an error to the handler if the given type is not a field or integer. - pub(crate) fn assert_field_int_type(&self, type_: &Option, span: Span) { - self.assert_one_of_types(type_, &FIELD_INT_TYPES, span) - } - - /// Emits an error to the handler if the given type is not a field or group. - pub(crate) fn assert_field_group_type(&self, type_: &Option, span: Span) { - self.assert_one_of_types(type_, &FIELD_GROUP_TYPES, span) - } - - /// Emits an error to the handler if the given type is not a field or scalar. - pub(crate) fn assert_field_scalar_type(&self, type_: &Option, span: Span) { - self.assert_one_of_types(type_, &FIELD_SCALAR_TYPES, span) - } - - /// Emits an error to the handler if the given type is not a field, group, or integer. - pub(crate) fn assert_field_group_int_type(&self, type_: &Option, span: Span) { - self.assert_one_of_types(type_, &FIELD_GROUP_INT_TYPES, span) - } - - /// Emits an error to the handler if the given type is not a field, group, scalar or integer. - pub(crate) fn assert_field_group_scalar_int_type(&self, type_: &Option, span: Span) { - self.assert_one_of_types(type_, &FIELD_GROUP_SCALAR_INT_TYPES, span) - } - - /// Emits an error to the handler if the given type is not an integer. - pub(crate) fn assert_int_type(&self, type_: &Option, span: Span) { - self.assert_one_of_types(type_, &INT_TYPES, span) - } - - /// Emits an error to the handler if the given type is not a signed integer. - pub(crate) fn assert_signed_int_type(&self, type_: &Option, span: Span) { - self.assert_one_of_types(type_, &SIGNED_INT_TYPES, span) - } - - /// Emits an error to the handler if the given type is not a magnitude (u8, u16, u32). - pub(crate) fn assert_magnitude_type(&self, type_: &Option, span: Span) { - self.assert_one_of_types(type_, &MAGNITUDE_TYPES, span) } } + +fn types_string(types: &[Type]) -> String { + types.iter().map(|type_| type_.to_string()).join(", ") +} \ No newline at end of file diff --git a/examples/hello-world/src/main.leo b/examples/hello-world/src/main.leo index 6bf610a57d..c1e5d41276 100644 --- a/examples/hello-world/src/main.leo +++ b/examples/hello-world/src/main.leo @@ -1,23 +1,3 @@ -record Token { - // The token owner. - owner: address, - // The Aleo balance (in gates). - balance: u64, - // The token amount. - amount: u64, -} - -function mint(owner: address, amount: u64) -> Token { - return Token { - owner, - balance: 0u64, - amount, - }; -} - -function main(x: address) -> u64 { - const c: u64 = 1u64; - let t: Token = mint(x, c); - - return t.balance; +function main() -> (bool, bool) { + return (true, false) } \ No newline at end of file diff --git a/examples/hello-world/src/token.leo b/examples/hello-world/src/token.leo new file mode 100644 index 0000000000..6bf610a57d --- /dev/null +++ b/examples/hello-world/src/token.leo @@ -0,0 +1,23 @@ +record Token { + // The token owner. + owner: address, + // The Aleo balance (in gates). + balance: u64, + // The token amount. + amount: u64, +} + +function mint(owner: address, amount: u64) -> Token { + return Token { + owner, + balance: 0u64, + amount, + }; +} + +function main(x: address) -> u64 { + const c: u64 = 1u64; + let t: Token = mint(x, c); + + return t.balance; +} \ No newline at end of file From b461539ae373942997f0c2b656dddb8658d8e460 Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Thu, 7 Jul 2022 13:22:59 -0700 Subject: [PATCH 14/37] use refactored methods in type checking, regen tests --- .../src/type_checker/check_expressions.rs | 178 ++++++++++-------- compiler/passes/src/type_checker/checker.rs | 98 +++++++--- .../core/algorithms/pedersen_fail.out | 2 +- .../compiler/group/mult_by_group_fail.out | 2 +- .../compare_invalid_negates_fail.out | 2 +- 5 files changed, 175 insertions(+), 107 deletions(-) diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index 67ff118f22..b7d435bedf 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -57,9 +57,9 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { fn visit_identifier(&mut self, var: &'a Identifier, expected: &Self::AdditionalInput) -> Self::Output { if let Some(circuit) = self.symbol_table.clone().lookup_circuit(&var.name) { - Some(self.check_expected_option(Type::Identifier(circuit.identifier), expected, circuit.span())) + Some(self.assert_and_return_type(Type::Identifier(circuit.identifier), expected, circuit.span())) } else if let Some(var) = self.symbol_table.clone().lookup_variable(&var.name) { - Some(self.check_expected_option(*var.type_, expected, var.span)) + Some(self.assert_and_return_type(*var.type_, expected, var.span)) } else { self.handler .emit_err(TypeCheckerError::unknown_sym("variable", var.name, var.span()).into()); @@ -69,9 +69,9 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { fn visit_literal(&mut self, input: &'a LiteralExpression, expected: &Self::AdditionalInput) -> Self::Output { Some(match input { - LiteralExpression::Address(_, _) => self.check_expected_option(Type::Address, expected, input.span()), - LiteralExpression::Boolean(_, _) => self.check_expected_option(Type::Boolean, expected, input.span()), - LiteralExpression::Field(_, _) => self.check_expected_option(Type::Field, expected, input.span()), + LiteralExpression::Address(_, _) => self.assert_and_return_type(Type::Address, expected, input.span()), + LiteralExpression::Boolean(_, _) => self.assert_and_return_type(Type::Boolean, expected, input.span()), + LiteralExpression::Field(_, _) => self.assert_and_return_type(Type::Field, expected, input.span()), LiteralExpression::Integer(type_, str_content, _) => { match type_ { IntegerType::I8 => { @@ -151,11 +151,11 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { .emit_err(TypeCheckerError::invalid_int_value(str_content, "u128", input.span()).into()), _ => {} } - self.check_expected_option(Type::IntegerType(*type_), expected, input.span()) + self.assert_and_return_type(Type::IntegerType(*type_), expected, input.span()) } - LiteralExpression::Group(_) => self.check_expected_option(Type::Group, expected, input.span()), - LiteralExpression::Scalar(_, _) => self.check_expected_option(Type::Scalar, expected, input.span()), - LiteralExpression::String(_, _) => self.check_expected_option(Type::String, expected, input.span()), + LiteralExpression::Group(_) => self.assert_and_return_type(Type::Group, expected, input.span()), + LiteralExpression::Scalar(_, _) => self.assert_and_return_type(Type::Scalar, expected, input.span()), + LiteralExpression::String(_, _) => self.assert_and_return_type(Type::String, expected, input.span()), }) } @@ -190,7 +190,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } // Check return type. - Some(self.check_expected_option(core_instruction.return_type(), expected, access.span())) + Some(self.assert_and_return_type(core_instruction.return_type(), expected, access.span())) } else { self.handler .emit_err(TypeCheckerError::invalid_access_expression(access, access.span()).into()); @@ -204,15 +204,15 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { fn visit_binary(&mut self, input: &'a BinaryExpression, destination: &Self::AdditionalInput) -> Self::Output { match input.op { BinaryOperation::And | BinaryOperation::Or | BinaryOperation::Nand | BinaryOperation::Nor => { - // Assert equal boolean types. - self.check_expected_option(Type::Boolean, destination, input.span()); + // Only boolean types. + self.assert_bool_type(destination, input.span()); let t1 = self.visit_expression(&input.left, destination); let t2 = self.visit_expression(&input.right, destination); return_incorrect_type(t1, t2, destination) } BinaryOperation::BitwiseAnd | BinaryOperation::BitwiseOr | BinaryOperation::Xor => { - // Assert equal boolean or integer types. + // Only boolean or integer types. self.assert_bool_int_type(destination, input.span()); let t1 = self.visit_expression(&input.left, destination); let t2 = self.visit_expression(&input.right, destination); @@ -220,7 +220,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { return_incorrect_type(t1, t2, destination) } BinaryOperation::Add => { - // Assert equal field, group, scalar, or integer types. + // Only field, group, scalar, or integer types. self.assert_field_group_scalar_int_type(destination, input.span()); let t1 = self.visit_expression(&input.left, destination); let t2 = self.visit_expression(&input.right, destination); @@ -228,7 +228,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { return_incorrect_type(t1, t2, destination) } BinaryOperation::Sub => { - // Assert equal field, group, or integer types. + // Only field, group, or integer types. self.assert_field_group_int_type(destination, input.span()); let t1 = self.visit_expression(&input.left, destination); let t2 = self.visit_expression(&input.right, destination); @@ -236,24 +236,34 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { return_incorrect_type(t1, t2, destination) } BinaryOperation::Mul => { - // Assert field, group or integer types. + // Operation returns field, group or integer types. self.assert_field_group_int_type(destination, input.span()); let t1 = self.visit_expression(&input.left, &None); let t2 = self.visit_expression(&input.right, &None); - // Allow `group` * `scalar` multiplication. + // Allow group * scalar multiplication. match (t1, t2) { - (Some(Type::Group), other) => { - self.check_expected_type(&other, Type::Scalar, input.right.span()); - Some(self.check_expected_type(destination, Type::Group, input.span())) + (Some(Type::Group), right) => { + // Right type must be scalar. + self.assert_scalar_type(&right, input.right.span()); + + // Operation returns group. + self.assert_group_type(destination, input.span()); + + Some(Type::Group) } - (other, Some(Type::Group)) => { - self.check_expected_type(&other, Type::Scalar, input.left.span()); - Some(self.check_expected_type(destination, Type::Group, input.span())) + (left, Some(Type::Group)) => { + // Left must be scalar. + self.assert_scalar_type(&left, input.left.span()); + + // Operation returns group. + self.assert_group_type(destination, input.span()); + + Some(Type::Group) } (t1, t2) => { - // Assert equal field or integer types. + // Otherwise, only field or integer types. self.assert_field_int_type(destination, input.span()); return_incorrect_type(t1, t2, destination) @@ -261,7 +271,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } } BinaryOperation::Div => { - // Assert equal field or integer types. + // Only field or integer types. self.assert_field_int_type(destination, input.span()); let t1 = self.visit_expression(&input.left, destination); @@ -270,7 +280,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { return_incorrect_type(t1, t2, destination) } BinaryOperation::Pow => { - // Assert field or integer types. + // Operation returns field or integer types. self.assert_field_int_type(destination, input.span()); let t1 = self.visit_expression(&input.left, &None); @@ -278,21 +288,37 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { // Allow field * field. match (t1, t2) { - (Some(Type::Field), type_) => { - self.check_expected_type(&type_, Type::Field, input.right.span()); - Some(self.check_expected_type(destination, Type::Field, input.span())) + (Some(Type::Field), right) => { + // Right must be field. + self.assert_field_type(&right, input.right.span()); + + // Operation returns field. + self.assert_field_type(destination, input.span()); + + Some(Type::Field) } - (type_, Some(Type::Field)) => { - self.check_expected_type(&type_, Type::Field, input.left.span()); - Some(self.check_expected_type(destination, Type::Field, input.span())) + (left, Some(Type::Field)) => { + // Left must be field. + self.assert_field_type(&left, input.left.span()); + + // Operation returns field. + self.assert_field_type(destination, input.span()); + + Some(Type::Field) } - (Some(t1), t2) => { - // Allow integer t2 magnitude (u8, u16, u32) - self.assert_magnitude_type(&t2, input.right.span()); - Some(self.check_expected_type(destination, t1, input.span())) + (Some(left), right) => { + // Left type is checked to be an integer by above. + // Right type must be magnitude (u8, u16, u32). + self.assert_magnitude_type(&right, input.right.span()); + + // Operation returns left type. + self.assert_type(destination, &left, input.span()); + + Some(left) } (None, t2) => { - // Allow integer t2 magnitude (u8, u16, u32) + // Lhs type is checked to be an integer by above. + // Rhs type must be magnitude (u8, u16, u32). self.assert_magnitude_type(&t2, input.right.span()); *destination } @@ -305,11 +331,11 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { match (t1, t2) { (Some(Type::IntegerType(_)), t2) => { - // Assert rhs is integer. + // Check rhs is integer and give detailed error message. self.assert_int_type(&t2, input.left.span()); } (t1, Some(Type::IntegerType(_))) => { - // Assert lhs is integer. + // Check lhs is integer and give detailed error message. self.assert_int_type(&t1, input.right.span()); } (t1, t2) => { @@ -317,8 +343,10 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } } - // Assert destination is boolean. - Some(self.check_expected_type(destination, Type::Boolean, input.span())) + // Operation returns a boolean. + self.assert_bool_type(destination, input.span()); + + Some(Type::Boolean) } BinaryOperation::Lt | BinaryOperation::Gt | BinaryOperation::Lte | BinaryOperation::Gte => { // Assert left and right are equal field, scalar, or integer types. @@ -333,41 +361,43 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } (Some(Type::Field), t2) => { // Assert rhs is field. - self.check_expected_type(&t2, Type::Field, input.left.span()); + self.assert_field_type(&t2, input.right.span()); } (t1, Some(Type::Field)) => { // Assert lhs is field. - self.check_expected_type(&t1, Type::Field, input.right.span()); + self.assert_field_type(&t1, input.left.span()); } (Some(Type::Scalar), t2) => { // Assert rhs is scalar. - self.check_expected_type(&t2, Type::Scalar, input.left.span()); + self.assert_scalar_type(&t2, input.right.span()); } (t1, Some(Type::Scalar)) => { // Assert lhs is scalar. - self.check_expected_type(&t1, Type::Scalar, input.right.span()); + self.assert_scalar_type(&t1, input.left.span()); } (Some(Type::IntegerType(_)), t2) => { // Assert rhs is integer. - self.assert_int_type(&t2, input.left.span()); + self.assert_int_type(&t2, input.right.span()); } (t1, Some(Type::IntegerType(_))) => { // Assert lhs is integer. - self.assert_int_type(&t1, input.right.span()); + self.assert_int_type(&t1, input.left.span()); } (_, _) => { // Not enough info to assert type. } } - // Assert destination is boolean. - Some(self.check_expected_type(destination, Type::Boolean, input.span())) + // Operation returns a boolean. + self.assert_bool_type(destination, input.span()); + + Some(Type::Boolean) } BinaryOperation::AddWrapped | BinaryOperation::SubWrapped | BinaryOperation::DivWrapped | BinaryOperation::MulWrapped => { - // Assert equal integer types. + // Only integer types. self.assert_int_type(destination, input.span); let t1 = self.visit_expression(&input.left, destination); let t2 = self.visit_expression(&input.right, destination); @@ -379,12 +409,14 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { | BinaryOperation::Shr | BinaryOperation::ShrWrapped | BinaryOperation::PowWrapped => { - // Assert left and destination are equal integer types. - self.assert_int_type(destination, input.span); let t1 = self.visit_expression(&input.left, destination); + let t2 = self.visit_expression(&input.right, &None); + + // Assert left and destination are equal integer types. + self.assert_int_type(&t1, input.left.span()); + self.assert_int_type(destination, input.span); // Assert right type is a magnitude (u8, u16, u32). - let t2 = self.visit_expression(&input.right, &None); self.assert_magnitude_type(&t2, input.right.span()); return_incorrect_type(t1, t2, destination) @@ -395,23 +427,23 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { fn visit_unary(&mut self, input: &'a UnaryExpression, destination: &Self::AdditionalInput) -> Self::Output { match input.op { UnaryOperation::Abs => { - // Assert integer type only. + // Only signed integer types. self.assert_signed_int_type(destination, input.span()); self.visit_expression(&input.receiver, destination) } UnaryOperation::AbsWrapped => { - // Assert integer type only. + // Only signed integer types. self.assert_signed_int_type(destination, input.span()); self.visit_expression(&input.receiver, destination) } UnaryOperation::Double => { - // Assert field and group type only. + // Only field or group types. self.assert_field_group_type(destination, input.span()); self.visit_expression(&input.receiver, destination) } UnaryOperation::Inverse => { - // Assert field type only. - self.check_expected_type(destination, Type::Field, input.span()); + // Only field types. + self.assert_field_type(destination, input.span()); self.visit_expression(&input.receiver, destination) } UnaryOperation::Negate => { @@ -420,37 +452,23 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { let type_ = self.visit_expression(&input.receiver, destination); self.negate = prior_negate_state; - match type_.as_ref() { - Some( - Type::IntegerType( - IntegerType::I8 - | IntegerType::I16 - | IntegerType::I32 - | IntegerType::I64 - | IntegerType::I128, - ) - | Type::Field - | Type::Group, - ) => {} - Some(t) => self - .handler - .emit_err(TypeCheckerError::type_is_not_negatable(t, input.receiver.span()).into()), - _ => {} - }; + + // Only field, group, or signed integer types. + self.assert_field_group_signed_int_type(&type_, input.receiver.span()); type_ } UnaryOperation::Not => { - // Assert boolean, integer types only. + // Only boolean or integer types. self.assert_bool_int_type(destination, input.span()); self.visit_expression(&input.receiver, destination) } UnaryOperation::Square => { - // Assert field type only. - self.check_expected_type(destination, Type::Field, input.span()); + // Only field type. + self.assert_field_type(destination, input.span()); self.visit_expression(&input.receiver, destination) } UnaryOperation::SquareRoot => { - // Assert field or scalar type. + // Only field or scalar type. self.assert_field_scalar_type(destination, input.span()); self.visit_expression(&input.receiver, destination) } @@ -470,7 +488,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { match &*input.function { Expression::Identifier(ident) => { if let Some(func) = self.symbol_table.clone().lookup_fn(ident.name) { - let ret = self.check_expected_option(func.output, expected, func.span()); + let ret = self.assert_and_return_type(func.output, expected, func.span()); // Check number of function arguments. if func.input.len() != input.arguments.len() { diff --git a/compiler/passes/src/type_checker/checker.rs b/compiler/passes/src/type_checker/checker.rs index 586a8b74d8..0f8944c6e0 100644 --- a/compiler/passes/src/type_checker/checker.rs +++ b/compiler/passes/src/type_checker/checker.rs @@ -33,8 +33,6 @@ pub struct TypeChecker<'a> { pub(crate) algorithms_types: IndexSet, } -const ADDRESS_TYPE: Type = Type::Address; - const BOOLEAN_TYPE: Type = Type::Boolean; const FIELD_TYPE: Type = Type::Field; @@ -43,8 +41,6 @@ const GROUP_TYPE: Type = Type::Group; const SCALAR_TYPE: Type = Type::Scalar; -const STRING_TYPE: Type = Type::String; - const INT_TYPES: [Type; 10] = [ Type::IntegerType(IntegerType::I8), Type::IntegerType(IntegerType::I16), @@ -102,22 +98,9 @@ impl<'a> TypeChecker<'a> { } } - /// Emits an error to the handler if the `expected` type is not equal to the `actual` type. - /// Use this method when you know the expected type. - /// `span` should be the location of the expected type. - pub(crate) fn check_expected_type(&mut self, actual: &Option, expected: Type, span: Span) -> Type { - if let Some(actual) = actual { - if !actual.eq_flat(&expected) { - self.emit_err(TypeCheckerError::type_should_be(actual, expected, span)); - } - } - - expected - } - - /// Emits an error to the handler if the `expected` type is not equal to the `actual` type. /// Use this method when you know the actual type. - pub(crate) fn check_expected_option(&mut self, actual: Type, expected: &Option, span: Span) -> Type { + /// Emits an error to the handler if the `actual` type is not equal to the `expected` type. + pub(crate) fn assert_and_return_type(&mut self, actual: Type, expected: &Option, span: Span) -> Type { if let Some(expected) = expected { if !actual.eq_flat(expected) { self.emit_err(TypeCheckerError::type_should_be(actual, expected, span)); @@ -147,17 +130,66 @@ impl<'a> TypeChecker<'a> { } } } - - /// Emits an error to the error handler if the given type is not equal to any of the expected types. - pub(crate) fn assert_one_of_types(&self, type_: &Option, expected: &[Type], span: Span) { + /// Emits an error to the error handler if the `actual` type is not equal to the `expected` type. + pub(crate) fn assert_type(&self, actual: &Option, expected: &Type, span: Span) { self.check_type( - | type_: &Type | expected.iter().any(|t: &Type| t == type_), + | actual: &Type | actual.eq_flat(expected), + expected.to_string(), + actual, + span, + ) + } + + /// Emits an error to the error handler if the actual type is not equal to any of the expected types. + pub(crate) fn assert_one_of_types(&self, actual: &Option, expected: &[Type], span: Span) { + self.check_type( + | actual: &Type | expected.iter().any(|t: &Type| t == actual), types_string(expected), - type_, + actual, span ) } + /// Emits an error to the handler if the given type is not a boolean. + pub(crate) fn assert_bool_type(&self, type_: &Option, span: Span) { + self.check_type( + | type_: &Type | BOOLEAN_TYPE.eq(type_), + BOOLEAN_TYPE.to_string(), + type_, + span, + ) + } + + /// Emits an error to the handler if the given type is not a field. + pub(crate) fn assert_field_type(&self, type_: &Option, span: Span) { + self.check_type( + | type_: &Type | FIELD_TYPE.eq(type_), + FIELD_TYPE.to_string(), + type_, + span, + ) + } + + /// Emits an error to the handler if the given type is not a group. + pub(crate) fn assert_group_type(&self, type_: &Option, span: Span) { + self.check_type( + | type_: &Type | GROUP_TYPE.eq(type_), + GROUP_TYPE.to_string(), + type_, + span, + ) + } + + /// Emits an error to the handler if the given type is not a scalar. + pub(crate) fn assert_scalar_type(&self, type_: &Option, span: Span) { + self.check_type( + | type_: &Type | SCALAR_TYPE.eq(type_), + SCALAR_TYPE.to_string(), + type_, + span, + ) + } + /// Emits an error to the handler if the given type is not an integer. pub(crate) fn assert_int_type(&self, type_: &Option, span: Span) { self.check_type( @@ -247,6 +279,24 @@ impl<'a> TypeChecker<'a> { ) } + /// Emits an error to the handler if the given type is not a field, group, or signed integer. + pub(crate) fn assert_field_group_signed_int_type(&self, type_: &Option, span: Span) { + self.check_type( + | type_: &Type | + FIELD_TYPE.eq(type_) + | GROUP_TYPE.eq(type_) + | SIGNED_INT_TYPES.contains(type_), + format!( + "{}, {}, {}", + FIELD_TYPE, + GROUP_TYPE, + types_string(&SIGNED_INT_TYPES), + ), + type_, + span, + ) + } + /// Emits an error to the handler if the given type is not a field, group, scalar or integer. pub(crate) fn assert_field_group_scalar_int_type(&self, type_: &Option, span: Span) { self.check_type( diff --git a/tests/expectations/compiler/compiler/core/algorithms/pedersen_fail.out b/tests/expectations/compiler/compiler/core/algorithms/pedersen_fail.out index ae1fb43b72..ddc453388c 100644 --- a/tests/expectations/compiler/compiler/core/algorithms/pedersen_fail.out +++ b/tests/expectations/compiler/compiler/core/algorithms/pedersen_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372009]: Expected one type from `bool,i8,i16,i32,i64,u8,u16,u32,u64,string,`, but got `u128`\n --> compiler-test:4:20\n |\n 4 | let a: group = Pedersen64::hash(1u128);\n | ^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Error [ETYC0372009]: Expected one type from `bool, i8, i16, i32, i64, u8, u16, u32, u64, string`, but got `u128`\n --> compiler-test:4:20\n |\n 4 | let a: group = Pedersen64::hash(1u128);\n | ^^^^^^^^^^^^^^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/compiler/group/mult_by_group_fail.out b/tests/expectations/compiler/compiler/group/mult_by_group_fail.out index d0d4ed45ed..3628b19006 100644 --- a/tests/expectations/compiler/compiler/group/mult_by_group_fail.out +++ b/tests/expectations/compiler/compiler/group/mult_by_group_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372003]: Found type `group` but type `scalar` was expected\n --> compiler-test:4:26\n |\n 4 | return (_, _)group * a;\n | ^\n" + - "Error [ETYC0372009]: Expected one type from `scalar`, but got `group`\n --> compiler-test:4:26\n |\n 4 | return (_, _)group * a;\n | ^\n" diff --git a/tests/expectations/compiler/compiler/statements/compare_invalid_negates_fail.out b/tests/expectations/compiler/compiler/statements/compare_invalid_negates_fail.out index b6d2d7b4ad..36b5cb8ee9 100644 --- a/tests/expectations/compiler/compiler/statements/compare_invalid_negates_fail.out +++ b/tests/expectations/compiler/compiler/statements/compare_invalid_negates_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372007]: The type `u8` is not negatable\n --> compiler-test:4:20\n |\n 4 | let b: bool = -a == -1u8;\n | ^\nError [ETYC0372007]: The type `u8` is not negatable\n --> compiler-test:4:26\n |\n 4 | let b: bool = -a == -1u8;\n | ^^^\nError [ETYC0372007]: The type `u8` is not negatable\n --> compiler-test:5:20\n |\n 5 | let c: bool = -a > -1u8;\n | ^\nError [ETYC0372007]: The type `u8` is not negatable\n --> compiler-test:5:25\n |\n 5 | let c: bool = -a > -1u8;\n | ^^^\nError [ETYC0372007]: The type `u8` is not negatable\n --> compiler-test:6:20\n |\n 6 | let d: bool = -a < -1u8;\n | ^\nError [ETYC0372007]: The type `u8` is not negatable\n --> compiler-test:6:25\n |\n 6 | let d: bool = -a < -1u8;\n | ^^^\nError [ETYC0372007]: The type `u8` is not negatable\n --> compiler-test:7:20\n |\n 7 | let e: bool = -a >= -1u8;\n | ^\nError [ETYC0372007]: The type `u8` is not negatable\n --> compiler-test:7:26\n |\n 7 | let e: bool = -a >= -1u8;\n | ^^^\nError [ETYC0372007]: The type `u8` is not negatable\n --> compiler-test:8:20\n |\n 8 | let f: bool = -a <= -1u8;\n | ^\nError [ETYC0372007]: The type `u8` is not negatable\n --> compiler-test:8:26\n |\n 8 | let f: bool = -a <= -1u8;\n | ^^^\nError [ETYC0372007]: The type `u8` is not negatable\n --> compiler-test:9:18\n |\n 9 | let g: u8 = -a * -1u8;\n | ^\nError [ETYC0372007]: The type `u8` is not negatable\n --> compiler-test:9:23\n |\n 9 | let g: u8 = -a * -1u8;\n | ^^^\nError [ETYC0372007]: The type `u8` is not negatable\n --> compiler-test:10:18\n |\n 10 | let h: u8 = -a ** -1u8;\n | ^\nError [ETYC0372007]: The type `u8` is not negatable\n --> compiler-test:10:24\n |\n 10 | let h: u8 = -a ** -1u8;\n | ^^^\n" + - "Error [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:4:20\n |\n 4 | let b: bool = -a == -1u8;\n | ^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:4:26\n |\n 4 | let b: bool = -a == -1u8;\n | ^^^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:5:20\n |\n 5 | let c: bool = -a > -1u8;\n | ^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:5:25\n |\n 5 | let c: bool = -a > -1u8;\n | ^^^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:6:20\n |\n 6 | let d: bool = -a < -1u8;\n | ^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:6:25\n |\n 6 | let d: bool = -a < -1u8;\n | ^^^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:7:20\n |\n 7 | let e: bool = -a >= -1u8;\n | ^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:7:26\n |\n 7 | let e: bool = -a >= -1u8;\n | ^^^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:8:20\n |\n 8 | let f: bool = -a <= -1u8;\n | ^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:8:26\n |\n 8 | let f: bool = -a <= -1u8;\n | ^^^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:9:18\n |\n 9 | let g: u8 = -a * -1u8;\n | ^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:9:23\n |\n 9 | let g: u8 = -a * -1u8;\n | ^^^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:10:18\n |\n 10 | let h: u8 = -a ** -1u8;\n | ^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:10:24\n |\n 10 | let h: u8 = -a ** -1u8;\n | ^^^\n" From 4d809e82a6331c9aff24e25ed58a85602fe5631b Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Thu, 7 Jul 2022 15:17:59 -0700 Subject: [PATCH 15/37] cargo fmt --- compiler/passes/src/type_checker/checker.rs | 108 ++++++-------------- 1 file changed, 34 insertions(+), 74 deletions(-) diff --git a/compiler/passes/src/type_checker/checker.rs b/compiler/passes/src/type_checker/checker.rs index 0f8944c6e0..614c6ae5bd 100644 --- a/compiler/passes/src/type_checker/checker.rs +++ b/compiler/passes/src/type_checker/checker.rs @@ -111,29 +111,17 @@ impl<'a> TypeChecker<'a> { } /// Emits an error to the handler if the given type is invalid. - fn check_type( - &self, - is_valid: impl Fn(&Type) -> bool, - error_string: String, - type_: &Option, - span: Span, - ) { + fn check_type(&self, is_valid: impl Fn(&Type) -> bool, error_string: String, type_: &Option, span: Span) { if let Some(type_) = type_ { if !is_valid(type_) { - self.emit_err( - TypeCheckerError::expected_one_type_of( - error_string, - type_, - span - ) - ); + self.emit_err(TypeCheckerError::expected_one_type_of(error_string, type_, span)); } } } /// Emits an error to the error handler if the `actual` type is not equal to the `expected` type. pub(crate) fn assert_type(&self, actual: &Option, expected: &Type, span: Span) { self.check_type( - | actual: &Type | actual.eq_flat(expected), + |actual: &Type| actual.eq_flat(expected), expected.to_string(), actual, span, @@ -143,17 +131,17 @@ impl<'a> TypeChecker<'a> { /// Emits an error to the error handler if the actual type is not equal to any of the expected types. pub(crate) fn assert_one_of_types(&self, actual: &Option, expected: &[Type], span: Span) { self.check_type( - | actual: &Type | expected.iter().any(|t: &Type| t == actual), - types_string(expected), + |actual: &Type| expected.iter().any(|t: &Type| t == actual), + types_to_string(expected), actual, - span + span, ) } /// Emits an error to the handler if the given type is not a boolean. pub(crate) fn assert_bool_type(&self, type_: &Option, span: Span) { self.check_type( - | type_: &Type | BOOLEAN_TYPE.eq(type_), + |type_: &Type| BOOLEAN_TYPE.eq(type_), BOOLEAN_TYPE.to_string(), type_, span, @@ -162,28 +150,18 @@ impl<'a> TypeChecker<'a> { /// Emits an error to the handler if the given type is not a field. pub(crate) fn assert_field_type(&self, type_: &Option, span: Span) { - self.check_type( - | type_: &Type | FIELD_TYPE.eq(type_), - FIELD_TYPE.to_string(), - type_, - span, - ) + self.check_type(|type_: &Type| FIELD_TYPE.eq(type_), FIELD_TYPE.to_string(), type_, span) } /// Emits an error to the handler if the given type is not a group. pub(crate) fn assert_group_type(&self, type_: &Option, span: Span) { - self.check_type( - | type_: &Type | GROUP_TYPE.eq(type_), - GROUP_TYPE.to_string(), - type_, - span, - ) + self.check_type(|type_: &Type| GROUP_TYPE.eq(type_), GROUP_TYPE.to_string(), type_, span) } /// Emits an error to the handler if the given type is not a scalar. pub(crate) fn assert_scalar_type(&self, type_: &Option, span: Span) { self.check_type( - | type_: &Type | SCALAR_TYPE.eq(type_), + |type_: &Type| SCALAR_TYPE.eq(type_), SCALAR_TYPE.to_string(), type_, span, @@ -193,8 +171,8 @@ impl<'a> TypeChecker<'a> { /// Emits an error to the handler if the given type is not an integer. pub(crate) fn assert_int_type(&self, type_: &Option, span: Span) { self.check_type( - | type_: &Type | INT_TYPES.contains(type_), - types_string(&INT_TYPES), + |type_: &Type| INT_TYPES.contains(type_), + types_to_string(&INT_TYPES), type_, span, ) @@ -203,8 +181,8 @@ impl<'a> TypeChecker<'a> { /// Emits an error to the handler if the given type is not a signed integer. pub(crate) fn assert_signed_int_type(&self, type_: &Option, span: Span) { self.check_type( - | type_: &Type | SIGNED_INT_TYPES.contains(type_), - types_string(&SIGNED_INT_TYPES), + |type_: &Type| SIGNED_INT_TYPES.contains(type_), + types_to_string(&SIGNED_INT_TYPES), type_, span, ) @@ -213,8 +191,8 @@ impl<'a> TypeChecker<'a> { /// Emits an error to the handler if the given type is not a magnitude (u8, u16, u32). pub(crate) fn assert_magnitude_type(&self, type_: &Option, span: Span) { self.check_type( - | type_: &Type | MAGNITUDE_TYPES.contains(type_), - types_string(&MAGNITUDE_TYPES), + |type_: &Type| MAGNITUDE_TYPES.contains(type_), + types_to_string(&MAGNITUDE_TYPES), type_, span, ) @@ -223,19 +201,18 @@ impl<'a> TypeChecker<'a> { /// Emits an error to the handler if the given type is not a boolean or an integer. pub(crate) fn assert_bool_int_type(&self, type_: &Option, span: Span) { self.check_type( - | type_: &Type | BOOLEAN_TYPE.eq(type_) | INT_TYPES.contains(type_), - format!("{}, {}", BOOLEAN_TYPE, types_string(&INT_TYPES)), + |type_: &Type| BOOLEAN_TYPE.eq(type_) | INT_TYPES.contains(type_), + format!("{}, {}", BOOLEAN_TYPE, types_to_string(&INT_TYPES)), type_, span, ) } - /// Emits an error to the handler if the given type is not a field or integer. pub(crate) fn assert_field_int_type(&self, type_: &Option, span: Span) { self.check_type( - | type_: &Type | FIELD_TYPE.eq(type_) | INT_TYPES.contains(type_), - format!("{}, {}", FIELD_TYPE, types_string(&INT_TYPES)), + |type_: &Type| FIELD_TYPE.eq(type_) | INT_TYPES.contains(type_), + format!("{}, {}", FIELD_TYPE, types_to_string(&INT_TYPES)), type_, span, ) @@ -244,7 +221,7 @@ impl<'a> TypeChecker<'a> { /// Emits an error to the handler if the given type is not a field or group. pub(crate) fn assert_field_group_type(&self, type_: &Option, span: Span) { self.check_type( - | type_: &Type | FIELD_TYPE.eq(type_) | GROUP_TYPE.eq(type_), + |type_: &Type| FIELD_TYPE.eq(type_) | GROUP_TYPE.eq(type_), format!("{}, {}", FIELD_TYPE, GROUP_TYPE), type_, span, @@ -254,7 +231,7 @@ impl<'a> TypeChecker<'a> { /// Emits an error to the handler if the given type is not a field or scalar. pub(crate) fn assert_field_scalar_type(&self, type_: &Option, span: Span) { self.check_type( - | type_: &Type | FIELD_TYPE.eq(type_) | SCALAR_TYPE.eq(type_), + |type_: &Type| FIELD_TYPE.eq(type_) | SCALAR_TYPE.eq(type_), format!("{}, {}", FIELD_TYPE, SCALAR_TYPE), type_, span, @@ -264,16 +241,8 @@ impl<'a> TypeChecker<'a> { /// Emits an error to the handler if the given type is not a field, group, or integer. pub(crate) fn assert_field_group_int_type(&self, type_: &Option, span: Span) { self.check_type( - | type_: &Type | - FIELD_TYPE.eq(type_) - | GROUP_TYPE.eq(type_) - | INT_TYPES.contains(type_), - format!( - "{}, {}, {}", - FIELD_TYPE, - GROUP_TYPE, - types_string(&INT_TYPES), - ), + |type_: &Type| FIELD_TYPE.eq(type_) | GROUP_TYPE.eq(type_) | INT_TYPES.contains(type_), + format!("{}, {}, {}", FIELD_TYPE, GROUP_TYPE, types_to_string(&INT_TYPES),), type_, span, ) @@ -282,16 +251,8 @@ impl<'a> TypeChecker<'a> { /// Emits an error to the handler if the given type is not a field, group, or signed integer. pub(crate) fn assert_field_group_signed_int_type(&self, type_: &Option, span: Span) { self.check_type( - | type_: &Type | - FIELD_TYPE.eq(type_) - | GROUP_TYPE.eq(type_) - | SIGNED_INT_TYPES.contains(type_), - format!( - "{}, {}, {}", - FIELD_TYPE, - GROUP_TYPE, - types_string(&SIGNED_INT_TYPES), - ), + |type_: &Type| FIELD_TYPE.eq(type_) | GROUP_TYPE.eq(type_) | SIGNED_INT_TYPES.contains(type_), + format!("{}, {}, {}", FIELD_TYPE, GROUP_TYPE, types_to_string(&SIGNED_INT_TYPES),), type_, span, ) @@ -300,17 +261,15 @@ impl<'a> TypeChecker<'a> { /// Emits an error to the handler if the given type is not a field, group, scalar or integer. pub(crate) fn assert_field_group_scalar_int_type(&self, type_: &Option, span: Span) { self.check_type( - | type_: &Type | - FIELD_TYPE.eq(type_) - | GROUP_TYPE.eq(type_) - | SCALAR_TYPE.eq(type_) - | INT_TYPES.contains(type_), + |type_: &Type| { + FIELD_TYPE.eq(type_) | GROUP_TYPE.eq(type_) | SCALAR_TYPE.eq(type_) | INT_TYPES.contains(type_) + }, format!( "{}, {}, {}, {}", FIELD_TYPE, GROUP_TYPE, SCALAR_TYPE, - types_string(&INT_TYPES), + types_to_string(&INT_TYPES), ), type_, span, @@ -349,7 +308,8 @@ impl<'a> TypeChecker<'a> { } /// Emits an error if the given type conflicts with a core library type. - pub(crate) fn check_ident_type(&self, type_: &Option) { // todo: deprecate this method. + pub(crate) fn check_ident_type(&self, type_: &Option) { + // todo: deprecate this method. if let Some(Type::Identifier(ident)) = type_ { if self.account_types.contains(&ident.name) || self.algorithms_types.contains(&ident.name) { self.emit_err(TypeCheckerError::core_type_name_conflict(&ident.name, ident.span())); @@ -358,6 +318,6 @@ impl<'a> TypeChecker<'a> { } } -fn types_string(types: &[Type]) -> String { +fn types_to_string(types: &[Type]) -> String { types.iter().map(|type_| type_.to_string()).join(", ") -} \ No newline at end of file +} From 906015a01d5ec67b42dfff02ac29bc0650fd15fa Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Thu, 7 Jul 2022 15:22:52 -0700 Subject: [PATCH 16/37] revert hello-world changes --- examples/hello-world/src/main.leo | 24 ++++++++++++++++++++++-- examples/hello-world/src/token.leo | 23 ----------------------- 2 files changed, 22 insertions(+), 25 deletions(-) delete mode 100644 examples/hello-world/src/token.leo diff --git a/examples/hello-world/src/main.leo b/examples/hello-world/src/main.leo index c1e5d41276..6bf610a57d 100644 --- a/examples/hello-world/src/main.leo +++ b/examples/hello-world/src/main.leo @@ -1,3 +1,23 @@ -function main() -> (bool, bool) { - return (true, false) +record Token { + // The token owner. + owner: address, + // The Aleo balance (in gates). + balance: u64, + // The token amount. + amount: u64, +} + +function mint(owner: address, amount: u64) -> Token { + return Token { + owner, + balance: 0u64, + amount, + }; +} + +function main(x: address) -> u64 { + const c: u64 = 1u64; + let t: Token = mint(x, c); + + return t.balance; } \ No newline at end of file diff --git a/examples/hello-world/src/token.leo b/examples/hello-world/src/token.leo deleted file mode 100644 index 6bf610a57d..0000000000 --- a/examples/hello-world/src/token.leo +++ /dev/null @@ -1,23 +0,0 @@ -record Token { - // The token owner. - owner: address, - // The Aleo balance (in gates). - balance: u64, - // The token amount. - amount: u64, -} - -function mint(owner: address, amount: u64) -> Token { - return Token { - owner, - balance: 0u64, - amount, - }; -} - -function main(x: address) -> u64 { - const c: u64 = 1u64; - let t: Token = mint(x, c); - - return t.balance; -} \ No newline at end of file From 418270838b16178ff5108e678f3edbf941636876 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Jul 2022 10:30:43 +0000 Subject: [PATCH 17/37] Bump backtrace from 0.3.65 to 0.3.66 Bumps [backtrace](https://github.com/rust-lang/backtrace-rs) from 0.3.65 to 0.3.66. - [Release notes](https://github.com/rust-lang/backtrace-rs/releases) - [Commits](https://github.com/rust-lang/backtrace-rs/compare/0.3.65...0.3.66) --- updated-dependencies: - dependency-name: backtrace dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- leo/errors/Cargo.toml | 2 +- tests/test-framework/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a37382b0bf..e875bc0eb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -194,9 +194,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a17d453482a265fd5f8479f2a3f405566e6ca627837aaddb85af8b1ab8ef61" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ "addr2line", "cc", @@ -1463,9 +1463,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.28.4" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index a8f2082ab3..1dbb40297f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,7 @@ git = "https://github.com/AleoHQ/snarkVM.git" rev = "51633e2" [dependencies.backtrace] -version = "0.3.65" +version = "0.3.66" [dependencies.clap] version = "3.2.8" diff --git a/leo/errors/Cargo.toml b/leo/errors/Cargo.toml index aa787d522f..7cd1ff3daf 100644 --- a/leo/errors/Cargo.toml +++ b/leo/errors/Cargo.toml @@ -19,7 +19,7 @@ edition = "2021" rust-version = "1.56" [dependencies.backtrace] -version = "0.3.65" +version = "0.3.66" [dependencies.leo-span] path = "../span" diff --git a/tests/test-framework/Cargo.toml b/tests/test-framework/Cargo.toml index dfef7b4e56..9cc03fcd49 100644 --- a/tests/test-framework/Cargo.toml +++ b/tests/test-framework/Cargo.toml @@ -22,7 +22,7 @@ name = "leo_compiler" harness = false [dependencies] -backtrace = "0.3.65" +backtrace = "0.3.66" walkdir = "2.3.2" [dependencies.serde] From 43db782ce260709bf1f29fe2b73ce6fe254cd2a1 Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Fri, 8 Jul 2022 12:22:25 -0700 Subject: [PATCH 18/37] remove Copy trait from Type enum --- compiler/ast/src/types/type_.rs | 2 +- .../passes/src/symbol_table/function_symbol.rs | 2 +- .../passes/src/type_checker/check_expressions.rs | 8 ++++---- compiler/passes/src/type_checker/check_program.rs | 4 ++-- .../passes/src/type_checker/check_statements.rs | 14 +++++++------- compiler/passes/src/type_checker/checker.rs | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/compiler/ast/src/types/type_.rs b/compiler/ast/src/types/type_.rs index 7535fc221f..424d3529b6 100644 --- a/compiler/ast/src/types/type_.rs +++ b/compiler/ast/src/types/type_.rs @@ -20,7 +20,7 @@ use serde::{Deserialize, Serialize}; use std::fmt; /// Explicit type used for defining a variable or expression type -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Type { // Data types /// The `address` type. diff --git a/compiler/passes/src/symbol_table/function_symbol.rs b/compiler/passes/src/symbol_table/function_symbol.rs index 8b5b6efad0..56f9783430 100644 --- a/compiler/passes/src/symbol_table/function_symbol.rs +++ b/compiler/passes/src/symbol_table/function_symbol.rs @@ -36,7 +36,7 @@ impl SymbolTable { pub(crate) fn new_function_symbol(id: usize, func: &Function) -> FunctionSymbol { FunctionSymbol { id, - output: func.output, + output: func.output.clone(), span: func.span, input: func.input.clone(), } diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index 7716037099..09a2c4c5ff 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -126,7 +126,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { // Lookup circuit variable name. if let Some(actual) = input.members.iter().find(|member| member.identifier.name == name.name) { if let Some(expr) = &actual.expression { - self.visit_expression(expr, &Some(*ty)); + self.visit_expression(expr, &Some(ty.clone())); } } else { self.handler.emit_err( @@ -147,7 +147,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { if let Some(circuit) = self.symbol_table.borrow().lookup_circuit(&var.name) { Some(self.assert_and_return_type(Type::Identifier(circuit.identifier), expected, var.span)) } else if let Some(var) = self.symbol_table.borrow().lookup_variable(&var.name) { - Some(self.assert_and_return_type(var.type_, expected, var.span)) + Some(self.assert_and_return_type(var.type_.clone(), expected, var.span)) } else { self.handler .emit_err(TypeCheckerError::unknown_sym("variable", var.name, var.span()).into()); @@ -366,7 +366,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { // Lhs type is checked to be an integer by above. // Rhs type must be magnitude (u8, u16, u32). self.assert_magnitude_type(&t2, input.right.span()); - *destination + destination.clone() } } } @@ -554,7 +554,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { .iter() .zip(input.arguments.iter()) .for_each(|(expected, argument)| { - self.visit_expression(argument, &Some(expected.get_variable().type_)); + self.visit_expression(argument, &Some(expected.get_variable().type_.clone())); }); Some(ret) diff --git a/compiler/passes/src/type_checker/check_program.rs b/compiler/passes/src/type_checker/check_program.rs index 5db32a1f1c..1a87d44994 100644 --- a/compiler/passes/src/type_checker/check_program.rs +++ b/compiler/passes/src/type_checker/check_program.rs @@ -35,13 +35,13 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { self.parent = Some(input.name()); input.input.iter().for_each(|i| { let input_var = i.get_variable(); - self.check_ident_type(&Some(input_var.type_)); + self.check_ident_type(&Some(input_var.type_.clone())); // Check for conflicting variable names. if let Err(err) = self.symbol_table.borrow_mut().insert_variable( input_var.identifier.name, VariableSymbol { - type_: input_var.type_, + type_: input_var.type_.clone(), 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 8629f00ce2..e3e1778bf4 100644 --- a/compiler/passes/src/type_checker/check_statements.rs +++ b/compiler/passes/src/type_checker/check_statements.rs @@ -27,7 +27,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { // statements should always have some parent block let parent = self.parent.unwrap(); - let return_type = &self.symbol_table.borrow().lookup_fn(&parent).map(|f| f.output); + let return_type = &self.symbol_table.borrow().lookup_fn(&parent).map(|f| f.output.clone()); self.check_ident_type(return_type); self.has_return = true; @@ -42,14 +42,14 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { }; input.variable_names.iter().for_each(|v| { - self.check_ident_type(&Some(input.type_)); + self.check_ident_type(&Some(input.type_.clone())); - self.visit_expression(&input.value, &Some(input.type_)); + self.visit_expression(&input.value, &Some(input.type_.clone())); if let Err(err) = self.symbol_table.borrow_mut().insert_variable( v.identifier.name, VariableSymbol { - type_: input.type_, + type_: input.type_.clone(), span: input.span(), declaration: declaration.clone(), }, @@ -81,7 +81,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { _ => {} } - Some(var.type_) + Some(var.type_.clone()) } else { self.handler .emit_err(TypeCheckerError::unknown_sym("variable", var_name.name, var_name.span).into()); @@ -104,13 +104,13 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { } fn visit_iteration(&mut self, input: &'a IterationStatement) { - let iter_type = &Some(input.type_); + let iter_type = &Some(input.type_.clone()); self.check_ident_type(iter_type); if let Err(err) = self.symbol_table.borrow_mut().insert_variable( input.variable.name, VariableSymbol { - type_: input.type_, + type_: input.type_.clone(), span: input.span(), declaration: Declaration::Const, }, diff --git a/compiler/passes/src/type_checker/checker.rs b/compiler/passes/src/type_checker/checker.rs index 18478e95c9..1f8f9248f2 100644 --- a/compiler/passes/src/type_checker/checker.rs +++ b/compiler/passes/src/type_checker/checker.rs @@ -105,7 +105,7 @@ impl<'a> TypeChecker<'a> { pub(crate) fn assert_and_return_type(&self, actual: Type, expected: &Option, span: Span) -> Type { if let Some(expected) = expected { if !actual.eq_flat(expected) { - self.emit_err(TypeCheckerError::type_should_be(actual, expected, span)); + self.emit_err(TypeCheckerError::type_should_be(actual.clone(), expected, span)); } } From ccd50fb7de3c6f2996501817ea0918f7b26c36ee Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Thu, 7 Jul 2022 19:53:06 -0700 Subject: [PATCH 19/37] Add more detailed error messages --- .../errors/type_checker/type_checker_error.rs | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) 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 1aeeaa1404..86fd653592 100644 --- a/leo/errors/src/errors/type_checker/type_checker_error.rs +++ b/leo/errors/src/errors/type_checker/type_checker_error.rs @@ -33,7 +33,7 @@ create_messages!( /// For when the user tries to assign to a const input. @formatted - cannont_assign_to_const_input { + cannot_assign_to_const_input { args: (input: impl Display), msg: format!( "Cannot assign to const input `{input}`", @@ -43,7 +43,7 @@ create_messages!( /// For when the user tries to assign to a const input. @formatted - cannont_assign_to_const_var { + cannot_assign_to_const_var { args: (var: impl Display), msg: format!( "Cannot assign to const variable `{var}`", @@ -61,6 +61,16 @@ create_messages!( help: None, } + /// For when the type checker cannot find a type for an expression. + @formatted + could_not_find_type { + args: (expr: impl Display), + msg: format!( + "Could not find type for `{expr}`", + ), + help: None, + } + /// The method name is known but not supported for the given type. @formatted type_method_not_supported { @@ -201,12 +211,22 @@ create_messages!( help: None, } + /// For when the user is missing a circuit member during initialization. + @formatted + missing_circuit_member { + args: (circuit: impl Display, member: impl Display), + msg: format!( + "Circuit `{circuit}` missing member `{member}`.", + ), + help: None, + } + /// An invalid access call is made e.g., `bool::MAX` @formatted - invalid_access_expression { + invalid_core_circuit_call { args: (expr: impl Display), msg: format!( - "Invalid method call to {expr}." + "{expr} is not a valid core circuit call." ), help: None, } From f31accb04eb9472602b4193feb27d7c41339d095 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Thu, 7 Jul 2022 19:53:52 -0700 Subject: [PATCH 20/37] Cleanup; type checking for Circuit Member Access --- .../src/type_checker/check_expressions.rs | 55 ++++++++++++++++++- .../src/type_checker/check_statements.rs | 4 +- 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index 7716037099..1438ab099f 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -89,11 +89,56 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { Some(self.assert_and_return_type(core_instruction.return_type(), expected, access.span())) } else { self.handler - .emit_err(TypeCheckerError::invalid_access_expression(access, access.span()).into()); + .emit_err(TypeCheckerError::invalid_core_circuit_call(access, access.span())); None } } - _expr => None, // todo: Add support for associated constants (u8::MAX). + AccessExpression::Member(access) => { + // Check that the type of `inner` in `inner.name` is a circuit. + match self.visit_expression(&access.inner, &None) { + Some(Type::Identifier(identifier)) => { + // Retrieve the circuit definition associated with `identifier`. + let circ = self.symbol_table.borrow().lookup_circuit(&identifier.name).cloned(); + if let Some(circ) = circ { + // Check that `access.name` is a member of the circuit. + match circ + .members + .iter() + .find(|circuit_member| circuit_member.name() == access.name.name) + { + // Case where `access.name` is a member of the circuit. + Some(CircuitMember::CircuitVariable(_, type_)) => Some(*type_), + // Case where `access.name` is not a member of the circuit. + None => { + self.handler.emit_err(TypeCheckerError::invalid_circuit_variable( + &access.name, + &circ, + access.name.span(), + )); + None + } + } + } else { + self.handler + .emit_err(TypeCheckerError::invalid_circuit(&access.inner, access.inner.span())); + None + } + } + Some(type_) => { + self.handler + .emit_err(TypeCheckerError::type_should_be(type_, "circuit", access.inner.span())); + None + } + None => { + self.handler.emit_err(TypeCheckerError::could_not_find_type( + &access.inner, + access.inner.span(), + )); + None + } + } + } + AccessExpression::AssociatedConstant(..) => None, // todo: Add support for associated constants (u8::MAX). } } @@ -120,6 +165,9 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } // Check circuit member types. + // TODO: Leo errors for: + // - missing members on initialization. + // - members that don't exist in the circuit circ.members .iter() .for_each(|CircuitMember::CircuitVariable(name, ty)| { @@ -533,6 +581,8 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { fn visit_call(&mut self, input: &'a CallExpression, expected: &Self::AdditionalInput) -> Self::Output { match &*input.function { Expression::Identifier(ident) => { + // Note: The function symbol lookup is performed outside of the `if let Some(func) ...` block to avoid a RefCell lifetime bug in Rust. + // Do not move it into the `if let Some(func) ...` block or it will keep `self.symbol_table` alive for the entire block and will be very memory inefficient! let func = self.symbol_table.borrow().lookup_fn(&ident.name).cloned(); if let Some(func) = func { let ret = self.assert_and_return_type(func.output, expected, func.span); @@ -564,6 +614,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { None } } + // TODO: Is this case sufficient? expr => self.visit_expression(expr, expected), } } diff --git a/compiler/passes/src/type_checker/check_statements.rs b/compiler/passes/src/type_checker/check_statements.rs index 8629f00ce2..22a43efbce 100644 --- a/compiler/passes/src/type_checker/check_statements.rs +++ b/compiler/passes/src/type_checker/check_statements.rs @@ -74,10 +74,10 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { match &var.declaration { Declaration::Const => self .handler - .emit_err(TypeCheckerError::cannont_assign_to_const_var(var_name, var.span).into()), + .emit_err(TypeCheckerError::cannot_assign_to_const_var(var_name, var.span)), Declaration::Input(ParamMode::Const) => self .handler - .emit_err(TypeCheckerError::cannont_assign_to_const_input(var_name, var.span).into()), + .emit_err(TypeCheckerError::cannot_assign_to_const_input(var_name, var.span)), _ => {} } From a1c42a8d3f0c252b6757b29872f4175fd350d07d Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Fri, 8 Jul 2022 13:07:20 -0700 Subject: [PATCH 21/37] impl tuple type --- compiler/ast/src/types/mod.rs | 3 + compiler/ast/src/types/tuple.rs | 54 ++ compiler/ast/src/types/type_.rs | 9 +- compiler/passes/src/type_checker/checker.rs | 19 +- leo/errors/src/errors/asg/asg_errors.rs | 534 -------------------- leo/errors/src/errors/asg/mod.rs | 19 - leo/errors/src/errors/ast/ast_errors.rs | 14 +- 7 files changed, 86 insertions(+), 566 deletions(-) create mode 100644 compiler/ast/src/types/tuple.rs delete mode 100644 leo/errors/src/errors/asg/asg_errors.rs delete mode 100644 leo/errors/src/errors/asg/mod.rs diff --git a/compiler/ast/src/types/mod.rs b/compiler/ast/src/types/mod.rs index f5b8196487..974c8bbe96 100644 --- a/compiler/ast/src/types/mod.rs +++ b/compiler/ast/src/types/mod.rs @@ -17,5 +17,8 @@ pub mod integer_type; pub use integer_type::*; +pub mod tuple; +pub use tuple::*; + pub mod type_; pub use type_::*; diff --git a/compiler/ast/src/types/tuple.rs b/compiler/ast/src/types/tuple.rs new file mode 100644 index 0000000000..1f861be121 --- /dev/null +++ b/compiler/ast/src/types/tuple.rs @@ -0,0 +1,54 @@ +// 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::Type; +use leo_errors::{AstError, Result}; +use leo_span::Span; + +use serde::{Deserialize, Serialize}; +use std::{ + fmt, + ops::Deref +}; + +/// A type list of at least two types. +#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub struct Tuple(Vec); + +impl Tuple { + /// Returns a new `Type::Tuple` enumeration. + pub fn new(elements: Vec, span: Span) -> Result { + match elements.len() { + 0 => Err(AstError::empty_tuple(span).into()), + 1 => Err(AstError::one_element_tuple(span).into()), + _ => Ok(Type::Tuple(Tuple(elements))) + } + } +} + +impl Deref for Tuple { + type Target = Vec; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl fmt::Display for Tuple { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "({})", self.0.iter().map(|x| x.to_string()).collect::>().join(",")) + } +} \ No newline at end of file diff --git a/compiler/ast/src/types/type_.rs b/compiler/ast/src/types/type_.rs index 424d3529b6..608fbcdc26 100644 --- a/compiler/ast/src/types/type_.rs +++ b/compiler/ast/src/types/type_.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Identifier, IntegerType}; +use crate::{Identifier, IntegerType, Tuple}; use serde::{Deserialize, Serialize}; use std::fmt; @@ -39,6 +39,8 @@ pub enum Type { IntegerType(IntegerType), /// A reference to a built in type. Identifier(Identifier), + /// A static tuple of at least one type. + Tuple(Tuple), /// Placeholder for a type that could not be resolved or was not well-formed. /// Will eventually lead to a compile error. @@ -60,6 +62,10 @@ impl Type { | (Type::Scalar, Type::Scalar) | (Type::String, Type::String) => true, (Type::IntegerType(left), Type::IntegerType(right)) => left.eq(right), + (Type::Tuple(left), Type::Tuple(right)) => left + .iter() + .zip(right.iter()) + .all(|(left_type, right_type)| left_type.eq_flat(right_type)), (Type::Identifier(left), Type::Identifier(right)) => left.matches(right), _ => false, } @@ -77,6 +83,7 @@ impl fmt::Display for Type { Type::String => write!(f, "string"), Type::IntegerType(ref integer_type) => write!(f, "{}", integer_type), Type::Identifier(ref variable) => write!(f, "circuit {}", variable), + Type::Tuple(ref tuple) => write!(f, "{}", tuple), Type::Err => write!(f, "error"), } } diff --git a/compiler/passes/src/type_checker/checker.rs b/compiler/passes/src/type_checker/checker.rs index 1f8f9248f2..40cff35838 100644 --- a/compiler/passes/src/type_checker/checker.rs +++ b/compiler/passes/src/type_checker/checker.rs @@ -85,10 +85,19 @@ impl<'a> TypeChecker<'a> { } /// Emits a type checker error. - pub(crate) fn emit_err(&self, err: TypeCheckerError) { + fn emit_err(&self, err: TypeCheckerError) { self.handler.emit_err(err.into()); } + /// Emits an error to the handler if the given type is invalid. + fn check_type(&self, is_valid: impl Fn(&Type) -> bool, error_string: String, type_: &Option, span: Span) { + if let Some(type_) = type_ { + if !is_valid(type_) { + self.emit_err(TypeCheckerError::expected_one_type_of(error_string, type_, span)); + } + } + } + /// Emits an error if the two given types are not equal. pub(crate) fn check_eq_types(&self, t1: &Option, t2: &Option, span: Span) { match (t1, t2) { @@ -112,14 +121,6 @@ impl<'a> TypeChecker<'a> { actual } - /// Emits an error to the handler if the given type is invalid. - fn check_type(&self, is_valid: impl Fn(&Type) -> bool, error_string: String, type_: &Option, span: Span) { - if let Some(type_) = type_ { - if !is_valid(type_) { - self.emit_err(TypeCheckerError::expected_one_type_of(error_string, type_, span)); - } - } - } /// Emits an error to the error handler if the `actual` type is not equal to the `expected` type. pub(crate) fn assert_type(&self, actual: &Option, expected: &Type, span: Span) { self.check_type( diff --git a/leo/errors/src/errors/asg/asg_errors.rs b/leo/errors/src/errors/asg/asg_errors.rs deleted file mode 100644 index 4447d1aa1a..0000000000 --- a/leo/errors/src/errors/asg/asg_errors.rs +++ /dev/null @@ -1,534 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::create_errors; - -use std::fmt::{Debug, Display}; - -create_errors!( - /// AsgError enum that represents all the errors for the `leo-asg` crate. - AsgError, - exit_code_mask: 3000i32, - error_code_prefix: "ASG", - - /// For when a circuit of the specified type is unresolved. - /// Note that the type for a circuit is represented by a name. - @formatted - unresolved_circuit { - args: (name: impl Display), - msg: format!("failed to resolve circuit: '{}'", name), - help: None, - } - - /// For when a circuit member of the specified name is unresolved. - @formatted - unresolved_circuit_member { - args: (circuit_name: impl Display, name: impl Display), - msg: format!( - "illegal reference to non-existant member '{}' of circuit '{}'", - name, circuit_name - ), - help: None, - } - - /// For when a user is initializing a circuit, and it's missing circuit member. - @formatted - missing_circuit_member { - args: (circuit_name: impl Display, name: impl Display), - msg: format!( - "missing circuit member '{}' for initialization of circuit '{}'", - name, circuit_name - ), - help: None, - } - - /// For when a user is initializing a circuit, and they declare a cirucit member twice. - @formatted - overridden_circuit_member { - args: (circuit_name: impl Display, name: impl Display), - msg: format!( - "cannot declare circuit member '{}' more than once for initialization of circuit '{}'", - name, circuit_name - ), - help: None, - } - - /// For when a user is defining a circuit, and they define a circuit member multiple times. - @formatted - redefined_circuit_member { - args: (circuit_name: impl Display, name: impl Display), - msg: format!( - "cannot declare circuit member '{}' multiple times in circuit '{}'", - name, circuit_name - ), - help: None, - } - - /// For when a user is initializing a circuit, and they add an extra circuit member. - @formatted - extra_circuit_member { - args: (circuit_name: impl Display, name: impl Display), - msg: format!( - "extra circuit member '{}' for initialization of circuit '{}' is not allowed", - name, circuit_name - ), - help: None, - } - - /// For when a user attempts to assign to a function. - @formatted - illegal_function_assign { - args: (name: impl Display), - msg: format!("attempt to assign to function '{}'", name), - help: None, - } - - /// For when a user tries to call a circuit variable as a function. - @formatted - circuit_variable_call { - args: (circuit_name: impl Display, name: impl Display), - msg: format!("cannot call variable member '{}' of circuit '{}'", name, circuit_name), - help: None, - } - - /// For when a user tries to call an invalid circuit static function. - @formatted - circuit_static_call_invalid { - args: (circuit_name: impl Display, name: impl Display), - msg: format!( - "cannot call static function '{}' of circuit '{}' from target", - name, circuit_name - ), - help: None, - } - - /// For when a user tries to call a mutable circuit member function from immutable context. - @formatted - circuit_member_mut_call_invalid { - args: (circuit_name: impl Display, name: impl Display), - msg: format!( - "cannot call mutable member function '{}' of circuit '{}' from immutable context", - name, circuit_name - ), - help: None, - } - - /// For when a user tries to call a circuit member function from static context. - @formatted - circuit_member_call_invalid { - args: (circuit_name: impl Display, name: impl Display), - msg: format!( - "cannot call member function '{}' of circuit '{}' from static context", - name, circuit_name - ), - help: None, - } - - /// For when a user tries to index into a non-array type. - @formatted - index_into_non_array { - args: (name: impl Display), - msg: format!("failed to index into non-array '{}'", name), - help: None, - } - - /// For when a user tries index with an invalid integer. - @formatted - invalid_assign_index { - args: (name: impl Display, num: impl Display), - msg: format!("failed to index array with invalid integer '{}'[{}]", name, num), - help: None, - } - - /// For when a user tries to index an array range, with a left value greater than right value. - @formatted - invalid_backwards_assignment { - args: (name: impl Display, left: impl Display, right: impl Display), - msg: format!( - "failed to index array range for assignment with left > right '{}'[{}..{}]", - name, left, right - ), - help: None, - } - - /// For when a user tries to create a constant varaible from non constant values. - @formatted - invalid_const_assign { - args: (name: impl Display), - msg: format!( - "failed to create const variable(s) '{}' with non constant values.", - name - ), - help: None, - } - - /// For when a user defines a function with the same name twice. - @formatted - duplicate_function_definition { - args: (name: impl Display), - msg: format!("a function named \"{}\" already exists in this scope", name), - help: None, - } - - /// For when a user defines variable with the same name twice. - @formatted - duplicate_variable_definition { - args: (name: impl Display), - msg: format!("a variable named \"{}\" already exists in this scope", name), - help: None, - } - - /// For when a user tries to index into a non-tuple type. - @formatted - index_into_non_tuple { - args: (name: impl Display), - msg: format!("failed to index into non-tuple '{}'", name), - help: None, - } - - /// For when a user tries access a tuple index out of bounds. - @formatted - tuple_index_out_of_bounds { - args: (index: impl Display), - msg: format!("tuple index out of bounds: '{}'", index), - help: None, - } - - /// For when a user tries access a array index out of bounds. - @formatted - array_index_out_of_bounds { - args: (index: impl Display), - msg: format!("array index out of bounds: '{}'", index), - help: None, - } - - /// For when a user tries have either side of a ternary return different variable types. - @formatted - ternary_different_types { - args: (left: impl Display, right: impl Display), - msg: format!("ternary sides had different types: left {}, right {}", left, right), - help: None, - } - - /// For when an array size cannot be inferred. - @formatted - unknown_array_size { - args: (), - msg: "array size cannot be inferred, add explicit types", - help: None, - } - - /// For when a user passes more arguements to a function than expected. - @formatted - unexpected_call_argument_count { - args: (expected: impl Display, got: impl Display), - msg: format!("function call expected {} arguments, got {}", expected, got), - help: None, - } - - /// For whan a function is unresolved. - @formatted - unresolved_function { - args: (name: impl Display), - msg: format!("failed to resolve function: '{}'", name), - help: None, - } - - /// For when a type cannot be resolved. - @formatted - unresolved_type { - args: (name: impl Display), - msg: format!("failed to resolve type for variable definition '{}'", name), - help: None, - } - - /// For when a user passes a type, but another was expected. - @formatted - unexpected_type { - args: (expected: impl Display, received: impl Display), - msg: format!( - "unexpected type, expected: '{}', received: '{}'", - expected, - received, - ), - help: None, - } - - /// For when a constant value was expected, but a non-constant one was received. - @formatted - unexpected_nonconst { - args: (), - msg: "expected const, found non-const value", - help: None, - } - - /// For whan a variable is unresolved. - @formatted - unresolved_reference { - args: (name: impl Display), - msg: format!("failed to resolve variable reference '{}'", name), - help: None, - } - - /// For when a boolean value cannot be parsed. - @formatted - invalid_boolean { - args: (value: impl Display), - msg: format!("failed to parse boolean value '{}'", value), - help: None, - } - - /// For when a char value cannot be parsed. - @formatted - invalid_char { - args: (value: impl Display), - msg: format!("failed to parse char value '{}'", value), - help: None, - } - - /// For when an int value cannot be parsed. - @formatted - invalid_int { - args: (value: impl Display), - msg: format!("failed to parse int value '{}'", value), - help: None, - } - - /// For when a user tries to negate an unsigned integer. - @formatted - unsigned_negation { - args: (), - msg: "cannot negate unsigned integer", - help: None, - } - - /// For when a user tries to assign to an immutable variable. - @formatted - immutable_assignment { - args: (name: impl Display), - msg: format!("illegal assignment to immutable variable '{}'", name), - help: None, - } - - /// For when a function is missing a return statement. - @formatted - function_missing_return { - args: (name: impl Display), - msg: format!("function '{}' missing return for all paths", name), - help: None, - } - - /// For when a function fails to resolve the correct return. - @formatted - function_return_validation { - args: (name: impl Display, description: impl Display), - msg: format!("function '{}' failed to validate return path: '{}'", name, description), - help: None, - } - - /// For when the type for an input variable could not be infered. - @formatted - input_ref_needs_type { - args: (category: impl Display, name: impl Display), - msg: format!("could not infer type for input in '{}': '{}'", category, name), - help: None, - } - - /// For when a user tries to call a test function. - @formatted - call_test_function { - args: (), - msg: "cannot call test function", - help: None, - } - - /// For when a user tries to define a circuit function as a test function. - @formatted - circuit_test_function { - args: (), - msg: "cannot have test function as member of circuit", - help: None, - } - - /// Failed to parse index. - @formatted - parse_index_error { - args: (), - msg: "failed to parse index", - help: None, - } - - /// Failed to parse array dimensions. - @formatted - parse_dimension_error { - args: (), - msg: "failed to parse dimension", - help: None, - } - - /// For when there is an illegal ast structure. - @formatted - illegal_ast_structure { - args: (details: impl Display), - msg: format!("illegal ast structure: {}", details), - help: None, - } - - /// For when a user tries to reference an input varaible but none is in scope. - @formatted - illegal_input_variable_reference { - args: (), - msg: "attempted to reference input when none is in scope", - help: None, - } - - /// For the ASG receives an big Self, which should never happen - /// as they should be resolved in an earlier compiler phase. - @formatted - unexpected_big_self { - args: (), - msg: "received a Self statement, which should never happen.", - help: Some("Something went wrong during canonicalization, or you ran the ASG on an uncanonicalized AST.".to_string()), - } - - /// For when a import of the specified name is unresolved. - @formatted - unresolved_import { - args: (name: impl Display), - msg: format!("failed to resolve import: '{}'", name), - help: None, - } - - /// For when a user defines an alias with the same name twice. - @formatted - duplicate_alias_definition { - args: (name: impl Display), - msg: format!("an alias named \"{}\" already exists in this scope", name), - help: None, - } - - /// For when a user defines an circuit with the same name twice. - @formatted - duplicate_circuit_definition { - args: (name: impl Display), - msg: format!("a circuit named \"{}\" already exists in this scope", name), - help: None, - } - - /// For when a user defines a function input with the same name twice. - @formatted - duplicate_function_input_definition { - args: (name: impl Display), - msg: format!("a function input named \"{}\" already exists in this scope", name), - help: None, - } - - /// For when a user defines a global const with the same name twice. - @formatted - duplicate_global_const_definition { - args: (name: impl Display), - msg: format!("a global const named \"{}\" already exists in this scope", name), - help: None, - } - - /// For when a function input shadows a global const. - @formatted - function_input_cannot_shadow_global_const { - args: (name: impl Display), - msg: format!("a function input cannot be named `{}` as a global const with that name already exists in this scope", name), - help: None, - } - - /// For when a variable definition shadows a global const. - @formatted - function_variable_cannot_shadow_global_const { - args: (name: impl Display), - msg: format!("a variable cannot be named `{}` as a global const with that name already exists in this scope", name), - help: None, - } - - /// For when a variable definition shadows a function input. - @formatted - function_variable_cannot_shadow_other_function_variable { - args: (name: impl Display), - msg: format!("a variable cannot be named `{}` as a function input or variable with that name already exists in this scope", name), - help: None, - } - - /// For when operator is used on an unsupported type. - @formatted - operator_allowed_only_for_type { - args: (operator: impl Display, type_: impl Display, received: impl Display), - msg: format!("operator '{}' is only allowed for type '{}', received: '{}'", operator, type_, received), - help: None, - } - - /// For when a user tries to call a circuit variable as a function. - @formatted - circuit_const_call { - args: (circuit_name: impl Display, name: impl Display), - msg: format!("cannot call const member '{}' of circuit '{}'", name, circuit_name), - help: None, - } - - /// For when `input` variable is accessed inside a const function. - @formatted - illegal_input_variable_reference_in_const_function { - args: (), - msg: "input access is illegal in const functions", - help: None, - } - - /// For when non-const function is called from a const context. - @formatted - calling_non_const_in_const_context { - args: (), - msg: "non-const functions cannot be called from const context", - help: None, - } - - /// For when const function modifier is added to the main function. - @formatted - main_cannot_be_const { - args: (), - msg: "main function cannot be const", - help: None, - } - - /// For when const function has non-const inputs or self. - @formatted - const_function_cannot_have_inputs { - args: (), - msg: "const function cannot have non-const input", - help: None, - } - - /// For when `main` is annotated. - @formatted - main_cannot_have_annotations { - args: (), - msg: "main function cannot have annotations", - help: None, - } - - /// For when unsupported annotation is added. - @formatted - unsupported_annotation { - args: (name: impl Display), - msg: format!("annotation `{}` does not exist", name), - help: None, - } -); diff --git a/leo/errors/src/errors/asg/mod.rs b/leo/errors/src/errors/asg/mod.rs deleted file mode 100644 index 515dade3c9..0000000000 --- a/leo/errors/src/errors/asg/mod.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -/// This module contains the ASG error definitions. -pub mod asg_errors; -pub use self::asg_errors::*; diff --git a/leo/errors/src/errors/ast/ast_errors.rs b/leo/errors/src/errors/ast/ast_errors.rs index e58f21e12f..b9f915ad3d 100644 --- a/leo/errors/src/errors/ast/ast_errors.rs +++ b/leo/errors/src/errors/ast/ast_errors.rs @@ -106,7 +106,7 @@ create_messages!( help: None, } - /// This error is for when a user tries to use the library and programatically inject an import + /// This error is for when a user tries to use the library and programmatically inject an import /// on the rust side. @backtraced injected_programs { @@ -133,12 +133,20 @@ create_messages!( /// For when a user tries to define a tuple dimension of 1. @formatted - invalid_tuple_dimension_size { + empty_tuple { args: (), - msg: "tuples of 1 element are not allowed", + msg: "Tuples of 0 elements are not allowed.", help: None, } + /// For when a user tries to define a tuple dimension of 1. + @formatted + one_element_tuple { + args: (), + msg: "Tuples of 1 element are not allowed.", + help: Some("Try defining a single type by removing the parenthesis `( )`".to_string()), + } + /// For when a user shadows a function. @formatted shadowed_function { From 0358a5f4da0941a38d70e51e62f5ce82816c92fb Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Thu, 7 Jul 2022 19:58:56 -0700 Subject: [PATCH 22/37] Fmt --- .../passes/src/type_checker/check_expressions.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index 1438ab099f..d83b43d5f7 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -63,14 +63,11 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { if let Some(core_instruction) = self.check_core_circuit_call(&access.ty, &access.name) { // Check num input arguments. if core_instruction.num_args() != access.args.len() { - self.handler.emit_err( - TypeCheckerError::incorrect_num_args_to_call( - core_instruction.num_args(), - access.args.len(), - input.span(), - ) - .into(), - ); + self.handler.emit_err(TypeCheckerError::incorrect_num_args_to_call( + core_instruction.num_args(), + access.args.len(), + input.span(), + )); } // Check first argument type. From 8af0f6268fb97cebbfbeab22ef5d7badaee47605 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Thu, 7 Jul 2022 20:16:37 -0700 Subject: [PATCH 23/37] Regenerate expectations --- tests/compiler/circuits/inline_member_pass.leo | 2 +- tests/expectations/compiler/compiler/address/gt_fail.out | 2 +- tests/expectations/compiler/compiler/address/gte_fail.out | 2 +- tests/expectations/compiler/compiler/address/lt_fail.out | 2 +- tests/expectations/compiler/compiler/address/lte_fail.out | 2 +- .../compiler/circuits/duplicate_circuit_variable.out | 2 +- .../compiler/compiler/circuits/inline_member_pass.out | 6 ++---- .../compiler/compiler/core/account/compute_key.out | 2 +- .../compiler/compiler/core/account/private_key.out | 2 +- .../compiler/compiler/core/account/signature.out | 2 +- .../compiler/compiler/core/account/view_key.out | 2 +- .../compiler/compiler/core/algorithms/pedersen_fail.out | 2 +- .../definition/use_decl_variable_as_assign_fail.out | 2 +- .../compiler/compiler/function/no_return_fail.out | 2 +- .../compiler/compiler/group/mult_by_group_fail.out | 2 +- .../compiler/compiler/records/balance_wrong_ty.out | 2 +- .../compiler/compiler/records/duplicate_var_fail.out | 2 +- .../compiler/compiler/records/init_expression_var_fail.out | 2 +- .../compiler/compiler/records/no_owner_fail.out | 2 +- .../compiler/compiler/records/owner_wrong_ty.out | 2 +- .../compiler/statements/compare_invalid_negates_fail.out | 2 +- .../compiler/statements/non_existant_var_exp_fail.out | 2 +- .../compiler/statements/non_existant_vars_mul_fail.out | 2 +- 23 files changed, 24 insertions(+), 26 deletions(-) diff --git a/tests/compiler/circuits/inline_member_pass.leo b/tests/compiler/circuits/inline_member_pass.leo index 4ada2e4c02..c64bc45acc 100644 --- a/tests/compiler/circuits/inline_member_pass.leo +++ b/tests/compiler/circuits/inline_member_pass.leo @@ -1,6 +1,6 @@ /* namespace: Compile -expectation: Pass +expectation: Fail inputs: - inline.in: | [main] diff --git a/tests/expectations/compiler/compiler/address/gt_fail.out b/tests/expectations/compiler/compiler/address/gt_fail.out index 629004a424..8130638d95 100644 --- a/tests/expectations/compiler/compiler/address/gt_fail.out +++ b/tests/expectations/compiler/compiler/address/gt_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372025]: Comparison `>` is not supported for the address type.\n --> compiler-test:6:12\n |\n 6 | return x > sender;\n | ^^^^^^^^^^\n" + - "Error [ETYC0372027]: Comparison `>` is not supported for the address type.\n --> compiler-test:6:12\n |\n 6 | return x > sender;\n | ^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/compiler/address/gte_fail.out b/tests/expectations/compiler/compiler/address/gte_fail.out index 7e120e40d0..8fe24b7712 100644 --- a/tests/expectations/compiler/compiler/address/gte_fail.out +++ b/tests/expectations/compiler/compiler/address/gte_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372025]: Comparison `>=` is not supported for the address type.\n --> compiler-test:6:12\n |\n 6 | return x >= sender;\n | ^^^^^^^^^^^\n" + - "Error [ETYC0372027]: Comparison `>=` is not supported for the address type.\n --> compiler-test:6:12\n |\n 6 | return x >= sender;\n | ^^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/compiler/address/lt_fail.out b/tests/expectations/compiler/compiler/address/lt_fail.out index 0cf1c89f82..4d5d3cca1f 100644 --- a/tests/expectations/compiler/compiler/address/lt_fail.out +++ b/tests/expectations/compiler/compiler/address/lt_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372025]: Comparison `<` is not supported for the address type.\n --> compiler-test:6:12\n |\n 6 | return x < sender;\n | ^^^^^^^^^^\n" + - "Error [ETYC0372027]: Comparison `<` is not supported for the address type.\n --> compiler-test:6:12\n |\n 6 | return x < sender;\n | ^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/compiler/address/lte_fail.out b/tests/expectations/compiler/compiler/address/lte_fail.out index 8527b2b3e2..e694bf8e27 100644 --- a/tests/expectations/compiler/compiler/address/lte_fail.out +++ b/tests/expectations/compiler/compiler/address/lte_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372025]: Comparison `<=` is not supported for the address type.\n --> compiler-test:6:12\n |\n 6 | return x <= sender;\n | ^^^^^^^^^^^\n" + - "Error [ETYC0372027]: Comparison `<=` is not supported for the address type.\n --> compiler-test:6:12\n |\n 6 | return x <= sender;\n | ^^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/compiler/circuits/duplicate_circuit_variable.out b/tests/expectations/compiler/compiler/circuits/duplicate_circuit_variable.out index 2a5c69f0b7..cf67de3a28 100644 --- a/tests/expectations/compiler/compiler/circuits/duplicate_circuit_variable.out +++ b/tests/expectations/compiler/compiler/circuits/duplicate_circuit_variable.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372019]: Circuit Bar defined with more than one member with the same name.\n --> compiler-test:3:1\n |\n 3 | circuit Bar {\n 4 | x: u32,\n 5 | x: u32,\n 6 | }\n | ^\n" + - "Error [ETYC0372021]: Circuit Bar defined with more than one member with the same name.\n --> compiler-test:3:1\n |\n 3 | circuit Bar {\n 4 | x: u32,\n 5 | x: u32,\n 6 | }\n | ^\n" diff --git a/tests/expectations/compiler/compiler/circuits/inline_member_pass.out b/tests/expectations/compiler/compiler/circuits/inline_member_pass.out index 2ba0ef792f..078d28400b 100644 --- a/tests/expectations/compiler/compiler/circuits/inline_member_pass.out +++ b/tests/expectations/compiler/compiler/circuits/inline_member_pass.out @@ -1,7 +1,5 @@ --- namespace: Compile -expectation: Pass +expectation: Fail outputs: - - output: - - initial_input_ast: no input - initial_ast: 9489ab9b78bd31ac516e1674a83c6b35708238174df88374a7b19cef3d4a8e8a + - "Error [ETYC0372006]: Unknown variable `b`\n --> compiler-test:10:13\n |\n 10 | return (b.x == a.x) == y;\n | ^\nError [ETYC0372004]: Could not find type for `b`\n --> compiler-test:10:13\n |\n 10 | return (b.x == a.x) == y;\n | ^\n" diff --git a/tests/expectations/compiler/compiler/core/account/compute_key.out b/tests/expectations/compiler/compiler/core/account/compute_key.out index 319ac1a602..83b2bec3a0 100644 --- a/tests/expectations/compiler/compiler/core/account/compute_key.out +++ b/tests/expectations/compiler/compiler/core/account/compute_key.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372014]: The type ComputeKey is a reserved core type name.\n --> compiler-test:4:35\n |\n 4 | function main(public compute_key: ComputeKey, a: bool) -> bool {\n | ^^^^^^^^^^\n" + - "Error [ETYC0372015]: The type ComputeKey is a reserved core type name.\n --> compiler-test:4:35\n |\n 4 | function main(public compute_key: ComputeKey, a: bool) -> bool {\n | ^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/compiler/core/account/private_key.out b/tests/expectations/compiler/compiler/core/account/private_key.out index b91a6407b1..33aff553f3 100644 --- a/tests/expectations/compiler/compiler/core/account/private_key.out +++ b/tests/expectations/compiler/compiler/core/account/private_key.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372014]: The type PrivateKey is a reserved core type name.\n --> compiler-test:4:35\n |\n 4 | function main(public private_key: PrivateKey, a: bool) -> bool {\n | ^^^^^^^^^^\n" + - "Error [ETYC0372015]: The type PrivateKey is a reserved core type name.\n --> compiler-test:4:35\n |\n 4 | function main(public private_key: PrivateKey, a: bool) -> bool {\n | ^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/compiler/core/account/signature.out b/tests/expectations/compiler/compiler/core/account/signature.out index b96ecadcf3..b9c4e63629 100644 --- a/tests/expectations/compiler/compiler/core/account/signature.out +++ b/tests/expectations/compiler/compiler/core/account/signature.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372014]: The type Signature is a reserved core type name.\n --> compiler-test:4:33\n |\n 4 | function main(public signature: Signature, a: bool) -> bool {\n | ^^^^^^^^^\n" + - "Error [ETYC0372015]: The type Signature is a reserved core type name.\n --> compiler-test:4:33\n |\n 4 | function main(public signature: Signature, a: bool) -> bool {\n | ^^^^^^^^^\n" diff --git a/tests/expectations/compiler/compiler/core/account/view_key.out b/tests/expectations/compiler/compiler/core/account/view_key.out index 912f865fbb..b2186751f9 100644 --- a/tests/expectations/compiler/compiler/core/account/view_key.out +++ b/tests/expectations/compiler/compiler/core/account/view_key.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372014]: The type ViewKey is a reserved core type name.\n --> compiler-test:4:32\n |\n 4 | function main(public view_key: ViewKey, a: bool) -> bool {\n | ^^^^^^^\n" + - "Error [ETYC0372015]: The type ViewKey is a reserved core type name.\n --> compiler-test:4:32\n |\n 4 | function main(public view_key: ViewKey, a: bool) -> bool {\n | ^^^^^^^\n" diff --git a/tests/expectations/compiler/compiler/core/algorithms/pedersen_fail.out b/tests/expectations/compiler/compiler/core/algorithms/pedersen_fail.out index ddc453388c..e45a4ebc90 100644 --- a/tests/expectations/compiler/compiler/core/algorithms/pedersen_fail.out +++ b/tests/expectations/compiler/compiler/core/algorithms/pedersen_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372009]: Expected one type from `bool, i8, i16, i32, i64, u8, u16, u32, u64, string`, but got `u128`\n --> compiler-test:4:20\n |\n 4 | let a: group = Pedersen64::hash(1u128);\n | ^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Error [ETYC0372010]: Expected one type from `bool, i8, i16, i32, i64, u8, u16, u32, u64, string`, but got `u128`\n --> compiler-test:4:20\n |\n 4 | let a: group = Pedersen64::hash(1u128);\n | ^^^^^^^^^^^^^^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/compiler/definition/use_decl_variable_as_assign_fail.out b/tests/expectations/compiler/compiler/definition/use_decl_variable_as_assign_fail.out index 0d2db82b07..ba12ac0a8d 100644 --- a/tests/expectations/compiler/compiler/definition/use_decl_variable_as_assign_fail.out +++ b/tests/expectations/compiler/compiler/definition/use_decl_variable_as_assign_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372005]: Unknown variable `b`\n --> compiler-test:4:14\n |\n 4 | \tlet b: u8 = b;\n | ^\n" + - "Error [ETYC0372006]: Unknown variable `b`\n --> compiler-test:4:14\n |\n 4 | \tlet b: u8 = b;\n | ^\n" diff --git a/tests/expectations/compiler/compiler/function/no_return_fail.out b/tests/expectations/compiler/compiler/function/no_return_fail.out index 5fb41fd73b..ad59d60cbb 100644 --- a/tests/expectations/compiler/compiler/function/no_return_fail.out +++ b/tests/expectations/compiler/compiler/function/no_return_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372015]: The function main has no return statement.\n --> compiler-test:3:1\n |\n 3 | function main() -> u8 {}\n | ^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Error [ETYC0372016]: The function main has no return statement.\n --> compiler-test:3:1\n |\n 3 | function main() -> u8 {}\n | ^^^^^^^^^^^^^^^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/compiler/group/mult_by_group_fail.out b/tests/expectations/compiler/compiler/group/mult_by_group_fail.out index 3628b19006..47e31c7cdb 100644 --- a/tests/expectations/compiler/compiler/group/mult_by_group_fail.out +++ b/tests/expectations/compiler/compiler/group/mult_by_group_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372009]: Expected one type from `scalar`, but got `group`\n --> compiler-test:4:26\n |\n 4 | return (_, _)group * a;\n | ^\n" + - "Error [ETYC0372010]: Expected one type from `scalar`, but got `group`\n --> compiler-test:4:26\n |\n 4 | return (_, _)group * a;\n | ^\n" diff --git a/tests/expectations/compiler/compiler/records/balance_wrong_ty.out b/tests/expectations/compiler/compiler/records/balance_wrong_ty.out index a16fb1208f..e62ef44b41 100644 --- a/tests/expectations/compiler/compiler/records/balance_wrong_ty.out +++ b/tests/expectations/compiler/compiler/records/balance_wrong_ty.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372024]: The field `balance` in a `record` must have type `u64`.\n --> compiler-test:4:1\n |\n 4 | record Token {\n 5 | balance: address,\n 6 | owner: address,\n 7 | }\n | ^\n" + - "Error [ETYC0372026]: The field `balance` in a `record` must have type `u64`.\n --> compiler-test:4:1\n |\n 4 | record Token {\n 5 | balance: address,\n 6 | owner: address,\n 7 | }\n | ^\n" diff --git a/tests/expectations/compiler/compiler/records/duplicate_var_fail.out b/tests/expectations/compiler/compiler/records/duplicate_var_fail.out index 2c42d35291..b128ffec30 100644 --- a/tests/expectations/compiler/compiler/records/duplicate_var_fail.out +++ b/tests/expectations/compiler/compiler/records/duplicate_var_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372020]: Record Token defined with more than one variable with the same name.\n --> compiler-test:3:1\n |\n 3 | record Token {\n 4 | // The token owner.\n 5 | owner: address,\n 6 | // The token owner.\n 7 | owner: address, // Cannot define two record variables with the same name.\n 8 | // The Aleo balance (in gates).\n 9 | balance: u64,\n 10 | // The token amount.\n 11 | amount: u64,\n 12 | }\n | ^\n" + - "Error [ETYC0372022]: Record Token defined with more than one variable with the same name.\n --> compiler-test:3:1\n |\n 3 | record Token {\n 4 | // The token owner.\n 5 | owner: address,\n 6 | // The token owner.\n 7 | owner: address, // Cannot define two record variables with the same name.\n 8 | // The Aleo balance (in gates).\n 9 | balance: u64,\n 10 | // The token amount.\n 11 | amount: u64,\n 12 | }\n | ^\n" diff --git a/tests/expectations/compiler/compiler/records/init_expression_var_fail.out b/tests/expectations/compiler/compiler/records/init_expression_var_fail.out index 543edd6fe7..16535102a9 100644 --- a/tests/expectations/compiler/compiler/records/init_expression_var_fail.out +++ b/tests/expectations/compiler/compiler/records/init_expression_var_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372005]: Unknown circuit member variable `owner`\n --> compiler-test:5:5\n |\n 5 | owner: address,\n | ^^^^^\n" + - "Error [ETYC0372006]: Unknown circuit member variable `owner`\n --> compiler-test:5:5\n |\n 5 | owner: address,\n | ^^^^^\n" diff --git a/tests/expectations/compiler/compiler/records/no_owner_fail.out b/tests/expectations/compiler/compiler/records/no_owner_fail.out index b9fb85d867..49ccd2e9e0 100644 --- a/tests/expectations/compiler/compiler/records/no_owner_fail.out +++ b/tests/expectations/compiler/compiler/records/no_owner_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372023]: The `record` type requires the variable `owner: address`.\n --> compiler-test:4:1\n |\n 4 | record Token {\n 5 | // The Aleo balance (in gates).\n 6 | balance: u64,\n 7 | // The token amount.\n 8 | amount: u64,\n 9 | }\n | ^\n" + - "Error [ETYC0372025]: The `record` type requires the variable `owner: address`.\n --> compiler-test:4:1\n |\n 4 | record Token {\n 5 | // The Aleo balance (in gates).\n 6 | balance: u64,\n 7 | // The token amount.\n 8 | amount: u64,\n 9 | }\n | ^\n" diff --git a/tests/expectations/compiler/compiler/records/owner_wrong_ty.out b/tests/expectations/compiler/compiler/records/owner_wrong_ty.out index 9b74ee668e..e36a564de1 100644 --- a/tests/expectations/compiler/compiler/records/owner_wrong_ty.out +++ b/tests/expectations/compiler/compiler/records/owner_wrong_ty.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372024]: The field `owner` in a `record` must have type `address`.\n --> compiler-test:4:1\n |\n 4 | record Token {\n 5 | balance: u64,\n 6 | owner: bool,\n 7 | }\n | ^\n" + - "Error [ETYC0372026]: The field `owner` in a `record` must have type `address`.\n --> compiler-test:4:1\n |\n 4 | record Token {\n 5 | balance: u64,\n 6 | owner: bool,\n 7 | }\n | ^\n" diff --git a/tests/expectations/compiler/compiler/statements/compare_invalid_negates_fail.out b/tests/expectations/compiler/compiler/statements/compare_invalid_negates_fail.out index 36b5cb8ee9..908f8861fc 100644 --- a/tests/expectations/compiler/compiler/statements/compare_invalid_negates_fail.out +++ b/tests/expectations/compiler/compiler/statements/compare_invalid_negates_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:4:20\n |\n 4 | let b: bool = -a == -1u8;\n | ^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:4:26\n |\n 4 | let b: bool = -a == -1u8;\n | ^^^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:5:20\n |\n 5 | let c: bool = -a > -1u8;\n | ^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:5:25\n |\n 5 | let c: bool = -a > -1u8;\n | ^^^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:6:20\n |\n 6 | let d: bool = -a < -1u8;\n | ^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:6:25\n |\n 6 | let d: bool = -a < -1u8;\n | ^^^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:7:20\n |\n 7 | let e: bool = -a >= -1u8;\n | ^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:7:26\n |\n 7 | let e: bool = -a >= -1u8;\n | ^^^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:8:20\n |\n 8 | let f: bool = -a <= -1u8;\n | ^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:8:26\n |\n 8 | let f: bool = -a <= -1u8;\n | ^^^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:9:18\n |\n 9 | let g: u8 = -a * -1u8;\n | ^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:9:23\n |\n 9 | let g: u8 = -a * -1u8;\n | ^^^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:10:18\n |\n 10 | let h: u8 = -a ** -1u8;\n | ^\nError [ETYC0372009]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:10:24\n |\n 10 | let h: u8 = -a ** -1u8;\n | ^^^\n" + - "Error [ETYC0372010]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:4:20\n |\n 4 | let b: bool = -a == -1u8;\n | ^\nError [ETYC0372010]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:4:26\n |\n 4 | let b: bool = -a == -1u8;\n | ^^^\nError [ETYC0372010]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:5:20\n |\n 5 | let c: bool = -a > -1u8;\n | ^\nError [ETYC0372010]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:5:25\n |\n 5 | let c: bool = -a > -1u8;\n | ^^^\nError [ETYC0372010]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:6:20\n |\n 6 | let d: bool = -a < -1u8;\n | ^\nError [ETYC0372010]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:6:25\n |\n 6 | let d: bool = -a < -1u8;\n | ^^^\nError [ETYC0372010]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:7:20\n |\n 7 | let e: bool = -a >= -1u8;\n | ^\nError [ETYC0372010]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:7:26\n |\n 7 | let e: bool = -a >= -1u8;\n | ^^^\nError [ETYC0372010]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:8:20\n |\n 8 | let f: bool = -a <= -1u8;\n | ^\nError [ETYC0372010]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:8:26\n |\n 8 | let f: bool = -a <= -1u8;\n | ^^^\nError [ETYC0372010]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:9:18\n |\n 9 | let g: u8 = -a * -1u8;\n | ^\nError [ETYC0372010]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:9:23\n |\n 9 | let g: u8 = -a * -1u8;\n | ^^^\nError [ETYC0372010]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:10:18\n |\n 10 | let h: u8 = -a ** -1u8;\n | ^\nError [ETYC0372010]: Expected one type from `field, group, i8, i16, i32, i64, i128`, but got `u8`\n --> compiler-test:10:24\n |\n 10 | let h: u8 = -a ** -1u8;\n | ^^^\n" diff --git a/tests/expectations/compiler/compiler/statements/non_existant_var_exp_fail.out b/tests/expectations/compiler/compiler/statements/non_existant_var_exp_fail.out index 36dbbd6b9e..ce9b14bec3 100644 --- a/tests/expectations/compiler/compiler/statements/non_existant_var_exp_fail.out +++ b/tests/expectations/compiler/compiler/statements/non_existant_var_exp_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372005]: Unknown variable `z`\n --> compiler-test:4:19\n |\n 4 | \tlet b: u8 = 1u8**z;\n | ^\n" + - "Error [ETYC0372006]: Unknown variable `z`\n --> compiler-test:4:19\n |\n 4 | \tlet b: u8 = 1u8**z;\n | ^\n" diff --git a/tests/expectations/compiler/compiler/statements/non_existant_vars_mul_fail.out b/tests/expectations/compiler/compiler/statements/non_existant_vars_mul_fail.out index d0fa22eb14..a6e5a08fcd 100644 --- a/tests/expectations/compiler/compiler/statements/non_existant_vars_mul_fail.out +++ b/tests/expectations/compiler/compiler/statements/non_existant_vars_mul_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372005]: Unknown variable `x`\n --> compiler-test:4:14\n |\n 4 | \tlet b: u8 = x*z;\n | ^\nError [ETYC0372005]: Unknown variable `z`\n --> compiler-test:4:16\n |\n 4 | \tlet b: u8 = x*z;\n | ^\n" + - "Error [ETYC0372006]: Unknown variable `x`\n --> compiler-test:4:14\n |\n 4 | \tlet b: u8 = x*z;\n | ^\nError [ETYC0372006]: Unknown variable `z`\n --> compiler-test:4:16\n |\n 4 | \tlet b: u8 = x*z;\n | ^\n" From cf7bde5fab7f82a89202ec0f9677fc10e33fe83d Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Fri, 8 Jul 2022 10:07:59 -0700 Subject: [PATCH 24/37] Clean up error --- compiler/ast/src/expressions/{value.rs => literal.rs} | 8 ++++---- leo/errors/src/errors/type_checker/type_checker_error.rs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) rename compiler/ast/src/expressions/{value.rs => literal.rs} (96%) diff --git a/compiler/ast/src/expressions/value.rs b/compiler/ast/src/expressions/literal.rs similarity index 96% rename from compiler/ast/src/expressions/value.rs rename to compiler/ast/src/expressions/literal.rs index 8a385a0e93..9353e338fd 100644 --- a/compiler/ast/src/expressions/value.rs +++ b/compiler/ast/src/expressions/literal.rs @@ -18,9 +18,9 @@ use crate::GroupLiteral; use super::*; -/// A literal expression. +/// A literal. #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum LiteralExpression { +pub enum Literal { // todo: deserialize values here /// An address literal, e.g., `aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9`. Address(String, #[serde(with = "leo_span::span_json")] Span), @@ -41,7 +41,7 @@ pub enum LiteralExpression { String(String, #[serde(with = "leo_span::span_json")] Span), } -impl fmt::Display for LiteralExpression { +impl fmt::Display for Literal { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match &self { Self::Address(address, _) => write!(f, "{}", address), @@ -55,7 +55,7 @@ impl fmt::Display for LiteralExpression { } } -impl Node for LiteralExpression { +impl Node for Literal { fn span(&self) -> Span { match &self { Self::Address(_, 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 86fd653592..5d63b7748e 100644 --- a/leo/errors/src/errors/type_checker/type_checker_error.rs +++ b/leo/errors/src/errors/type_checker/type_checker_error.rs @@ -61,12 +61,12 @@ create_messages!( help: None, } - /// For when the type checker cannot find a type for an expression. + /// For when the type checker cannot determine the type of an expression. @formatted - could_not_find_type { + could_not_determine_type { args: (expr: impl Display), msg: format!( - "Could not find type for `{expr}`", + "Could not determine the type of `{expr}`", ), help: None, } From 990b5a75da1d223e0e5ab6d8e43aedca83318b84 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Fri, 8 Jul 2022 10:08:46 -0700 Subject: [PATCH 25/37] Rename LiteralExpression to Literal; more cleanup --- compiler/ast/src/expressions/mod.rs | 6 ++--- compiler/ast/src/input/input_value.rs | 12 ++++----- compiler/ast/src/passes/reconstructor.rs | 2 +- compiler/ast/src/passes/visitor.rs | 2 +- compiler/ast/src/types/type_.rs | 1 + compiler/parser/src/parser/expression.rs | 26 ++++++++----------- .../src/type_checker/check_expressions.rs | 18 ++++++------- .../src/type_checker/check_statements.rs | 20 +++++++------- 8 files changed, 43 insertions(+), 44 deletions(-) diff --git a/compiler/ast/src/expressions/mod.rs b/compiler/ast/src/expressions/mod.rs index 4fcca54b4b..5b6657f462 100644 --- a/compiler/ast/src/expressions/mod.rs +++ b/compiler/ast/src/expressions/mod.rs @@ -41,8 +41,8 @@ pub use ternary::*; mod unary; pub use unary::*; -mod value; -pub use value::*; +mod literal; +pub use literal::*; /// Expression that evaluates to a value. #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] @@ -52,7 +52,7 @@ pub enum Expression { /// An identifier expression. Identifier(Identifier), /// A literal expression. - Literal(LiteralExpression), + Literal(Literal), /// A binary expression, e.g., `42 + 24`. Binary(BinaryExpression), /// A call expression, e.g., `my_fun(args)`. diff --git a/compiler/ast/src/input/input_value.rs b/compiler/ast/src/input/input_value.rs index ce2096cef9..1b1e3e6a26 100644 --- a/compiler/ast/src/input/input_value.rs +++ b/compiler/ast/src/input/input_value.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{Expression, GroupLiteral, IntegerType, LiteralExpression, Node, Type, UnaryOperation}; +use crate::{Expression, GroupLiteral, IntegerType, Literal, Node, Type, UnaryOperation}; use leo_errors::{InputError, LeoError, Result}; use serde::{Deserialize, Serialize}; @@ -34,11 +34,11 @@ impl TryFrom<(Type, Expression)> for InputValue { fn try_from(value: (Type, Expression)) -> Result { Ok(match value { (type_, Expression::Literal(lit)) => match (type_, lit) { - (Type::Address, LiteralExpression::Address(value, _)) => Self::Address(value), - (Type::Boolean, LiteralExpression::Boolean(value, _)) => Self::Boolean(value), - (Type::Field, LiteralExpression::Field(value, _)) => Self::Field(value), - (Type::Group, LiteralExpression::Group(value)) => Self::Group(*value), - (Type::IntegerType(expected), LiteralExpression::Integer(actual, value, span)) => { + (Type::Address, Literal::Address(value, _)) => Self::Address(value), + (Type::Boolean, Literal::Boolean(value, _)) => Self::Boolean(value), + (Type::Field, Literal::Field(value, _)) => Self::Field(value), + (Type::Group, Literal::Group(value)) => Self::Group(*value), + (Type::IntegerType(expected), Literal::Integer(actual, value, span)) => { if expected == actual { Self::Integer(expected, value) } else { diff --git a/compiler/ast/src/passes/reconstructor.rs b/compiler/ast/src/passes/reconstructor.rs index 24d4a0874e..d789a836c9 100644 --- a/compiler/ast/src/passes/reconstructor.rs +++ b/compiler/ast/src/passes/reconstructor.rs @@ -42,7 +42,7 @@ pub trait ExpressionReconstructor { (Expression::Identifier(input), Default::default()) } - fn reconstruct_literal(&mut self, input: LiteralExpression) -> (Expression, Self::AdditionalOutput) { + fn reconstruct_literal(&mut self, input: Literal) -> (Expression, Self::AdditionalOutput) { (Expression::Literal(input), Default::default()) } diff --git a/compiler/ast/src/passes/visitor.rs b/compiler/ast/src/passes/visitor.rs index 3a1b0b3d18..72dcc26d82 100644 --- a/compiler/ast/src/passes/visitor.rs +++ b/compiler/ast/src/passes/visitor.rs @@ -55,7 +55,7 @@ pub trait ExpressionVisitor<'a> { Default::default() } - fn visit_literal(&mut self, _input: &'a LiteralExpression, _additional: &Self::AdditionalInput) -> Self::Output { + fn visit_literal(&mut self, _input: &'a Literal, _additional: &Self::AdditionalInput) -> Self::Output { Default::default() } diff --git a/compiler/ast/src/types/type_.rs b/compiler/ast/src/types/type_.rs index 7535fc221f..1b92a84af1 100644 --- a/compiler/ast/src/types/type_.rs +++ b/compiler/ast/src/types/type_.rs @@ -51,6 +51,7 @@ impl Type { /// /// Flattens array syntax: `[[u8; 1]; 2] == [u8; (2, 1)] == true` /// + // TODO: Does not seem to flatten? pub fn eq_flat(&self, other: &Self) -> bool { match (self, other) { (Type::Address, Type::Address) diff --git a/compiler/parser/src/parser/expression.rs b/compiler/parser/src/parser/expression.rs index 1cdf2233e7..ee3366526e 100644 --- a/compiler/parser/src/parser/expression.rs +++ b/compiler/parser/src/parser/expression.rs @@ -374,9 +374,7 @@ impl ParserContext<'_> { /// tuple initialization expression or an affine group literal. fn parse_tuple_expression(&mut self) -> Result { if let Some(gt) = self.eat_group_partial().transpose()? { - return Ok(Expression::Literal(LiteralExpression::Group(Box::new( - GroupLiteral::Tuple(gt), - )))); + return Ok(Expression::Literal(Literal::Group(Box::new(GroupLiteral::Tuple(gt))))); } let (mut tuple, trailing, span) = self.parse_expr_tuple()?; @@ -465,7 +463,7 @@ impl ParserContext<'_> { /// Returns an [`Expression`] AST node if the next tokens represent a /// circuit initialization expression. /// let foo = Foo { x: 1u8 }; - pub fn parse_circuit_expression(&mut self, identifier: Identifier) -> Result { + pub fn parse_circuit_init_expression(&mut self, identifier: Identifier) -> Result { let (members, _, end) = self.parse_list(Delimiter::Brace, Some(Token::Comma), |p| { p.parse_circuit_member().map(Some) })?; @@ -501,44 +499,42 @@ impl ParserContext<'_> { // Literal followed by `field`, e.g., `42field`. Some(Token::Field) => { assert_no_whitespace("field")?; - Expression::Literal(LiteralExpression::Field(value, full_span)) + Expression::Literal(Literal::Field(value, full_span)) } // Literal followed by `group`, e.g., `42group`. Some(Token::Group) => { assert_no_whitespace("group")?; - Expression::Literal(LiteralExpression::Group(Box::new(GroupLiteral::Single( - value, full_span, - )))) + Expression::Literal(Literal::Group(Box::new(GroupLiteral::Single(value, full_span)))) } // Literal followed by `scalar` e.g., `42scalar`. Some(Token::Scalar) => { assert_no_whitespace("scalar")?; - Expression::Literal(LiteralExpression::Scalar(value, full_span)) + Expression::Literal(Literal::Scalar(value, full_span)) } // Literal followed by other type suffix, e.g., `42u8`. Some(suffix) => { assert_no_whitespace(&suffix.to_string())?; let int_ty = Self::token_to_int_type(suffix).expect("unknown int type token"); - Expression::Literal(LiteralExpression::Integer(int_ty, value, full_span)) + Expression::Literal(Literal::Integer(int_ty, value, full_span)) } None => return Err(ParserError::implicit_values_not_allowed(value, span).into()), } } - Token::True => Expression::Literal(LiteralExpression::Boolean(true, span)), - Token::False => Expression::Literal(LiteralExpression::Boolean(false, span)), + Token::True => Expression::Literal(Literal::Boolean(true, span)), + Token::False => Expression::Literal(Literal::Boolean(false, span)), Token::AddressLit(addr) => { if addr.parse::>().is_err() { self.emit_err(ParserError::invalid_address_lit(&addr, span)); } - Expression::Literal(LiteralExpression::Address(addr, span)) + Expression::Literal(Literal::Address(addr, span)) } - Token::StaticString(value) => Expression::Literal(LiteralExpression::String(value, span)), + Token::StaticString(value) => Expression::Literal(Literal::String(value, span)), Token::Ident(name) => { let ident = Identifier { name, span }; if !self.disallow_circuit_construction && self.check(&Token::LeftCurly) { // Parse circuit and records inits as circuit expressions. // Enforce circuit or record type later at type checking. - self.parse_circuit_expression(ident)? + self.parse_circuit_init_expression(ident)? } else { Expression::Identifier(ident) } diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index d83b43d5f7..144695fdfc 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -127,7 +127,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { None } None => { - self.handler.emit_err(TypeCheckerError::could_not_find_type( + self.handler.emit_err(TypeCheckerError::could_not_determine_type( &access.inner, access.inner.span(), )); @@ -200,12 +200,12 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } } - fn visit_literal(&mut self, input: &'a LiteralExpression, expected: &Self::AdditionalInput) -> Self::Output { + fn visit_literal(&mut self, input: &'a Literal, expected: &Self::AdditionalInput) -> Self::Output { Some(match input { - LiteralExpression::Address(_, _) => self.assert_and_return_type(Type::Address, expected, input.span()), - LiteralExpression::Boolean(_, _) => self.assert_and_return_type(Type::Boolean, expected, input.span()), - LiteralExpression::Field(_, _) => self.assert_and_return_type(Type::Field, expected, input.span()), - LiteralExpression::Integer(type_, str_content, _) => { + Literal::Address(_, _) => self.assert_and_return_type(Type::Address, expected, input.span()), + Literal::Boolean(_, _) => self.assert_and_return_type(Type::Boolean, expected, input.span()), + Literal::Field(_, _) => self.assert_and_return_type(Type::Field, expected, input.span()), + Literal::Integer(type_, str_content, _) => { match type_ { IntegerType::I8 => { let int = if self.negate { @@ -286,9 +286,9 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } self.assert_and_return_type(Type::IntegerType(*type_), expected, input.span()) } - LiteralExpression::Group(_) => self.assert_and_return_type(Type::Group, expected, input.span()), - LiteralExpression::Scalar(_, _) => self.assert_and_return_type(Type::Scalar, expected, input.span()), - LiteralExpression::String(_, _) => self.assert_and_return_type(Type::String, expected, input.span()), + Literal::Group(_) => self.assert_and_return_type(Type::Group, expected, input.span()), + Literal::Scalar(_, _) => self.assert_and_return_type(Type::Scalar, expected, input.span()), + Literal::String(_, _) => self.assert_and_return_type(Type::String, expected, input.span()), }) } diff --git a/compiler/passes/src/type_checker/check_statements.rs b/compiler/passes/src/type_checker/check_statements.rs index 22a43efbce..c094c8426e 100644 --- a/compiler/passes/src/type_checker/check_statements.rs +++ b/compiler/passes/src/type_checker/check_statements.rs @@ -84,8 +84,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { Some(var.type_) } else { self.handler - .emit_err(TypeCheckerError::unknown_sym("variable", var_name.name, var_name.span).into()); - + .emit_err(TypeCheckerError::unknown_sym("variable", var_name.name, var_name.span)); None }; @@ -105,7 +104,8 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { fn visit_iteration(&mut self, input: &'a IterationStatement) { let iter_type = &Some(input.type_); - self.check_ident_type(iter_type); + self.assert_int_type(iter_type, input.variable.span); + self.check_core_type_conflict(iter_type); if let Err(err) = self.symbol_table.borrow_mut().insert_variable( input.variable.name, @@ -136,10 +136,10 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { fn visit_block(&mut self, input: &'a Block) { // Creates a new sub-scope since we are in a block. let scope_index = self.symbol_table.borrow_mut().insert_block(); - let prev_st = std::mem::take(&mut self.symbol_table); + let previous_symbol_table = std::mem::take(&mut self.symbol_table); self.symbol_table - .swap(prev_st.borrow().get_block_scope(scope_index).unwrap()); - self.symbol_table.borrow_mut().parent = Some(Box::new(prev_st.into_inner())); + .swap(previous_symbol_table.borrow().get_block_scope(scope_index).unwrap()); + self.symbol_table.borrow_mut().parent = Some(Box::new(previous_symbol_table.into_inner())); input.statements.iter().for_each(|stmt| { match stmt { @@ -153,8 +153,10 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { }; }); - let prev_st = *self.symbol_table.borrow_mut().parent.take().unwrap(); - self.symbol_table.swap(prev_st.get_block_scope(scope_index).unwrap()); - self.symbol_table = RefCell::new(prev_st); + let previous_symbol_table = *self.symbol_table.borrow_mut().parent.take().unwrap(); + // TODO: Is this swap necessary? + self.symbol_table + .swap(previous_symbol_table.get_block_scope(scope_index).unwrap()); + self.symbol_table = RefCell::new(previous_symbol_table); } } From 014959aa2414bc16d7abe7e7b7266104009b1b6c Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Fri, 8 Jul 2022 10:14:05 -0700 Subject: [PATCH 26/37] Regenerate expectations --- .../compiler/compiler/circuits/inline_member_pass.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/expectations/compiler/compiler/circuits/inline_member_pass.out b/tests/expectations/compiler/compiler/circuits/inline_member_pass.out index 078d28400b..e49761bcbe 100644 --- a/tests/expectations/compiler/compiler/circuits/inline_member_pass.out +++ b/tests/expectations/compiler/compiler/circuits/inline_member_pass.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372006]: Unknown variable `b`\n --> compiler-test:10:13\n |\n 10 | return (b.x == a.x) == y;\n | ^\nError [ETYC0372004]: Could not find type for `b`\n --> compiler-test:10:13\n |\n 10 | return (b.x == a.x) == y;\n | ^\n" + - "Error [ETYC0372006]: Unknown variable `b`\n --> compiler-test:10:13\n |\n 10 | return (b.x == a.x) == y;\n | ^\nError [ETYC0372004]: Could not determine the type of `b`\n --> compiler-test:10:13\n |\n 10 | return (b.x == a.x) == y;\n | ^\n" From e7f4a4141044c4a62a4c7492909ee73b169964dd Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Fri, 8 Jul 2022 10:27:53 -0700 Subject: [PATCH 27/37] Better error for missing member on circuit init --- compiler/passes/src/type_checker/check_expressions.rs | 11 +++++------ .../src/errors/type_checker/type_checker_error.rs | 2 +- .../compiler/records/init_expression_var_fail.out | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index 144695fdfc..940bbcb171 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -162,9 +162,6 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } // Check circuit member types. - // TODO: Leo errors for: - // - missing members on initialization. - // - members that don't exist in the circuit circ.members .iter() .for_each(|CircuitMember::CircuitVariable(name, ty)| { @@ -174,9 +171,11 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { self.visit_expression(expr, &Some(*ty)); } } else { - self.handler.emit_err( - TypeCheckerError::unknown_sym("circuit member variable", name, name.span()).into(), - ); + self.handler.emit_err(TypeCheckerError::missing_circuit_member( + circ.identifier, + name, + input.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 5d63b7748e..98b69cbc59 100644 --- a/leo/errors/src/errors/type_checker/type_checker_error.rs +++ b/leo/errors/src/errors/type_checker/type_checker_error.rs @@ -216,7 +216,7 @@ create_messages!( missing_circuit_member { args: (circuit: impl Display, member: impl Display), msg: format!( - "Circuit `{circuit}` missing member `{member}`.", + "Circuit initialization expression for `{circuit}` is missing member `{member}`.", ), help: None, } diff --git a/tests/expectations/compiler/compiler/records/init_expression_var_fail.out b/tests/expectations/compiler/compiler/records/init_expression_var_fail.out index 16535102a9..db6c601efc 100644 --- a/tests/expectations/compiler/compiler/records/init_expression_var_fail.out +++ b/tests/expectations/compiler/compiler/records/init_expression_var_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372006]: Unknown circuit member variable `owner`\n --> compiler-test:5:5\n |\n 5 | owner: address,\n | ^^^^^\n" + - "Error [ETYC0372019]: Circuit initialization expression for `Token` is missing member `owner`.\n --> compiler-test:13:12\n |\n 13 | return Token {\n 14 | sender: r0, // This variable should be named `owner`.\n 15 | balance: 0u64,\n 16 | amount: r1,\n 17 | };\n | ^^^^^^\n" From 8ab98c9434dc27ce913320de36314b51281fc715 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Fri, 8 Jul 2022 14:10:54 -0700 Subject: [PATCH 28/37] Refactor emitter to reduce the number of into invocations; more cleanup --- compiler/parser/src/parser/context.rs | 2 +- .../src/type_checker/check_expressions.rs | 59 +++++++++---------- .../passes/src/type_checker/check_program.rs | 22 ++++--- .../src/type_checker/check_statements.rs | 8 +-- compiler/passes/src/type_checker/checker.rs | 4 +- leo/errors/src/emitter/mod.rs | 12 ++-- 6 files changed, 55 insertions(+), 52 deletions(-) diff --git a/compiler/parser/src/parser/context.rs b/compiler/parser/src/parser/context.rs index eb35746975..e7558e2643 100644 --- a/compiler/parser/src/parser/context.rs +++ b/compiler/parser/src/parser/context.rs @@ -115,7 +115,7 @@ impl<'a> ParserContext<'a> { /// Emit the error `err`. pub(super) fn emit_err(&self, err: ParserError) { - self.handler.emit_err(err.into()); + self.handler.emit_err(err); } /// Emit the error `err`. diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index 940bbcb171..d31a1c0a6c 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -151,14 +151,11 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { // Check number of circuit members. if circ.members.len() != input.members.len() { - self.handler.emit_err( - TypeCheckerError::incorrect_num_circuit_members( - circ.members.len(), - input.members.len(), - input.span(), - ) - .into(), - ); + self.handler.emit_err(TypeCheckerError::incorrect_num_circuit_members( + circ.members.len(), + input.members.len(), + input.span(), + )); } // Check circuit member types. @@ -181,8 +178,11 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { Some(ret) } else { - self.handler - .emit_err(TypeCheckerError::unknown_sym("circuit", &input.name.name, input.name.span()).into()); + self.handler.emit_err(TypeCheckerError::unknown_sym( + "circuit", + &input.name.name, + input.name.span(), + )); None } } @@ -194,7 +194,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { Some(self.assert_and_return_type(var.type_, expected, var.span)) } else { self.handler - .emit_err(TypeCheckerError::unknown_sym("variable", var.name, var.span()).into()); + .emit_err(TypeCheckerError::unknown_sym("variable", var.name, var.span())); None } } @@ -215,7 +215,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { if int.parse::().is_err() { self.handler - .emit_err(TypeCheckerError::invalid_int_value(int, "i8", input.span()).into()); + .emit_err(TypeCheckerError::invalid_int_value(int, "i8", input.span())); } } IntegerType::I16 => { @@ -227,7 +227,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { if int.parse::().is_err() { self.handler - .emit_err(TypeCheckerError::invalid_int_value(int, "i16", input.span()).into()); + .emit_err(TypeCheckerError::invalid_int_value(int, "i16", input.span())); } } IntegerType::I32 => { @@ -239,7 +239,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { if int.parse::().is_err() { self.handler - .emit_err(TypeCheckerError::invalid_int_value(int, "i32", input.span()).into()); + .emit_err(TypeCheckerError::invalid_int_value(int, "i32", input.span())); } } IntegerType::I64 => { @@ -251,7 +251,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { if int.parse::().is_err() { self.handler - .emit_err(TypeCheckerError::invalid_int_value(int, "i64", input.span()).into()); + .emit_err(TypeCheckerError::invalid_int_value(int, "i64", input.span())); } } IntegerType::I128 => { @@ -263,24 +263,24 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { if int.parse::().is_err() { self.handler - .emit_err(TypeCheckerError::invalid_int_value(int, "i128", input.span()).into()); + .emit_err(TypeCheckerError::invalid_int_value(int, "i128", input.span())); } } IntegerType::U8 if str_content.parse::().is_err() => self .handler - .emit_err(TypeCheckerError::invalid_int_value(str_content, "u8", input.span()).into()), + .emit_err(TypeCheckerError::invalid_int_value(str_content, "u8", input.span())), IntegerType::U16 if str_content.parse::().is_err() => self .handler - .emit_err(TypeCheckerError::invalid_int_value(str_content, "u16", input.span()).into()), + .emit_err(TypeCheckerError::invalid_int_value(str_content, "u16", input.span())), IntegerType::U32 if str_content.parse::().is_err() => self .handler - .emit_err(TypeCheckerError::invalid_int_value(str_content, "u32", input.span()).into()), + .emit_err(TypeCheckerError::invalid_int_value(str_content, "u32", input.span())), IntegerType::U64 if str_content.parse::().is_err() => self .handler - .emit_err(TypeCheckerError::invalid_int_value(str_content, "u64", input.span()).into()), + .emit_err(TypeCheckerError::invalid_int_value(str_content, "u64", input.span())), IntegerType::U128 if str_content.parse::().is_err() => self .handler - .emit_err(TypeCheckerError::invalid_int_value(str_content, "u128", input.span()).into()), + .emit_err(TypeCheckerError::invalid_int_value(str_content, "u128", input.span())), _ => {} } self.assert_and_return_type(Type::IntegerType(*type_), expected, input.span()) @@ -447,7 +447,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { (Some(Type::Address), _) | (_, Some(Type::Address)) => { // Emit an error for address comparison. self.handler - .emit_err(TypeCheckerError::compare_address(input.op, input.span()).into()); + .emit_err(TypeCheckerError::compare_address(input.op, input.span())); } (Some(Type::Field), t2) => { // Assert rhs is field. @@ -585,14 +585,11 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { // Check number of function arguments. if func.input.len() != input.arguments.len() { - self.handler.emit_err( - TypeCheckerError::incorrect_num_args_to_call( - func.input.len(), - input.arguments.len(), - input.span(), - ) - .into(), - ); + self.handler.emit_err(TypeCheckerError::incorrect_num_args_to_call( + func.input.len(), + input.arguments.len(), + input.span(), + )); } // Check function argument types. @@ -606,7 +603,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { Some(ret) } else { self.handler - .emit_err(TypeCheckerError::unknown_sym("function", &ident.name, ident.span()).into()); + .emit_err(TypeCheckerError::unknown_sym("function", &ident.name, ident.span())); None } } diff --git a/compiler/passes/src/type_checker/check_program.rs b/compiler/passes/src/type_checker/check_program.rs index 5db32a1f1c..9cab2de985 100644 --- a/compiler/passes/src/type_checker/check_program.rs +++ b/compiler/passes/src/type_checker/check_program.rs @@ -35,7 +35,7 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { self.parent = Some(input.name()); input.input.iter().for_each(|i| { let input_var = i.get_variable(); - self.check_ident_type(&Some(input_var.type_)); + self.check_core_type_conflict(&Some(input_var.type_)); // Check for conflicting variable names. if let Err(err) = self.symbol_table.borrow_mut().insert_variable( @@ -53,7 +53,7 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { if !self.has_return { self.handler - .emit_err(TypeCheckerError::function_has_no_return(input.name(), input.span()).into()); + .emit_err(TypeCheckerError::function_has_no_return(input.name(), input.span())); } let prev_st = *self.symbol_table.borrow_mut().parent.take().unwrap(); @@ -66,9 +66,9 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { let mut used = HashSet::new(); if !input.members.iter().all(|member| used.insert(member.name())) { self.handler.emit_err(if input.is_record { - TypeCheckerError::duplicate_record_variable(input.name(), input.span()).into() + TypeCheckerError::duplicate_record_variable(input.name(), input.span()) } else { - TypeCheckerError::duplicate_circuit_member(input.name(), input.span()).into() + TypeCheckerError::duplicate_circuit_member(input.name(), input.span()) }); } @@ -81,12 +81,18 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { { Some((_, actual_ty)) if expected_ty.eq_flat(actual_ty) => {} // All good, found + right type! Some((field, _)) => { - self.handler - .emit_err(TypeCheckerError::record_var_wrong_type(field, expected_ty, input.span()).into()); + self.handler.emit_err(TypeCheckerError::record_var_wrong_type( + field, + expected_ty, + input.span(), + )); } None => { - self.handler - .emit_err(TypeCheckerError::required_record_variable(need, expected_ty, input.span()).into()); + self.handler.emit_err(TypeCheckerError::required_record_variable( + need, + expected_ty, + input.span(), + )); } }; check_has_field(sym::owner, Type::Address); diff --git a/compiler/passes/src/type_checker/check_statements.rs b/compiler/passes/src/type_checker/check_statements.rs index c094c8426e..1ce00be291 100644 --- a/compiler/passes/src/type_checker/check_statements.rs +++ b/compiler/passes/src/type_checker/check_statements.rs @@ -28,7 +28,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { let parent = self.parent.unwrap(); let return_type = &self.symbol_table.borrow().lookup_fn(&parent).map(|f| f.output); - self.check_ident_type(return_type); + self.check_core_type_conflict(return_type); self.has_return = true; self.visit_expression(&input.expression, return_type); @@ -42,7 +42,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { }; input.variable_names.iter().for_each(|v| { - self.check_ident_type(&Some(input.type_)); + self.check_core_type_conflict(&Some(input.type_)); self.visit_expression(&input.value, &Some(input.type_)); @@ -64,7 +64,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { Expression::Identifier(id) => id, _ => { self.handler - .emit_err(TypeCheckerError::invalid_assignment_target(input.place.span()).into()); + .emit_err(TypeCheckerError::invalid_assignment_target(input.place.span())); return; } }; @@ -89,7 +89,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { }; if var_type.is_some() { - self.check_ident_type(&var_type); + self.check_core_type_conflict(&var_type); self.visit_expression(&input.value, &var_type); } } diff --git a/compiler/passes/src/type_checker/checker.rs b/compiler/passes/src/type_checker/checker.rs index 18478e95c9..7dbf6ad0d1 100644 --- a/compiler/passes/src/type_checker/checker.rs +++ b/compiler/passes/src/type_checker/checker.rs @@ -86,7 +86,7 @@ impl<'a> TypeChecker<'a> { /// Emits a type checker error. pub(crate) fn emit_err(&self, err: TypeCheckerError) { - self.handler.emit_err(err.into()); + self.handler.emit_err(err); } /// Emits an error if the two given types are not equal. @@ -310,7 +310,7 @@ impl<'a> TypeChecker<'a> { } /// Emits an error if the given type conflicts with a core library type. - pub(crate) fn check_ident_type(&self, type_: &Option) { + pub(crate) fn check_core_type_conflict(&self, type_: &Option) { // todo: deprecate this method. if let Some(Type::Identifier(ident)) = type_ { if self.account_types.contains(&ident.name) || self.algorithms_types.contains(&ident.name) { diff --git a/leo/errors/src/emitter/mod.rs b/leo/errors/src/emitter/mod.rs index f08d959cbd..fd4268db62 100644 --- a/leo/errors/src/emitter/mod.rs +++ b/leo/errors/src/emitter/mod.rs @@ -205,8 +205,8 @@ impl Handler { } /// Emit the error `err`. - pub fn emit_err(&self, err: LeoError) { - self.inner.borrow_mut().emit_err(err); + pub fn emit_err>(&self, err: E) { + self.inner.borrow_mut().emit_err(err.into()); } /// Emit the error `err`. @@ -282,9 +282,9 @@ mod tests { let res: Result<(), _> = Handler::with(|h| { let s = Span::default(); assert_eq!(h.err_count(), 0); - h.emit_err(ParserError::invalid_import_list(s).into()); + h.emit_err(ParserError::invalid_import_list(s)); assert_eq!(h.err_count(), 1); - h.emit_err(ParserError::unexpected_eof(s).into()); + h.emit_err(ParserError::unexpected_eof(s)); assert_eq!(h.err_count(), 2); Err(ParserError::spread_in_array_init(s).into()) }); @@ -293,8 +293,8 @@ mod tests { let res: Result<(), _> = Handler::with(|h| { let s = Span::default(); - h.emit_err(ParserError::invalid_import_list(s).into()); - h.emit_err(ParserError::unexpected_eof(s).into()); + h.emit_err(ParserError::invalid_import_list(s)); + h.emit_err(ParserError::unexpected_eof(s)); Ok(()) }); assert_eq!(count_err(res.unwrap_err().to_string()), 2); From 296c62a280c1665595dbd94f0aa83847dc43d797 Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Sat, 9 Jul 2022 10:15:08 -0700 Subject: [PATCH 29/37] impl tuple type expression --- compiler/ast/src/expressions/circuit_init.rs | 6 +- compiler/ast/src/expressions/mod.rs | 36 +- compiler/ast/src/expressions/tuple_init.rs | 43 ++ compiler/ast/src/passes/reconstructor.rs | 94 ++-- compiler/ast/src/passes/visitor.rs | 81 ++-- compiler/ast/src/types/tuple.rs | 15 +- compiler/parser/src/parser/expression.rs | 2 +- .../src/type_checker/check_expressions.rs | 434 ++++++++++-------- .../passes/src/type_checker/check_program.rs | 3 +- .../src/type_checker/check_statements.rs | 3 +- compiler/passes/src/type_checker/checker.rs | 2 +- .../errors/type_checker/type_checker_error.rs | 14 + 12 files changed, 424 insertions(+), 309 deletions(-) create mode 100644 compiler/ast/src/expressions/tuple_init.rs diff --git a/compiler/ast/src/expressions/circuit_init.rs b/compiler/ast/src/expressions/circuit_init.rs index 46e5ad4306..81e8fec94f 100644 --- a/compiler/ast/src/expressions/circuit_init.rs +++ b/compiler/ast/src/expressions/circuit_init.rs @@ -38,7 +38,7 @@ impl fmt::Display for CircuitVariableInitializer { /// A circuit initialization expression, e.g., `Foo { bar: 42, baz }`. #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct CircuitInitExpression { +pub struct CircuitExpression { /// The name of the structure type to initialize. pub name: Identifier, /// Initializer expressions for each of the fields in the circuit. @@ -50,7 +50,7 @@ pub struct CircuitInitExpression { pub span: Span, } -impl fmt::Display for CircuitInitExpression { +impl fmt::Display for CircuitExpression { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{} {{ ", self.name)?; for member in self.members.iter() { @@ -61,4 +61,4 @@ impl fmt::Display for CircuitInitExpression { } } -crate::simple_node_impl!(CircuitInitExpression); +crate::simple_node_impl!(CircuitExpression); diff --git a/compiler/ast/src/expressions/mod.rs b/compiler/ast/src/expressions/mod.rs index 4fcca54b4b..e896696dac 100644 --- a/compiler/ast/src/expressions/mod.rs +++ b/compiler/ast/src/expressions/mod.rs @@ -38,6 +38,9 @@ pub use err::*; mod ternary; pub use ternary::*; +mod tuple_init; +pub use tuple_init::*; + mod unary; pub use unary::*; @@ -49,21 +52,23 @@ pub use value::*; pub enum Expression { /// A circuit access expression, e.g., `Foo.bar`. Access(AccessExpression), - /// An identifier expression. - Identifier(Identifier), - /// A literal expression. - Literal(LiteralExpression), /// A binary expression, e.g., `42 + 24`. Binary(BinaryExpression), /// A call expression, e.g., `my_fun(args)`. Call(CallExpression), /// An expression constructing a circuit like `Foo { bar: 42, baz }`. - CircuitInit(CircuitInitExpression), + Circuit(CircuitExpression), /// An expression of type "error". /// Will result in a compile error eventually. Err(ErrExpression), + /// An identifier. + Identifier(Identifier), + /// A literal expression. + Literal(LiteralExpression), /// A ternary conditional expression `cond ? if_expr : else_expr`. Ternary(TernaryExpression), + /// A tuple expression e.g., `(foo, 42, true)`. + Tuple(TupleExpression), /// An unary expression. Unary(UnaryExpression), } @@ -73,13 +78,14 @@ impl Node for Expression { use Expression::*; match self { Access(n) => n.span(), - Identifier(n) => n.span(), - Literal(n) => n.span(), Binary(n) => n.span(), Call(n) => n.span(), - CircuitInit(n) => n.span(), + Circuit(n) => n.span(), Err(n) => n.span(), + Identifier(n) => n.span(), + Literal(n) => n.span(), Ternary(n) => n.span(), + Tuple(n) => n.span(), Unary(n) => n.span(), } } @@ -88,13 +94,14 @@ impl Node for Expression { use Expression::*; match self { Access(n) => n.set_span(span), - Identifier(n) => n.set_span(span), - Literal(n) => n.set_span(span), Binary(n) => n.set_span(span), Call(n) => n.set_span(span), - CircuitInit(n) => n.set_span(span), + Circuit(n) => n.set_span(span), + Identifier(n) => n.set_span(span), + Literal(n) => n.set_span(span), Err(n) => n.set_span(span), Ternary(n) => n.set_span(span), + Tuple(n) => n.set_span(span), Unary(n) => n.set_span(span), } } @@ -105,13 +112,14 @@ impl fmt::Display for Expression { use Expression::*; match &self { Access(n) => n.fmt(f), - Identifier(n) => n.fmt(f), - Literal(n) => n.fmt(f), Binary(n) => n.fmt(f), Call(n) => n.fmt(f), - CircuitInit(n) => n.fmt(f), + Circuit(n) => n.fmt(f), Err(n) => n.fmt(f), + Identifier(n) => n.fmt(f), + Literal(n) => n.fmt(f), Ternary(n) => n.fmt(f), + Tuple(n) => n.fmt(f), Unary(n) => n.fmt(f), } } diff --git a/compiler/ast/src/expressions/tuple_init.rs b/compiler/ast/src/expressions/tuple_init.rs new file mode 100644 index 0000000000..7be5a38a97 --- /dev/null +++ b/compiler/ast/src/expressions/tuple_init.rs @@ -0,0 +1,43 @@ +// Copyright (C) 2019-2022 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +use super::*; + +/// A tuple construction expression, e.g., `(foo, false, 42)`. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct TupleExpression { + /// The elements of the tuple. + /// In the example above, it would be `foo`, `false`, and `42`. + pub elements: Vec, + /// The span from `(` to `)`. + pub span: Span, +} + +impl fmt::Display for TupleExpression { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!( + f, + "({})", + self.elements + .iter() + .map(|x| x.to_string()) + .collect::>() + .join(",") + ) + } +} + +crate::simple_node_impl!(TupleExpression); diff --git a/compiler/ast/src/passes/reconstructor.rs b/compiler/ast/src/passes/reconstructor.rs index 24d4a0874e..048c27143b 100644 --- a/compiler/ast/src/passes/reconstructor.rs +++ b/compiler/ast/src/passes/reconstructor.rs @@ -27,33 +27,22 @@ pub trait ExpressionReconstructor { fn reconstruct_expression(&mut self, input: Expression) -> (Expression, Self::AdditionalOutput) { match input { Expression::Access(access) => self.reconstruct_access(access), - Expression::Identifier(identifier) => self.reconstruct_identifier(identifier), - Expression::Literal(value) => self.reconstruct_literal(value), Expression::Binary(binary) => self.reconstruct_binary(binary), Expression::Call(call) => self.reconstruct_call(call), - Expression::CircuitInit(circuit) => self.reconstruct_circuit_init(circuit), - Expression::Unary(unary) => self.reconstruct_unary(unary), - Expression::Ternary(ternary) => self.reconstruct_ternary(ternary), + Expression::Circuit(circuit) => self.reconstruct_circuit_init(circuit), Expression::Err(err) => self.reconstruct_err(err), + Expression::Identifier(identifier) => self.reconstruct_identifier(identifier), + Expression::Literal(value) => self.reconstruct_literal(value), + Expression::Ternary(ternary) => self.reconstruct_ternary(ternary), + Expression::Tuple(tuple) => self.reconstruct_tuple(tuple), + Expression::Unary(unary) => self.reconstruct_unary(unary), } } - fn reconstruct_identifier(&mut self, input: Identifier) -> (Expression, Self::AdditionalOutput) { - (Expression::Identifier(input), Default::default()) - } - - fn reconstruct_literal(&mut self, input: LiteralExpression) -> (Expression, Self::AdditionalOutput) { - (Expression::Literal(input), Default::default()) - } - fn reconstruct_access(&mut self, input: AccessExpression) -> (Expression, Self::AdditionalOutput) { (Expression::Access(input), Default::default()) } - fn reconstruct_circuit_init(&mut self, input: CircuitInitExpression) -> (Expression, Self::AdditionalOutput) { - (Expression::CircuitInit(input), Default::default()) - } - fn reconstruct_binary(&mut self, input: BinaryExpression) -> (Expression, Self::AdditionalOutput) { ( Expression::Binary(BinaryExpression { @@ -66,28 +55,6 @@ pub trait ExpressionReconstructor { ) } - fn reconstruct_unary(&mut self, input: UnaryExpression) -> (Expression, Self::AdditionalOutput) { - ( - Expression::Unary(UnaryExpression { - receiver: Box::new(self.reconstruct_expression(*input.receiver).0), - op: input.op, - span: input.span, - }), - Default::default(), - ) - } - - fn reconstruct_ternary(&mut self, input: TernaryExpression) -> (Expression, Self::AdditionalOutput) { - ( - Expression::Ternary(TernaryExpression { - condition: Box::new(self.reconstruct_expression(*input.condition).0), - if_true: Box::new(self.reconstruct_expression(*input.if_true).0), - if_false: Box::new(self.reconstruct_expression(*input.if_false).0), - span: input.span, - }), - Default::default(), - ) - } fn reconstruct_call(&mut self, input: CallExpression) -> (Expression, Self::AdditionalOutput) { ( @@ -104,9 +71,58 @@ pub trait ExpressionReconstructor { ) } + fn reconstruct_circuit_init(&mut self, input: CircuitExpression) -> (Expression, Self::AdditionalOutput) { + (Expression::Circuit(input), Default::default()) + } + fn reconstruct_err(&mut self, input: ErrExpression) -> (Expression, Self::AdditionalOutput) { (Expression::Err(input), Default::default()) } + + fn reconstruct_identifier(&mut self, input: Identifier) -> (Expression, Self::AdditionalOutput) { + (Expression::Identifier(input), Default::default()) + } + + fn reconstruct_literal(&mut self, input: LiteralExpression) -> (Expression, Self::AdditionalOutput) { + (Expression::Literal(input), Default::default()) + } + + fn reconstruct_ternary(&mut self, input: TernaryExpression) -> (Expression, Self::AdditionalOutput) { + ( + Expression::Ternary(TernaryExpression { + condition: Box::new(self.reconstruct_expression(*input.condition).0), + if_true: Box::new(self.reconstruct_expression(*input.if_true).0), + if_false: Box::new(self.reconstruct_expression(*input.if_false).0), + span: input.span, + }), + Default::default(), + ) + } + + fn reconstruct_tuple(&mut self, input: TupleExpression) -> (Expression, Self::AdditionalOutput) { + ( + Expression::Tuple(TupleExpression { + elements: input + .elements + .into_iter() + .map(|element| self.reconstruct_expression(element).0) + .collect(), + span: input.span, + }), + Default::default(), + ) + } + + fn reconstruct_unary(&mut self, input: UnaryExpression) -> (Expression, Self::AdditionalOutput) { + ( + Expression::Unary(UnaryExpression { + receiver: Box::new(self.reconstruct_expression(*input.receiver).0), + op: input.op, + span: input.span, + }), + Default::default(), + ) + } } /// A Reconstructor trait for statements in the AST. diff --git a/compiler/ast/src/passes/visitor.rs b/compiler/ast/src/passes/visitor.rs index 3a1b0b3d18..ea7e74e17f 100644 --- a/compiler/ast/src/passes/visitor.rs +++ b/compiler/ast/src/passes/visitor.rs @@ -27,15 +27,16 @@ pub trait ExpressionVisitor<'a> { fn visit_expression(&mut self, input: &'a Expression, additional: &Self::AdditionalInput) -> Self::Output { match input { - Expression::Access(expr) => self.visit_access(expr, additional), - Expression::CircuitInit(expr) => self.visit_circuit_init(expr, additional), - Expression::Identifier(expr) => self.visit_identifier(expr, additional), - Expression::Literal(expr) => self.visit_literal(expr, additional), - Expression::Binary(expr) => self.visit_binary(expr, additional), - Expression::Unary(expr) => self.visit_unary(expr, additional), - Expression::Ternary(expr) => self.visit_ternary(expr, additional), - Expression::Call(expr) => self.visit_call(expr, additional), - Expression::Err(expr) => self.visit_err(expr, additional), + Expression::Access(access) => self.visit_access(access, additional), + Expression::Binary(binary) => self.visit_binary(binary, additional), + Expression::Call(call) => self.visit_call(call, additional), + Expression::Circuit(circuit) => self.visit_circuit_init(circuit, additional), + Expression::Err(err) => self.visit_err(err, additional), + Expression::Identifier(identifier) => self.visit_identifier(identifier, additional), + Expression::Literal(literal) => self.visit_literal(literal, additional), + Expression::Ternary(ternary) => self.visit_ternary(ternary, additional), + Expression::Tuple(tuple) => self.visit_tuple(tuple, additional), + Expression::Unary(unary) => self.visit_unary(unary, additional), } } @@ -43,40 +44,12 @@ pub trait ExpressionVisitor<'a> { Default::default() } - fn visit_circuit_init( - &mut self, - _input: &'a CircuitInitExpression, - _additional: &Self::AdditionalInput, - ) -> Self::Output { - Default::default() - } - - fn visit_identifier(&mut self, _input: &'a Identifier, _additional: &Self::AdditionalInput) -> Self::Output { - Default::default() - } - - fn visit_literal(&mut self, _input: &'a LiteralExpression, _additional: &Self::AdditionalInput) -> Self::Output { - Default::default() - } - fn visit_binary(&mut self, input: &'a BinaryExpression, additional: &Self::AdditionalInput) -> Self::Output { self.visit_expression(&input.left, additional); self.visit_expression(&input.right, additional); Default::default() } - fn visit_unary(&mut self, input: &'a UnaryExpression, additional: &Self::AdditionalInput) -> Self::Output { - self.visit_expression(&input.receiver, additional); - Default::default() - } - - fn visit_ternary(&mut self, input: &'a TernaryExpression, additional: &Self::AdditionalInput) -> Self::Output { - self.visit_expression(&input.condition, additional); - self.visit_expression(&input.if_true, additional); - self.visit_expression(&input.if_false, additional); - Default::default() - } - fn visit_call(&mut self, input: &'a CallExpression, additional: &Self::AdditionalInput) -> Self::Output { input.arguments.iter().for_each(|expr| { self.visit_expression(expr, additional); @@ -87,6 +60,40 @@ pub trait ExpressionVisitor<'a> { fn visit_err(&mut self, _input: &'a ErrExpression, _additional: &Self::AdditionalInput) -> Self::Output { Default::default() } + fn visit_identifier(&mut self, _input: &'a Identifier, _additional: &Self::AdditionalInput) -> Self::Output { + Default::default() + } + + fn visit_literal(&mut self, _input: &'a LiteralExpression, _additional: &Self::AdditionalInput) -> Self::Output { + Default::default() + } + + fn visit_circuit_init( + &mut self, + _input: &'a CircuitExpression, + _additional: &Self::AdditionalInput, + ) -> Self::Output { + Default::default() + } + + fn visit_ternary(&mut self, input: &'a TernaryExpression, additional: &Self::AdditionalInput) -> Self::Output { + self.visit_expression(&input.condition, additional); + self.visit_expression(&input.if_true, additional); + self.visit_expression(&input.if_false, additional); + Default::default() + } + + fn visit_tuple(&mut self, input: &'a TupleExpression, additional: &Self::AdditionalInput) -> Self::Output { + input.elements.iter().for_each(|expr| { + self.visit_expression(expr, additional); + }); + Default::default() + } + + fn visit_unary(&mut self, input: &'a UnaryExpression, additional: &Self::AdditionalInput) -> Self::Output { + self.visit_expression(&input.receiver, additional); + Default::default() + } } /// A Visitor trait for statements in the AST. diff --git a/compiler/ast/src/types/tuple.rs b/compiler/ast/src/types/tuple.rs index 1f861be121..427fe58608 100644 --- a/compiler/ast/src/types/tuple.rs +++ b/compiler/ast/src/types/tuple.rs @@ -19,10 +19,7 @@ use leo_errors::{AstError, Result}; use leo_span::Span; use serde::{Deserialize, Serialize}; -use std::{ - fmt, - ops::Deref -}; +use std::{fmt, ops::Deref}; /// A type list of at least two types. #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] @@ -34,7 +31,7 @@ impl Tuple { match elements.len() { 0 => Err(AstError::empty_tuple(span).into()), 1 => Err(AstError::one_element_tuple(span).into()), - _ => Ok(Type::Tuple(Tuple(elements))) + _ => Ok(Type::Tuple(Tuple(elements))), } } } @@ -49,6 +46,10 @@ impl Deref for Tuple { impl fmt::Display for Tuple { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "({})", self.0.iter().map(|x| x.to_string()).collect::>().join(",")) + write!( + f, + "({})", + self.0.iter().map(|x| x.to_string()).collect::>().join(",") + ) } -} \ No newline at end of file +} diff --git a/compiler/parser/src/parser/expression.rs b/compiler/parser/src/parser/expression.rs index 1cdf2233e7..6d0689aee5 100644 --- a/compiler/parser/src/parser/expression.rs +++ b/compiler/parser/src/parser/expression.rs @@ -470,7 +470,7 @@ impl ParserContext<'_> { p.parse_circuit_member().map(Some) })?; - Ok(Expression::CircuitInit(CircuitInitExpression { + Ok(Expression::Circuit(CircuitExpression { span: identifier.span + end, name: identifier, members, diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index 09a2c4c5ff..8089db9e20 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -43,14 +43,15 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { fn visit_expression(&mut self, input: &'a Expression, expected: &Self::AdditionalInput) -> Self::Output { match input { - Expression::Access(expr) => self.visit_access(expr, expected), - Expression::Identifier(expr) => self.visit_identifier(expr, expected), - Expression::Literal(expr) => self.visit_literal(expr, expected), - Expression::Binary(expr) => self.visit_binary(expr, expected), - Expression::Call(expr) => self.visit_call(expr, expected), - Expression::CircuitInit(expr) => self.visit_circuit_init(expr, expected), - Expression::Err(expr) => self.visit_err(expr, expected), - Expression::Ternary(expr) => self.visit_ternary(expr, expected), + Expression::Access(access) => self.visit_access(access, expected), + Expression::Binary(binary) => self.visit_binary(binary, expected), + Expression::Call(call) => self.visit_call(call, expected), + Expression::Circuit(circuit) => self.visit_circuit_init(circuit, expected), + Expression::Identifier(identifier) => self.visit_identifier(identifier, expected), + Expression::Err(err) => self.visit_err(err, expected), + Expression::Literal(literal) => self.visit_literal(literal, expected), + Expression::Ternary(ternary) => self.visit_ternary(ternary, expected), + Expression::Tuple(tuple) => self.visit_tuple(tuple, expected), Expression::Unary(expr) => self.visit_unary(expr, expected), } } @@ -97,155 +98,6 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } } - fn visit_circuit_init( - &mut self, - input: &'a CircuitInitExpression, - additional: &Self::AdditionalInput, - ) -> Self::Output { - let circ = self.symbol_table.borrow().lookup_circuit(&input.name.name).cloned(); - if let Some(circ) = circ { - // Check circuit type name. - let ret = self.check_expected_circuit(circ.identifier, additional, input.name.span()); - - // Check number of circuit members. - if circ.members.len() != input.members.len() { - self.handler.emit_err( - TypeCheckerError::incorrect_num_circuit_members( - circ.members.len(), - input.members.len(), - input.span(), - ) - .into(), - ); - } - - // Check circuit member types. - circ.members - .iter() - .for_each(|CircuitMember::CircuitVariable(name, ty)| { - // Lookup circuit variable name. - if let Some(actual) = input.members.iter().find(|member| member.identifier.name == name.name) { - if let Some(expr) = &actual.expression { - self.visit_expression(expr, &Some(ty.clone())); - } - } else { - self.handler.emit_err( - TypeCheckerError::unknown_sym("circuit member variable", name, name.span()).into(), - ); - }; - }); - - Some(ret) - } else { - self.handler - .emit_err(TypeCheckerError::unknown_sym("circuit", &input.name.name, input.name.span()).into()); - None - } - } - - fn visit_identifier(&mut self, var: &'a Identifier, expected: &Self::AdditionalInput) -> Self::Output { - if let Some(circuit) = self.symbol_table.borrow().lookup_circuit(&var.name) { - Some(self.assert_and_return_type(Type::Identifier(circuit.identifier), expected, var.span)) - } else if let Some(var) = self.symbol_table.borrow().lookup_variable(&var.name) { - Some(self.assert_and_return_type(var.type_.clone(), expected, var.span)) - } else { - self.handler - .emit_err(TypeCheckerError::unknown_sym("variable", var.name, var.span()).into()); - None - } - } - - fn visit_literal(&mut self, input: &'a LiteralExpression, expected: &Self::AdditionalInput) -> Self::Output { - Some(match input { - LiteralExpression::Address(_, _) => self.assert_and_return_type(Type::Address, expected, input.span()), - LiteralExpression::Boolean(_, _) => self.assert_and_return_type(Type::Boolean, expected, input.span()), - LiteralExpression::Field(_, _) => self.assert_and_return_type(Type::Field, expected, input.span()), - LiteralExpression::Integer(type_, str_content, _) => { - match type_ { - IntegerType::I8 => { - let int = if self.negate { - format!("-{str_content}") - } else { - str_content.clone() - }; - - if int.parse::().is_err() { - self.handler - .emit_err(TypeCheckerError::invalid_int_value(int, "i8", input.span()).into()); - } - } - IntegerType::I16 => { - let int = if self.negate { - format!("-{str_content}") - } else { - str_content.clone() - }; - - if int.parse::().is_err() { - self.handler - .emit_err(TypeCheckerError::invalid_int_value(int, "i16", input.span()).into()); - } - } - IntegerType::I32 => { - let int = if self.negate { - format!("-{str_content}") - } else { - str_content.clone() - }; - - if int.parse::().is_err() { - self.handler - .emit_err(TypeCheckerError::invalid_int_value(int, "i32", input.span()).into()); - } - } - IntegerType::I64 => { - let int = if self.negate { - format!("-{str_content}") - } else { - str_content.clone() - }; - - if int.parse::().is_err() { - self.handler - .emit_err(TypeCheckerError::invalid_int_value(int, "i64", input.span()).into()); - } - } - IntegerType::I128 => { - let int = if self.negate { - format!("-{str_content}") - } else { - str_content.clone() - }; - - if int.parse::().is_err() { - self.handler - .emit_err(TypeCheckerError::invalid_int_value(int, "i128", input.span()).into()); - } - } - IntegerType::U8 if str_content.parse::().is_err() => self - .handler - .emit_err(TypeCheckerError::invalid_int_value(str_content, "u8", input.span()).into()), - IntegerType::U16 if str_content.parse::().is_err() => self - .handler - .emit_err(TypeCheckerError::invalid_int_value(str_content, "u16", input.span()).into()), - IntegerType::U32 if str_content.parse::().is_err() => self - .handler - .emit_err(TypeCheckerError::invalid_int_value(str_content, "u32", input.span()).into()), - IntegerType::U64 if str_content.parse::().is_err() => self - .handler - .emit_err(TypeCheckerError::invalid_int_value(str_content, "u64", input.span()).into()), - IntegerType::U128 if str_content.parse::().is_err() => self - .handler - .emit_err(TypeCheckerError::invalid_int_value(str_content, "u128", input.span()).into()), - _ => {} - } - self.assert_and_return_type(Type::IntegerType(*type_), expected, input.span()) - } - LiteralExpression::Group(_) => self.assert_and_return_type(Type::Group, expected, input.span()), - LiteralExpression::Scalar(_, _) => self.assert_and_return_type(Type::Scalar, expected, input.span()), - LiteralExpression::String(_, _) => self.assert_and_return_type(Type::String, expected, input.span()), - }) - } fn visit_binary(&mut self, input: &'a BinaryExpression, destination: &Self::AdditionalInput) -> Self::Output { match input.op { @@ -470,6 +322,228 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } } + + fn visit_call(&mut self, input: &'a CallExpression, expected: &Self::AdditionalInput) -> Self::Output { + match &*input.function { + Expression::Identifier(ident) => { + let func = self.symbol_table.borrow().lookup_fn(&ident.name).cloned(); + if let Some(func) = func { + let ret = self.assert_and_return_type(func.output, expected, func.span); + + // Check number of function arguments. + if func.input.len() != input.arguments.len() { + self.handler.emit_err( + TypeCheckerError::incorrect_num_args_to_call( + func.input.len(), + input.arguments.len(), + input.span(), + ) + .into(), + ); + } + + // Check function argument types. + func.input + .iter() + .zip(input.arguments.iter()) + .for_each(|(expected, argument)| { + self.visit_expression(argument, &Some(expected.get_variable().type_.clone())); + }); + + Some(ret) + } else { + self.handler + .emit_err(TypeCheckerError::unknown_sym("function", &ident.name, ident.span()).into()); + None + } + } + expr => self.visit_expression(expr, expected), + } + } + + fn visit_circuit_init( + &mut self, + input: &'a CircuitExpression, + additional: &Self::AdditionalInput, + ) -> Self::Output { + let circ = self.symbol_table.borrow().lookup_circuit(&input.name.name).cloned(); + if let Some(circ) = circ { + // Check circuit type name. + let ret = self.check_expected_circuit(circ.identifier, additional, input.name.span()); + + // Check number of circuit members. + if circ.members.len() != input.members.len() { + self.emit_err( + TypeCheckerError::incorrect_num_circuit_members( + circ.members.len(), + input.members.len(), + input.span(), + ) + .into(), + ); + } + + // Check circuit member types. + circ.members + .iter() + .for_each(|CircuitMember::CircuitVariable(name, ty)| { + // Lookup circuit variable name. + if let Some(actual) = input.members.iter().find(|member| member.identifier.name == name.name) { + if let Some(expr) = &actual.expression { + self.visit_expression(expr, &Some(ty.clone())); + } + } else { + self.handler.emit_err( + TypeCheckerError::unknown_sym("circuit member variable", name, name.span()).into(), + ); + }; + }); + + Some(ret) + } else { + self.emit_err(TypeCheckerError::unknown_sym("circuit", &input.name.name, input.name.span()).into()); + None + } + } + + fn visit_identifier(&mut self, var: &'a Identifier, expected: &Self::AdditionalInput) -> Self::Output { + if let Some(circuit) = self.symbol_table.borrow().lookup_circuit(&var.name) { + Some(self.assert_and_return_type(Type::Identifier(circuit.identifier), expected, var.span)) + } else if let Some(var) = self.symbol_table.borrow().lookup_variable(&var.name) { + Some(self.assert_and_return_type(var.type_.clone(), expected, var.span)) + } else { + self.emit_err(TypeCheckerError::unknown_sym("variable", var.name, var.span()).into()); + None + } + } + + fn visit_literal(&mut self, input: &'a LiteralExpression, expected: &Self::AdditionalInput) -> Self::Output { + Some(match input { + LiteralExpression::Address(_, _) => self.assert_and_return_type(Type::Address, expected, input.span()), + LiteralExpression::Boolean(_, _) => self.assert_and_return_type(Type::Boolean, expected, input.span()), + LiteralExpression::Field(_, _) => self.assert_and_return_type(Type::Field, expected, input.span()), + LiteralExpression::Integer(type_, str_content, _) => { + match type_ { + IntegerType::I8 => { + let int = if self.negate { + format!("-{str_content}") + } else { + str_content.clone() + }; + + if int.parse::().is_err() { + self.handler + .emit_err(TypeCheckerError::invalid_int_value(int, "i8", input.span()).into()); + } + } + IntegerType::I16 => { + let int = if self.negate { + format!("-{str_content}") + } else { + str_content.clone() + }; + + if int.parse::().is_err() { + self.handler + .emit_err(TypeCheckerError::invalid_int_value(int, "i16", input.span()).into()); + } + } + IntegerType::I32 => { + let int = if self.negate { + format!("-{str_content}") + } else { + str_content.clone() + }; + + if int.parse::().is_err() { + self.handler + .emit_err(TypeCheckerError::invalid_int_value(int, "i32", input.span()).into()); + } + } + IntegerType::I64 => { + let int = if self.negate { + format!("-{str_content}") + } else { + str_content.clone() + }; + + if int.parse::().is_err() { + self.handler + .emit_err(TypeCheckerError::invalid_int_value(int, "i64", input.span()).into()); + } + } + IntegerType::I128 => { + let int = if self.negate { + format!("-{str_content}") + } else { + str_content.clone() + }; + + if int.parse::().is_err() { + self.handler + .emit_err(TypeCheckerError::invalid_int_value(int, "i128", input.span()).into()); + } + } + IntegerType::U8 if str_content.parse::().is_err() => self + .handler + .emit_err(TypeCheckerError::invalid_int_value(str_content, "u8", input.span()).into()), + IntegerType::U16 if str_content.parse::().is_err() => self + .handler + .emit_err(TypeCheckerError::invalid_int_value(str_content, "u16", input.span()).into()), + IntegerType::U32 if str_content.parse::().is_err() => self + .handler + .emit_err(TypeCheckerError::invalid_int_value(str_content, "u32", input.span()).into()), + IntegerType::U64 if str_content.parse::().is_err() => self + .handler + .emit_err(TypeCheckerError::invalid_int_value(str_content, "u64", input.span()).into()), + IntegerType::U128 if str_content.parse::().is_err() => self + .handler + .emit_err(TypeCheckerError::invalid_int_value(str_content, "u128", input.span()).into()), + _ => {} + } + self.assert_and_return_type(Type::IntegerType(*type_), expected, input.span()) + } + LiteralExpression::Group(_) => self.assert_and_return_type(Type::Group, expected, input.span()), + LiteralExpression::Scalar(_, _) => self.assert_and_return_type(Type::Scalar, expected, input.span()), + LiteralExpression::String(_, _) => self.assert_and_return_type(Type::String, expected, input.span()), + }) + } + + + + fn visit_ternary(&mut self, input: &'a TernaryExpression, expected: &Self::AdditionalInput) -> Self::Output { + self.visit_expression(&input.condition, &Some(Type::Boolean)); + + let t1 = self.visit_expression(&input.if_true, expected); + let t2 = self.visit_expression(&input.if_false, expected); + + return_incorrect_type(t1, t2, expected) + } + + fn visit_tuple(&mut self, input: &'a TupleExpression, expected: &Self::AdditionalInput) -> Self::Output { + // Check the expected tuple types if they are known. + if let Some(Type::Tuple(expected_types)) = expected { + // Check actual length is equal to expected length. + if expected_types.len() != input.elements.len() { + self.emit_err(TypeCheckerError::incorrect_tuple_length(expected_types.len(), input.elements.len(), input.span())); + } + + expected_types + .iter() + .zip(input.elements.iter()) + .for_each(|(expected, expr)| { + self.visit_expression(expr, &Some(expected.clone())); + }); + + Some(Type::Tuple(expected_types.clone())) + } else { + // Tuples must be explicitly typed in testnet3. + self.emit_err(TypeCheckerError::invalid_tuple(input.span())); + + None + } + } + fn visit_unary(&mut self, input: &'a UnaryExpression, destination: &Self::AdditionalInput) -> Self::Output { match input.op { UnaryOperation::Abs => { @@ -521,50 +595,4 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } } - fn visit_ternary(&mut self, input: &'a TernaryExpression, expected: &Self::AdditionalInput) -> Self::Output { - self.visit_expression(&input.condition, &Some(Type::Boolean)); - - let t1 = self.visit_expression(&input.if_true, expected); - let t2 = self.visit_expression(&input.if_false, expected); - - return_incorrect_type(t1, t2, expected) - } - - fn visit_call(&mut self, input: &'a CallExpression, expected: &Self::AdditionalInput) -> Self::Output { - match &*input.function { - Expression::Identifier(ident) => { - let func = self.symbol_table.borrow().lookup_fn(&ident.name).cloned(); - if let Some(func) = func { - let ret = self.assert_and_return_type(func.output, expected, func.span); - - // Check number of function arguments. - if func.input.len() != input.arguments.len() { - self.handler.emit_err( - TypeCheckerError::incorrect_num_args_to_call( - func.input.len(), - input.arguments.len(), - input.span(), - ) - .into(), - ); - } - - // Check function argument types. - func.input - .iter() - .zip(input.arguments.iter()) - .for_each(|(expected, argument)| { - self.visit_expression(argument, &Some(expected.get_variable().type_.clone())); - }); - - Some(ret) - } else { - self.handler - .emit_err(TypeCheckerError::unknown_sym("function", &ident.name, ident.span()).into()); - None - } - } - expr => self.visit_expression(expr, expected), - } - } } diff --git a/compiler/passes/src/type_checker/check_program.rs b/compiler/passes/src/type_checker/check_program.rs index 1a87d44994..95c3c0d1e5 100644 --- a/compiler/passes/src/type_checker/check_program.rs +++ b/compiler/passes/src/type_checker/check_program.rs @@ -52,8 +52,7 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { self.visit_block(&input.block); if !self.has_return { - self.handler - .emit_err(TypeCheckerError::function_has_no_return(input.name(), input.span()).into()); + self.emit_err(TypeCheckerError::function_has_no_return(input.name(), input.span()).into()); } let prev_st = *self.symbol_table.borrow_mut().parent.take().unwrap(); diff --git a/compiler/passes/src/type_checker/check_statements.rs b/compiler/passes/src/type_checker/check_statements.rs index e3e1778bf4..5aa68701ad 100644 --- a/compiler/passes/src/type_checker/check_statements.rs +++ b/compiler/passes/src/type_checker/check_statements.rs @@ -83,8 +83,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { Some(var.type_.clone()) } else { - self.handler - .emit_err(TypeCheckerError::unknown_sym("variable", var_name.name, var_name.span).into()); + self.emit_err(TypeCheckerError::unknown_sym("variable", var_name.name, var_name.span).into()); None }; diff --git a/compiler/passes/src/type_checker/checker.rs b/compiler/passes/src/type_checker/checker.rs index 40cff35838..e6a240f6f7 100644 --- a/compiler/passes/src/type_checker/checker.rs +++ b/compiler/passes/src/type_checker/checker.rs @@ -85,7 +85,7 @@ impl<'a> TypeChecker<'a> { } /// Emits a type checker error. - fn emit_err(&self, err: TypeCheckerError) { + pub fn emit_err(&self, err: TypeCheckerError) { self.handler.emit_err(err.into()); } 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 1aeeaa1404..4a1ba2d500 100644 --- a/leo/errors/src/errors/type_checker/type_checker_error.rs +++ b/leo/errors/src/errors/type_checker/type_checker_error.rs @@ -271,4 +271,18 @@ create_messages!( msg: format!("Comparison `{operator}` is not supported for the address type."), help: None, } + + @formatted + incorrect_tuple_length { + args: (expected: impl Display, actual: impl Display), + msg: format!("Expected a tuple of length `{expected}` got `{actual}`"), + help: None, + } + + @formatted + invalid_tuple { + args: (), + msg: format!("Tuples must be explicitly typed in Leo"), + help: Some("The function definition must match the function return statement".to_string()), + } ); From 9e422599a0abe37243469ddfa4029626ba000f6b Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Sat, 9 Jul 2022 12:39:50 -0700 Subject: [PATCH 30/37] impl tuple parsing --- compiler/parser/src/parser/expression.rs | 9 ++++++--- compiler/parser/src/parser/file.rs | 6 +++--- compiler/parser/src/parser/statement.rs | 4 ++-- compiler/parser/src/parser/type_.rs | 19 ++++++++++++++++++- examples/token/src/main.leo | 5 ++--- leo/errors/src/errors/ast/ast_errors.rs | 8 ++++---- .../errors/type_checker/type_checker_error.rs | 2 +- 7 files changed, 36 insertions(+), 17 deletions(-) diff --git a/compiler/parser/src/parser/expression.rs b/compiler/parser/src/parser/expression.rs index 6d0689aee5..dd547fcc62 100644 --- a/compiler/parser/src/parser/expression.rs +++ b/compiler/parser/src/parser/expression.rs @@ -320,8 +320,8 @@ impl ParserContext<'_> { })) } - /// Parses a tuple of expressions. - fn parse_expr_tuple(&mut self) -> Result<(Vec, bool, Span)> { + /// Parses a tuple of `Expression` AST nodes. + pub(crate) fn parse_expr_tuple(&mut self) -> Result<(Vec, bool, Span)> { self.parse_paren_comma_list(|p| p.parse_expression().map(Some)) } @@ -384,7 +384,10 @@ impl ParserContext<'_> { if !trailing && tuple.len() == 1 { Ok(tuple.swap_remove(0)) } else { - Err(ParserError::unexpected("A tuple expression.", "A valid expression.", span).into()) + Ok(Expression::Tuple(TupleExpression { + elements: tuple, + span + })) } } diff --git a/compiler/parser/src/parser/file.rs b/compiler/parser/src/parser/file.rs index 7a94c0c823..e7ed2104ab 100644 --- a/compiler/parser/src/parser/file.rs +++ b/compiler/parser/src/parser/file.rs @@ -107,7 +107,7 @@ impl ParserContext<'_> { fn parse_member(&mut self) -> Result<(Identifier, Type)> { let name = self.expect_ident()?; self.expect(&Token::Colon)?; - let type_ = self.parse_all_types()?.0; + let type_ = self.parse_single_type()?.0; Ok((name, type_)) } @@ -201,7 +201,7 @@ impl ParserContext<'_> { let name = self.expect_ident()?; self.expect(&Token::Colon)?; - let type_ = self.parse_all_types()?.0; + let type_ = self.parse_single_type()?.0; Ok(FunctionInput::Variable(FunctionInputVariable::new( name, mode, type_, name.span, ))) @@ -229,7 +229,7 @@ impl ParserContext<'_> { // Parse return type. self.expect(&Token::Arrow)?; self.disallow_circuit_construction = true; - let output = self.parse_all_types()?.0; + let output = self.parse_any_type()?.0; self.disallow_circuit_construction = false; // Parse the function body. diff --git a/compiler/parser/src/parser/statement.rs b/compiler/parser/src/parser/statement.rs index a7a35f15f5..16d556b55a 100644 --- a/compiler/parser/src/parser/statement.rs +++ b/compiler/parser/src/parser/statement.rs @@ -103,7 +103,7 @@ impl ParserContext<'_> { let start_span = self.expect(&Token::For)?; let ident = self.expect_ident()?; self.expect(&Token::Colon)?; - let type_ = self.parse_all_types()?; + let type_ = self.parse_single_type()?; self.expect(&Token::In)?; // Parse iteration range. @@ -222,7 +222,7 @@ impl ParserContext<'_> { }; self.expect(&Token::Colon)?; - let type_ = self.parse_all_types()?; + let type_ = self.parse_single_type()?; self.expect(&Token::Assign)?; let expr = self.parse_expression()?; diff --git a/compiler/parser/src/parser/type_.rs b/compiler/parser/src/parser/type_.rs index 4b34dae557..fa360dec9a 100644 --- a/compiler/parser/src/parser/type_.rs +++ b/compiler/parser/src/parser/type_.rs @@ -74,7 +74,7 @@ impl ParserContext<'_> { /// Returns a [`(Type, Span)`] tuple of AST nodes if the next token represents a type. /// Also returns the span of the parsed token. - pub fn parse_all_types(&mut self) -> Result<(Type, Span)> { + pub fn parse_single_type(&mut self) -> Result<(Type, Span)> { Ok(if let Some(ident) = self.eat_identifier() { let span = ident.span; (Type::Identifier(ident), span) @@ -82,4 +82,21 @@ impl ParserContext<'_> { self.parse_non_ident_types()? }) } + + /// Returns a [`(Type, Span)`] where `Type` is a `Type::Tuple` AST node. + pub fn parse_tuple_type(&mut self) -> Result<(Type, Span)> { // todo: catch and return error for nested tuple type. + let (types, _, span) = self.parse_paren_comma_list(|p| p.parse_single_type().map(Some))?; + let elements = types.into_iter().map(|(type_, _)| type_).collect::>(); + + Ok((Tuple::new(elements, span)?, span)) + } + + /// Returns a [`(Type, Span)`] where `Type` is a tuple or single type. + pub fn parse_any_type(&mut self) -> Result<(Type, Span)> { + if self.peek_is_left_par() { + self.parse_tuple_type() + } else { + self.parse_single_type() + } + } } diff --git a/examples/token/src/main.leo b/examples/token/src/main.leo index d7adbc5b55..80e1bf8b0e 100644 --- a/examples/token/src/main.leo +++ b/examples/token/src/main.leo @@ -26,7 +26,7 @@ function mint(r0: address, r1: u64) -> Token { // The `transfer` function sends the specified number of tokens // to the receiver from the provided token record. -function transfer(r0: Token, r1: Receiver) -> Token { +function transfer(r0: Token, r1: Receiver) -> (Token, Token) { // Checks the given token record has sufficient balance. // This `sub` operation is safe, and the proof will fail // if an overflow occurs. The output register `r2` holds @@ -41,8 +41,7 @@ function transfer(r0: Token, r1: Receiver) -> Token { // with the change amount for the sender. let r4: Token = mint(r0.owner, r0.amount); - // return (r3, r4); - return r3; + return (r3, r4); } function main() -> u8 { diff --git a/leo/errors/src/errors/ast/ast_errors.rs b/leo/errors/src/errors/ast/ast_errors.rs index b9f915ad3d..425ae93bad 100644 --- a/leo/errors/src/errors/ast/ast_errors.rs +++ b/leo/errors/src/errors/ast/ast_errors.rs @@ -131,19 +131,19 @@ create_messages!( help: None, } - /// For when a user tries to define a tuple dimension of 1. + /// For when a user tries to define an empty tuple. @formatted empty_tuple { args: (), - msg: "Tuples of 0 elements are not allowed.", + msg: "Tuples of zero elements are not allowed.", help: None, } - /// For when a user tries to define a tuple dimension of 1. + /// For when a user tries to define a tuple dimension of one. @formatted one_element_tuple { args: (), - msg: "Tuples of 1 element are not allowed.", + msg: "Tuples of one element are not allowed.", help: Some("Try defining a single type by removing the parenthesis `( )`".to_string()), } 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 4a1ba2d500..284bb86ae7 100644 --- a/leo/errors/src/errors/type_checker/type_checker_error.rs +++ b/leo/errors/src/errors/type_checker/type_checker_error.rs @@ -275,7 +275,7 @@ create_messages!( @formatted incorrect_tuple_length { args: (expected: impl Display, actual: impl Display), - msg: format!("Expected a tuple of length `{expected}` got `{actual}`"), + msg: format!("Expected a tuple of length `{expected}` found length `{actual}`"), help: None, } From a7fc19a69fbe34e33e8781572660de258bc0192b Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Sat, 9 Jul 2022 13:22:10 -0700 Subject: [PATCH 31/37] impl tuple ast access --- compiler/ast/src/access/mod.rs | 11 +++-- compiler/ast/src/access/tuple_access.rs | 40 +++++++++++++++++++ compiler/ast/src/expressions/access.rs | 20 +++++----- compiler/ast/src/passes/reconstructor.rs | 30 +++++++++++++- compiler/ast/src/passes/visitor.rs | 23 +++++++++-- compiler/parser/src/parser/expression.rs | 5 +-- compiler/parser/src/parser/type_.rs | 3 +- .../src/type_checker/check_expressions.rs | 19 ++++----- tests/compiler/tuple/function_return.leo | 10 +++++ .../tuple/function_return_single_fail.leo | 10 +++++ .../tuple/function_return_zero_fail.leo | 10 +++++ tests/compiler/tuple/inputs/bool_bool.in | 3 ++ .../circuits/duplicate_name_context.out | 2 +- .../compiler/compiler/circuits/inline.out | 2 +- .../compiler/circuits/inline_member_pass.out | 2 +- .../compiler/circuits/member_variable.out | 2 +- .../function/duplicate_definition_fail.out | 2 +- .../function/duplicate_parameter_fail.out | 2 +- .../shadow_function_with_input_fail.out | 2 +- .../records/duplicate_circuit_name_fail.out | 2 +- .../compiler/records/init_expression.out | 2 +- .../records/init_expression_shorthand.out | 2 +- .../statements/duplicate_variable.out | 2 +- .../compiler/tuple/function_return.out | 7 ++++ .../tuple/function_return_single_fail.out | 5 +++ .../tuple/function_return_zero_fail.out | 5 +++ .../parser/expression/literal/group_fail.out | 4 +- 27 files changed, 177 insertions(+), 50 deletions(-) create mode 100644 compiler/ast/src/access/tuple_access.rs create mode 100644 tests/compiler/tuple/function_return.leo create mode 100644 tests/compiler/tuple/function_return_single_fail.leo create mode 100644 tests/compiler/tuple/function_return_zero_fail.leo create mode 100644 tests/compiler/tuple/inputs/bool_bool.in create mode 100644 tests/expectations/compiler/compiler/tuple/function_return.out create mode 100644 tests/expectations/compiler/compiler/tuple/function_return_single_fail.out create mode 100644 tests/expectations/compiler/compiler/tuple/function_return_zero_fail.out diff --git a/compiler/ast/src/access/mod.rs b/compiler/ast/src/access/mod.rs index e4610f5f0c..3fc7e0abe8 100644 --- a/compiler/ast/src/access/mod.rs +++ b/compiler/ast/src/access/mod.rs @@ -14,11 +14,14 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -mod member_access; -pub use member_access::*; +mod associated_constant_access; +pub use associated_constant_access::*; mod associated_function_access; pub use associated_function_access::*; -mod associated_constant_access; -pub use associated_constant_access::*; +mod member_access; +pub use member_access::*; + +mod tuple_access; +pub use tuple_access::*; diff --git a/compiler/ast/src/access/tuple_access.rs b/compiler/ast/src/access/tuple_access.rs new file mode 100644 index 0000000000..818bfea750 --- /dev/null +++ b/compiler/ast/src/access/tuple_access.rs @@ -0,0 +1,40 @@ +// 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::{Expression, Node, PositiveNumber}; +use leo_span::Span; + +use serde::{Deserialize, Serialize}; +use std::fmt; + +/// An tuple access expression, e.g., `tuple.index`. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct TupleAccess { + /// An expression evaluating to some tuple type, e.g., `(5, 2)`. + pub tuple: Box, + /// The index to access in the tuple expression. E.g., `0` for `(5, 2)` would yield `5`. + pub index: PositiveNumber, + /// The span for the entire expression `tuple.index`. + pub span: Span, +} + +impl fmt::Display for TupleAccess { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}.{}", self.tuple, self.index) + } +} + +crate::simple_node_impl!(TupleAccess); diff --git a/compiler/ast/src/expressions/access.rs b/compiler/ast/src/expressions/access.rs index 0326f335ac..81588b420a 100644 --- a/compiler/ast/src/expressions/access.rs +++ b/compiler/ast/src/expressions/access.rs @@ -27,30 +27,32 @@ pub enum AccessExpression { // Array(ArrayAccess), // /// An expression accessing a range of an array. // ArrayRange(ArrayRangeAccess), - /// An expression accessing a field in a structure, e.g., `circuit_var.field`. - Member(MemberAccess), - // /// Access to a tuple field using its position, e.g., `tuple.1`. - // Tuple(TupleAccess), /// Access to an associated variable of a circuit e.g `u8::MAX`. AssociatedConstant(AssociatedConstant), /// Access to an associated function of a circuit e.g `Pedersen64::hash()`. AssociatedFunction(AssociatedFunction), + /// An expression accessing a field in a structure, e.g., `circuit_var.field`. + Member(MemberAccess), + /// Access to a tuple field using its position, e.g., `tuple.1`. + Tuple(TupleAccess), } impl Node for AccessExpression { fn span(&self) -> Span { match self { - AccessExpression::Member(n) => n.span(), AccessExpression::AssociatedConstant(n) => n.span(), AccessExpression::AssociatedFunction(n) => n.span(), + AccessExpression::Member(n) => n.span(), + AccessExpression::Tuple(n) => n.span(), } } fn set_span(&mut self, span: Span) { match self { - AccessExpression::Member(n) => n.set_span(span), AccessExpression::AssociatedConstant(n) => n.set_span(span), AccessExpression::AssociatedFunction(n) => n.set_span(span), + AccessExpression::Member(n) => n.set_span(span), + AccessExpression::Tuple(n) => n.set_span(span), } } } @@ -60,12 +62,10 @@ impl fmt::Display for AccessExpression { use AccessExpression::*; match self { - // Array(access) => access.fmt(f), - // ArrayRange(access) => access.fmt(f), - Member(access) => access.fmt(f), - // Tuple(access) => access.fmt(f), AssociatedConstant(access) => access.fmt(f), AssociatedFunction(access) => access.fmt(f), + Member(access) => access.fmt(f), + Tuple(access) => access.fmt(f), } } } diff --git a/compiler/ast/src/passes/reconstructor.rs b/compiler/ast/src/passes/reconstructor.rs index 048c27143b..32826802bf 100644 --- a/compiler/ast/src/passes/reconstructor.rs +++ b/compiler/ast/src/passes/reconstructor.rs @@ -40,7 +40,34 @@ pub trait ExpressionReconstructor { } fn reconstruct_access(&mut self, input: AccessExpression) -> (Expression, Self::AdditionalOutput) { - (Expression::Access(input), Default::default()) + ( + Expression::Access(match input { + AccessExpression::AssociatedFunction(function) => { + AccessExpression::AssociatedFunction(AssociatedFunction { + ty: function.ty, + name: function.name, + args: function + .args + .into_iter() + .map(|arg| self.reconstruct_expression(arg).0) + .collect(), + span: function.span, + }) + } + AccessExpression::Member(member) => AccessExpression::Member(MemberAccess { + inner: Box::new(self.reconstruct_expression(*member.inner).0), + name: member.name, + span: member.span, + }), + AccessExpression::Tuple(tuple) => AccessExpression::Tuple(TupleAccess { + tuple: Box::new(self.reconstruct_expression(*tuple.tuple).0), + index: tuple.index, + span: tuple.span, + }), + expr => expr, + }), + Default::default(), + ) } fn reconstruct_binary(&mut self, input: BinaryExpression) -> (Expression, Self::AdditionalOutput) { @@ -55,7 +82,6 @@ pub trait ExpressionReconstructor { ) } - fn reconstruct_call(&mut self, input: CallExpression) -> (Expression, Self::AdditionalOutput) { ( Expression::Call(CallExpression { diff --git a/compiler/ast/src/passes/visitor.rs b/compiler/ast/src/passes/visitor.rs index ea7e74e17f..97dec60550 100644 --- a/compiler/ast/src/passes/visitor.rs +++ b/compiler/ast/src/passes/visitor.rs @@ -40,7 +40,22 @@ pub trait ExpressionVisitor<'a> { } } - fn visit_access(&mut self, _input: &'a AccessExpression, _additional: &Self::AdditionalInput) -> Self::Output { + fn visit_access(&mut self, input: &'a AccessExpression, additional: &Self::AdditionalInput) -> Self::Output { + match input { + AccessExpression::AssociatedFunction(function) => { + function.args.iter().for_each(|arg| { + self.visit_expression(arg, &Default::default()); + }); + } + AccessExpression::Member(member) => { + self.visit_expression(&member.inner, additional); + } + AccessExpression::Tuple(tuple) => { + self.visit_expression(&tuple.tuple, additional); + } + _ => {} + } + Default::default() } @@ -69,9 +84,9 @@ pub trait ExpressionVisitor<'a> { } fn visit_circuit_init( - &mut self, - _input: &'a CircuitExpression, - _additional: &Self::AdditionalInput, + &mut self, + _input: &'a CircuitExpression, + _additional: &Self::AdditionalInput, ) -> Self::Output { Default::default() } diff --git a/compiler/parser/src/parser/expression.rs b/compiler/parser/src/parser/expression.rs index dd547fcc62..d596f4bb0e 100644 --- a/compiler/parser/src/parser/expression.rs +++ b/compiler/parser/src/parser/expression.rs @@ -384,10 +384,7 @@ impl ParserContext<'_> { if !trailing && tuple.len() == 1 { Ok(tuple.swap_remove(0)) } else { - Ok(Expression::Tuple(TupleExpression { - elements: tuple, - span - })) + Ok(Expression::Tuple(TupleExpression { elements: tuple, span })) } } diff --git a/compiler/parser/src/parser/type_.rs b/compiler/parser/src/parser/type_.rs index fa360dec9a..e6ca27cc1b 100644 --- a/compiler/parser/src/parser/type_.rs +++ b/compiler/parser/src/parser/type_.rs @@ -84,7 +84,8 @@ impl ParserContext<'_> { } /// Returns a [`(Type, Span)`] where `Type` is a `Type::Tuple` AST node. - pub fn parse_tuple_type(&mut self) -> Result<(Type, Span)> { // todo: catch and return error for nested tuple type. + pub fn parse_tuple_type(&mut self) -> Result<(Type, Span)> { + // todo: catch and return error for nested tuple type. let (types, _, span) = self.parse_paren_comma_list(|p| p.parse_single_type().map(Some))?; let elements = types.into_iter().map(|(type_, _)| type_).collect::>(); diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index 8089db9e20..a00a6ea2ca 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -98,7 +98,6 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } } - fn visit_binary(&mut self, input: &'a BinaryExpression, destination: &Self::AdditionalInput) -> Self::Output { match input.op { BinaryOperation::And | BinaryOperation::Or | BinaryOperation::Nand | BinaryOperation::Nor => { @@ -322,7 +321,6 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } } - fn visit_call(&mut self, input: &'a CallExpression, expected: &Self::AdditionalInput) -> Self::Output { match &*input.function { Expression::Identifier(ident) => { @@ -338,7 +336,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { input.arguments.len(), input.span(), ) - .into(), + .into(), ); } @@ -361,11 +359,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } } - fn visit_circuit_init( - &mut self, - input: &'a CircuitExpression, - additional: &Self::AdditionalInput, - ) -> Self::Output { + fn visit_circuit_init(&mut self, input: &'a CircuitExpression, additional: &Self::AdditionalInput) -> Self::Output { let circ = self.symbol_table.borrow().lookup_circuit(&input.name.name).cloned(); if let Some(circ) = circ { // Check circuit type name. @@ -509,8 +503,6 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { }) } - - fn visit_ternary(&mut self, input: &'a TernaryExpression, expected: &Self::AdditionalInput) -> Self::Output { self.visit_expression(&input.condition, &Some(Type::Boolean)); @@ -525,7 +517,11 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { if let Some(Type::Tuple(expected_types)) = expected { // Check actual length is equal to expected length. if expected_types.len() != input.elements.len() { - self.emit_err(TypeCheckerError::incorrect_tuple_length(expected_types.len(), input.elements.len(), input.span())); + self.emit_err(TypeCheckerError::incorrect_tuple_length( + expected_types.len(), + input.elements.len(), + input.span(), + )); } expected_types @@ -594,5 +590,4 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } } } - } diff --git a/tests/compiler/tuple/function_return.leo b/tests/compiler/tuple/function_return.leo new file mode 100644 index 0000000000..57ff57b454 --- /dev/null +++ b/tests/compiler/tuple/function_return.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Pass +input_file: + - inputs/bool_bool.in +*/ + +function main(a: bool, b: bool) -> (bool, bool) { + return (a, b); +} \ No newline at end of file diff --git a/tests/compiler/tuple/function_return_single_fail.leo b/tests/compiler/tuple/function_return_single_fail.leo new file mode 100644 index 0000000000..21d0763013 --- /dev/null +++ b/tests/compiler/tuple/function_return_single_fail.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Fail +input_file: + - inputs/bool_bool.in +*/ + +function main(a: bool, b: bool) -> (bool) { + return (a); +} \ No newline at end of file diff --git a/tests/compiler/tuple/function_return_zero_fail.leo b/tests/compiler/tuple/function_return_zero_fail.leo new file mode 100644 index 0000000000..7e9c5b15ec --- /dev/null +++ b/tests/compiler/tuple/function_return_zero_fail.leo @@ -0,0 +1,10 @@ +/* +namespace: Compile +expectation: Fail +input_file: + - inputs/bool_bool.in +*/ + +function main(a: bool, b: bool) -> () { + return (); +} \ No newline at end of file diff --git a/tests/compiler/tuple/inputs/bool_bool.in b/tests/compiler/tuple/inputs/bool_bool.in new file mode 100644 index 0000000000..b786a3ab5f --- /dev/null +++ b/tests/compiler/tuple/inputs/bool_bool.in @@ -0,0 +1,3 @@ +[main] +a: bool = true; +b: bool = false; \ No newline at end of file diff --git a/tests/expectations/compiler/compiler/circuits/duplicate_name_context.out b/tests/expectations/compiler/compiler/circuits/duplicate_name_context.out index 0b332c10bf..a3f3e330a2 100644 --- a/tests/expectations/compiler/compiler/circuits/duplicate_name_context.out +++ b/tests/expectations/compiler/compiler/circuits/duplicate_name_context.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EAST0372015]: circuit `Bar` shadowed by\n --> compiler-test:8:5\n |\n 8 | const Bar: u32 = 66u32;\n | ^^^^^^^^^^^^^^^^^^^^^^\n" + - "Error [EAST0372016]: circuit `Bar` shadowed by\n --> compiler-test:8:5\n |\n 8 | const Bar: u32 = 66u32;\n | ^^^^^^^^^^^^^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/compiler/circuits/inline.out b/tests/expectations/compiler/compiler/circuits/inline.out index 94d4418f77..940083acfe 100644 --- a/tests/expectations/compiler/compiler/circuits/inline.out +++ b/tests/expectations/compiler/compiler/circuits/inline.out @@ -4,4 +4,4 @@ expectation: Pass outputs: - output: - initial_input_ast: no input - initial_ast: 8507cd1753f4d2a835fa34d3d784487d89d595ea415d51145dd7291a839159c2 + initial_ast: 06b7428058f95519ae12657c24f873f86f43f30f9715ee3f1c0192e632775d32 diff --git a/tests/expectations/compiler/compiler/circuits/inline_member_pass.out b/tests/expectations/compiler/compiler/circuits/inline_member_pass.out index 2ba0ef792f..4b1eea619b 100644 --- a/tests/expectations/compiler/compiler/circuits/inline_member_pass.out +++ b/tests/expectations/compiler/compiler/circuits/inline_member_pass.out @@ -4,4 +4,4 @@ expectation: Pass outputs: - output: - initial_input_ast: no input - initial_ast: 9489ab9b78bd31ac516e1674a83c6b35708238174df88374a7b19cef3d4a8e8a + initial_ast: d040a3a4f2be00b8123a1cbdbfe08a651526c76f12b24e0378f4f11fa7ded820 diff --git a/tests/expectations/compiler/compiler/circuits/member_variable.out b/tests/expectations/compiler/compiler/circuits/member_variable.out index 059608050c..5076366ca3 100644 --- a/tests/expectations/compiler/compiler/circuits/member_variable.out +++ b/tests/expectations/compiler/compiler/circuits/member_variable.out @@ -4,4 +4,4 @@ expectation: Pass outputs: - output: - initial_input_ast: 29f6139d908d390f890f04d8ee620757d29b7f71cd48c46ff65bc1e70aae840c - initial_ast: 630995cc22fb6ec613f02e3aaa18392770158b2bbaf5aa1736c0bf71dd7357ce + initial_ast: 9a9a861c36d5b4a6207e542505b8fa338721cd6cb57904577b425c733f0ae480 diff --git a/tests/expectations/compiler/compiler/function/duplicate_definition_fail.out b/tests/expectations/compiler/compiler/function/duplicate_definition_fail.out index 2611b147e4..1b17b84c4b 100644 --- a/tests/expectations/compiler/compiler/function/duplicate_definition_fail.out +++ b/tests/expectations/compiler/compiler/function/duplicate_definition_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EAST0372014]: function `main` shadowed by\n --> compiler-test:8:1\n |\n 8 | function main(y: bool) -> bool {\n 9 | console.log(\"{}\", 2u8);\n 10 | return y; \n 11 | }\n | ^\n" + - "Error [EAST0372015]: function `main` shadowed by\n --> compiler-test:8:1\n |\n 8 | function main(y: bool) -> bool {\n 9 | console.log(\"{}\", 2u8);\n 10 | return y; \n 11 | }\n | ^\n" diff --git a/tests/expectations/compiler/compiler/function/duplicate_parameter_fail.out b/tests/expectations/compiler/compiler/function/duplicate_parameter_fail.out index 220d9627c8..0dc05262eb 100644 --- a/tests/expectations/compiler/compiler/function/duplicate_parameter_fail.out +++ b/tests/expectations/compiler/compiler/function/duplicate_parameter_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EAST0372017]: variable `a` shadowed by\n --> compiler-test:3:23\n |\n 3 | function main(a: u32, a: u32) -> u32 {\n | ^\n" + - "Error [EAST0372018]: variable `a` shadowed by\n --> compiler-test:3:23\n |\n 3 | function main(a: u32, a: u32) -> u32 {\n | ^\n" diff --git a/tests/expectations/compiler/compiler/function/shadow_function_with_input_fail.out b/tests/expectations/compiler/compiler/function/shadow_function_with_input_fail.out index e9566ff145..904be5fe3d 100644 --- a/tests/expectations/compiler/compiler/function/shadow_function_with_input_fail.out +++ b/tests/expectations/compiler/compiler/function/shadow_function_with_input_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EAST0372014]: function `hi` shadowed by\n --> compiler-test:7:17\n |\n 7 | function tester(hi: u8) -> u8 {\n | ^^\n" + - "Error [EAST0372015]: function `hi` shadowed by\n --> compiler-test:7:17\n |\n 7 | function tester(hi: u8) -> u8 {\n | ^^\n" diff --git a/tests/expectations/compiler/compiler/records/duplicate_circuit_name_fail.out b/tests/expectations/compiler/compiler/records/duplicate_circuit_name_fail.out index d5697f8223..c8f3a0621d 100644 --- a/tests/expectations/compiler/compiler/records/duplicate_circuit_name_fail.out +++ b/tests/expectations/compiler/compiler/records/duplicate_circuit_name_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EAST0372016]: record `Token` shadowed by\n --> compiler-test:12:1\n |\n 12 | circuit Token { // This circuit cannot have the same name as the record defined above it.\n 13 | x: u32,\n 14 | }\n | ^\n" + - "Error [EAST0372017]: record `Token` shadowed by\n --> compiler-test:12:1\n |\n 12 | circuit Token { // This circuit cannot have the same name as the record defined above it.\n 13 | x: u32,\n 14 | }\n | ^\n" diff --git a/tests/expectations/compiler/compiler/records/init_expression.out b/tests/expectations/compiler/compiler/records/init_expression.out index 97d133aee1..619a6bb82a 100644 --- a/tests/expectations/compiler/compiler/records/init_expression.out +++ b/tests/expectations/compiler/compiler/records/init_expression.out @@ -4,4 +4,4 @@ expectation: Pass outputs: - output: - initial_input_ast: no input - initial_ast: cc9fdc5ee476d5c8930260c5fc50c968915434892180f0084f15cd69b905dc20 + initial_ast: 209ec3cdd48655115bca90839ebe91260044d8ee9edb4c7c4542497427cb1d76 diff --git a/tests/expectations/compiler/compiler/records/init_expression_shorthand.out b/tests/expectations/compiler/compiler/records/init_expression_shorthand.out index 909857c5a5..7bc575d766 100644 --- a/tests/expectations/compiler/compiler/records/init_expression_shorthand.out +++ b/tests/expectations/compiler/compiler/records/init_expression_shorthand.out @@ -4,4 +4,4 @@ expectation: Pass outputs: - output: - initial_input_ast: no input - initial_ast: c765de9e29d4ca9bd9ba2f7a5ee72c2e4c8278948d32a6c9a441f5eacde564ea + initial_ast: 73452a5c1cd8fc44277d025eb18a42529e4cc9f97282b508e996912c6b8753d3 diff --git a/tests/expectations/compiler/compiler/statements/duplicate_variable.out b/tests/expectations/compiler/compiler/statements/duplicate_variable.out index a53e9f3568..397a47a58e 100644 --- a/tests/expectations/compiler/compiler/statements/duplicate_variable.out +++ b/tests/expectations/compiler/compiler/statements/duplicate_variable.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EAST0372017]: variable `x` shadowed by\n --> compiler-test:5:4\n |\n 5 | \tlet x: bool = true;\n | ^^^^^^^^^^^^^^^^^^\n" + - "Error [EAST0372018]: variable `x` shadowed by\n --> compiler-test:5:4\n |\n 5 | \tlet x: bool = true;\n | ^^^^^^^^^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/compiler/tuple/function_return.out b/tests/expectations/compiler/compiler/tuple/function_return.out new file mode 100644 index 0000000000..bffddad618 --- /dev/null +++ b/tests/expectations/compiler/compiler/tuple/function_return.out @@ -0,0 +1,7 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 99be02d0d987d66d7bcac961871997df93d22a28989a08cb71ce2ea65528b6e6 + initial_ast: 6f8a109c723a892e2b3dc61071a5330fa6827fb15bea0ed6e1f52bf40f60f8cf diff --git a/tests/expectations/compiler/compiler/tuple/function_return_single_fail.out b/tests/expectations/compiler/compiler/tuple/function_return_single_fail.out new file mode 100644 index 0000000000..507aee750a --- /dev/null +++ b/tests/expectations/compiler/compiler/tuple/function_return_single_fail.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EAST0372014]: Tuples of one element are not allowed.\n --> compiler-test:3:36\n |\n 3 | function main(a: bool, b: bool) -> (bool) {\n | ^^^^^^\n |\n = Try defining a single type by removing the parenthesis `( )`" diff --git a/tests/expectations/compiler/compiler/tuple/function_return_zero_fail.out b/tests/expectations/compiler/compiler/tuple/function_return_zero_fail.out new file mode 100644 index 0000000000..4607698926 --- /dev/null +++ b/tests/expectations/compiler/compiler/tuple/function_return_zero_fail.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EAST0372013]: Tuples of zero elements are not allowed.\n --> compiler-test:3:36\n |\n 3 | function main(a: bool, b: bool) -> () {\n | ^^" diff --git a/tests/expectations/parser/parser/expression/literal/group_fail.out b/tests/expectations/parser/parser/expression/literal/group_fail.out index 449c4db287..4a718549b8 100644 --- a/tests/expectations/parser/parser/expression/literal/group_fail.out +++ b/tests/expectations/parser/parser/expression/literal/group_fail.out @@ -2,12 +2,12 @@ namespace: ParseExpression expectation: Fail outputs: - - "Error [EPAR0370005]: expected A valid expression. -- got 'A tuple expression.'\n --> test:1:1\n |\n 1 | ()group\n | ^^" + - "did not consume all input: 'group' @ 1:3-8\n" - "Error [EPAR0370027]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123)group\n | ^^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got ','\n --> test:1:2\n |\n 1 | (,)group\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '+'\n --> test:1:2\n |\n 1 | (+, -,)group\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got ','\n --> test:1:2\n |\n 1 | (,+, -)group\n | ^" - - "Error [EPAR0370005]: expected A valid expression. -- got 'A tuple expression.'\n --> test:1:1\n |\n 1 | (x,y)group\n | ^^^^^" + - "did not consume all input: 'group' @ 1:6-11\n" - "Error [EPAR0370027]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123,456u8)group\n | ^^^" - "Error [EPAR0370027]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123,456field)group\n | ^^^" - "Error [EPAR0370004]: Unexpected white space between terms (123,456) and group\n --> test:1:11\n |\n 1 | (123, 456) group\n | ^" From 642ad32e99f83db67a51089fac823e8d215f55cf Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Sat, 9 Jul 2022 14:11:18 -0700 Subject: [PATCH 32/37] parse tuple access --- compiler/parser/src/parser/context.rs | 30 ++++- compiler/parser/src/parser/expression.rs | 46 +++++--- compiler/parser/src/parser/file.rs | 13 +-- compiler/parser/src/parser/input.rs | 6 +- compiler/parser/src/parser/statement.rs | 8 +- compiler/parser/src/tokenizer/lexer.rs | 4 +- compiler/parser/src/tokenizer/token.rs | 8 +- leo/errors/src/errors/parser/parser_errors.rs | 18 +-- tests/compiler/tuple/access.leo | 11 ++ ...rcuit_function_namespace_conflict_fail.out | 2 +- .../compiler/circuits/inline_fail.out | 2 +- .../compiler/circuits/inline_member_fail.out | 2 +- .../compiler/circuits/inline_undefined.out | 2 +- .../circuits/member_variable_fail.out | 2 +- .../compiler/compiler/console/log_fail.out | 2 +- .../console/log_parameter_unkown_fail.out | 2 +- .../compiler/compiler/console/log_string.out | 2 +- .../compiler/compiler/core/account/record.out | 2 +- .../field/no_space_between_literal.out | 2 +- .../compiler/compiler/function/scope_fail.out | 2 +- .../function/shadow_parameter_fail.out | 2 +- .../compiler/integers/i128/max_fail.out | 2 +- .../compiler/integers/i128/min_fail.out | 2 +- .../i128/no_space_between_literal.out | 2 +- .../compiler/integers/i16/max_fail.out | 2 +- .../compiler/integers/i16/min_fail.out | 2 +- .../integers/i16/no_space_between_literal.out | 2 +- .../compiler/integers/i32/max_fail.out | 2 +- .../compiler/integers/i32/min_fail.out | 2 +- .../integers/i32/no_space_between_literal.out | 2 +- .../compiler/integers/i64/max_fail.out | 2 +- .../compiler/integers/i64/min_fail.out | 2 +- .../integers/i64/no_space_between_literal.out | 2 +- .../compiler/integers/i8/max_fail.out | 2 +- .../compiler/integers/i8/min_fail.out | 2 +- .../integers/i8/no_space_between_literal.out | 2 +- .../compiler/integers/u128/max_fail.out | 2 +- .../compiler/integers/u128/min_fail.out | 2 +- .../u128/no_space_between_literal.out | 2 +- .../compiler/integers/u16/max_fail.out | 2 +- .../compiler/integers/u16/min_fail.out | 2 +- .../integers/u16/no_space_between_literal.out | 2 +- .../compiler/integers/u32/max_fail.out | 2 +- .../compiler/integers/u32/min_fail.out | 2 +- .../integers/u32/no_space_between_literal.out | 2 +- .../compiler/integers/u64/max_fail.out | 2 +- .../compiler/integers/u64/min_fail.out | 2 +- .../integers/u64/no_space_between_literal.out | 2 +- .../compiler/integers/u8/max_fail.out | 2 +- .../compiler/integers/u8/min_fail.out | 2 +- .../integers/u8/no_space_between_literal.out | 2 +- .../scalar/no_space_between_literal.out | 2 +- .../compiler/statements/all_loops_fail.out | 2 +- .../compiler/statements/assign_ternary.out | 2 +- .../compiler/compiler/tuple/access.out | 7 ++ .../parser/expression/array_init_fail.out | 8 +- .../parser/expression/array_inline_fail.out | 10 +- .../parser/expression/circuit_init_fail.out | 22 ++-- .../expression/literal/comment_fail.out | 4 +- .../parser/expression/literal/group_fail.out | 6 +- .../parser/parser/expression/token_format.out | 90 +++++++-------- .../functions/const_public_param_fail.out | 2 +- .../parser/functions/ident_token_fail.out | 2 +- .../parser/functions/mut_input_fail.out | 2 +- .../inputs/input_constant_public_fail.out | 2 +- .../parser/parser/program/pipe_eof.out | 2 +- .../parser/parser/serialize/parser_error.out | 2 +- .../parser/statement/conditional_fail.out | 2 +- .../parser/parser/statement/console_fail.out | 4 +- .../parser/statement/definition_fail.out | 84 +++++++------- .../parser/statement/expression_fail.out | 10 +- .../parser/statement/let_mut_recover.out | 2 +- .../parser/parser/statement/return_fail.out | 4 +- .../parser/parser/unreachable/define.out | 88 +++++++------- .../parser/parser/unreachable/eat_ident.out | 2 +- .../parser/parser/unreachable/eat_int.out | 104 ++++++++--------- .../equality_and_order_expression.out | 104 ++++++++--------- .../parser/unreachable/expect_ident.out | 104 ++++++++--------- .../parser/unreachable/math_op_fail.out | 108 +++++++++--------- .../parser/unreachable/postfix_fail.out | 40 +++---- 80 files changed, 549 insertions(+), 500 deletions(-) create mode 100644 tests/compiler/tuple/access.leo create mode 100644 tests/expectations/compiler/compiler/tuple/access.out diff --git a/compiler/parser/src/parser/context.rs b/compiler/parser/src/parser/context.rs index eb35746975..eab221413b 100644 --- a/compiler/parser/src/parser/context.rs +++ b/compiler/parser/src/parser/context.rs @@ -87,11 +87,19 @@ impl<'a> ParserContext<'a> { self.prev_token = mem::replace(&mut self.token, next_token); } - /// Checks whether the current token is `token`. + /// Checks whether the current token is `Token`. pub(super) fn check(&self, tok: &Token) -> bool { &self.token.token == tok } + /// Checks whether the current token is a `Token::Int(_)`. + pub(super) fn check_int(&self) -> bool { + match &self.token.token { + Token::Integer(_) => true, + _ => false, + } + } + /// Returns `true` if the next token is equal to the given token. /// Advances the parser to the next token. pub(super) fn eat(&mut self, token: &Token) -> bool { @@ -136,7 +144,7 @@ impl<'a> ParserContext<'a> { /// Eats the next token if its an identifier and returns it. pub(super) fn eat_identifier(&mut self) -> Option { - if let Token::Ident(name) = self.token.token { + if let Token::Identifier(name) = self.token.token { self.bump(); return Some(self.mk_ident_prev(name)); } @@ -144,9 +152,23 @@ impl<'a> ParserContext<'a> { } /// Expects an [`Identifier`], or errors. - pub(super) fn expect_ident(&mut self) -> Result { + pub(super) fn expect_identifier(&mut self) -> Result { self.eat_identifier() - .ok_or_else(|| ParserError::unexpected_str(&self.token.token, "ident", self.token.span).into()) + .ok_or_else(|| ParserError::unexpected_str(&self.token.token, "identifier", self.token.span).into()) + } + + /// + /// Removes the next token if it is a [`Token::Integer(_)`] and returns it, or [None] if + /// the next token is not a [`Token::Integer(_)`] or if the next token does not exist. + /// + pub fn eat_integer(&mut self) -> Result<(PositiveNumber, Span)> { + let token = self.token.token.clone(); + if let Token::Integer(value) = token { + self.bump(); + Ok((PositiveNumber { value }, self.token.span)) + } else { + Err(ParserError::unexpected(&self.token.token, "integer literal", self.token.span).into()) + } } /// Eats any of the given `tokens`, returning `true` if anything was eaten. diff --git a/compiler/parser/src/parser/expression.rs b/compiler/parser/src/parser/expression.rs index d596f4bb0e..f4bc13feb4 100644 --- a/compiler/parser/src/parser/expression.rs +++ b/compiler/parser/src/parser/expression.rs @@ -296,7 +296,7 @@ impl ParserContext<'_> { }; // Parse the circuit member name (can be variable or function name). - let member_name = self.expect_ident()?; + let member_name = self.expect_identifier()?; // Check if there are arguments. Ok(Expression::Access(if self.check(&Token::LeftParen) { @@ -336,19 +336,29 @@ impl ParserContext<'_> { let mut expr = self.parse_primary_expression()?; loop { if self.eat(&Token::Dot) { - // Parse the method name. - let name = self.expect_ident()?; - - if self.check(&Token::LeftParen) { - // Eat a method call on a type - expr = self.parse_method_call_expression(expr, name)? - } else { - // Eat a circuit member access. - expr = Expression::Access(AccessExpression::Member(MemberAccess { - span: expr.span(), - inner: Box::new(expr), - name, + if self.check_int() { + // Eat a tuple member access. + let (index, span) = self.eat_integer()?; + expr = Expression::Access(AccessExpression::Tuple(TupleAccess { + tuple: Box::new(expr), + index, + span, })) + } else { + // Parse identifier name. + let name = self.expect_identifier()?; + + if self.check(&Token::LeftParen) { + // Eat a method call on a type + expr = self.parse_method_call_expression(expr, name)? + } else { + // Eat a circuit member access. + expr = Expression::Access(AccessExpression::Member(MemberAccess { + span: expr.span(), + inner: Box::new(expr), + name, + })) + } } } else if self.eat(&Token::DoubleColon) { // Eat a core circuit constant or core circuit function call. @@ -394,11 +404,11 @@ impl ParserContext<'_> { let (advanced, gc) = self.look_ahead(*dist, |t0| match &t0.token { Token::Add => Some((1, GroupCoordinate::SignHigh)), Token::Minus => self.look_ahead(*dist + 1, |t1| match &t1.token { - Token::Int(value) => Some((2, GroupCoordinate::Number(format!("-{}", value), t1.span))), + Token::Integer(value) => Some((2, GroupCoordinate::Number(format!("-{}", value), t1.span))), _ => Some((1, GroupCoordinate::SignLow)), }), Token::Underscore => Some((1, GroupCoordinate::Inferred)), - Token::Int(value) => Some((1, GroupCoordinate::Number(value.clone(), t0.span))), + Token::Integer(value) => Some((1, GroupCoordinate::Number(value.clone(), t0.span))), _ => None, })?; *dist += advanced; @@ -451,7 +461,7 @@ impl ParserContext<'_> { } fn parse_circuit_member(&mut self) -> Result { - let identifier = self.expect_ident()?; + let identifier = self.expect_identifier()?; let expression = if self.eat(&Token::Colon) { // Parse individual circuit variable declarations. Some(self.parse_expression()?) @@ -493,7 +503,7 @@ impl ParserContext<'_> { self.bump(); Ok(match token { - Token::Int(value) => { + Token::Integer(value) => { let suffix_span = self.token.span; let full_span = span + suffix_span; let assert_no_whitespace = |x| assert_no_whitespace(span, suffix_span, &value, x); @@ -533,7 +543,7 @@ impl ParserContext<'_> { Expression::Literal(LiteralExpression::Address(addr, span)) } Token::StaticString(value) => Expression::Literal(LiteralExpression::String(value, span)), - Token::Ident(name) => { + Token::Identifier(name) => { let ident = Identifier { name, span }; if !self.disallow_circuit_construction && self.check(&Token::LeftCurly) { // Parse circuit and records inits as circuit expressions. diff --git a/compiler/parser/src/parser/file.rs b/compiler/parser/src/parser/file.rs index e7ed2104ab..c038d0edf9 100644 --- a/compiler/parser/src/parser/file.rs +++ b/compiler/parser/src/parser/file.rs @@ -35,7 +35,7 @@ impl ParserContext<'_> { let (id, function) = self.parse_function()?; functions.insert(id, function); } - Token::Ident(sym::test) => return Err(ParserError::test_function(self.token.span).into()), + Token::Identifier(sym::test) => return Err(ParserError::test_function(self.token.span).into()), Token::Function => { let (id, function) = self.parse_function()?; functions.insert(id, function); @@ -54,7 +54,7 @@ impl ParserContext<'_> { fn unexpected_item(token: &SpannedToken) -> ParserError { ParserError::unexpected( &token.token, - [Token::Function, Token::Circuit, Token::Ident(sym::test)] + [Token::Function, Token::Circuit, Token::Identifier(sym::test)] .iter() .map(|x| format!("'{}'", x)) .collect::>() @@ -105,7 +105,7 @@ impl ParserContext<'_> { /// Parses `IDENT: TYPE`. fn parse_member(&mut self) -> Result<(Identifier, Type)> { - let name = self.expect_ident()?; + let name = self.expect_identifier()?; self.expect(&Token::Colon)?; let type_ = self.parse_single_type()?.0; @@ -154,7 +154,7 @@ impl ParserContext<'_> { pub(super) fn parse_circuit(&mut self) -> Result<(Identifier, Circuit)> { let is_record = matches!(&self.token.token, Token::Record); let start = self.expect_any(&[Token::Circuit, Token::Record])?; - let circuit_name = self.expect_ident()?; + let circuit_name = self.expect_identifier()?; self.expect(&Token::LeftCurly)?; let (members, end) = self.parse_circuit_members()?; @@ -197,8 +197,7 @@ impl ParserContext<'_> { /// Returns a [`FunctionInput`] AST node if the next tokens represent a function parameter. fn parse_function_parameter(&mut self) -> Result { let mode = self.parse_function_parameter_mode()?; - - let name = self.expect_ident()?; + let name = self.expect_identifier()?; self.expect(&Token::Colon)?; let type_ = self.parse_single_type()?.0; @@ -221,7 +220,7 @@ impl ParserContext<'_> { fn parse_function(&mut self) -> Result<(Identifier, Function)> { // Parse `function IDENT`. let start = self.expect(&Token::Function)?; - let name = self.expect_ident()?; + let name = self.expect_identifier()?; // Parse parameters. let (inputs, ..) = self.parse_paren_comma_list(|p| p.parse_function_parameter().map(Some))?; diff --git a/compiler/parser/src/parser/input.rs b/compiler/parser/src/parser/input.rs index a4575ab3b9..f56baf0575 100644 --- a/compiler/parser/src/parser/input.rs +++ b/compiler/parser/src/parser/input.rs @@ -42,11 +42,11 @@ impl ParserContext<'_> { /// Returns [`Section`]. fn parse_section(&mut self) -> Result
{ self.expect(&Token::LeftSquare)?; - let section = self.expect_ident()?; + let section = self.expect_identifier()?; self.expect(&Token::RightSquare)?; let mut definitions = Vec::new(); - while let Token::Const | Token::Constant | Token::Public | Token::Ident(_) = self.token.token { + while let Token::Const | Token::Constant | Token::Public | Token::Identifier(_) = self.token.token { definitions.push(self.parse_input_definition()?); } @@ -63,7 +63,7 @@ impl ParserContext<'_> { fn parse_input_definition(&mut self) -> Result { let mode = self.parse_function_parameter_mode()?; - let name = self.expect_ident()?; + let name = self.expect_identifier()?; self.expect(&Token::Colon)?; let (type_, span) = self.parse_non_ident_types()?; self.expect(&Token::Assign)?; diff --git a/compiler/parser/src/parser/statement.rs b/compiler/parser/src/parser/statement.rs index 16d556b55a..d71bce41ce 100644 --- a/compiler/parser/src/parser/statement.rs +++ b/compiler/parser/src/parser/statement.rs @@ -101,7 +101,7 @@ impl ParserContext<'_> { /// Returns an [`IterationStatement`] AST node if the next tokens represent an iteration statement. fn parse_loop_statement(&mut self) -> Result { let start_span = self.expect(&Token::For)?; - let ident = self.expect_ident()?; + let ident = self.expect_identifier()?; self.expect(&Token::Colon)?; let type_ = self.parse_single_type()?; self.expect(&Token::In)?; @@ -158,7 +158,7 @@ impl ParserContext<'_> { fn parse_console_statement(&mut self) -> Result { let keyword = self.expect(&Token::Console)?; self.expect(&Token::Dot)?; - let function = self.expect_ident()?; + let function = self.expect_identifier()?; let function = match function.name { sym::assert => { self.expect(&Token::LeftParen)?; @@ -189,7 +189,7 @@ impl ParserContext<'_> { /// Returns a [`VariableName`] AST node if the next tokens represent a variable name with /// valid keywords. fn parse_variable_name(&mut self, decl_ty: Declare, _span: Span) -> Result { - let name = self.expect_ident()?; + let name = self.expect_identifier()?; Ok(VariableName { span: name.span, mutable: matches!(decl_ty, Declare::Let), @@ -222,7 +222,7 @@ impl ParserContext<'_> { }; self.expect(&Token::Colon)?; - let type_ = self.parse_single_type()?; + let type_ = self.parse_any_type()?; self.expect(&Token::Assign)?; let expr = self.parse_expression()?; diff --git a/compiler/parser/src/tokenizer/lexer.rs b/compiler/parser/src/tokenizer/lexer.rs index 7b61de792d..3b1c64bfd9 100644 --- a/compiler/parser/src/tokenizer/lexer.rs +++ b/compiler/parser/src/tokenizer/lexer.rs @@ -172,7 +172,7 @@ impl Token { int.push(c); } - Ok((int.len(), Token::Int(int))) + Ok((int.len(), Token::Integer(int))) } /// Returns a tuple: [(token length, token)] if the next token can be eaten, otherwise returns [`None`]. @@ -326,7 +326,7 @@ impl Token { "u32" => Token::U32, "u64" => Token::U64, "u128" => Token::U128, - _ => Token::Ident(Symbol::intern(&ident)), + _ => Token::Identifier(Symbol::intern(&ident)), }, )); } diff --git a/compiler/parser/src/tokenizer/token.rs b/compiler/parser/src/tokenizer/token.rs index 965e98fbf9..4448c50b69 100644 --- a/compiler/parser/src/tokenizer/token.rs +++ b/compiler/parser/src/tokenizer/token.rs @@ -27,8 +27,8 @@ pub enum Token { CommentLine(String), CommentBlock(String), StaticString(String), - Ident(Symbol), - Int(String), + Identifier(Symbol), + Integer(String), True, False, AddressLit(String), @@ -208,8 +208,8 @@ impl fmt::Display for Token { CommentLine(s) => write!(f, "{}", s), CommentBlock(s) => write!(f, "{}", s), StaticString(s) => write!(f, "\"{}\"", s), - Ident(s) => write!(f, "{}", s), - Int(s) => write!(f, "{}", s), + Identifier(s) => write!(f, "{}", s), + Integer(s) => write!(f, "{}", s), True => write!(f, "true"), False => write!(f, "false"), AddressLit(s) => write!(f, "{}", s), diff --git a/leo/errors/src/errors/parser/parser_errors.rs b/leo/errors/src/errors/parser/parser_errors.rs index 52bddb044f..173613058f 100644 --- a/leo/errors/src/errors/parser/parser_errors.rs +++ b/leo/errors/src/errors/parser/parser_errors.rs @@ -67,8 +67,8 @@ create_messages!( /// For when the parser encountered an unexpected list of tokens. @formatted unexpected { - args: (got: impl Display, expected: impl Display), - msg: format!("expected {} -- got '{}'", expected, got), + args: (found: impl Display, expected: impl Display), + msg: format!("expected {} -- found '{}'", expected, found), help: None, } @@ -83,15 +83,15 @@ create_messages!( /// For when the parser encountered an unexpected identifier. @formatted unexpected_ident { - args: (got: impl Display, expected: &[impl Display]), + args: (found: impl Display, expected: &[impl Display]), msg: format!( - "unexpected identifier: expected {} -- got '{}'", + "unexpected identifier: expected {} -- found '{}'", expected .iter() .map(|x| format!("'{}'", x)) .collect::>() .join(", "), - got + found ), help: None, } @@ -99,16 +99,16 @@ create_messages!( /// For when the parser encountered an unexpected statement. @formatted unexpected_statement { - args: (got: impl Display, expected: impl Display), - msg: format!("unexpected statement: expected '{}', got '{}'", expected, got), + args: (found: impl Display, expected: impl Display), + msg: format!("unexpected statement: expected '{}', found '{}'", expected, found), help: None, } /// For when the parser encountered an unexpected string. @formatted unexpected_str { - args: (got: impl Display, expected: impl Display), - msg: format!("unexpected string: expected '{}', got '{}'", expected, got), + args: (found: impl Display, expected: impl Display), + msg: format!("unexpected string: expected '{}', found '{}'", expected, found), help: None, } diff --git a/tests/compiler/tuple/access.leo b/tests/compiler/tuple/access.leo new file mode 100644 index 0000000000..eb3dd982f1 --- /dev/null +++ b/tests/compiler/tuple/access.leo @@ -0,0 +1,11 @@ +/* +namespace: Compile +expectation: Pass +input_file: + - inputs/bool_bool.in +*/ + +function main(a: bool, b: bool) -> (bool, bool) { + let t: (bool, bool) = (a, b); + return (t.0, t.1); +} \ No newline at end of file diff --git a/tests/expectations/compiler/compiler/circuits/circuit_function_namespace_conflict_fail.out b/tests/expectations/compiler/compiler/circuits/circuit_function_namespace_conflict_fail.out index 42e21bec70..6db7ce9cdb 100644 --- a/tests/expectations/compiler/compiler/circuits/circuit_function_namespace_conflict_fail.out +++ b/tests/expectations/compiler/compiler/circuits/circuit_function_namespace_conflict_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:7:16\n |\n 7 | function Foo() {}\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:7:16\n |\n 7 | function Foo() {}\n | ^" diff --git a/tests/expectations/compiler/compiler/circuits/inline_fail.out b/tests/expectations/compiler/compiler/circuits/inline_fail.out index 769bbcaee3..98cea7a383 100644 --- a/tests/expectations/compiler/compiler/circuits/inline_fail.out +++ b/tests/expectations/compiler/compiler/circuits/inline_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:7:17\n |\n 7 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:7:17\n |\n 7 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/circuits/inline_member_fail.out b/tests/expectations/compiler/compiler/circuits/inline_member_fail.out index 769bbcaee3..98cea7a383 100644 --- a/tests/expectations/compiler/compiler/circuits/inline_member_fail.out +++ b/tests/expectations/compiler/compiler/circuits/inline_member_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:7:17\n |\n 7 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:7:17\n |\n 7 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/circuits/inline_undefined.out b/tests/expectations/compiler/compiler/circuits/inline_undefined.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/circuits/inline_undefined.out +++ b/tests/expectations/compiler/compiler/circuits/inline_undefined.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/circuits/member_variable_fail.out b/tests/expectations/compiler/compiler/circuits/member_variable_fail.out index 769bbcaee3..98cea7a383 100644 --- a/tests/expectations/compiler/compiler/circuits/member_variable_fail.out +++ b/tests/expectations/compiler/compiler/circuits/member_variable_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:7:17\n |\n 7 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:7:17\n |\n 7 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/console/log_fail.out b/tests/expectations/compiler/compiler/console/log_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/console/log_fail.out +++ b/tests/expectations/compiler/compiler/console/log_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/console/log_parameter_unkown_fail.out b/tests/expectations/compiler/compiler/console/log_parameter_unkown_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/console/log_parameter_unkown_fail.out +++ b/tests/expectations/compiler/compiler/console/log_parameter_unkown_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/console/log_string.out b/tests/expectations/compiler/compiler/console/log_string.out index 64ebaf7814..4924c283fb 100644 --- a/tests/expectations/compiler/compiler/console/log_string.out +++ b/tests/expectations/compiler/compiler/console/log_string.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'formatted static_string', got 'hello'\n --> compiler-test:5:17\n |\n 5 | console.log(hello);\n | ^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'formatted static_string', found 'hello'\n --> compiler-test:5:17\n |\n 5 | console.log(hello);\n | ^^^^^" diff --git a/tests/expectations/compiler/compiler/core/account/record.out b/tests/expectations/compiler/compiler/core/account/record.out index 4db7ce0db2..42f0d01267 100644 --- a/tests/expectations/compiler/compiler/core/account/record.out +++ b/tests/expectations/compiler/compiler/core/account/record.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'record'\n --> compiler-test:4:22\n |\n 4 | function main(public record: Record, a: bool) -> bool {\n | ^^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'record'\n --> compiler-test:4:22\n |\n 4 | function main(public record: Record, a: bool) -> bool {\n | ^^^^^^" diff --git a/tests/expectations/compiler/compiler/field/no_space_between_literal.out b/tests/expectations/compiler/compiler/field/no_space_between_literal.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/field/no_space_between_literal.out +++ b/tests/expectations/compiler/compiler/field/no_space_between_literal.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/function/scope_fail.out b/tests/expectations/compiler/compiler/function/scope_fail.out index cf561c6ce6..987a02a25a 100644 --- a/tests/expectations/compiler/compiler/function/scope_fail.out +++ b/tests/expectations/compiler/compiler/function/scope_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected : -- got '='\n --> compiler-test:9:20\n |\n 9 | const myGlobal = 42field;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> compiler-test:9:20\n |\n 9 | const myGlobal = 42field;\n | ^" diff --git a/tests/expectations/compiler/compiler/function/shadow_parameter_fail.out b/tests/expectations/compiler/compiler/function/shadow_parameter_fail.out index ed9c2b60bd..f0be731957 100644 --- a/tests/expectations/compiler/compiler/function/shadow_parameter_fail.out +++ b/tests/expectations/compiler/compiler/function/shadow_parameter_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected : -- got '='\n --> compiler-test:4:14\n |\n 4 | const hi = 2u8;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> compiler-test:4:14\n |\n 4 | const hi = 2u8;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i128/max_fail.out b/tests/expectations/compiler/compiler/integers/i128/max_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/i128/max_fail.out +++ b/tests/expectations/compiler/compiler/integers/i128/max_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i128/min_fail.out b/tests/expectations/compiler/compiler/integers/i128/min_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/i128/min_fail.out +++ b/tests/expectations/compiler/compiler/integers/i128/min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i128/no_space_between_literal.out b/tests/expectations/compiler/compiler/integers/i128/no_space_between_literal.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/i128/no_space_between_literal.out +++ b/tests/expectations/compiler/compiler/integers/i128/no_space_between_literal.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i16/max_fail.out b/tests/expectations/compiler/compiler/integers/i16/max_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/i16/max_fail.out +++ b/tests/expectations/compiler/compiler/integers/i16/max_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i16/min_fail.out b/tests/expectations/compiler/compiler/integers/i16/min_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/i16/min_fail.out +++ b/tests/expectations/compiler/compiler/integers/i16/min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i16/no_space_between_literal.out b/tests/expectations/compiler/compiler/integers/i16/no_space_between_literal.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/i16/no_space_between_literal.out +++ b/tests/expectations/compiler/compiler/integers/i16/no_space_between_literal.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i32/max_fail.out b/tests/expectations/compiler/compiler/integers/i32/max_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/i32/max_fail.out +++ b/tests/expectations/compiler/compiler/integers/i32/max_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i32/min_fail.out b/tests/expectations/compiler/compiler/integers/i32/min_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/i32/min_fail.out +++ b/tests/expectations/compiler/compiler/integers/i32/min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i32/no_space_between_literal.out b/tests/expectations/compiler/compiler/integers/i32/no_space_between_literal.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/i32/no_space_between_literal.out +++ b/tests/expectations/compiler/compiler/integers/i32/no_space_between_literal.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i64/max_fail.out b/tests/expectations/compiler/compiler/integers/i64/max_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/i64/max_fail.out +++ b/tests/expectations/compiler/compiler/integers/i64/max_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i64/min_fail.out b/tests/expectations/compiler/compiler/integers/i64/min_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/i64/min_fail.out +++ b/tests/expectations/compiler/compiler/integers/i64/min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i64/no_space_between_literal.out b/tests/expectations/compiler/compiler/integers/i64/no_space_between_literal.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/i64/no_space_between_literal.out +++ b/tests/expectations/compiler/compiler/integers/i64/no_space_between_literal.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i8/max_fail.out b/tests/expectations/compiler/compiler/integers/i8/max_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/i8/max_fail.out +++ b/tests/expectations/compiler/compiler/integers/i8/max_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i8/min_fail.out b/tests/expectations/compiler/compiler/integers/i8/min_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/i8/min_fail.out +++ b/tests/expectations/compiler/compiler/integers/i8/min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i8/no_space_between_literal.out b/tests/expectations/compiler/compiler/integers/i8/no_space_between_literal.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/i8/no_space_between_literal.out +++ b/tests/expectations/compiler/compiler/integers/i8/no_space_between_literal.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u128/max_fail.out b/tests/expectations/compiler/compiler/integers/u128/max_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/u128/max_fail.out +++ b/tests/expectations/compiler/compiler/integers/u128/max_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u128/min_fail.out b/tests/expectations/compiler/compiler/integers/u128/min_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/u128/min_fail.out +++ b/tests/expectations/compiler/compiler/integers/u128/min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u128/no_space_between_literal.out b/tests/expectations/compiler/compiler/integers/u128/no_space_between_literal.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/u128/no_space_between_literal.out +++ b/tests/expectations/compiler/compiler/integers/u128/no_space_between_literal.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u16/max_fail.out b/tests/expectations/compiler/compiler/integers/u16/max_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/u16/max_fail.out +++ b/tests/expectations/compiler/compiler/integers/u16/max_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u16/min_fail.out b/tests/expectations/compiler/compiler/integers/u16/min_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/u16/min_fail.out +++ b/tests/expectations/compiler/compiler/integers/u16/min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u16/no_space_between_literal.out b/tests/expectations/compiler/compiler/integers/u16/no_space_between_literal.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/u16/no_space_between_literal.out +++ b/tests/expectations/compiler/compiler/integers/u16/no_space_between_literal.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u32/max_fail.out b/tests/expectations/compiler/compiler/integers/u32/max_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/u32/max_fail.out +++ b/tests/expectations/compiler/compiler/integers/u32/max_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u32/min_fail.out b/tests/expectations/compiler/compiler/integers/u32/min_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/u32/min_fail.out +++ b/tests/expectations/compiler/compiler/integers/u32/min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u32/no_space_between_literal.out b/tests/expectations/compiler/compiler/integers/u32/no_space_between_literal.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/u32/no_space_between_literal.out +++ b/tests/expectations/compiler/compiler/integers/u32/no_space_between_literal.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u64/max_fail.out b/tests/expectations/compiler/compiler/integers/u64/max_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/u64/max_fail.out +++ b/tests/expectations/compiler/compiler/integers/u64/max_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u64/min_fail.out b/tests/expectations/compiler/compiler/integers/u64/min_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/u64/min_fail.out +++ b/tests/expectations/compiler/compiler/integers/u64/min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u64/no_space_between_literal.out b/tests/expectations/compiler/compiler/integers/u64/no_space_between_literal.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/u64/no_space_between_literal.out +++ b/tests/expectations/compiler/compiler/integers/u64/no_space_between_literal.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u8/max_fail.out b/tests/expectations/compiler/compiler/integers/u8/max_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/u8/max_fail.out +++ b/tests/expectations/compiler/compiler/integers/u8/max_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u8/min_fail.out b/tests/expectations/compiler/compiler/integers/u8/min_fail.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/u8/min_fail.out +++ b/tests/expectations/compiler/compiler/integers/u8/min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u8/no_space_between_literal.out b/tests/expectations/compiler/compiler/integers/u8/no_space_between_literal.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/integers/u8/no_space_between_literal.out +++ b/tests/expectations/compiler/compiler/integers/u8/no_space_between_literal.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/scalar/no_space_between_literal.out b/tests/expectations/compiler/compiler/scalar/no_space_between_literal.out index 6072996488..9ac75fd08d 100644 --- a/tests/expectations/compiler/compiler/scalar/no_space_between_literal.out +++ b/tests/expectations/compiler/compiler/scalar/no_space_between_literal.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/compiler/compiler/statements/all_loops_fail.out b/tests/expectations/compiler/compiler/statements/all_loops_fail.out index 4c3e127148..b6979435ee 100644 --- a/tests/expectations/compiler/compiler/statements/all_loops_fail.out +++ b/tests/expectations/compiler/compiler/statements/all_loops_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> compiler-test:15:26\n |\n 15 | for a: u32 in 10u32..=0u32 {\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '='\n --> compiler-test:15:26\n |\n 15 | for a: u32 in 10u32..=0u32 {\n | ^" diff --git a/tests/expectations/compiler/compiler/statements/assign_ternary.out b/tests/expectations/compiler/compiler/statements/assign_ternary.out index bc2fcb5fec..efdfd7f46d 100644 --- a/tests/expectations/compiler/compiler/statements/assign_ternary.out +++ b/tests/expectations/compiler/compiler/statements/assign_ternary.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> compiler-test:3:23\n |\n 3 | function main(x: u32) {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> compiler-test:3:23\n |\n 3 | function main(x: u32) {\n | ^" diff --git a/tests/expectations/compiler/compiler/tuple/access.out b/tests/expectations/compiler/compiler/tuple/access.out new file mode 100644 index 0000000000..fda1595286 --- /dev/null +++ b/tests/expectations/compiler/compiler/tuple/access.out @@ -0,0 +1,7 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 28dc123e02031e0415c48db81dce6750f03d8b4e47f97038dd3a1e808cc9b255 + initial_ast: d539e763bc9610a6090f222c2e73908ed607e40fc326f6f2a639ef762aeb8b58 diff --git a/tests/expectations/parser/parser/expression/array_init_fail.out b/tests/expectations/parser/parser/expression/array_init_fail.out index 80ea97fbc2..66c99b3d13 100644 --- a/tests/expectations/parser/parser/expression/array_init_fail.out +++ b/tests/expectations/parser/parser/expression/array_init_fail.out @@ -2,7 +2,7 @@ namespace: ParseExpression expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [...0u8; 1]\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [...0; 1]\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [0; ()]\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [0; (1)]\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '['\n --> test:1:1\n |\n 1 | [...0u8; 1]\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '['\n --> test:1:1\n |\n 1 | [...0; 1]\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '['\n --> test:1:1\n |\n 1 | [0; ()]\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '['\n --> test:1:1\n |\n 1 | [0; (1)]\n | ^" diff --git a/tests/expectations/parser/parser/expression/array_inline_fail.out b/tests/expectations/parser/parser/expression/array_inline_fail.out index ddff3711a8..3b19a17abe 100644 --- a/tests/expectations/parser/parser/expression/array_inline_fail.out +++ b/tests/expectations/parser/parser/expression/array_inline_fail.out @@ -2,8 +2,8 @@ namespace: ParseExpression expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [,]\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [,,]\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [0,,]\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [,0]\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [,0,]\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '['\n --> test:1:1\n |\n 1 | [,]\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '['\n --> test:1:1\n |\n 1 | [,,]\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '['\n --> test:1:1\n |\n 1 | [0,,]\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '['\n --> test:1:1\n |\n 1 | [,0]\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '['\n --> test:1:1\n |\n 1 | [,0,]\n | ^" diff --git a/tests/expectations/parser/parser/expression/circuit_init_fail.out b/tests/expectations/parser/parser/expression/circuit_init_fail.out index f94b936705..a1898918cf 100644 --- a/tests/expectations/parser/parser/expression/circuit_init_fail.out +++ b/tests/expectations/parser/parser/expression/circuit_init_fail.out @@ -2,15 +2,15 @@ namespace: ParseExpression expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ''\n --> test:1:3\n |\n 1 | x {\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ''\n --> test:1:3\n |\n 1 | x {\n | ^" - "did not consume all input: '}' @ 1:3-4\n" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:4\n |\n 1 | x {,}\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:5\n |\n 1 | x { , }\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:4\n |\n 1 | x {,,,}\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:6\n |\n 1 | x {x,,}\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:4\n |\n 1 | x {,,x}\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:4\n |\n 1 | x {,x}\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:8\n |\n 1 | x {x:y,,}\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:4\n |\n 1 | x {,,x:y}\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:4\n |\n 1 | x {,x:y}\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '}'\n --> test:1:6\n |\n 1 | x {x:}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ','\n --> test:1:4\n |\n 1 | x {,}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ','\n --> test:1:5\n |\n 1 | x { , }\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ','\n --> test:1:4\n |\n 1 | x {,,,}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ','\n --> test:1:6\n |\n 1 | x {x,,}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ','\n --> test:1:4\n |\n 1 | x {,,x}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ','\n --> test:1:4\n |\n 1 | x {,x}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ','\n --> test:1:8\n |\n 1 | x {x:y,,}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ','\n --> test:1:4\n |\n 1 | x {,,x:y}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ','\n --> test:1:4\n |\n 1 | x {,x:y}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '}'\n --> test:1:6\n |\n 1 | x {x:}\n | ^" diff --git a/tests/expectations/parser/parser/expression/literal/comment_fail.out b/tests/expectations/parser/parser/expression/literal/comment_fail.out index f07e268426..1cce72d9ce 100644 --- a/tests/expectations/parser/parser/expression/literal/comment_fail.out +++ b/tests/expectations/parser/parser/expression/literal/comment_fail.out @@ -4,9 +4,9 @@ expectation: Fail outputs: - "Error [EPAR0370023]: Empty block comment." - "Error [EPAR0370024]: Block comment does not close with content: `/* test`." - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '/'\n --> test:1:1\n |\n 1 | / /\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '/'\n --> test:1:1\n |\n 1 | / /\n | ^" - "Error [EPAR0370024]: Block comment does not close with content: `/*/`." - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '*'\n --> test:1:1\n |\n 1 | */\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '*'\n --> test:1:1\n |\n 1 | */\n | ^" - "Error [EPAR0370025]: Could not lex the following content: `🦀**/`.\n" - "Error [EPAR0370025]: Could not lex the following content: `🦀*/`.\n" - "Error [EPAR0370024]: Block comment does not close with content: `/*🦀/`." diff --git a/tests/expectations/parser/parser/expression/literal/group_fail.out b/tests/expectations/parser/parser/expression/literal/group_fail.out index 4a718549b8..ccd0c77fed 100644 --- a/tests/expectations/parser/parser/expression/literal/group_fail.out +++ b/tests/expectations/parser/parser/expression/literal/group_fail.out @@ -4,9 +4,9 @@ expectation: Fail outputs: - "did not consume all input: 'group' @ 1:3-8\n" - "Error [EPAR0370027]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123)group\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ','\n --> test:1:2\n |\n 1 | (,)group\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '+'\n --> test:1:2\n |\n 1 | (+, -,)group\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ','\n --> test:1:2\n |\n 1 | (,+, -)group\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ','\n --> test:1:2\n |\n 1 | (,)group\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '+'\n --> test:1:2\n |\n 1 | (+, -,)group\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ','\n --> test:1:2\n |\n 1 | (,+, -)group\n | ^" - "did not consume all input: 'group' @ 1:6-11\n" - "Error [EPAR0370027]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123,456u8)group\n | ^^^" - "Error [EPAR0370027]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123,456field)group\n | ^^^" diff --git a/tests/expectations/parser/parser/expression/token_format.out b/tests/expectations/parser/parser/expression/token_format.out index 9bccb1ee43..55a21164c9 100644 --- a/tests/expectations/parser/parser/expression/token_format.out +++ b/tests/expectations/parser/parser/expression/token_format.out @@ -11,41 +11,41 @@ outputs: - "Error [EPAR0370025]: Could not lex the following content: `'h'`.\n" - "Error [EPAR0370025]: Could not lex the following content: `@test`.\n" - "Error [EPAR0370025]: Could not lex the following content: `~`.\n" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '&&'\n --> test:1:1\n |\n 1 | &&\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '||'\n --> test:1:1\n |\n 1 | ||\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '=='\n --> test:1:1\n |\n 1 | ==\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '!='\n --> test:1:1\n |\n 1 | !=\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '<'\n --> test:1:1\n |\n 1 | <\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '<='\n --> test:1:1\n |\n 1 | <=\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '>'\n --> test:1:1\n |\n 1 | >\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '>='\n --> test:1:1\n |\n 1 | >=\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '+'\n --> test:1:1\n |\n 1 | +\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ''\n --> test:1:1\n |\n 1 | -\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '*'\n --> test:1:1\n |\n 1 | *\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '**'\n --> test:1:1\n |\n 1 | **\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '/'\n --> test:1:1\n |\n 1 | /\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:1\n |\n 1 | =\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '+'\n --> test:1:1\n |\n 1 | +=\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:2\n |\n 1 | -=\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '*'\n --> test:1:1\n |\n 1 | *=\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '/'\n --> test:1:1\n |\n 1 | /=\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '**'\n --> test:1:1\n |\n 1 | **=\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ''\n --> test:1:1\n |\n 1 | (\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ')'\n --> test:1:1\n |\n 1 | )\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ']'\n --> test:1:1\n |\n 1 | ]\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '{'\n --> test:1:1\n |\n 1 | {\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '}'\n --> test:1:1\n |\n 1 | }\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ','\n --> test:1:1\n |\n 1 | ,\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '.'\n --> test:1:1\n |\n 1 | .\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '..'\n --> test:1:1\n |\n 1 | ..\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '..'\n --> test:1:1\n |\n 1 | ...\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ';'\n --> test:1:1\n |\n 1 | ;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ':'\n --> test:1:1\n |\n 1 | :\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ''\n --> test:1:2\n |\n 1 | h::\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '?'\n --> test:1:1\n |\n 1 | ?\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '->'\n --> test:1:1\n |\n 1 | ->\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '_'\n --> test:1:1\n |\n 1 | _\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '&&'\n --> test:1:1\n |\n 1 | &&\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '||'\n --> test:1:1\n |\n 1 | ||\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '=='\n --> test:1:1\n |\n 1 | ==\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '!='\n --> test:1:1\n |\n 1 | !=\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '<'\n --> test:1:1\n |\n 1 | <\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '<='\n --> test:1:1\n |\n 1 | <=\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '>'\n --> test:1:1\n |\n 1 | >\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '>='\n --> test:1:1\n |\n 1 | >=\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '+'\n --> test:1:1\n |\n 1 | +\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ''\n --> test:1:1\n |\n 1 | -\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '*'\n --> test:1:1\n |\n 1 | *\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '**'\n --> test:1:1\n |\n 1 | **\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '/'\n --> test:1:1\n |\n 1 | /\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '='\n --> test:1:1\n |\n 1 | =\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '+'\n --> test:1:1\n |\n 1 | +=\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '='\n --> test:1:2\n |\n 1 | -=\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '*'\n --> test:1:1\n |\n 1 | *=\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '/'\n --> test:1:1\n |\n 1 | /=\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '**'\n --> test:1:1\n |\n 1 | **=\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ''\n --> test:1:1\n |\n 1 | (\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ')'\n --> test:1:1\n |\n 1 | )\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '['\n --> test:1:1\n |\n 1 | [\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ']'\n --> test:1:1\n |\n 1 | ]\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '{'\n --> test:1:1\n |\n 1 | {\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '}'\n --> test:1:1\n |\n 1 | }\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ','\n --> test:1:1\n |\n 1 | ,\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '.'\n --> test:1:1\n |\n 1 | .\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '..'\n --> test:1:1\n |\n 1 | ..\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '..'\n --> test:1:1\n |\n 1 | ...\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ';'\n --> test:1:1\n |\n 1 | ;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ':'\n --> test:1:1\n |\n 1 | :\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ''\n --> test:1:2\n |\n 1 | h::\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '?'\n --> test:1:1\n |\n 1 | ?\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '->'\n --> test:1:1\n |\n 1 | ->\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '_'\n --> test:1:1\n |\n 1 | _\n | ^" - "Error [EPAR0370025]: Could not lex the following content: `~`.\n" - "Error [EPAR0370025]: Could not lex the following content: `~`.\n" - "Error [EPAR0370025]: Could not lex the following content: `~`.\n" @@ -62,13 +62,13 @@ outputs: - "Error [EPAR0370025]: Could not lex the following content: `~`.\n" - "Error [EPAR0370025]: Could not lex the following content: `~`.\n" - "Error [EPAR0370025]: Could not lex the following content: `~`.\n" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'console'\n --> test:1:1\n |\n 1 | console\n | ^^^^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'const'\n --> test:1:1\n |\n 1 | const\n | ^^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'else'\n --> test:1:1\n |\n 1 | else\n | ^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'for'\n --> test:1:1\n |\n 1 | for\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'function'\n --> test:1:1\n |\n 1 | function\n | ^^^^^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'in'\n --> test:1:1\n |\n 1 | in\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'let'\n --> test:1:1\n |\n 1 | let\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '&'\n --> test:1:1\n |\n 1 | &\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'return'\n --> test:1:1\n |\n 1 | return\n | ^^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'console'\n --> test:1:1\n |\n 1 | console\n | ^^^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'const'\n --> test:1:1\n |\n 1 | const\n | ^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'else'\n --> test:1:1\n |\n 1 | else\n | ^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'for'\n --> test:1:1\n |\n 1 | for\n | ^^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'function'\n --> test:1:1\n |\n 1 | function\n | ^^^^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'in'\n --> test:1:1\n |\n 1 | in\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'let'\n --> test:1:1\n |\n 1 | let\n | ^^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '&'\n --> test:1:1\n |\n 1 | &\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'return'\n --> test:1:1\n |\n 1 | return\n | ^^^^^^" diff --git a/tests/expectations/parser/parser/functions/const_public_param_fail.out b/tests/expectations/parser/parser/functions/const_public_param_fail.out index 24c32456b2..91bf7adfbf 100644 --- a/tests/expectations/parser/parser/functions/const_public_param_fail.out +++ b/tests/expectations/parser/parser/functions/const_public_param_fail.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'public'\n --> test:3:26\n |\n 3 | function x(x: u32, const public y: i32) {\n | ^^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'public'\n --> test:3:26\n |\n 3 | function x(x: u32, const public y: i32) {\n | ^^^^^^" diff --git a/tests/expectations/parser/parser/functions/ident_token_fail.out b/tests/expectations/parser/parser/functions/ident_token_fail.out index 9bb9dfa589..6ed7a2602a 100644 --- a/tests/expectations/parser/parser/functions/ident_token_fail.out +++ b/tests/expectations/parser/parser/functions/ident_token_fail.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370005]: expected 'function', 'circuit', 'test' -- got '1'\n --> test:3:1\n |\n 3 | 1 main() {}\n | ^" + - "Error [EPAR0370005]: expected 'function', 'circuit', 'test' -- found '1'\n --> test:3:1\n |\n 3 | 1 main() {}\n | ^" diff --git a/tests/expectations/parser/parser/functions/mut_input_fail.out b/tests/expectations/parser/parser/functions/mut_input_fail.out index 3f657a07e7..6218eab0f5 100644 --- a/tests/expectations/parser/parser/functions/mut_input_fail.out +++ b/tests/expectations/parser/parser/functions/mut_input_fail.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370005]: expected : -- got 'a'\n --> test:3:16\n |\n 3 | function f(mut a: u8) {}\n | ^" + - "Error [EPAR0370005]: expected : -- found 'a'\n --> test:3:16\n |\n 3 | function f(mut a: u8) {}\n | ^" diff --git a/tests/expectations/parser/parser/inputs/input_constant_public_fail.out b/tests/expectations/parser/parser/inputs/input_constant_public_fail.out index f618c2ebbb..3a6bfe1661 100644 --- a/tests/expectations/parser/parser/inputs/input_constant_public_fail.out +++ b/tests/expectations/parser/parser/inputs/input_constant_public_fail.out @@ -2,4 +2,4 @@ namespace: Input expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'public'\n --> test:4:10\n |\n 4 | constant public a: bool = true; \n | ^^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'public'\n --> test:4:10\n |\n 4 | constant public a: bool = true; \n | ^^^^^^" diff --git a/tests/expectations/parser/parser/program/pipe_eof.out b/tests/expectations/parser/parser/program/pipe_eof.out index 9c18242a31..cd3e0fe4fc 100644 --- a/tests/expectations/parser/parser/program/pipe_eof.out +++ b/tests/expectations/parser/parser/program/pipe_eof.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> test:3:17\n |\n 3 | function main() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> test:3:17\n |\n 3 | function main() {\n | ^" diff --git a/tests/expectations/parser/parser/serialize/parser_error.out b/tests/expectations/parser/parser/serialize/parser_error.out index f932c95ee3..d37e0e45a0 100644 --- a/tests/expectations/parser/parser/serialize/parser_error.out +++ b/tests/expectations/parser/parser/serialize/parser_error.out @@ -2,4 +2,4 @@ namespace: Serialize expectation: Fail outputs: - - "Error [EPAR0370005]: expected 'function', 'circuit', 'test' -- got 'invalid'\n --> test:3:1\n |\n 3 | invalid\n | ^^^^^^^" + - "Error [EPAR0370005]: expected 'function', 'circuit', 'test' -- found 'invalid'\n --> test:3:1\n |\n 3 | invalid\n | ^^^^^^^" diff --git a/tests/expectations/parser/parser/statement/conditional_fail.out b/tests/expectations/parser/parser/statement/conditional_fail.out index 1150138dbb..6282f02aa2 100644 --- a/tests/expectations/parser/parser/statement/conditional_fail.out +++ b/tests/expectations/parser/parser/statement/conditional_fail.out @@ -2,4 +2,4 @@ namespace: ParseStatement expectation: Fail outputs: - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:23\n |\n 1 | if true {} else let x = 2;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:23\n |\n 1 | if true {} else let x = 2;\n | ^" diff --git a/tests/expectations/parser/parser/statement/console_fail.out b/tests/expectations/parser/parser/statement/console_fail.out index ca4fd249c3..e1132d24a3 100644 --- a/tests/expectations/parser/parser/statement/console_fail.out +++ b/tests/expectations/parser/parser/statement/console_fail.out @@ -3,5 +3,5 @@ namespace: ParseStatement expectation: Fail outputs: - "Error [EPAR0370039]: Unicode bidi override code point encountered." - - "Error [EPAR0370009]: unexpected string: expected 'formatted static_string', got '1'\n --> test:1:13\n |\n 1 | console.log(1);\n | ^" - - "Error [EPAR0370007]: unexpected identifier: expected 'assert', 'error', 'log' -- got 'test'\n --> test:1:9\n |\n 1 | console.test();\n | ^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'formatted static_string', found '1'\n --> test:1:13\n |\n 1 | console.log(1);\n | ^" + - "Error [EPAR0370007]: unexpected identifier: expected 'assert', 'error', 'log' -- found 'test'\n --> test:1:9\n |\n 1 | console.test();\n | ^^^^" diff --git a/tests/expectations/parser/parser/statement/definition_fail.out b/tests/expectations/parser/parser/statement/definition_fail.out index 1cfbb44106..6c6e467778 100644 --- a/tests/expectations/parser/parser/statement/definition_fail.out +++ b/tests/expectations/parser/parser/statement/definition_fail.out @@ -2,46 +2,46 @@ namespace: ParseStatement expectation: Fail outputs: - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x = expr;\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x = ();\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x = x+y;\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x = (x,y);\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x = x();\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x = expr;\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x = ();\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x = x+y;\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x = (x,y);\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x = x();\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x: u32 = expr;\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x: u32 = ();\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x: u32 = x+y;\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x: u32 = (x,y);\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x: u32 = x();\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x: u32 = expr;\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x: u32 = ();\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x: u32 = x+y;\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x: u32 = (x,y);\n | ^" - - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x: u32 = x();\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:10\n |\n 1 | let (x,y,,) = ();\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:6\n |\n 1 | let (,x,y) = ();\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:8\n |\n 1 | let (x,,y) = ();\n | ^" - - "Error [EPAR0370005]: expected 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- got '['\n --> test:1:8\n |\n 1 | let x: [u8; (2,,)] = [[0,0], [0,0]];\n | ^" - - "Error [EPAR0370005]: expected 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- got 'const'\n --> test:1:8\n |\n 1 | let x: const = expr;\n | ^^^^^" - - "Error [EPAR0370005]: expected 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- got 'let'\n --> test:1:10\n |\n 1 | const x: let = 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 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- 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 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- got '='\n --> test:1:8\n |\n 1 | let x: = 1;\n | ^" - - "Error [EPAR0370005]: expected 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- got '['\n --> test:1:8\n |\n 1 | let x: [u8] = 1;\n | ^" - - "Error [EPAR0370005]: expected 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- got '['\n --> test:1:8\n |\n 1 | let x: [u8;\n | ^" - - "Error [EPAR0370005]: expected 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- 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 [EPAR0370005]: expected : -- found 'x'\n --> test:1:9\n |\n 1 | let mut x = expr;\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:9\n |\n 1 | let mut x = ();\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:9\n |\n 1 | let mut x = x+y;\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:9\n |\n 1 | let mut x = (x,y);\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:9\n |\n 1 | let mut x = x();\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:11\n |\n 1 | const mut x = expr;\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:11\n |\n 1 | const mut x = ();\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:11\n |\n 1 | const mut x = x+y;\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:11\n |\n 1 | const mut x = (x,y);\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:11\n |\n 1 | const mut x = x();\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:9\n |\n 1 | let mut x: u32 = expr;\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:9\n |\n 1 | let mut x: u32 = ();\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:9\n |\n 1 | let mut x: u32 = x+y;\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:9\n |\n 1 | let mut x: u32 = (x,y);\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:9\n |\n 1 | let mut x: u32 = x();\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:11\n |\n 1 | const mut x: u32 = expr;\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:11\n |\n 1 | const mut x: u32 = ();\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:11\n |\n 1 | const mut x: u32 = x+y;\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:11\n |\n 1 | const mut x: u32 = (x,y);\n | ^" + - "Error [EPAR0370005]: expected : -- found 'x'\n --> test:1:11\n |\n 1 | const mut x: u32 = x();\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ','\n --> test:1:10\n |\n 1 | let (x,y,,) = ();\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ','\n --> test:1:6\n |\n 1 | let (,x,y) = ();\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ','\n --> test:1:8\n |\n 1 | let (x,,y) = ();\n | ^" + - "Error [EPAR0370005]: expected 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- found '['\n --> test:1:8\n |\n 1 | let x: [u8; (2,,)] = [[0,0], [0,0]];\n | ^" + - "Error [EPAR0370005]: expected 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- found 'const'\n --> test:1:8\n |\n 1 | let x: const = expr;\n | ^^^^^" + - "Error [EPAR0370005]: expected 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- found 'let'\n --> test:1:10\n |\n 1 | const x: let = expr;\n | ^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ''\n --> test:1:1\n |\n 1 | let\n | ^^^" + - "Error [EPAR0370005]: expected : -- found ''\n --> test:1:5\n |\n 1 | let x\n | ^" + - "Error [EPAR0370005]: expected 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- found ''\n --> test:1:6\n |\n 1 | let x:\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = (a, y]);\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '='\n --> test:1:5\n |\n 1 | let = 1u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ';'\n --> test:1:4\n |\n 1 | let;\n | ^" + - "Error [EPAR0370005]: expected : -- found '1'\n --> test:1:7\n |\n 1 | let x 1u8;\n | ^" + - "Error [EPAR0370005]: expected = -- found ';'\n --> test:1:10\n |\n 1 | let x: u8;\n | ^" + - "Error [EPAR0370005]: expected = -- found ''\n --> test:1:8\n |\n 1 | let x: u8\n | ^^" + - "Error [EPAR0370005]: expected 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- found '='\n --> test:1:8\n |\n 1 | let x: = 1;\n | ^" + - "Error [EPAR0370005]: expected 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- found '['\n --> test:1:8\n |\n 1 | let x: [u8] = 1;\n | ^" + - "Error [EPAR0370005]: expected 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- found '['\n --> test:1:8\n |\n 1 | let x: [u8;\n | ^" + - "Error [EPAR0370005]: expected 'address', 'bool', 'field', 'group', 'scalar', 'string', 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128' -- found '['\n --> test:1:8\n |\n 1 | let x: [u8; 1u8] = [1,\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ']'\n --> test:1:15\n |\n 1 | let dbg: u8 = ];\n | ^" - "Error [EPAR0370025]: Could not lex the following content: `🦀:`.\n" - - "Error [EPAR0370034]: 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 | ^" - - "Error [EPAR0370034]: 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:10\n |\n 1 | let (x,) = ...;\n | ^" + - "Error [EPAR0370034]: do not put parens around single variable names\n --> test:1:6\n |\n 1 | let (x) = ...;\n | ^\nError [EPAR0370005]: expected : -- found '='\n --> test:1:9\n |\n 1 | let (x) = ...;\n | ^" + - "Error [EPAR0370034]: do not put parens around single variable names\n --> test:1:6\n |\n 1 | let (x,) = ...;\n | ^\nError [EPAR0370005]: expected : -- found '='\n --> test:1:10\n |\n 1 | let (x,) = ...;\n | ^" diff --git a/tests/expectations/parser/parser/statement/expression_fail.out b/tests/expectations/parser/parser/statement/expression_fail.out index d8b6dda7e6..bfecf47fb1 100644 --- a/tests/expectations/parser/parser/statement/expression_fail.out +++ b/tests/expectations/parser/parser/statement/expression_fail.out @@ -2,9 +2,9 @@ namespace: ParseStatement expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ']'\n --> test:1:2\n |\n 1 | (];\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [);\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ']'\n --> test:1:2\n |\n 1 | (];\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '['\n --> test:1:1\n |\n 1 | [);\n | ^" - "Error [EPAR0370025]: Could not lex the following content: `\\y`.\n" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ';'\n --> test:1:6\n |\n 1 | (x,y|;\n | ^" - - "Error [EPAR0370005]: expected ; -- got '['\n --> test:1:2\n |\n 1 | x[};\n | ^" - - "Error [EPAR0370005]: expected ) -- got ']'\n --> test:1:6\n |\n 1 | (x, y];\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ';'\n --> test:1:6\n |\n 1 | (x,y|;\n | ^" + - "Error [EPAR0370005]: expected ; -- found '['\n --> test:1:2\n |\n 1 | x[};\n | ^" + - "Error [EPAR0370005]: expected ) -- found ']'\n --> test:1:6\n |\n 1 | (x, y];\n | ^" diff --git a/tests/expectations/parser/parser/statement/let_mut_recover.out b/tests/expectations/parser/parser/statement/let_mut_recover.out index acb14a5c3f..f3ab17869e 100644 --- a/tests/expectations/parser/parser/statement/let_mut_recover.out +++ b/tests/expectations/parser/parser/statement/let_mut_recover.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370005]: expected -> -- got '{'\n --> test:3:16\n |\n 3 | function foo() {\n | ^" + - "Error [EPAR0370005]: expected -> -- found '{'\n --> test:3:16\n |\n 3 | function foo() {\n | ^" diff --git a/tests/expectations/parser/parser/statement/return_fail.out b/tests/expectations/parser/parser/statement/return_fail.out index d7c60d2359..a981b6efb8 100644 --- a/tests/expectations/parser/parser/statement/return_fail.out +++ b/tests/expectations/parser/parser/statement/return_fail.out @@ -2,6 +2,6 @@ namespace: ParseStatement expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ''\n --> test:1:1\n |\n 1 | return\n | ^^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ''\n --> test:1:1\n |\n 1 | return\n | ^^^^^^" - "Error [EPAR0370027]: Could not parse the implicit value: 5.\n --> test:1:8\n |\n 1 | return 5\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:2:1\n |\n 2 | if x {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:2:1\n |\n 2 | if x {}\n | ^^" diff --git a/tests/expectations/parser/parser/unreachable/define.out b/tests/expectations/parser/parser/unreachable/define.out index cf4b1ed592..029ec9dbee 100644 --- a/tests/expectations/parser/parser/unreachable/define.out +++ b/tests/expectations/parser/parser/unreachable/define.out @@ -2,48 +2,48 @@ namespace: ParseStatement expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ';'\n --> test:1:1\n |\n 1 | ; x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '.'\n --> test:1:1\n |\n 1 | . x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:8\n |\n 1 | import x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ','\n --> test:1:1\n |\n 1 | , x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [ x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ']'\n --> test:1:1\n |\n 1 | ] x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ''\n --> test:1:11\n |\n 1 | { x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '}'\n --> test:1:1\n |\n 1 | } x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ) -- got '='\n --> test:1:5\n |\n 1 | ( x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ')'\n --> test:1:1\n |\n 1 | ) x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ':'\n --> test:1:1\n |\n 1 | : x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '::'\n --> test:1:1\n |\n 1 | :: x = 10u8;\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '?'\n --> test:1:1\n |\n 1 | ? x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '_'\n --> test:1:1\n |\n 1 | _ x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:1\n |\n 1 | = x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '=='\n --> test:1:1\n |\n 1 | == x = 10u8;\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '!='\n --> test:1:1\n |\n 1 | != x = 10u8;\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '>'\n --> test:1:1\n |\n 1 | > x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '>='\n --> test:1:1\n |\n 1 | >= x = 10u8;\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '<'\n --> test:1:1\n |\n 1 | < x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '<='\n --> test:1:1\n |\n 1 | <= x = 10u8;\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '>'\n --> test:1:1\n |\n 1 | > x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '..'\n --> test:1:1\n |\n 1 | .. x = 10u8;\n | ^^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:4\n |\n 1 | as x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected . -- got 'x'\n --> test:1:9\n |\n 1 | console x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | for x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected { -- got '='\n --> test:1:6\n |\n 1 | if x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'else'\n --> test:1:1\n |\n 1 | else x = 10u8;\n | ^^^^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:4\n |\n 1 | i8 x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:5\n |\n 1 | i16 x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:5\n |\n 1 | i32 x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:5\n |\n 1 | i64 x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:6\n |\n 1 | i128 x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:4\n |\n 1 | u8 x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:5\n |\n 1 | u16 x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:5\n |\n 1 | u32 x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:5\n |\n 1 | u64 x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:6\n |\n 1 | u128 x = 10u8;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '&'\n --> test:1:1\n |\n 1 | & x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ; -- got '='\n --> test:1:10\n |\n 1 | return x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:6\n |\n 1 | self x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:6\n |\n 1 | Self x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:6\n |\n 1 | true x = 10u8;\n | ^" - - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:7\n |\n 1 | false x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ';'\n --> test:1:1\n |\n 1 | ; x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '.'\n --> test:1:1\n |\n 1 | . x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:8\n |\n 1 | import x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ','\n --> test:1:1\n |\n 1 | , x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '['\n --> test:1:1\n |\n 1 | [ x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ']'\n --> test:1:1\n |\n 1 | ] x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ''\n --> test:1:11\n |\n 1 | { x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '}'\n --> test:1:1\n |\n 1 | } x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ) -- found '='\n --> test:1:5\n |\n 1 | ( x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ')'\n --> test:1:1\n |\n 1 | ) x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ':'\n --> test:1:1\n |\n 1 | : x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '::'\n --> test:1:1\n |\n 1 | :: x = 10u8;\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '?'\n --> test:1:1\n |\n 1 | ? x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '_'\n --> test:1:1\n |\n 1 | _ x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '='\n --> test:1:1\n |\n 1 | = x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '=='\n --> test:1:1\n |\n 1 | == x = 10u8;\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '!='\n --> test:1:1\n |\n 1 | != x = 10u8;\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '>'\n --> test:1:1\n |\n 1 | > x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '>='\n --> test:1:1\n |\n 1 | >= x = 10u8;\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '<'\n --> test:1:1\n |\n 1 | < x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '<='\n --> test:1:1\n |\n 1 | <= x = 10u8;\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '>'\n --> test:1:1\n |\n 1 | > x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '..'\n --> test:1:1\n |\n 1 | .. x = 10u8;\n | ^^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:4\n |\n 1 | as x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected . -- found 'x'\n --> test:1:9\n |\n 1 | console x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | for x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected { -- found '='\n --> test:1:6\n |\n 1 | if x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'else'\n --> test:1:1\n |\n 1 | else x = 10u8;\n | ^^^^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:4\n |\n 1 | i8 x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:5\n |\n 1 | i16 x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:5\n |\n 1 | i32 x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:5\n |\n 1 | i64 x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:6\n |\n 1 | i128 x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:4\n |\n 1 | u8 x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:5\n |\n 1 | u16 x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:5\n |\n 1 | u32 x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:5\n |\n 1 | u64 x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:6\n |\n 1 | u128 x = 10u8;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '&'\n --> test:1:1\n |\n 1 | & x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ; -- found '='\n --> test:1:10\n |\n 1 | return x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:6\n |\n 1 | self x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:6\n |\n 1 | Self x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:6\n |\n 1 | true x = 10u8;\n | ^" + - "Error [EPAR0370005]: expected ; -- found 'x'\n --> test:1:7\n |\n 1 | false x = 10u8;\n | ^" - "Error [EPAR0370027]: Could not parse the implicit value: 0.\n --> test:1:1\n |\n 1 | 0 x = 10u8;\n | ^" diff --git a/tests/expectations/parser/parser/unreachable/eat_ident.out b/tests/expectations/parser/parser/unreachable/eat_ident.out index cb16998106..39f564c282 100644 --- a/tests/expectations/parser/parser/unreachable/eat_ident.out +++ b/tests/expectations/parser/parser/unreachable/eat_ident.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ';'\n --> test:3:9\n |\n 3 | circuit ;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ';'\n --> test:3:9\n |\n 3 | circuit ;\n | ^" diff --git a/tests/expectations/parser/parser/unreachable/eat_int.out b/tests/expectations/parser/parser/unreachable/eat_int.out index f7a9dc0aa2..600a89e081 100644 --- a/tests/expectations/parser/parser/unreachable/eat_int.out +++ b/tests/expectations/parser/parser/unreachable/eat_int.out @@ -2,55 +2,55 @@ namespace: ParseStatement expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '-'\n --> test:1:3\n |\n 1 | x.-12\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_.\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_import\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_,\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_*\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_+\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_-\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_/\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_[\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_]\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_{\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_}\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_(\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_)\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_:\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_::\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_?\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0__\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_=\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_==\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_!\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_!=\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_>\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_>=\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_<\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_<=\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_>\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_..\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_as\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_console\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_const\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_let\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_for\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_if\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_else\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_i8\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_i16\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_i32\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_i64\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_i128\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_u8\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_u16\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_u32\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_u64\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_u128\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_&\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_return\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_self\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_Self\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_true\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:3\n |\n 1 | x.0_false\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '-'\n --> test:1:3\n |\n 1 | x.-12\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_;\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_.\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_import\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_,\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_*\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_+\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_-\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_/\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_[\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_]\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_{\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_}\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_(\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_)\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_:\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_::\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_?\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0__\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_=\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_==\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_!\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_!=\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_>\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_>=\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_<\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_<=\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_>\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_..\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_as\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_console\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_const\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_let\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_for\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_if\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_else\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_i8\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_i16\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_i32\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_i64\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_i128\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_u8\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_u16\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_u32\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_u64\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_u128\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_&\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_return\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_self\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_Self\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_true\n | ^" + - "Error [EPAR0370005]: expected ; -- found '_'\n --> test:1:4\n |\n 1 | x.0_false\n | ^" diff --git a/tests/expectations/parser/parser/unreachable/equality_and_order_expression.out b/tests/expectations/parser/parser/unreachable/equality_and_order_expression.out index 23a140dc16..6fa21e2342 100644 --- a/tests/expectations/parser/parser/unreachable/equality_and_order_expression.out +++ b/tests/expectations/parser/parser/unreachable/equality_and_order_expression.out @@ -2,55 +2,55 @@ namespace: ParseExpression expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 ; {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 . {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 import {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 , {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 * {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 + {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 - {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 / {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 [ {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 ] {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 { {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 } {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 ( {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 ) {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 : {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 :: {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 ? {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 _ {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 = {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 == {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 ! {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 != {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 > {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 >= {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 < {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 <= {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 > {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 .. {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 as {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 console {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 const {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 let {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 for {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 if {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 else {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 i8 {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 i16 {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 i32 {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 i64 {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 i128 {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 u8 {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 u16 {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 u32 {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 u64 {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 u128 {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 & {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 return {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 self {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 Self {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 true {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 false {}\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if 10 0 {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 ; {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 . {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 import {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 , {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 * {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 + {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 - {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 / {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 [ {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 ] {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 { {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 } {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 ( {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 ) {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 : {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 :: {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 ? {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 _ {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 = {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 == {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 ! {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 != {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 > {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 >= {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 < {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 <= {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 > {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 .. {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 as {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 console {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 const {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 let {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 for {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 if {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 else {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 i8 {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 i16 {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 i32 {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 i64 {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 i128 {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 u8 {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 u16 {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 u32 {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 u64 {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 u128 {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 & {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 return {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 self {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 Self {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 true {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 false {}\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found 'if'\n --> test:1:1\n |\n 1 | if 10 0 {}\n | ^^" diff --git a/tests/expectations/parser/parser/unreachable/expect_ident.out b/tests/expectations/parser/parser/unreachable/expect_ident.out index 303b8d95ef..d0501d689c 100644 --- a/tests/expectations/parser/parser/unreachable/expect_ident.out +++ b/tests/expectations/parser/parser/unreachable/expect_ident.out @@ -2,55 +2,55 @@ namespace: ParseStatement expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ';'\n --> test:1:4\n |\n 1 | x::;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '.'\n --> test:1:4\n |\n 1 | x::.\n | ^" - - "Error [EPAR0370005]: expected ; -- got ''\n --> test:1:4\n |\n 1 | x::import\n | ^^^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:4\n |\n 1 | x::,\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '*'\n --> test:1:4\n |\n 1 | x::*\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '+'\n --> test:1:4\n |\n 1 | x::+\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '-'\n --> test:1:4\n |\n 1 | x::-\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '/'\n --> test:1:4\n |\n 1 | x::/\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '['\n --> test:1:4\n |\n 1 | x::[\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ']'\n --> test:1:4\n |\n 1 | x::]\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '{'\n --> test:1:4\n |\n 1 | x::{\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '}'\n --> test:1:4\n |\n 1 | x::}\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '('\n --> test:1:4\n |\n 1 | x::(\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ')'\n --> test:1:4\n |\n 1 | x::)\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ':'\n --> test:1:4\n |\n 1 | x:::\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '::'\n --> test:1:4\n |\n 1 | x::::\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '?'\n --> test:1:4\n |\n 1 | x::?\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '_'\n --> test:1:4\n |\n 1 | x::_\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '='\n --> test:1:4\n |\n 1 | x::=\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '=='\n --> test:1:4\n |\n 1 | x::==\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '!'\n --> test:1:4\n |\n 1 | x::!\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '!='\n --> test:1:4\n |\n 1 | x::!=\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '>'\n --> test:1:4\n |\n 1 | x::>\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '>='\n --> test:1:4\n |\n 1 | x::>=\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '<'\n --> test:1:4\n |\n 1 | x::<\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '<='\n --> test:1:4\n |\n 1 | x::<=\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '>'\n --> test:1:4\n |\n 1 | x::>\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '..'\n --> test:1:4\n |\n 1 | x::..\n | ^^" - - "Error [EPAR0370005]: expected ; -- got ''\n --> test:1:4\n |\n 1 | x::as\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'console'\n --> test:1:4\n |\n 1 | x::console\n | ^^^^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'const'\n --> test:1:4\n |\n 1 | x::const\n | ^^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'let'\n --> test:1:4\n |\n 1 | x::let\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'for'\n --> test:1:4\n |\n 1 | x::for\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'if'\n --> test:1:4\n |\n 1 | x::if\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'else'\n --> test:1:4\n |\n 1 | x::else\n | ^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'i8'\n --> test:1:4\n |\n 1 | x::i8\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'i16'\n --> test:1:4\n |\n 1 | x::i16\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'i32'\n --> test:1:4\n |\n 1 | x::i32\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'i64'\n --> test:1:4\n |\n 1 | x::i64\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'i128'\n --> test:1:4\n |\n 1 | x::i128\n | ^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'u8'\n --> test:1:4\n |\n 1 | x::u8\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'u16'\n --> test:1:4\n |\n 1 | x::u16\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'u32'\n --> test:1:4\n |\n 1 | x::u32\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'u64'\n --> test:1:4\n |\n 1 | x::u64\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'u128'\n --> test:1:4\n |\n 1 | x::u128\n | ^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '&'\n --> test:1:4\n |\n 1 | x::&\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'return'\n --> test:1:4\n |\n 1 | x::return\n | ^^^^^^" - - "Error [EPAR0370005]: expected ; -- got ''\n --> test:1:4\n |\n 1 | x::self\n | ^^^^" - - "Error [EPAR0370005]: expected ; -- got ''\n --> test:1:4\n |\n 1 | x::Self\n | ^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'true'\n --> test:1:4\n |\n 1 | x::true\n | ^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'false'\n --> test:1:4\n |\n 1 | x::false\n | ^^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '0'\n --> test:1:4\n |\n 1 | x::0\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ';'\n --> test:1:4\n |\n 1 | x::;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '.'\n --> test:1:4\n |\n 1 | x::.\n | ^" + - "Error [EPAR0370005]: expected ; -- found ''\n --> test:1:4\n |\n 1 | x::import\n | ^^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ','\n --> test:1:4\n |\n 1 | x::,\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '*'\n --> test:1:4\n |\n 1 | x::*\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '+'\n --> test:1:4\n |\n 1 | x::+\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '-'\n --> test:1:4\n |\n 1 | x::-\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '/'\n --> test:1:4\n |\n 1 | x::/\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '['\n --> test:1:4\n |\n 1 | x::[\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ']'\n --> test:1:4\n |\n 1 | x::]\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '{'\n --> test:1:4\n |\n 1 | x::{\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '}'\n --> test:1:4\n |\n 1 | x::}\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '('\n --> test:1:4\n |\n 1 | x::(\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ')'\n --> test:1:4\n |\n 1 | x::)\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found ':'\n --> test:1:4\n |\n 1 | x:::\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '::'\n --> test:1:4\n |\n 1 | x::::\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '?'\n --> test:1:4\n |\n 1 | x::?\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '_'\n --> test:1:4\n |\n 1 | x::_\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '='\n --> test:1:4\n |\n 1 | x::=\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '=='\n --> test:1:4\n |\n 1 | x::==\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '!'\n --> test:1:4\n |\n 1 | x::!\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '!='\n --> test:1:4\n |\n 1 | x::!=\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '>'\n --> test:1:4\n |\n 1 | x::>\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '>='\n --> test:1:4\n |\n 1 | x::>=\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '<'\n --> test:1:4\n |\n 1 | x::<\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '<='\n --> test:1:4\n |\n 1 | x::<=\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '>'\n --> test:1:4\n |\n 1 | x::>\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '..'\n --> test:1:4\n |\n 1 | x::..\n | ^^" + - "Error [EPAR0370005]: expected ; -- found ''\n --> test:1:4\n |\n 1 | x::as\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'console'\n --> test:1:4\n |\n 1 | x::console\n | ^^^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'const'\n --> test:1:4\n |\n 1 | x::const\n | ^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'let'\n --> test:1:4\n |\n 1 | x::let\n | ^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'for'\n --> test:1:4\n |\n 1 | x::for\n | ^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'if'\n --> test:1:4\n |\n 1 | x::if\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'else'\n --> test:1:4\n |\n 1 | x::else\n | ^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'i8'\n --> test:1:4\n |\n 1 | x::i8\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'i16'\n --> test:1:4\n |\n 1 | x::i16\n | ^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'i32'\n --> test:1:4\n |\n 1 | x::i32\n | ^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'i64'\n --> test:1:4\n |\n 1 | x::i64\n | ^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'i128'\n --> test:1:4\n |\n 1 | x::i128\n | ^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'u8'\n --> test:1:4\n |\n 1 | x::u8\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'u16'\n --> test:1:4\n |\n 1 | x::u16\n | ^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'u32'\n --> test:1:4\n |\n 1 | x::u32\n | ^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'u64'\n --> test:1:4\n |\n 1 | x::u64\n | ^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'u128'\n --> test:1:4\n |\n 1 | x::u128\n | ^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '&'\n --> test:1:4\n |\n 1 | x::&\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'return'\n --> test:1:4\n |\n 1 | x::return\n | ^^^^^^" + - "Error [EPAR0370005]: expected ; -- found ''\n --> test:1:4\n |\n 1 | x::self\n | ^^^^" + - "Error [EPAR0370005]: expected ; -- found ''\n --> test:1:4\n |\n 1 | x::Self\n | ^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'true'\n --> test:1:4\n |\n 1 | x::true\n | ^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found 'false'\n --> test:1:4\n |\n 1 | x::false\n | ^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '0'\n --> test:1:4\n |\n 1 | x::0\n | ^" diff --git a/tests/expectations/parser/parser/unreachable/math_op_fail.out b/tests/expectations/parser/parser/unreachable/math_op_fail.out index f288ea3eaa..45b4f5010d 100644 --- a/tests/expectations/parser/parser/unreachable/math_op_fail.out +++ b/tests/expectations/parser/parser/unreachable/math_op_fail.out @@ -2,61 +2,61 @@ namespace: ParseStatement expectation: Fail outputs: - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a ; b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a import b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a , b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a [ b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a ] b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a { b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a } b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a ( b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a ) b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a : b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a ? b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a _ b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a = b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a ! b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a .. b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a console b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a const b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a let b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a for b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a if b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a else b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a i8 b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a i16 b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a i32 b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a i64 b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a i128 b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a u8 b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a u16 b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a u32 b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a u64 b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a u128 b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a & b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a return b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a self b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a Self b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a true b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a false b;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a 0 b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a ; b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a import b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a , b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a [ b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a ] b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a { b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a } b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a ( b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a ) b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a : b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a ? b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a _ b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a = b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a ! b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a .. b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a console b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a const b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a let b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a for b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a if b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a else b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a i8 b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a i16 b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a i32 b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a i64 b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a i128 b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a u8 b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a u16 b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a u32 b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a u64 b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a u128 b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a & b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a return b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a self b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a Self b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a true b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a false b;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a 0 b;\n | ^" - "Error [EPAR0370040]: Expression statements are not supported.\n --> test:1:1\n |\n 1 | x;=b;\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '='\n --> test:1:3\n |\n 1 | x.=b;\n | ^" - - "Error [EPAR0370005]: expected ; -- got ','\n --> test:1:2\n |\n 1 | x,=b; // 43\n | ^" - - "Error [EPAR0370005]: expected ; -- got '['\n --> test:1:2\n |\n 1 | x[=b;\n | ^" - - "Error [EPAR0370005]: expected ; -- got ']'\n --> test:1:2\n |\n 1 | x]=b;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '='\n --> test:1:3\n |\n 1 | x{=b;\n | ^" - - "Error [EPAR0370005]: expected ; -- got '}'\n --> test:1:2\n |\n 1 | x}=b;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ';'\n --> test:1:4\n |\n 1 | x=(;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ')'\n --> test:1:3\n |\n 1 | x=);\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got ':'\n --> test:1:3\n |\n 1 | x=:;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '::'\n --> test:1:3\n |\n 1 | x=::;\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:3\n |\n 1 | x?=b;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:4\n |\n 1 | x!==b;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:4\n |\n 1 | x>==b;\n | ^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:4\n |\n 1 | x<==b;\n | ^" - - "Error [EPAR0370005]: expected ; -- got '..'\n --> test:1:2\n |\n 1 | x..=b;\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:3\n |\n 1 | x&=b;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '='\n --> test:1:3\n |\n 1 | x.=b;\n | ^" + - "Error [EPAR0370005]: expected ; -- found ','\n --> test:1:2\n |\n 1 | x,=b; // 43\n | ^" + - "Error [EPAR0370005]: expected ; -- found '['\n --> test:1:2\n |\n 1 | x[=b;\n | ^" + - "Error [EPAR0370005]: expected ; -- found ']'\n --> test:1:2\n |\n 1 | x]=b;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '='\n --> test:1:3\n |\n 1 | x{=b;\n | ^" + - "Error [EPAR0370005]: expected ; -- found '}'\n --> test:1:2\n |\n 1 | x}=b;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ';'\n --> test:1:4\n |\n 1 | x=(;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ')'\n --> test:1:3\n |\n 1 | x=);\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found ':'\n --> test:1:3\n |\n 1 | x=:;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '::'\n --> test:1:3\n |\n 1 | x=::;\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '='\n --> test:1:3\n |\n 1 | x?=b;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '='\n --> test:1:4\n |\n 1 | x!==b;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '='\n --> test:1:4\n |\n 1 | x>==b;\n | ^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '='\n --> test:1:4\n |\n 1 | x<==b;\n | ^" + - "Error [EPAR0370005]: expected ; -- found '..'\n --> test:1:2\n |\n 1 | x..=b;\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'expression', found '='\n --> test:1:3\n |\n 1 | x&=b;\n | ^" - "Error [EPAR0370040]: Expression statements are not supported.\n --> test:1:1\n |\n 1 | x==b;\n | ^^^^^" - "Error [EPAR0370040]: Expression statements are not supported.\n --> test:1:1\n |\n 1 | x!=b;\n | ^^^^^" - "Error [EPAR0370040]: Expression statements are not supported.\n --> test:1:1\n |\n 1 | x>=b;\n | ^^^^^" diff --git a/tests/expectations/parser/parser/unreachable/postfix_fail.out b/tests/expectations/parser/parser/unreachable/postfix_fail.out index fed5d32151..1391c02928 100644 --- a/tests/expectations/parser/parser/unreachable/postfix_fail.out +++ b/tests/expectations/parser/parser/unreachable/postfix_fail.out @@ -2,23 +2,23 @@ namespace: ParseStatement expectation: Fail outputs: - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a;;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a.;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a,;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a[;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a];\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a{;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a};\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a);\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a:;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a?;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a=;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a==;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a!;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a!=;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a>;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a>=;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a<;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a<=;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a>;\n | ^" - - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a..;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a;;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a.;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a,;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a[;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a];\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a{;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a};\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a);\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a:;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a?;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a=;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a==;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a!;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a!=;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a>;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a>=;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a<;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a<=;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a>;\n | ^" + - "Error [EPAR0370005]: expected : -- found '='\n --> test:1:7\n |\n 1 | let x = a..;\n | ^" From 2a61f26ccc75341f594f922fbb3529ca464222c7 Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Sat, 9 Jul 2022 15:02:45 -0700 Subject: [PATCH 33/37] impl tuple tests --- compiler/ast/src/common/positive_number.rs | 5 ++++ .../src/type_checker/check_expressions.rs | 26 ++++++++++++++++--- .../errors/type_checker/type_checker_error.rs | 9 ++++++- tests/compiler/tuple/access_negative_fail.leo | 12 +++++++++ .../tuple/access_out_of_bounds_fail.leo | 12 +++++++++ tests/compiler/tuple/declare_fail.leo | 12 +++++++++ .../compiler/tuple/return_statement_fail.leo | 12 +++++++++ tests/compiler/tuple/type_fail.leo | 12 +++++++++ .../records/init_expression_type_fail.out | 2 +- .../compiler/tuple/access_negative_fail.out | 5 ++++ .../tuple/access_out_of_bounds_fail.out | 5 ++++ .../compiler/compiler/tuple/declare_fail.out | 5 ++++ .../compiler/tuple/return_statement_fail.out | 7 +++++ .../compiler/compiler/tuple/type_fail.out | 5 ++++ 14 files changed, 123 insertions(+), 6 deletions(-) create mode 100644 tests/compiler/tuple/access_negative_fail.leo create mode 100644 tests/compiler/tuple/access_out_of_bounds_fail.leo create mode 100644 tests/compiler/tuple/declare_fail.leo create mode 100644 tests/compiler/tuple/return_statement_fail.leo create mode 100644 tests/compiler/tuple/type_fail.leo create mode 100644 tests/expectations/compiler/compiler/tuple/access_negative_fail.out create mode 100644 tests/expectations/compiler/compiler/tuple/access_out_of_bounds_fail.out create mode 100644 tests/expectations/compiler/compiler/tuple/declare_fail.out create mode 100644 tests/expectations/compiler/compiler/tuple/return_statement_fail.out create mode 100644 tests/expectations/compiler/compiler/tuple/type_fail.out diff --git a/compiler/ast/src/common/positive_number.rs b/compiler/ast/src/common/positive_number.rs index 2d1c28bf36..c361a8a802 100644 --- a/compiler/ast/src/common/positive_number.rs +++ b/compiler/ast/src/common/positive_number.rs @@ -16,6 +16,7 @@ use serde::{Deserialize, Serialize}; use std::fmt; +use std::str::FromStr; /// A number string guaranteed to be positive. #[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Eq, Hash)] @@ -30,6 +31,10 @@ impl PositiveNumber { pub fn is_zero(&self) -> bool { self.value.eq("0") } + + pub fn to_usize(&self) -> usize { + usize::from_str(&self.value).expect("failed to parse positive number") + } } impl fmt::Display for PositiveNumber { diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index a00a6ea2ca..3973b26e5a 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -57,7 +57,6 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } fn visit_access(&mut self, input: &'a AccessExpression, expected: &Self::AdditionalInput) -> Self::Output { - // CAUTION: This implementation only allows access to core circuits. match input { AccessExpression::AssociatedFunction(access) => { // Check core circuit name and function. @@ -87,15 +86,34 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } // Check return type. - Some(self.assert_and_return_type(core_instruction.return_type(), expected, access.span())) + return Some(self.assert_and_return_type(core_instruction.return_type(), expected, access.span())); } else { self.handler .emit_err(TypeCheckerError::invalid_access_expression(access, access.span()).into()); - None } } - _expr => None, // todo: Add support for associated constants (u8::MAX). + AccessExpression::Tuple(access) => { + if let Some(type_) = self.visit_expression(&access.tuple, &None) { + match type_ { + Type::Tuple(tuple) => { + // Check out of range access. + let index = access.index.to_usize(); + if index > tuple.len() - 1 { + self.emit_err(TypeCheckerError::tuple_out_of_range(index, tuple.len(), access.span())); + } else { + // Return type of tuple index. + return Some(tuple.get(index).expect("failed to get tuple index").clone()); + } + } + type_ => { + self.emit_err(TypeCheckerError::type_should_be(type_, "tuple", access.span())); + } + } + } + } + _expr => {} // todo: Add support for associated constants (u8::MAX). } + None } fn visit_binary(&mut self, input: &'a BinaryExpression, destination: &Self::AdditionalInput) -> 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 284bb86ae7..335bc7bb1c 100644 --- a/leo/errors/src/errors/type_checker/type_checker_error.rs +++ b/leo/errors/src/errors/type_checker/type_checker_error.rs @@ -56,7 +56,7 @@ create_messages!( type_should_be { args: (type_: impl Display, expected: impl Display), msg: format!( - "Found type `{type_}` but type `{expected}` was expected", + "Expected type `{expected}` but type `{type_}` was found", ), help: None, } @@ -285,4 +285,11 @@ create_messages!( msg: format!("Tuples must be explicitly typed in Leo"), help: Some("The function definition must match the function return statement".to_string()), } + + @formatted + tuple_out_of_range { + args: (index: impl Display, length: impl Display), + msg: format!("Tuple index `{index}` out of range for a tuple with length `{length}`"), + help: None, + } ); diff --git a/tests/compiler/tuple/access_negative_fail.leo b/tests/compiler/tuple/access_negative_fail.leo new file mode 100644 index 0000000000..7caafabfe6 --- /dev/null +++ b/tests/compiler/tuple/access_negative_fail.leo @@ -0,0 +1,12 @@ +/* +namespace: Compile +expectation: Fail +input_file: + - inputs/bool_bool.in +*/ + +function main(a: bool, b: bool) -> (bool, bool) { + let t: (bool, bool) = (a, b); + + return (t.0, t.-1); // Index `t.-1` is invalid. +} \ No newline at end of file diff --git a/tests/compiler/tuple/access_out_of_bounds_fail.leo b/tests/compiler/tuple/access_out_of_bounds_fail.leo new file mode 100644 index 0000000000..fd946963d9 --- /dev/null +++ b/tests/compiler/tuple/access_out_of_bounds_fail.leo @@ -0,0 +1,12 @@ +/* +namespace: Compile +expectation: Fail +input_file: + - inputs/bool_bool.in +*/ + +function main(a: bool, b: bool) -> (bool, bool) { + let t: (bool, bool) = (a, b); + + return (t.0, t.2); // Index `t.2` is out of bounds. +} \ No newline at end of file diff --git a/tests/compiler/tuple/declare_fail.leo b/tests/compiler/tuple/declare_fail.leo new file mode 100644 index 0000000000..a4c55dfdaa --- /dev/null +++ b/tests/compiler/tuple/declare_fail.leo @@ -0,0 +1,12 @@ +/* +namespace: Compile +expectation: Fail +input_file: + - inputs/bool_bool.in +*/ + +function main(a: bool, b: bool) -> (bool, bool) { + let t: (bool, bool) = (a, 1u64); // We should be declaring to a boolean, not a u64. + + return (t.0, t.1); +} \ No newline at end of file diff --git a/tests/compiler/tuple/return_statement_fail.leo b/tests/compiler/tuple/return_statement_fail.leo new file mode 100644 index 0000000000..614efa4380 --- /dev/null +++ b/tests/compiler/tuple/return_statement_fail.leo @@ -0,0 +1,12 @@ +/* +namespace: Compile +expectation: Pass +input_file: + - inputs/bool_bool.in +*/ + +function main(a: bool, b: bool) -> (bool, u64) { + let t: (bool, bool) = (a, b); + + return (t.0, t.1); // The second element should be type u64 as in the function declaration. +} \ No newline at end of file diff --git a/tests/compiler/tuple/type_fail.leo b/tests/compiler/tuple/type_fail.leo new file mode 100644 index 0000000000..6136f5a093 --- /dev/null +++ b/tests/compiler/tuple/type_fail.leo @@ -0,0 +1,12 @@ +/* +namespace: Compile +expectation: Fail +input_file: + - inputs/bool_bool.in +*/ + +function main(a: bool, b: bool) -> (bool, bool) { + let t: (bool, u64) = (a, b); // We should expect a boolean, not a u64. + + return (t.0, t.1); +} \ No newline at end of file diff --git a/tests/expectations/compiler/compiler/records/init_expression_type_fail.out b/tests/expectations/compiler/compiler/records/init_expression_type_fail.out index 3554e1935f..2b77bbee7c 100644 --- a/tests/expectations/compiler/compiler/records/init_expression_type_fail.out +++ b/tests/expectations/compiler/compiler/records/init_expression_type_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372003]: Found type `u64` but type `address` was expected\n --> compiler-test:12:28\n |\n 12 | function mint(r0: address, r1: u64) -> Token {\n | ^^\nError [ETYC0372003]: Found type `address` but type `u64` was expected\n --> compiler-test:12:15\n |\n 12 | function mint(r0: address, r1: u64) -> Token {\n | ^^\n" + - "Error [ETYC0372003]: Expected type `address` but type `u64` was found\n --> compiler-test:12:28\n |\n 12 | function mint(r0: address, r1: u64) -> Token {\n | ^^\nError [ETYC0372003]: Expected type `u64` but type `address` was found\n --> compiler-test:12:15\n |\n 12 | function mint(r0: address, r1: u64) -> Token {\n | ^^\n" diff --git a/tests/expectations/compiler/compiler/tuple/access_negative_fail.out b/tests/expectations/compiler/compiler/tuple/access_negative_fail.out new file mode 100644 index 0000000000..021a7db830 --- /dev/null +++ b/tests/expectations/compiler/compiler/tuple/access_negative_fail.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '-'\n --> compiler-test:6:20\n |\n 6 | return (t.0, t.-1); // Index `t.-1` is invalid.\n | ^" diff --git a/tests/expectations/compiler/compiler/tuple/access_out_of_bounds_fail.out b/tests/expectations/compiler/compiler/tuple/access_out_of_bounds_fail.out new file mode 100644 index 0000000000..4e2bae8f1f --- /dev/null +++ b/tests/expectations/compiler/compiler/tuple/access_out_of_bounds_fail.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [ETYC0372028]: Tuple index `2` out of range for a tuple with length `2`\n --> compiler-test:6:21\n |\n 6 | return (t.0, t.2); // Index `t.2` is out of bounds.\n | ^\n" diff --git a/tests/expectations/compiler/compiler/tuple/declare_fail.out b/tests/expectations/compiler/compiler/tuple/declare_fail.out new file mode 100644 index 0000000000..cd1d784e80 --- /dev/null +++ b/tests/expectations/compiler/compiler/tuple/declare_fail.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [ETYC0372003]: Expected type `bool` but type `u64` was found\n --> compiler-test:4:31\n |\n 4 | let t: (bool, bool) = (a, 1u64); // We should be declaring to a boolean, not a u64.\n | ^^^^\n" diff --git a/tests/expectations/compiler/compiler/tuple/return_statement_fail.out b/tests/expectations/compiler/compiler/tuple/return_statement_fail.out new file mode 100644 index 0000000000..29c0dcafbf --- /dev/null +++ b/tests/expectations/compiler/compiler/tuple/return_statement_fail.out @@ -0,0 +1,7 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: 6607a8eab25d6001b58441084978cbf2d37295c9d77e3730c1dd74d2fa1e0a94 + initial_ast: e1960f775049d0d2b246d0da716aa5b8c261b518cab913d287f26fe2c1e0515f diff --git a/tests/expectations/compiler/compiler/tuple/type_fail.out b/tests/expectations/compiler/compiler/tuple/type_fail.out new file mode 100644 index 0000000000..5264685394 --- /dev/null +++ b/tests/expectations/compiler/compiler/tuple/type_fail.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [ETYC0372003]: Expected type `u64` but type `bool` was found\n --> compiler-test:3:24\n |\n 3 | function main(a: bool, b: bool) -> (bool, bool) {\n | ^\n" From aff2db67dae6c1bed6284261bd970f55fe19b8ef Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Sat, 9 Jul 2022 15:13:42 -0700 Subject: [PATCH 34/37] check that returned tuple types are valid --- .../passes/src/type_checker/check_expressions.rs | 15 ++++++++++++++- tests/compiler/tuple/return_statement_fail.leo | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index 3973b26e5a..fd31fb6f03 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -101,8 +101,21 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { if index > tuple.len() - 1 { self.emit_err(TypeCheckerError::tuple_out_of_range(index, tuple.len(), access.span())); } else { + // Lookup type of tuple index. + let actual = tuple.get(index).expect("failed to get tuple index").clone(); + if let Some(expected) = expected { + // Emit error for mismatched types. + if !actual.eq_flat(expected) { + self.emit_err(TypeCheckerError::type_should_be( + &actual, + expected, + access.span(), + )) + } + } + // Return type of tuple index. - return Some(tuple.get(index).expect("failed to get tuple index").clone()); + return Some(actual); } } type_ => { diff --git a/tests/compiler/tuple/return_statement_fail.leo b/tests/compiler/tuple/return_statement_fail.leo index 614efa4380..2871a277a1 100644 --- a/tests/compiler/tuple/return_statement_fail.leo +++ b/tests/compiler/tuple/return_statement_fail.leo @@ -1,6 +1,6 @@ /* namespace: Compile -expectation: Pass +expectation: Fail input_file: - inputs/bool_bool.in */ From 1bcb9accec4e2ce24bf798b57f14123dc8cb829b Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Sat, 9 Jul 2022 15:29:35 -0700 Subject: [PATCH 35/37] clippy --- compiler/ast/src/types/tuple.rs | 2 +- compiler/parser/src/parser/context.rs | 5 +- compiler/parser/src/parser/type_.rs | 2 +- compiler/parser/src/tokenizer/mod.rs | 5 +- .../src/type_checker/check_expressions.rs | 109 ++++++++---------- .../passes/src/type_checker/check_program.rs | 22 ++-- .../src/type_checker/check_statements.rs | 15 +-- leo/errors/src/emitter/mod.rs | 2 +- .../errors/type_checker/type_checker_error.rs | 2 +- 9 files changed, 77 insertions(+), 87 deletions(-) diff --git a/compiler/ast/src/types/tuple.rs b/compiler/ast/src/types/tuple.rs index 427fe58608..42e7613a99 100644 --- a/compiler/ast/src/types/tuple.rs +++ b/compiler/ast/src/types/tuple.rs @@ -27,7 +27,7 @@ pub struct Tuple(Vec); impl Tuple { /// Returns a new `Type::Tuple` enumeration. - pub fn new(elements: Vec, span: Span) -> Result { + pub fn try_new(elements: Vec, span: Span) -> Result { match elements.len() { 0 => Err(AstError::empty_tuple(span).into()), 1 => Err(AstError::one_element_tuple(span).into()), diff --git a/compiler/parser/src/parser/context.rs b/compiler/parser/src/parser/context.rs index eab221413b..978efe492b 100644 --- a/compiler/parser/src/parser/context.rs +++ b/compiler/parser/src/parser/context.rs @@ -94,10 +94,7 @@ impl<'a> ParserContext<'a> { /// Checks whether the current token is a `Token::Int(_)`. pub(super) fn check_int(&self) -> bool { - match &self.token.token { - Token::Integer(_) => true, - _ => false, - } + matches!(&self.token.token, Token::Integer(_)) } /// Returns `true` if the next token is equal to the given token. diff --git a/compiler/parser/src/parser/type_.rs b/compiler/parser/src/parser/type_.rs index e6ca27cc1b..181d7b65b2 100644 --- a/compiler/parser/src/parser/type_.rs +++ b/compiler/parser/src/parser/type_.rs @@ -89,7 +89,7 @@ impl ParserContext<'_> { let (types, _, span) = self.parse_paren_comma_list(|p| p.parse_single_type().map(Some))?; let elements = types.into_iter().map(|(type_, _)| type_).collect::>(); - Ok((Tuple::new(elements, span)?, span)) + Ok((Tuple::try_new(elements, span)?, span)) } /// Returns a [`(Type, Span)`] where `Type` is a tuple or single type. diff --git a/compiler/parser/src/tokenizer/mod.rs b/compiler/parser/src/tokenizer/mod.rs index 20e838804e..c0b6259107 100644 --- a/compiler/parser/src/tokenizer/mod.rs +++ b/compiler/parser/src/tokenizer/mod.rs @@ -20,7 +20,6 @@ //! separated by whitespace. pub(crate) mod token; -use std::iter; pub use self::token::KEYWORD_TOKENS; pub(crate) use self::token::*; @@ -30,6 +29,7 @@ pub(crate) use self::lexer::*; use leo_errors::Result; use leo_span::span::{BytePos, Pos, Span}; +use std::iter; /// Creates a new vector of spanned tokens from a given file path and source code text. pub(crate) fn tokenize(input: &str, start_pos: BytePos) -> Result> { @@ -65,6 +65,7 @@ pub(crate) fn tokenize_iter(mut input: &str, mut lo: BytePos) -> impl '_ + Itera mod tests { use super::*; use leo_span::{source_map::FileName, symbol::create_session_if_not_set_then}; + use std::fmt::Write; #[test] fn test_tokenizer() { @@ -147,7 +148,7 @@ mod tests { let tokens = tokenize(&sf.src, sf.start_pos).unwrap(); let mut output = String::new(); for SpannedToken { token, .. } in tokens.iter() { - output += &format!("{} ", token); + write!(output, "{} ", token).expect("failed to write string"); } assert_eq!( diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index fd31fb6f03..9e0a63e58c 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -63,14 +63,11 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { if let Some(core_instruction) = self.check_core_circuit_call(&access.ty, &access.name) { // Check num input arguments. if core_instruction.num_args() != access.args.len() { - self.handler.emit_err( - TypeCheckerError::incorrect_num_args_to_call( - core_instruction.num_args(), - access.args.len(), - input.span(), - ) - .into(), - ); + self.emit_err(TypeCheckerError::incorrect_num_args_to_call( + core_instruction.num_args(), + access.args.len(), + input.span(), + )); } // Check first argument type. @@ -88,8 +85,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { // Check return type. return Some(self.assert_and_return_type(core_instruction.return_type(), expected, access.span())); } else { - self.handler - .emit_err(TypeCheckerError::invalid_access_expression(access, access.span()).into()); + self.emit_err(TypeCheckerError::invalid_access_expression(access, access.span())); } } AccessExpression::Tuple(access) => { @@ -284,8 +280,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { match (t1, t2) { (Some(Type::Address), _) | (_, Some(Type::Address)) => { // Emit an error for address comparison. - self.handler - .emit_err(TypeCheckerError::compare_address(input.op, input.span()).into()); + self.emit_err(TypeCheckerError::compare_address(input.op, input.span())); } (Some(Type::Field), t2) => { // Assert rhs is field. @@ -361,14 +356,11 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { // Check number of function arguments. if func.input.len() != input.arguments.len() { - self.handler.emit_err( - TypeCheckerError::incorrect_num_args_to_call( - func.input.len(), - input.arguments.len(), - input.span(), - ) - .into(), - ); + self.emit_err(TypeCheckerError::incorrect_num_args_to_call( + func.input.len(), + input.arguments.len(), + input.span(), + )); } // Check function argument types. @@ -381,8 +373,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { Some(ret) } else { - self.handler - .emit_err(TypeCheckerError::unknown_sym("function", &ident.name, ident.span()).into()); + self.emit_err(TypeCheckerError::unknown_sym("function", &ident.name, ident.span())); None } } @@ -398,14 +389,11 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { // Check number of circuit members. if circ.members.len() != input.members.len() { - self.emit_err( - TypeCheckerError::incorrect_num_circuit_members( - circ.members.len(), - input.members.len(), - input.span(), - ) - .into(), - ); + self.emit_err(TypeCheckerError::incorrect_num_circuit_members( + circ.members.len(), + input.members.len(), + input.span(), + )); } // Check circuit member types. @@ -418,15 +406,21 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { self.visit_expression(expr, &Some(ty.clone())); } } else { - self.handler.emit_err( - TypeCheckerError::unknown_sym("circuit member variable", name, name.span()).into(), - ); + self.emit_err(TypeCheckerError::unknown_sym( + "circuit member variable", + name, + name.span(), + )); }; }); Some(ret) } else { - self.emit_err(TypeCheckerError::unknown_sym("circuit", &input.name.name, input.name.span()).into()); + self.emit_err(TypeCheckerError::unknown_sym( + "circuit", + &input.name.name, + input.name.span(), + )); None } } @@ -437,7 +431,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { } else if let Some(var) = self.symbol_table.borrow().lookup_variable(&var.name) { Some(self.assert_and_return_type(var.type_.clone(), expected, var.span)) } else { - self.emit_err(TypeCheckerError::unknown_sym("variable", var.name, var.span()).into()); + self.emit_err(TypeCheckerError::unknown_sym("variable", var.name, var.span())); None } } @@ -457,8 +451,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { }; if int.parse::().is_err() { - self.handler - .emit_err(TypeCheckerError::invalid_int_value(int, "i8", input.span()).into()); + self.emit_err(TypeCheckerError::invalid_int_value(int, "i8", input.span())); } } IntegerType::I16 => { @@ -469,8 +462,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { }; if int.parse::().is_err() { - self.handler - .emit_err(TypeCheckerError::invalid_int_value(int, "i16", input.span()).into()); + self.emit_err(TypeCheckerError::invalid_int_value(int, "i16", input.span())); } } IntegerType::I32 => { @@ -481,8 +473,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { }; if int.parse::().is_err() { - self.handler - .emit_err(TypeCheckerError::invalid_int_value(int, "i32", input.span()).into()); + self.emit_err(TypeCheckerError::invalid_int_value(int, "i32", input.span())); } } IntegerType::I64 => { @@ -493,8 +484,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { }; if int.parse::().is_err() { - self.handler - .emit_err(TypeCheckerError::invalid_int_value(int, "i64", input.span()).into()); + self.emit_err(TypeCheckerError::invalid_int_value(int, "i64", input.span())); } } IntegerType::I128 => { @@ -505,25 +495,24 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { }; if int.parse::().is_err() { - self.handler - .emit_err(TypeCheckerError::invalid_int_value(int, "i128", input.span()).into()); + self.emit_err(TypeCheckerError::invalid_int_value(int, "i128", input.span())); } } - IntegerType::U8 if str_content.parse::().is_err() => self - .handler - .emit_err(TypeCheckerError::invalid_int_value(str_content, "u8", input.span()).into()), - IntegerType::U16 if str_content.parse::().is_err() => self - .handler - .emit_err(TypeCheckerError::invalid_int_value(str_content, "u16", input.span()).into()), - IntegerType::U32 if str_content.parse::().is_err() => self - .handler - .emit_err(TypeCheckerError::invalid_int_value(str_content, "u32", input.span()).into()), - IntegerType::U64 if str_content.parse::().is_err() => self - .handler - .emit_err(TypeCheckerError::invalid_int_value(str_content, "u64", input.span()).into()), - IntegerType::U128 if str_content.parse::().is_err() => self - .handler - .emit_err(TypeCheckerError::invalid_int_value(str_content, "u128", input.span()).into()), + IntegerType::U8 if str_content.parse::().is_err() => { + self.emit_err(TypeCheckerError::invalid_int_value(str_content, "u8", input.span())) + } + IntegerType::U16 if str_content.parse::().is_err() => { + self.emit_err(TypeCheckerError::invalid_int_value(str_content, "u16", input.span())) + } + IntegerType::U32 if str_content.parse::().is_err() => { + self.emit_err(TypeCheckerError::invalid_int_value(str_content, "u32", input.span())) + } + IntegerType::U64 if str_content.parse::().is_err() => { + self.emit_err(TypeCheckerError::invalid_int_value(str_content, "u64", input.span())) + } + IntegerType::U128 if str_content.parse::().is_err() => { + self.emit_err(TypeCheckerError::invalid_int_value(str_content, "u128", input.span())) + } _ => {} } self.assert_and_return_type(Type::IntegerType(*type_), expected, input.span()) diff --git a/compiler/passes/src/type_checker/check_program.rs b/compiler/passes/src/type_checker/check_program.rs index 95c3c0d1e5..5970865544 100644 --- a/compiler/passes/src/type_checker/check_program.rs +++ b/compiler/passes/src/type_checker/check_program.rs @@ -52,7 +52,7 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { self.visit_block(&input.block); if !self.has_return { - self.emit_err(TypeCheckerError::function_has_no_return(input.name(), input.span()).into()); + self.emit_err(TypeCheckerError::function_has_no_return(input.name(), input.span())); } let prev_st = *self.symbol_table.borrow_mut().parent.take().unwrap(); @@ -64,10 +64,10 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { // Check for conflicting circuit/record member names. let mut used = HashSet::new(); if !input.members.iter().all(|member| used.insert(member.name())) { - self.handler.emit_err(if input.is_record { - TypeCheckerError::duplicate_record_variable(input.name(), input.span()).into() + self.emit_err(if input.is_record { + TypeCheckerError::duplicate_record_variable(input.name(), input.span()) } else { - TypeCheckerError::duplicate_circuit_member(input.name(), input.span()).into() + TypeCheckerError::duplicate_circuit_member(input.name(), input.span()) }); } @@ -80,12 +80,18 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { { Some((_, actual_ty)) if expected_ty.eq_flat(actual_ty) => {} // All good, found + right type! Some((field, _)) => { - self.handler - .emit_err(TypeCheckerError::record_var_wrong_type(field, expected_ty, input.span()).into()); + self.emit_err(TypeCheckerError::record_var_wrong_type( + field, + expected_ty, + input.span(), + )); } None => { - self.handler - .emit_err(TypeCheckerError::required_record_variable(need, expected_ty, input.span()).into()); + self.emit_err(TypeCheckerError::required_record_variable( + need, + expected_ty, + input.span(), + )); } }; check_has_field(sym::owner, Type::Address); diff --git a/compiler/passes/src/type_checker/check_statements.rs b/compiler/passes/src/type_checker/check_statements.rs index 5aa68701ad..31e180ba67 100644 --- a/compiler/passes/src/type_checker/check_statements.rs +++ b/compiler/passes/src/type_checker/check_statements.rs @@ -63,8 +63,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { let var_name = match input.place { Expression::Identifier(id) => id, _ => { - self.handler - .emit_err(TypeCheckerError::invalid_assignment_target(input.place.span()).into()); + self.emit_err(TypeCheckerError::invalid_assignment_target(input.place.span())); return; } }; @@ -72,18 +71,16 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { let var_type = if let Some(var) = self.symbol_table.borrow_mut().lookup_variable(&var_name.name) { // TODO: Check where this check is moved to in `improved-flattening`. match &var.declaration { - Declaration::Const => self - .handler - .emit_err(TypeCheckerError::cannont_assign_to_const_var(var_name, var.span).into()), - Declaration::Input(ParamMode::Const) => self - .handler - .emit_err(TypeCheckerError::cannont_assign_to_const_input(var_name, var.span).into()), + Declaration::Const => self.emit_err(TypeCheckerError::cannont_assign_to_const_var(var_name, var.span)), + Declaration::Input(ParamMode::Const) => { + self.emit_err(TypeCheckerError::cannont_assign_to_const_input(var_name, var.span)) + } _ => {} } Some(var.type_.clone()) } else { - self.emit_err(TypeCheckerError::unknown_sym("variable", var_name.name, var_name.span).into()); + self.emit_err(TypeCheckerError::unknown_sym("variable", var_name.name, var_name.span)); None }; diff --git a/leo/errors/src/emitter/mod.rs b/leo/errors/src/emitter/mod.rs index f08d959cbd..180f9f0afc 100644 --- a/leo/errors/src/emitter/mod.rs +++ b/leo/errors/src/emitter/mod.rs @@ -299,7 +299,7 @@ mod tests { }); assert_eq!(count_err(res.unwrap_err().to_string()), 2); - let () = Handler::with(|_| Ok(())).unwrap(); + Handler::with(|_| Ok(())).unwrap(); }) } } 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 335bc7bb1c..b8980d29cb 100644 --- a/leo/errors/src/errors/type_checker/type_checker_error.rs +++ b/leo/errors/src/errors/type_checker/type_checker_error.rs @@ -282,7 +282,7 @@ create_messages!( @formatted invalid_tuple { args: (), - msg: format!("Tuples must be explicitly typed in Leo"), + msg: "Tuples must be explicitly typed in Leo".to_string(), help: Some("The function definition must match the function return statement".to_string()), } From 01a1953021fed61ca62c0d91e0bd94046be08e97 Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Sat, 9 Jul 2022 16:19:48 -0700 Subject: [PATCH 36/37] regen tests --- .../compiler/compiler/tuple/return_statement_fail.out | 6 ++---- tests/expectations/compiler/compiler/tuple/type_fail.out | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/expectations/compiler/compiler/tuple/return_statement_fail.out b/tests/expectations/compiler/compiler/tuple/return_statement_fail.out index 29c0dcafbf..d094edf533 100644 --- a/tests/expectations/compiler/compiler/tuple/return_statement_fail.out +++ b/tests/expectations/compiler/compiler/tuple/return_statement_fail.out @@ -1,7 +1,5 @@ --- namespace: Compile -expectation: Pass +expectation: Fail outputs: - - output: - - initial_input_ast: 6607a8eab25d6001b58441084978cbf2d37295c9d77e3730c1dd74d2fa1e0a94 - initial_ast: e1960f775049d0d2b246d0da716aa5b8c261b518cab913d287f26fe2c1e0515f + - "Error [ETYC0372003]: Expected type `u64` but type `bool` was found\n --> compiler-test:6:21\n |\n 6 | return (t.0, t.1); // The second element should be type u64 as in the function declaration.\n | ^\n" diff --git a/tests/expectations/compiler/compiler/tuple/type_fail.out b/tests/expectations/compiler/compiler/tuple/type_fail.out index 5264685394..81225b96dc 100644 --- a/tests/expectations/compiler/compiler/tuple/type_fail.out +++ b/tests/expectations/compiler/compiler/tuple/type_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372003]: Expected type `u64` but type `bool` was found\n --> compiler-test:3:24\n |\n 3 | function main(a: bool, b: bool) -> (bool, bool) {\n | ^\n" + - "Error [ETYC0372003]: Expected type `u64` but type `bool` was found\n --> compiler-test:3:24\n |\n 3 | function main(a: bool, b: bool) -> (bool, bool) {\n | ^\nError [ETYC0372003]: Expected type `bool` but type `u64` was found\n --> compiler-test:6:21\n |\n 6 | return (t.0, t.1);\n | ^\n" From d59cff08445c1dc1dd04e7b78cc169858b097ebf Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Sat, 9 Jul 2022 16:55:54 -0700 Subject: [PATCH 37/37] cargo fmt --- compiler/passes/src/type_checker/check_expressions.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index c086413c58..ed4ba30cdb 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -165,11 +165,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { None } - fn visit_circuit_init( - &mut self, - input: &'a CircuitExpression, - additional: &Self::AdditionalInput, - ) -> Self::Output { + fn visit_circuit_init(&mut self, input: &'a CircuitExpression, additional: &Self::AdditionalInput) -> Self::Output { let circ = self.symbol_table.borrow().lookup_circuit(&input.name.name).cloned(); if let Some(circ) = circ { // Check circuit type name. @@ -544,7 +540,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> { // Check number of function arguments. if func.input.len() != input.arguments.len() { - self.handler.emit_err(TypeCheckerError::incorrect_num_args_to_call( + self.emit_err(TypeCheckerError::incorrect_num_args_to_call( func.input.len(), input.arguments.len(), input.span(),