From 76070a8795f4a70643b3c35202c58afab7cf509e Mon Sep 17 00:00:00 2001 From: gluax Date: Mon, 4 Apr 2022 14:14:17 -0700 Subject: [PATCH 01/12] intial adding of public and private params --- compiler/ast/src/functions/input/function_input.rs | 4 ++++ compiler/ast/src/reducer/reconstructing_reducer.rs | 2 ++ compiler/parser/src/parser/file.rs | 5 +++++ compiler/parser/src/tokenizer/lexer.rs | 2 ++ compiler/parser/src/tokenizer/token.rs | 8 ++++++++ leo/span/src/symbol.rs | 2 ++ 6 files changed, 23 insertions(+) diff --git a/compiler/ast/src/functions/input/function_input.rs b/compiler/ast/src/functions/input/function_input.rs index 1e7c46895c..eae6971964 100644 --- a/compiler/ast/src/functions/input/function_input.rs +++ b/compiler/ast/src/functions/input/function_input.rs @@ -27,6 +27,10 @@ pub struct FunctionInputVariable { pub identifier: Identifier, /// Is it a const parameter? pub const_: bool, + /// Is it a private input parameter? + pub private: bool, + /// Is it a public parameter? + pub public: bool, /// Is it a mutable parameter? pub mutable: bool, /// What's the parameter's type? diff --git a/compiler/ast/src/reducer/reconstructing_reducer.rs b/compiler/ast/src/reducer/reconstructing_reducer.rs index 9521010288..d015103a64 100644 --- a/compiler/ast/src/reducer/reconstructing_reducer.rs +++ b/compiler/ast/src/reducer/reconstructing_reducer.rs @@ -276,6 +276,8 @@ pub trait ReconstructingReducer { identifier, const_: variable.const_, mutable: variable.mutable, + private: variable.private, + public: variable.public, type_, span: variable.span.clone(), }) diff --git a/compiler/parser/src/parser/file.rs b/compiler/parser/src/parser/file.rs index 207711b1d5..34db99b7b5 100644 --- a/compiler/parser/src/parser/file.rs +++ b/compiler/parser/src/parser/file.rs @@ -67,6 +67,9 @@ impl ParserContext<'_> { pub fn parse_function_parameters(&mut self) -> Result { let const_ = self.eat(Token::Const); let mutable = self.eat(Token::Mut); + let private = self.eat(Token::Private).is_some(); + let public = self.eat(Token::Public).is_some(); + let name = self.expect_ident()?; if let Some(mutable) = &mutable { @@ -78,6 +81,8 @@ impl ParserContext<'_> { Ok(FunctionInput::Variable(FunctionInputVariable { const_: const_.is_some(), mutable: const_.is_none(), + private, + public, type_, span: name.span.clone(), identifier: name, diff --git a/compiler/parser/src/tokenizer/lexer.rs b/compiler/parser/src/tokenizer/lexer.rs index f8f87ae77c..46b84611ad 100644 --- a/compiler/parser/src/tokenizer/lexer.rs +++ b/compiler/parser/src/tokenizer/lexer.rs @@ -421,6 +421,8 @@ impl Token { "input" => Token::Input, "let" => Token::Let, "mut" => Token::Mut, + "private" => Token::Private, + "public" => Token::Public, "return" => Token::Return, "true" => Token::True, "type" => Token::Type, diff --git a/compiler/parser/src/tokenizer/token.rs b/compiler/parser/src/tokenizer/token.rs index f4f3fed866..43c906b94b 100644 --- a/compiler/parser/src/tokenizer/token.rs +++ b/compiler/parser/src/tokenizer/token.rs @@ -128,6 +128,10 @@ pub enum Token { In, Let, Mut, + /// For private inputs. + Private, + /// For public inputs. + Public, Return, Type, @@ -198,6 +202,8 @@ impl Token { Token::Input => sym::input, Token::Let => sym::Let, Token::Mut => sym::Mut, + Token::Private => sym::Private, + Token::Public => sym::Public, Token::Return => sym::Return, Token::True => sym::True, Token::Type => sym::Type, @@ -294,6 +300,8 @@ impl fmt::Display for Token { In => write!(f, "in"), Let => write!(f, "let"), Mut => write!(f, "mut"), + Private => write!(f, "private"), + Public => write!(f, "public"), Return => write!(f, "return"), Type => write!(f, "type"), Eof => write!(f, ""), diff --git a/leo/span/src/symbol.rs b/leo/span/src/symbol.rs index 7f5bbe42b0..d4dd9daa20 100644 --- a/leo/span/src/symbol.rs +++ b/leo/span/src/symbol.rs @@ -131,6 +131,8 @@ symbols! { main, Mut: "mut", prelude, + Private: "private", + Public: "public", Return: "return", Star: "*", std, From ffa2705a4e959e2962d1c18c19ebf94dd9f875f4 Mon Sep 17 00:00:00 2001 From: gluax Date: Mon, 4 Apr 2022 14:18:34 -0700 Subject: [PATCH 02/12] remove empty inputs files --- compiler/input/Cargo.toml | 37 ------------------- compiler/input/LICENSE.md | 0 compiler/input/README.md | 0 compiler/input/src/ast.rs | 0 compiler/input/src/common/eoi.rs | 0 compiler/input/src/common/identifier.rs | 0 compiler/input/src/common/line_end.rs | 0 compiler/input/src/common/mod.rs | 0 compiler/input/src/definitions/definition.rs | 0 compiler/input/src/definitions/mod.rs | 0 compiler/input/src/errors/mod.rs | 0 compiler/input/src/errors/parser.rs | 0 compiler/input/src/errors/syntax.rs | 0 .../array_initializer_expression.rs | 0 .../expressions/array_inline_expression.rs | 0 compiler/input/src/expressions/expression.rs | 0 compiler/input/src/expressions/mod.rs | 0 .../src/expressions/string_expression.rs | 0 .../input/src/expressions/tuple_expression.rs | 0 compiler/input/src/files/file.rs | 0 compiler/input/src/files/mod.rs | 0 compiler/input/src/files/table_or_section.rs | 0 compiler/input/src/leo-input.pest | 0 compiler/input/src/lib.rs | 0 compiler/input/src/parameters/mod.rs | 0 compiler/input/src/parameters/parameter.rs | 0 compiler/input/src/sections/constants.rs | 0 compiler/input/src/sections/header.rs | 0 compiler/input/src/sections/main_.rs | 0 compiler/input/src/sections/mod.rs | 0 compiler/input/src/sections/record.rs | 0 compiler/input/src/sections/registers.rs | 0 compiler/input/src/sections/section.rs | 0 compiler/input/src/sections/state.rs | 0 compiler/input/src/sections/state_leaf.rs | 0 compiler/input/src/tables/mod.rs | 0 compiler/input/src/tables/private.rs | 0 compiler/input/src/tables/public.rs | 0 compiler/input/src/tables/table.rs | 0 compiler/input/src/tables/visibility.rs | 0 compiler/input/src/types/address_type.rs | 0 compiler/input/src/types/array_dimensions.rs | 0 compiler/input/src/types/array_type.rs | 0 compiler/input/src/types/boolean_type.rs | 0 compiler/input/src/types/char_type.rs | 0 compiler/input/src/types/data_type.rs | 0 compiler/input/src/types/field_type.rs | 0 compiler/input/src/types/group_type.rs | 0 compiler/input/src/types/integer_type.rs | 0 compiler/input/src/types/mod.rs | 0 .../input/src/types/signed_integer_type.rs | 0 compiler/input/src/types/tuple_type.rs | 0 compiler/input/src/types/type_.rs | 0 .../input/src/types/unsigned_integer_type.rs | 0 compiler/input/src/values/address.rs | 0 compiler/input/src/values/address_typed.rs | 0 compiler/input/src/values/address_value.rs | 0 compiler/input/src/values/boolean_value.rs | 0 compiler/input/src/values/char_types.rs | 0 compiler/input/src/values/char_value.rs | 0 compiler/input/src/values/field_value.rs | 0 compiler/input/src/values/group_coordinate.rs | 0 compiler/input/src/values/group_value.rs | 0 compiler/input/src/values/integer_value.rs | 0 compiler/input/src/values/mod.rs | 0 compiler/input/src/values/negative_number.rs | 0 compiler/input/src/values/number_value.rs | 0 compiler/input/src/values/positive_number.rs | 0 .../input/src/values/signed_integer_value.rs | 0 .../src/values/unsigned_integer_value.rs | 0 compiler/input/src/values/value.rs | 0 71 files changed, 37 deletions(-) delete mode 100644 compiler/input/Cargo.toml delete mode 100644 compiler/input/LICENSE.md delete mode 100644 compiler/input/README.md delete mode 100644 compiler/input/src/ast.rs delete mode 100644 compiler/input/src/common/eoi.rs delete mode 100644 compiler/input/src/common/identifier.rs delete mode 100644 compiler/input/src/common/line_end.rs delete mode 100644 compiler/input/src/common/mod.rs delete mode 100644 compiler/input/src/definitions/definition.rs delete mode 100644 compiler/input/src/definitions/mod.rs delete mode 100644 compiler/input/src/errors/mod.rs delete mode 100644 compiler/input/src/errors/parser.rs delete mode 100644 compiler/input/src/errors/syntax.rs delete mode 100644 compiler/input/src/expressions/array_initializer_expression.rs delete mode 100644 compiler/input/src/expressions/array_inline_expression.rs delete mode 100644 compiler/input/src/expressions/expression.rs delete mode 100644 compiler/input/src/expressions/mod.rs delete mode 100644 compiler/input/src/expressions/string_expression.rs delete mode 100644 compiler/input/src/expressions/tuple_expression.rs delete mode 100644 compiler/input/src/files/file.rs delete mode 100644 compiler/input/src/files/mod.rs delete mode 100644 compiler/input/src/files/table_or_section.rs delete mode 100644 compiler/input/src/leo-input.pest delete mode 100644 compiler/input/src/lib.rs delete mode 100644 compiler/input/src/parameters/mod.rs delete mode 100644 compiler/input/src/parameters/parameter.rs delete mode 100644 compiler/input/src/sections/constants.rs delete mode 100644 compiler/input/src/sections/header.rs delete mode 100644 compiler/input/src/sections/main_.rs delete mode 100644 compiler/input/src/sections/mod.rs delete mode 100644 compiler/input/src/sections/record.rs delete mode 100644 compiler/input/src/sections/registers.rs delete mode 100644 compiler/input/src/sections/section.rs delete mode 100644 compiler/input/src/sections/state.rs delete mode 100644 compiler/input/src/sections/state_leaf.rs delete mode 100644 compiler/input/src/tables/mod.rs delete mode 100644 compiler/input/src/tables/private.rs delete mode 100644 compiler/input/src/tables/public.rs delete mode 100644 compiler/input/src/tables/table.rs delete mode 100644 compiler/input/src/tables/visibility.rs delete mode 100644 compiler/input/src/types/address_type.rs delete mode 100644 compiler/input/src/types/array_dimensions.rs delete mode 100644 compiler/input/src/types/array_type.rs delete mode 100644 compiler/input/src/types/boolean_type.rs delete mode 100644 compiler/input/src/types/char_type.rs delete mode 100644 compiler/input/src/types/data_type.rs delete mode 100644 compiler/input/src/types/field_type.rs delete mode 100644 compiler/input/src/types/group_type.rs delete mode 100644 compiler/input/src/types/integer_type.rs delete mode 100644 compiler/input/src/types/mod.rs delete mode 100644 compiler/input/src/types/signed_integer_type.rs delete mode 100644 compiler/input/src/types/tuple_type.rs delete mode 100644 compiler/input/src/types/type_.rs delete mode 100644 compiler/input/src/types/unsigned_integer_type.rs delete mode 100644 compiler/input/src/values/address.rs delete mode 100644 compiler/input/src/values/address_typed.rs delete mode 100644 compiler/input/src/values/address_value.rs delete mode 100644 compiler/input/src/values/boolean_value.rs delete mode 100644 compiler/input/src/values/char_types.rs delete mode 100644 compiler/input/src/values/char_value.rs delete mode 100644 compiler/input/src/values/field_value.rs delete mode 100644 compiler/input/src/values/group_coordinate.rs delete mode 100644 compiler/input/src/values/group_value.rs delete mode 100644 compiler/input/src/values/integer_value.rs delete mode 100644 compiler/input/src/values/mod.rs delete mode 100644 compiler/input/src/values/negative_number.rs delete mode 100644 compiler/input/src/values/number_value.rs delete mode 100644 compiler/input/src/values/positive_number.rs delete mode 100644 compiler/input/src/values/signed_integer_value.rs delete mode 100644 compiler/input/src/values/unsigned_integer_value.rs delete mode 100644 compiler/input/src/values/value.rs diff --git a/compiler/input/Cargo.toml b/compiler/input/Cargo.toml deleted file mode 100644 index 19765514b5..0000000000 --- a/compiler/input/Cargo.toml +++ /dev/null @@ -1,37 +0,0 @@ -[package] -name = "leo-input" -version = "1.5.3" -authors = [ "The Aleo Team " ] -description = "Input parser of the Leo programming language" -homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/leo" -keywords = [ - "aleo", - "cryptography", - "leo", - "programming-language", - "zero-knowledge" -] -categories = [ "cryptography::cryptocurrencies", "web-programming" ] -include = [ "Cargo.toml", "src", "README.md", "LICENSE.md" ] -license = "GPL-3.0" -edition = "2021" -rust-version = "1.56.1" - -[dependencies.from-pest] -version = "0.3.1" - -[dependencies.pest] -version = "2.0" - -[dependencies.pest-ast] -version = "0.3.3" - -[dependencies.pest_derive] -version = "2.0" - -[dependencies.thiserror] -version = "1.0" - -[dependencies.tracing] -version = "0.1" diff --git a/compiler/input/LICENSE.md b/compiler/input/LICENSE.md deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/README.md b/compiler/input/README.md deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/ast.rs b/compiler/input/src/ast.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/common/eoi.rs b/compiler/input/src/common/eoi.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/common/identifier.rs b/compiler/input/src/common/identifier.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/common/line_end.rs b/compiler/input/src/common/line_end.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/common/mod.rs b/compiler/input/src/common/mod.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/definitions/definition.rs b/compiler/input/src/definitions/definition.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/definitions/mod.rs b/compiler/input/src/definitions/mod.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/errors/mod.rs b/compiler/input/src/errors/mod.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/errors/parser.rs b/compiler/input/src/errors/parser.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/errors/syntax.rs b/compiler/input/src/errors/syntax.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/expressions/array_initializer_expression.rs b/compiler/input/src/expressions/array_initializer_expression.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/expressions/array_inline_expression.rs b/compiler/input/src/expressions/array_inline_expression.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/expressions/expression.rs b/compiler/input/src/expressions/expression.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/expressions/mod.rs b/compiler/input/src/expressions/mod.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/expressions/string_expression.rs b/compiler/input/src/expressions/string_expression.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/expressions/tuple_expression.rs b/compiler/input/src/expressions/tuple_expression.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/files/file.rs b/compiler/input/src/files/file.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/files/mod.rs b/compiler/input/src/files/mod.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/files/table_or_section.rs b/compiler/input/src/files/table_or_section.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/leo-input.pest b/compiler/input/src/leo-input.pest deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/lib.rs b/compiler/input/src/lib.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/parameters/mod.rs b/compiler/input/src/parameters/mod.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/parameters/parameter.rs b/compiler/input/src/parameters/parameter.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/sections/constants.rs b/compiler/input/src/sections/constants.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/sections/header.rs b/compiler/input/src/sections/header.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/sections/main_.rs b/compiler/input/src/sections/main_.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/sections/mod.rs b/compiler/input/src/sections/mod.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/sections/record.rs b/compiler/input/src/sections/record.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/sections/registers.rs b/compiler/input/src/sections/registers.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/sections/section.rs b/compiler/input/src/sections/section.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/sections/state.rs b/compiler/input/src/sections/state.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/sections/state_leaf.rs b/compiler/input/src/sections/state_leaf.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/tables/mod.rs b/compiler/input/src/tables/mod.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/tables/private.rs b/compiler/input/src/tables/private.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/tables/public.rs b/compiler/input/src/tables/public.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/tables/table.rs b/compiler/input/src/tables/table.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/tables/visibility.rs b/compiler/input/src/tables/visibility.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/types/address_type.rs b/compiler/input/src/types/address_type.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/types/array_dimensions.rs b/compiler/input/src/types/array_dimensions.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/types/array_type.rs b/compiler/input/src/types/array_type.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/types/boolean_type.rs b/compiler/input/src/types/boolean_type.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/types/char_type.rs b/compiler/input/src/types/char_type.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/types/data_type.rs b/compiler/input/src/types/data_type.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/types/field_type.rs b/compiler/input/src/types/field_type.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/types/group_type.rs b/compiler/input/src/types/group_type.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/types/integer_type.rs b/compiler/input/src/types/integer_type.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/types/mod.rs b/compiler/input/src/types/mod.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/types/signed_integer_type.rs b/compiler/input/src/types/signed_integer_type.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/types/tuple_type.rs b/compiler/input/src/types/tuple_type.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/types/type_.rs b/compiler/input/src/types/type_.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/types/unsigned_integer_type.rs b/compiler/input/src/types/unsigned_integer_type.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/address.rs b/compiler/input/src/values/address.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/address_typed.rs b/compiler/input/src/values/address_typed.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/address_value.rs b/compiler/input/src/values/address_value.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/boolean_value.rs b/compiler/input/src/values/boolean_value.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/char_types.rs b/compiler/input/src/values/char_types.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/char_value.rs b/compiler/input/src/values/char_value.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/field_value.rs b/compiler/input/src/values/field_value.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/group_coordinate.rs b/compiler/input/src/values/group_coordinate.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/group_value.rs b/compiler/input/src/values/group_value.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/integer_value.rs b/compiler/input/src/values/integer_value.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/mod.rs b/compiler/input/src/values/mod.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/negative_number.rs b/compiler/input/src/values/negative_number.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/number_value.rs b/compiler/input/src/values/number_value.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/positive_number.rs b/compiler/input/src/values/positive_number.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/signed_integer_value.rs b/compiler/input/src/values/signed_integer_value.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/unsigned_integer_value.rs b/compiler/input/src/values/unsigned_integer_value.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/compiler/input/src/values/value.rs b/compiler/input/src/values/value.rs deleted file mode 100644 index e69de29bb2..0000000000 From f6aa32da352dd945b29fa1df7b7c08983f80c79f Mon Sep 17 00:00:00 2001 From: gluax Date: Mon, 4 Apr 2022 14:51:46 -0700 Subject: [PATCH 03/12] parse input changes for private public const --- compiler/ast/src/input/definition.rs | 3 +++ compiler/ast/src/input/program_input.rs | 16 +++------------- compiler/parser/src/parser/input.rs | 13 +++++++++++++ leo/errors/src/parser/parser_errors.rs | 16 ++++++++++++++++ 4 files changed, 35 insertions(+), 13 deletions(-) diff --git a/compiler/ast/src/input/definition.rs b/compiler/ast/src/input/definition.rs index b98eab8279..8e5315723a 100644 --- a/compiler/ast/src/input/definition.rs +++ b/compiler/ast/src/input/definition.rs @@ -21,6 +21,9 @@ use crate::{Expression, Identifier, Type}; /// Definitions should be structured as: `: = ;` #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Definition { + pub const_: bool, + pub private: bool, + pub public: bool, pub type_: Type, pub name: Identifier, pub value: Expression, diff --git a/compiler/ast/src/input/program_input.rs b/compiler/ast/src/input/program_input.rs index 96ff686758..162ef8a3ea 100644 --- a/compiler/ast/src/input/program_input.rs +++ b/compiler/ast/src/input/program_input.rs @@ -21,7 +21,6 @@ use super::*; pub struct ProgramInput { pub main: Definitions, pub registers: Definitions, - pub constants: Definitions, } impl TryFrom for ProgramInput { @@ -29,20 +28,15 @@ impl TryFrom for ProgramInput { fn try_from(input: ParsedInputFile) -> Result { let mut main = IndexMap::new(); let mut registers = IndexMap::new(); - let mut constants = IndexMap::new(); for section in input.sections { let target = match section.name { sym::main => &mut main, sym::registers => &mut registers, - sym::constants => &mut constants, _ => { - return Err(InputError::unexpected_section( - &["main", "registers", "constants"], - section.name, - §ion.span, + return Err( + InputError::unexpected_section(&["main", "registers"], section.name, §ion.span).into(), ) - .into()) } }; @@ -54,10 +48,6 @@ impl TryFrom for ProgramInput { } } - Ok(ProgramInput { - main, - registers, - constants, - }) + Ok(ProgramInput { main, registers }) } } diff --git a/compiler/parser/src/parser/input.rs b/compiler/parser/src/parser/input.rs index 66b81896e0..dc1118a090 100644 --- a/compiler/parser/src/parser/input.rs +++ b/compiler/parser/src/parser/input.rs @@ -66,6 +66,16 @@ impl ParserContext<'_> { /// ` : = ;` /// Returns [`Definition`]. pub fn parse_input_definition(&mut self) -> Result { + let const_ = self.eat(Token::Const).is_some(); + let private = self.eat(Token::Private).is_some(); + let public = self.eat(Token::Public).is_some(); + + match (const_, private, public) { + (true, false, false) | (false, true, false) | (false, false, true) => {} + (false, false, false) => return Err(ParserError::inputs_no_variable_type_specified().into()), + _ => return Err(ParserError::inputs_multpe_variable_types_specified().into()), + } + let name = self.expect_ident()?; self.expect(Token::Colon)?; let (type_, span) = self.parse_type()?; @@ -74,6 +84,9 @@ impl ParserContext<'_> { self.expect(Token::Semicolon)?; Ok(Definition { + const_, + private, + public, name, type_, value, diff --git a/leo/errors/src/parser/parser_errors.rs b/leo/errors/src/parser/parser_errors.rs index 9ce55319ca..3570158e90 100644 --- a/leo/errors/src/parser/parser_errors.rs +++ b/leo/errors/src/parser/parser_errors.rs @@ -358,4 +358,20 @@ create_errors!( msg: format!("Found the char `{}`, but expected `{}`", found, expected), help: None, } + + /// For when a user does not specify a type of input. + @backtraced + inputs_no_variable_type_specified { + args: (), + msg: "An input must be either const, private, or public.", + help: None, + } + + /// For when a user specified more than a type of input. + @backtraced + inputs_multpe_variable_types_specified { + args: (), + msg: "An input can only be one of const, private, or public.", + help: None, + } ); From 80d97416cb7ee9c535b0795b92b2a1d1d65b0611 Mon Sep 17 00:00:00 2001 From: gluax Date: Mon, 4 Apr 2022 15:31:08 -0700 Subject: [PATCH 04/12] fixes and correct tests --- compiler/parser/src/parser/input.rs | 14 +- .../functions/bounded_recursion.leo.out | 4 + .../parser/functions/const_param.leo.out | 8 + .../functions/infinite_recursion.leo.out | 2 + .../parser/parser/functions/params.leo.out | 4 + .../parser/functions/params_return.leo.out | 4 + .../inputs/input_const_section_fail .leo.out | 5 + .../parser/inputs/input_const_success.leo.out | 295 ++++++++++++++++++ .../inputs/input_public_success.leo.out | 295 ++++++++++++++++++ .../parser/inputs/input_success.leo.out | 262 +++++----------- tests/parser/inputs/input_const_success.leo | 18 ++ tests/parser/inputs/input_public_success.leo | 19 ++ tests/parser/inputs/input_success.leo | 16 +- 13 files changed, 748 insertions(+), 198 deletions(-) create mode 100644 tests/expectations/parser/parser/inputs/input_const_section_fail .leo.out create mode 100644 tests/expectations/parser/parser/inputs/input_const_success.leo.out create mode 100644 tests/expectations/parser/parser/inputs/input_public_success.leo.out create mode 100644 tests/parser/inputs/input_const_success.leo create mode 100644 tests/parser/inputs/input_public_success.leo diff --git a/compiler/parser/src/parser/input.rs b/compiler/parser/src/parser/input.rs index dc1118a090..0354967d8d 100644 --- a/compiler/parser/src/parser/input.rs +++ b/compiler/parser/src/parser/input.rs @@ -17,6 +17,7 @@ use super::*; use leo_errors::{ParserError, Result}; +use leo_span::sym; impl ParserContext<'_> { /// Returns a [`ParsedInputFile`] struct filled with the data acquired in the file. @@ -49,10 +50,10 @@ impl ParserContext<'_> { let mut definitions = Vec::new(); while let Some(SpannedToken { - token: Token::Ident(_), .. + token: Token::Const | Token::Private | Token::Public | Token::Ident(_), .. }) = self.peek_option() { - definitions.push(self.parse_input_definition()?); + definitions.push(self.parse_input_definition(section.name == sym::main)?); } Ok(Section { @@ -65,15 +66,16 @@ impl ParserContext<'_> { /// Parses a single parameter definition: /// ` : = ;` /// Returns [`Definition`]. - pub fn parse_input_definition(&mut self) -> Result { + pub fn parse_input_definition(&mut self, is_main: bool) -> Result { let const_ = self.eat(Token::Const).is_some(); let private = self.eat(Token::Private).is_some(); let public = self.eat(Token::Public).is_some(); match (const_, private, public) { - (true, false, false) | (false, true, false) | (false, false, true) => {} - (false, false, false) => return Err(ParserError::inputs_no_variable_type_specified().into()), - _ => return Err(ParserError::inputs_multpe_variable_types_specified().into()), + (true, false, false) | (false, true, false) | (false, false, true) if is_main => {} + (false, false, false) if is_main => return Err(ParserError::inputs_no_variable_type_specified().into()), + _ if is_main => return Err(ParserError::inputs_multpe_variable_types_specified().into()), + _ => {} } let name = self.expect_ident()?; diff --git a/tests/expectations/parser/parser/functions/bounded_recursion.leo.out b/tests/expectations/parser/parser/functions/bounded_recursion.leo.out index c5daae1256..dc914ea67a 100644 --- a/tests/expectations/parser/parser/functions/bounded_recursion.leo.out +++ b/tests/expectations/parser/parser/functions/bounded_recursion.leo.out @@ -11,6 +11,8 @@ outputs: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const y: u32) {\\\"}\"}" const_: true + private: false + public: false mutable: false type_: IntegerType: U32 @@ -130,6 +132,8 @@ outputs: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":15,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(y: bool) -> bool {\\\"}\"}" const_: false + private: false + public: false mutable: true type_: Boolean span: diff --git a/tests/expectations/parser/parser/functions/const_param.leo.out b/tests/expectations/parser/parser/functions/const_param.leo.out index 1abefd7344..979a1f10af 100644 --- a/tests/expectations/parser/parser/functions/const_param.leo.out +++ b/tests/expectations/parser/parser/functions/const_param.leo.out @@ -11,6 +11,8 @@ outputs: - Variable: identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}" const_: false + private: false + public: false mutable: true type_: IntegerType: U32 @@ -24,6 +26,8 @@ outputs: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}" const_: true + private: false + public: false mutable: false type_: IntegerType: I32 @@ -78,6 +82,8 @@ outputs: - Variable: identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}" const_: true + private: false + public: false mutable: false type_: IntegerType: U32 @@ -91,6 +97,8 @@ outputs: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}" const_: false + private: false + public: false mutable: true type_: IntegerType: I32 diff --git a/tests/expectations/parser/parser/functions/infinite_recursion.leo.out b/tests/expectations/parser/parser/functions/infinite_recursion.leo.out index 196af95639..8e4db4fe1c 100644 --- a/tests/expectations/parser/parser/functions/infinite_recursion.leo.out +++ b/tests/expectations/parser/parser/functions/infinite_recursion.leo.out @@ -53,6 +53,8 @@ outputs: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":15,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(y: bool) -> bool {\\\"}\"}" const_: false + private: false + public: false mutable: true type_: Boolean span: diff --git a/tests/expectations/parser/parser/functions/params.leo.out b/tests/expectations/parser/parser/functions/params.leo.out index 555c27d59b..447f73de83 100644 --- a/tests/expectations/parser/parser/functions/params.leo.out +++ b/tests/expectations/parser/parser/functions/params.leo.out @@ -11,6 +11,8 @@ outputs: - Variable: identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" const_: false + private: false + public: false mutable: true type_: IntegerType: U32 @@ -24,6 +26,8 @@ outputs: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" const_: false + private: false + public: false mutable: true type_: IntegerType: I32 diff --git a/tests/expectations/parser/parser/functions/params_return.leo.out b/tests/expectations/parser/parser/functions/params_return.leo.out index 6be865eaa0..271407aae7 100644 --- a/tests/expectations/parser/parser/functions/params_return.leo.out +++ b/tests/expectations/parser/parser/functions/params_return.leo.out @@ -11,6 +11,8 @@ outputs: - Variable: identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}" const_: false + private: false + public: false mutable: true type_: IntegerType: U32 @@ -24,6 +26,8 @@ outputs: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}" const_: false + private: false + public: false mutable: true type_: IntegerType: I32 diff --git a/tests/expectations/parser/parser/inputs/input_const_section_fail .leo.out b/tests/expectations/parser/parser/inputs/input_const_section_fail .leo.out new file mode 100644 index 0000000000..0673b242df --- /dev/null +++ b/tests/expectations/parser/parser/inputs/input_const_section_fail .leo.out @@ -0,0 +1,5 @@ +--- +namespace: Input +expectation: Fail +outputs: + - "Error [EPAR0370000]: c0\n --> test:4:1\n |\n 4 | c0: bool = true; \n | ^^" diff --git a/tests/expectations/parser/parser/inputs/input_const_success.leo.out b/tests/expectations/parser/parser/inputs/input_const_success.leo.out new file mode 100644 index 0000000000..55bd221b09 --- /dev/null +++ b/tests/expectations/parser/parser/inputs/input_const_success.leo.out @@ -0,0 +1,295 @@ +--- +namespace: Input +expectation: Pass +outputs: + - sections: + - name: main + definitions: + - const_: true + private: false + public: false + type_: Boolean + name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const a: bool = true; \\\"}\"}" + value: + Value: + Boolean: + - "true" + - span: + line_start: 4 + line_stop: 4 + col_start: 18 + col_stop: 22 + path: "" + content: "const a: bool = true; " + span: + line_start: 4 + line_stop: 4 + col_start: 10 + col_stop: 14 + path: "" + content: "const a: bool = true; " + - const_: true + private: false + public: false + type_: + IntegerType: U8 + name: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const b: u8 = 2; \\\"}\"}" + value: + Value: + Implicit: + - "2" + - span: + line_start: 5 + line_stop: 5 + col_start: 18 + col_stop: 19 + path: "" + content: "const b: u8 = 2; " + span: + line_start: 5 + line_stop: 5 + col_start: 10 + col_stop: 12 + path: "" + content: "const b: u8 = 2; " + - const_: true + private: false + public: false + type_: Field + name: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const c: field = 0; \\\"}\"}" + value: + Value: + Implicit: + - "0" + - span: + line_start: 6 + line_stop: 6 + col_start: 18 + col_stop: 19 + path: "" + content: "const c: field = 0; " + span: + line_start: 6 + line_stop: 6 + col_start: 10 + col_stop: 15 + path: "" + content: "const c: field = 0; " + - const_: true + private: false + public: false + type_: Group + name: "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const d: group = (0, 1)group; \\\"}\"}" + value: + Value: + Group: + Tuple: + x: + Number: + - "0" + - span: + line_start: 7 + line_stop: 7 + col_start: 19 + col_stop: 20 + path: "" + content: "const d: group = (0, 1)group; " + y: + Number: + - "1" + - span: + line_start: 7 + line_stop: 7 + col_start: 22 + col_stop: 23 + path: "" + content: "const d: group = (0, 1)group; " + span: + line_start: 7 + line_stop: 7 + col_start: 19 + col_stop: 29 + path: "" + content: "const d: group = (0, 1)group; " + span: + line_start: 7 + line_stop: 7 + col_start: 10 + col_stop: 15 + path: "" + content: "const d: group = (0, 1)group; " + - const_: true + private: false + public: false + type_: Address + name: "{\"name\":\"e\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" + value: + Value: + Address: + - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 + - span: + line_start: 8 + line_stop: 8 + col_start: 20 + col_stop: 83 + path: "" + content: "const e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + span: + line_start: 8 + line_stop: 8 + col_start: 10 + col_stop: 17 + path: "" + content: "const e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + span: + line_start: 3 + line_stop: 3 + col_start: 2 + col_stop: 6 + path: "" + content: "[main]" + - name: registers + definitions: + - const_: false + private: false + public: false + type_: Boolean + name: "{\"name\":\"r0\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r0: bool = true; \\\"}\"}" + value: + Value: + Boolean: + - "true" + - span: + line_start: 11 + line_stop: 11 + col_start: 13 + col_stop: 17 + path: "" + content: "r0: bool = true; " + span: + line_start: 11 + line_stop: 11 + col_start: 5 + col_stop: 9 + path: "" + content: "r0: bool = true; " + - const_: false + private: false + public: false + type_: + IntegerType: U8 + name: "{\"name\":\"r1\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r1: u8 = 2; \\\"}\"}" + value: + Value: + Implicit: + - "2" + - span: + line_start: 12 + line_stop: 12 + col_start: 13 + col_stop: 14 + path: "" + content: "r1: u8 = 2; " + span: + line_start: 12 + line_stop: 12 + col_start: 5 + col_stop: 7 + path: "" + content: "r1: u8 = 2; " + - const_: false + private: false + public: false + type_: Field + name: "{\"name\":\"r2\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r2: field = 0; \\\"}\"}" + value: + Value: + Implicit: + - "0" + - span: + line_start: 13 + line_stop: 13 + col_start: 13 + col_stop: 14 + path: "" + content: "r2: field = 0; " + span: + line_start: 13 + line_stop: 13 + col_start: 5 + col_stop: 10 + path: "" + content: "r2: field = 0; " + - const_: false + private: false + public: false + type_: Group + name: "{\"name\":\"r3\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r3: group = (0, 1)group; \\\"}\"}" + value: + Value: + Group: + Tuple: + x: + Number: + - "0" + - span: + line_start: 14 + line_stop: 14 + col_start: 14 + col_stop: 15 + path: "" + content: "r3: group = (0, 1)group; " + y: + Number: + - "1" + - span: + line_start: 14 + line_stop: 14 + col_start: 17 + col_stop: 18 + path: "" + content: "r3: group = (0, 1)group; " + span: + line_start: 14 + line_stop: 14 + col_start: 14 + col_stop: 24 + path: "" + content: "r3: group = (0, 1)group; " + span: + line_start: 14 + line_stop: 14 + col_start: 5 + col_stop: 10 + path: "" + content: "r3: group = (0, 1)group; " + - const_: false + private: false + public: false + type_: Address + name: "{\"name\":\"r4\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" + value: + Value: + Address: + - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 + - span: + line_start: 15 + line_stop: 15 + col_start: 15 + col_stop: 78 + path: "" + content: "r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + span: + line_start: 15 + line_stop: 15 + col_start: 5 + col_stop: 12 + path: "" + content: "r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + span: + line_start: 10 + line_stop: 10 + col_start: 2 + col_stop: 11 + path: "" + content: "[registers]" diff --git a/tests/expectations/parser/parser/inputs/input_public_success.leo.out b/tests/expectations/parser/parser/inputs/input_public_success.leo.out new file mode 100644 index 0000000000..3233085279 --- /dev/null +++ b/tests/expectations/parser/parser/inputs/input_public_success.leo.out @@ -0,0 +1,295 @@ +--- +namespace: Input +expectation: Pass +outputs: + - sections: + - name: main + definitions: + - const_: false + private: false + public: true + type_: Boolean + name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public a: bool = true; \\\"}\"}" + value: + Value: + Boolean: + - "true" + - span: + line_start: 4 + line_stop: 4 + col_start: 19 + col_stop: 23 + path: "" + content: "public a: bool = true; " + span: + line_start: 4 + line_stop: 4 + col_start: 11 + col_stop: 15 + path: "" + content: "public a: bool = true; " + - const_: false + private: false + public: true + type_: + IntegerType: U8 + name: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public b: u8 = 2; \\\"}\"}" + value: + Value: + Implicit: + - "2" + - span: + line_start: 5 + line_stop: 5 + col_start: 19 + col_stop: 20 + path: "" + content: "public b: u8 = 2; " + span: + line_start: 5 + line_stop: 5 + col_start: 11 + col_stop: 13 + path: "" + content: "public b: u8 = 2; " + - const_: false + private: false + public: true + type_: Field + name: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public c: field = 0; \\\"}\"}" + value: + Value: + Implicit: + - "0" + - span: + line_start: 6 + line_stop: 6 + col_start: 19 + col_stop: 20 + path: "" + content: "public c: field = 0; " + span: + line_start: 6 + line_stop: 6 + col_start: 11 + col_stop: 16 + path: "" + content: "public c: field = 0; " + - const_: false + private: false + public: true + type_: Group + name: "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public d: group = (0, 1)group; \\\"}\"}" + value: + Value: + Group: + Tuple: + x: + Number: + - "0" + - span: + line_start: 7 + line_stop: 7 + col_start: 20 + col_stop: 21 + path: "" + content: "public d: group = (0, 1)group; " + y: + Number: + - "1" + - span: + line_start: 7 + line_stop: 7 + col_start: 23 + col_stop: 24 + path: "" + content: "public d: group = (0, 1)group; " + span: + line_start: 7 + line_stop: 7 + col_start: 20 + col_stop: 30 + path: "" + content: "public d: group = (0, 1)group; " + span: + line_start: 7 + line_stop: 7 + col_start: 11 + col_stop: 16 + path: "" + content: "public d: group = (0, 1)group; " + - const_: false + private: false + public: true + type_: Address + name: "{\"name\":\"e\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" + value: + Value: + Address: + - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 + - span: + line_start: 8 + line_stop: 8 + col_start: 21 + col_stop: 84 + path: "" + content: "public e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + span: + line_start: 8 + line_stop: 8 + col_start: 11 + col_stop: 18 + path: "" + content: "public e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + span: + line_start: 3 + line_stop: 3 + col_start: 2 + col_stop: 6 + path: "" + content: "[main]" + - name: registers + definitions: + - const_: false + private: false + public: false + type_: Boolean + name: "{\"name\":\"r0\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r0: bool = true; \\\"}\"}" + value: + Value: + Boolean: + - "true" + - span: + line_start: 11 + line_stop: 11 + col_start: 13 + col_stop: 17 + path: "" + content: "r0: bool = true; " + span: + line_start: 11 + line_stop: 11 + col_start: 5 + col_stop: 9 + path: "" + content: "r0: bool = true; " + - const_: false + private: false + public: false + type_: + IntegerType: U8 + name: "{\"name\":\"r1\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r1: u8 = 2; \\\"}\"}" + value: + Value: + Implicit: + - "2" + - span: + line_start: 12 + line_stop: 12 + col_start: 13 + col_stop: 14 + path: "" + content: "r1: u8 = 2; " + span: + line_start: 12 + line_stop: 12 + col_start: 5 + col_stop: 7 + path: "" + content: "r1: u8 = 2; " + - const_: false + private: false + public: false + type_: Field + name: "{\"name\":\"r2\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r2: field = 0; \\\"}\"}" + value: + Value: + Implicit: + - "0" + - span: + line_start: 13 + line_stop: 13 + col_start: 13 + col_stop: 14 + path: "" + content: "r2: field = 0; " + span: + line_start: 13 + line_stop: 13 + col_start: 5 + col_stop: 10 + path: "" + content: "r2: field = 0; " + - const_: false + private: false + public: false + type_: Group + name: "{\"name\":\"r3\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r3: group = (0, 1)group; \\\"}\"}" + value: + Value: + Group: + Tuple: + x: + Number: + - "0" + - span: + line_start: 14 + line_stop: 14 + col_start: 14 + col_stop: 15 + path: "" + content: "r3: group = (0, 1)group; " + y: + Number: + - "1" + - span: + line_start: 14 + line_stop: 14 + col_start: 17 + col_stop: 18 + path: "" + content: "r3: group = (0, 1)group; " + span: + line_start: 14 + line_stop: 14 + col_start: 14 + col_stop: 24 + path: "" + content: "r3: group = (0, 1)group; " + span: + line_start: 14 + line_stop: 14 + col_start: 5 + col_stop: 10 + path: "" + content: "r3: group = (0, 1)group; " + - const_: false + private: false + public: false + type_: Address + name: "{\"name\":\"r4\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" + value: + Value: + Address: + - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 + - span: + line_start: 15 + line_stop: 15 + col_start: 15 + col_stop: 78 + path: "" + content: "r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + span: + line_start: 15 + line_stop: 15 + col_start: 5 + col_stop: 12 + path: "" + content: "r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + span: + line_start: 10 + line_stop: 10 + col_start: 2 + col_stop: 11 + path: "" + content: "[registers]" diff --git a/tests/expectations/parser/parser/inputs/input_success.leo.out b/tests/expectations/parser/parser/inputs/input_success.leo.out index e8089469d1..276903324a 100644 --- a/tests/expectations/parser/parser/inputs/input_success.leo.out +++ b/tests/expectations/parser/parser/inputs/input_success.leo.out @@ -5,8 +5,11 @@ outputs: - sections: - name: main definitions: - - type_: Boolean - name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"a: bool = true; \\\"}\"}" + - const_: false + private: true + public: false + type_: Boolean + name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"private a: bool = true; \\\"}\"}" value: Value: Boolean: @@ -14,20 +17,23 @@ outputs: - span: line_start: 4 line_stop: 4 - col_start: 12 - col_stop: 16 + col_start: 20 + col_stop: 24 path: "" - content: "a: bool = true; " + content: "private a: bool = true; " span: line_start: 4 line_stop: 4 - col_start: 4 - col_stop: 8 + col_start: 12 + col_stop: 16 path: "" - content: "a: bool = true; " - - type_: + content: "private a: bool = true; " + - const_: false + private: true + public: false + type_: IntegerType: U8 - name: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"b: u8 = 2; \\\"}\"}" + name: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"private b: u8 = 2; \\\"}\"}" value: Value: Implicit: @@ -35,19 +41,22 @@ outputs: - span: line_start: 5 line_stop: 5 - col_start: 12 - col_stop: 13 + col_start: 20 + col_stop: 21 path: "" - content: "b: u8 = 2; " + content: "private b: u8 = 2; " span: line_start: 5 line_stop: 5 - col_start: 4 - col_stop: 6 + col_start: 12 + col_stop: 14 path: "" - content: "b: u8 = 2; " - - type_: Field - name: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"c: field = 0; \\\"}\"}" + content: "private b: u8 = 2; " + - const_: false + private: true + public: false + type_: Field + name: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"private c: field = 0; \\\"}\"}" value: Value: Implicit: @@ -55,19 +64,22 @@ outputs: - span: line_start: 6 line_stop: 6 - col_start: 12 - col_stop: 13 + col_start: 20 + col_stop: 21 path: "" - content: "c: field = 0; " + content: "private c: field = 0; " span: line_start: 6 line_stop: 6 - col_start: 4 - col_stop: 9 + col_start: 12 + col_stop: 17 path: "" - content: "c: field = 0; " - - type_: Group - name: "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"d: group = (0, 1)group; \\\"}\"}" + content: "private c: field = 0; " + - const_: false + private: true + public: false + type_: Group + name: "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"private d: group = (0, 1)group; \\\"}\"}" value: Value: Group: @@ -78,36 +90,39 @@ outputs: - span: line_start: 7 line_stop: 7 - col_start: 13 - col_stop: 14 + col_start: 21 + col_stop: 22 path: "" - content: "d: group = (0, 1)group; " + content: "private d: group = (0, 1)group; " y: Number: - "1" - span: line_start: 7 line_stop: 7 - col_start: 16 - col_stop: 17 + col_start: 24 + col_stop: 25 path: "" - content: "d: group = (0, 1)group; " + content: "private d: group = (0, 1)group; " span: line_start: 7 line_stop: 7 - col_start: 13 - col_stop: 23 + col_start: 21 + col_stop: 31 path: "" - content: "d: group = (0, 1)group; " + content: "private d: group = (0, 1)group; " span: line_start: 7 line_stop: 7 - col_start: 4 - col_stop: 9 + col_start: 12 + col_stop: 17 path: "" - content: "d: group = (0, 1)group; " - - type_: Address - name: "{\"name\":\"e\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" + content: "private d: group = (0, 1)group; " + - const_: false + private: true + public: false + type_: Address + name: "{\"name\":\"e\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"private e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" value: Value: Address: @@ -115,17 +130,17 @@ outputs: - span: line_start: 8 line_stop: 8 - col_start: 14 - col_stop: 77 + col_start: 22 + col_stop: 85 path: "" - content: "e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + content: "private e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" span: line_start: 8 line_stop: 8 - col_start: 4 - col_stop: 11 + col_start: 12 + col_stop: 19 path: "" - content: "e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + content: "private e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" span: line_start: 3 line_stop: 3 @@ -135,7 +150,10 @@ outputs: content: "[main]" - name: registers definitions: - - type_: Boolean + - const_: false + private: false + public: false + type_: Boolean name: "{\"name\":\"r0\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r0: bool = true; \\\"}\"}" value: Value: @@ -155,7 +173,10 @@ outputs: col_stop: 9 path: "" content: "r0: bool = true; " - - type_: + - const_: false + private: false + public: false + type_: IntegerType: U8 name: "{\"name\":\"r1\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r1: u8 = 2; \\\"}\"}" value: @@ -176,7 +197,10 @@ outputs: col_stop: 7 path: "" content: "r1: u8 = 2; " - - type_: Field + - const_: false + private: false + public: false + type_: Field name: "{\"name\":\"r2\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r2: field = 0; \\\"}\"}" value: Value: @@ -196,7 +220,10 @@ outputs: col_stop: 10 path: "" content: "r2: field = 0; " - - type_: Group + - const_: false + private: false + public: false + type_: Group name: "{\"name\":\"r3\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r3: group = (0, 1)group; \\\"}\"}" value: Value: @@ -236,7 +263,10 @@ outputs: col_stop: 10 path: "" content: "r3: group = (0, 1)group; " - - type_: Address + - const_: false + private: false + public: false + type_: Address name: "{\"name\":\"r4\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" value: Value: @@ -263,133 +293,3 @@ outputs: col_stop: 11 path: "" content: "[registers]" - - name: constants - definitions: - - type_: Boolean - name: "{\"name\":\"c0\",\"span\":\"{\\\"line_start\\\":18,\\\"line_stop\\\":18,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"c0: bool = true; \\\"}\"}" - value: - Value: - Boolean: - - "true" - - span: - line_start: 18 - line_stop: 18 - col_start: 13 - col_stop: 17 - path: "" - content: "c0: bool = true; " - span: - line_start: 18 - line_stop: 18 - col_start: 5 - col_stop: 9 - path: "" - content: "c0: bool = true; " - - type_: - IntegerType: U8 - name: "{\"name\":\"c1\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"c1: u8 = 2; \\\"}\"}" - value: - Value: - Implicit: - - "2" - - span: - line_start: 19 - line_stop: 19 - col_start: 13 - col_stop: 14 - path: "" - content: "c1: u8 = 2; " - span: - line_start: 19 - line_stop: 19 - col_start: 5 - col_stop: 7 - path: "" - content: "c1: u8 = 2; " - - type_: Field - name: "{\"name\":\"c2\",\"span\":\"{\\\"line_start\\\":20,\\\"line_stop\\\":20,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"c2: field = 0; \\\"}\"}" - value: - Value: - Implicit: - - "0" - - span: - line_start: 20 - line_stop: 20 - col_start: 13 - col_stop: 14 - path: "" - content: "c2: field = 0; " - span: - line_start: 20 - line_stop: 20 - col_start: 5 - col_stop: 10 - path: "" - content: "c2: field = 0; " - - type_: Group - name: "{\"name\":\"c3\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"c3: group = (0, 1)group; \\\"}\"}" - value: - Value: - Group: - Tuple: - x: - Number: - - "0" - - span: - line_start: 21 - line_stop: 21 - col_start: 14 - col_stop: 15 - path: "" - content: "c3: group = (0, 1)group; " - y: - Number: - - "1" - - span: - line_start: 21 - line_stop: 21 - col_start: 17 - col_stop: 18 - path: "" - content: "c3: group = (0, 1)group; " - span: - line_start: 21 - line_stop: 21 - col_start: 14 - col_stop: 24 - path: "" - content: "c3: group = (0, 1)group; " - span: - line_start: 21 - line_stop: 21 - col_start: 5 - col_stop: 10 - path: "" - content: "c3: group = (0, 1)group; " - - type_: Address - name: "{\"name\":\"c4\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"c4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" - value: - Value: - Address: - - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 - - span: - line_start: 22 - line_stop: 22 - col_start: 15 - col_stop: 78 - path: "" - content: "c4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" - span: - line_start: 22 - line_stop: 22 - col_start: 5 - col_stop: 12 - path: "" - content: "c4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" - span: - line_start: 17 - line_stop: 17 - col_start: 2 - col_stop: 11 - path: "" - content: "[constants]" diff --git a/tests/parser/inputs/input_const_success.leo b/tests/parser/inputs/input_const_success.leo new file mode 100644 index 0000000000..8db7f767ff --- /dev/null +++ b/tests/parser/inputs/input_const_success.leo @@ -0,0 +1,18 @@ +/* +namespace: Input +expectation: Pass +*/ + +[main] +const a: bool = true; +const b: u8 = 2; +const c: field = 0; +const d: group = (0, 1)group; +const e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + +[registers] +r0: bool = true; +r1: u8 = 2; +r2: field = 0; +r3: group = (0, 1)group; +r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; diff --git a/tests/parser/inputs/input_public_success.leo b/tests/parser/inputs/input_public_success.leo new file mode 100644 index 0000000000..cc449fe9e1 --- /dev/null +++ b/tests/parser/inputs/input_public_success.leo @@ -0,0 +1,19 @@ +/* +namespace: Input +expectation: Pass +*/ + +[main] +public a: bool = true; +public b: u8 = 2; +public c: field = 0; +public d: group = (0, 1)group; +public e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + +[registers] +r0: bool = true; +r1: u8 = 2; +r2: field = 0; +r3: group = (0, 1)group; +r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + diff --git a/tests/parser/inputs/input_success.leo b/tests/parser/inputs/input_success.leo index ed24602a59..ada20e1c29 100644 --- a/tests/parser/inputs/input_success.leo +++ b/tests/parser/inputs/input_success.leo @@ -4,11 +4,11 @@ expectation: Pass */ [main] -a: bool = true; -b: u8 = 2; -c: field = 0; -d: group = (0, 1)group; -e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; +private a: bool = true; +private b: u8 = 2; +private c: field = 0; +private d: group = (0, 1)group; +private e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; [registers] r0: bool = true; @@ -17,9 +17,3 @@ r2: field = 0; r3: group = (0, 1)group; r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; -[constants] -c0: bool = true; -c1: u8 = 2; -c2: field = 0; -c3: group = (0, 1)group; -c4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; From 6aa6b0fa0733baf98bc3bcbcf311bbaaa36deb31 Mon Sep 17 00:00:00 2001 From: gluax Date: Mon, 4 Apr 2022 15:52:05 -0700 Subject: [PATCH 05/12] add parsing input to compiler --- compiler/compiler/src/lib.rs | 23 ++++++++++++++++++++++- compiler/parser/src/parser/input.rs | 3 ++- compiler/parser/src/parser/mod.rs | 4 ++-- leo/commands/build.rs | 5 +++-- leo/package/src/inputs/input.rs | 2 +- 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/compiler/compiler/src/lib.rs b/compiler/compiler/src/lib.rs index 1402f11c0a..e42267e7cc 100644 --- a/compiler/compiler/src/lib.rs +++ b/compiler/compiler/src/lib.rs @@ -36,17 +36,24 @@ pub struct Compiler<'a> { handler: &'a Handler, main_file_path: PathBuf, output_directory: PathBuf, + input_file_path: PathBuf, } impl<'a> Compiler<'a> { /// /// Returns a new Leo compiler. /// - pub fn new(handler: &'a Handler, main_file_path: PathBuf, output_directory: PathBuf) -> Self { + pub fn new( + handler: &'a Handler, + main_file_path: PathBuf, + output_directory: PathBuf, + input_file_path: PathBuf, + ) -> Self { Self { handler, main_file_path, output_directory, + input_file_path, } } @@ -70,6 +77,20 @@ impl<'a> Compiler<'a> { /// Runs the compiler stages. /// fn compiler_stages(self) -> Result { + //load the input file if it exists. + let _input_ast = if self.input_file_path.exists() { + let input_string = fs::read_to_string(&self.input_file_path) + .map_err(|e| CompilerError::file_read_error(self.main_file_path.clone(), e))?; + + Some(leo_parser::parse_input( + self.handler, + self.input_file_path.to_str().unwrap_or_default(), + input_string, + )?) + } else { + None + }; + // Load the program file. let program_string = fs::read_to_string(&self.main_file_path) .map_err(|e| CompilerError::file_read_error(self.main_file_path.clone(), e))?; diff --git a/compiler/parser/src/parser/input.rs b/compiler/parser/src/parser/input.rs index 0354967d8d..66366625ed 100644 --- a/compiler/parser/src/parser/input.rs +++ b/compiler/parser/src/parser/input.rs @@ -50,7 +50,8 @@ impl ParserContext<'_> { let mut definitions = Vec::new(); while let Some(SpannedToken { - token: Token::Const | Token::Private | Token::Public | Token::Ident(_), .. + token: Token::Const | Token::Private | Token::Public | Token::Ident(_), + .. }) = self.peek_option() { definitions.push(self.parse_input_definition(section.name == sym::main)?); diff --git a/compiler/parser/src/parser/mod.rs b/compiler/parser/src/parser/mod.rs index 60f041cbdf..db828fda04 100644 --- a/compiler/parser/src/parser/mod.rs +++ b/compiler/parser/src/parser/mod.rs @@ -57,8 +57,8 @@ pub fn parse(handler: &Handler, path: &str, source: &str) -> Result { } /// Parses an input file at the given file `path` and `source` code text. -pub fn parse_input(handler: &Handler, path: &str, source: &str) -> Result { - let mut tokens = ParserContext::new(handler, crate::tokenize(path, source)?); +pub fn parse_input, Y: AsRef>(handler: &Handler, path: T, source: Y) -> Result { + let mut tokens = ParserContext::new(handler, crate::tokenize(path.as_ref(), source.as_ref())?); tokens.parse_input() } diff --git a/leo/commands/build.rs b/leo/commands/build.rs index b8d0d1fb7b..3996c17dcf 100644 --- a/leo/commands/build.rs +++ b/leo/commands/build.rs @@ -18,6 +18,7 @@ use crate::{commands::Command, context::Context}; use leo_compiler::{Ast, Compiler}; use leo_errors::{CliError, Result}; use leo_package::{ + inputs::InputFile, // inputs::*, // outputs::CircuitFile outputs::{ChecksumFile, OutputsDirectory, OUTPUTS_DIRECTORY_NAME}, @@ -147,7 +148,7 @@ impl Command for Build { main_file_path.push(MAIN_FILENAME); // Load the input file at `package_name.in` - // let (input_string, input_path) = InputFile::new(&package_name).read_from(&path)?; + let input_path = InputFile::new(&package_name).setup_file_path(&path); // Load the state file at `package_name.in` // let (state_string, state_path) = StateFile::new(&package_name).read_from(&path)?; @@ -179,7 +180,7 @@ impl Command for Build { // Initialize error handler let handler = leo_errors::emitter::Handler::default(); - let program = Compiler::new(&handler, main_file_path, output_directory); + let program = Compiler::new(&handler, main_file_path, output_directory, input_path.to_path_buf()); // Compute the current program checksum let program_checksum = program.checksum()?; diff --git a/leo/package/src/inputs/input.rs b/leo/package/src/inputs/input.rs index 0d708c6643..330eedfb02 100644 --- a/leo/package/src/inputs/input.rs +++ b/leo/package/src/inputs/input.rs @@ -86,7 +86,7 @@ r0: u32 = 0; ) } - fn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path> { + pub fn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path> { let mut path = Cow::from(path); if path.is_dir() { if !path.ends_with(INPUTS_DIRECTORY_NAME) { From 16914e3ce887dd29f6a7228ba7103328777bac5e Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Tue, 5 Apr 2022 09:27:39 -0700 Subject: [PATCH 06/12] remove private keyword --- .../ast/src/functions/input/function_input.rs | 8 +++++--- compiler/ast/src/input/definition.rs | 1 - .../ast/src/reducer/reconstructing_reducer.rs | 1 - compiler/parser/src/parser/file.rs | 2 -- compiler/parser/src/parser/input.rs | 16 +++------------- compiler/parser/src/tokenizer/lexer.rs | 1 - compiler/parser/src/tokenizer/token.rs | 5 +---- leo/errors/src/parser/parser_errors.rs | 16 ---------------- leo/span/src/symbol.rs | 1 - 9 files changed, 9 insertions(+), 42 deletions(-) diff --git a/compiler/ast/src/functions/input/function_input.rs b/compiler/ast/src/functions/input/function_input.rs index eae6971964..0da279d029 100644 --- a/compiler/ast/src/functions/input/function_input.rs +++ b/compiler/ast/src/functions/input/function_input.rs @@ -27,8 +27,6 @@ pub struct FunctionInputVariable { pub identifier: Identifier, /// Is it a const parameter? pub const_: bool, - /// Is it a private input parameter? - pub private: bool, /// Is it a public parameter? pub public: bool, /// Is it a mutable parameter? @@ -41,7 +39,11 @@ pub struct FunctionInputVariable { impl FunctionInputVariable { fn format(&self, f: &mut fmt::Formatter) -> fmt::Result { - // mut var: bool + if self.public { + write!(f, "public ")?; + } else { + write!(f, "private ")?; + } if self.const_ { write!(f, "const ")?; } diff --git a/compiler/ast/src/input/definition.rs b/compiler/ast/src/input/definition.rs index 8e5315723a..9090111b5e 100644 --- a/compiler/ast/src/input/definition.rs +++ b/compiler/ast/src/input/definition.rs @@ -22,7 +22,6 @@ use crate::{Expression, Identifier, Type}; #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Definition { pub const_: bool, - pub private: bool, pub public: bool, pub type_: Type, pub name: Identifier, diff --git a/compiler/ast/src/reducer/reconstructing_reducer.rs b/compiler/ast/src/reducer/reconstructing_reducer.rs index d015103a64..1af16ec488 100644 --- a/compiler/ast/src/reducer/reconstructing_reducer.rs +++ b/compiler/ast/src/reducer/reconstructing_reducer.rs @@ -276,7 +276,6 @@ pub trait ReconstructingReducer { identifier, const_: variable.const_, mutable: variable.mutable, - private: variable.private, public: variable.public, type_, span: variable.span.clone(), diff --git a/compiler/parser/src/parser/file.rs b/compiler/parser/src/parser/file.rs index 34db99b7b5..a6863ce69c 100644 --- a/compiler/parser/src/parser/file.rs +++ b/compiler/parser/src/parser/file.rs @@ -67,7 +67,6 @@ impl ParserContext<'_> { pub fn parse_function_parameters(&mut self) -> Result { let const_ = self.eat(Token::Const); let mutable = self.eat(Token::Mut); - let private = self.eat(Token::Private).is_some(); let public = self.eat(Token::Public).is_some(); let name = self.expect_ident()?; @@ -81,7 +80,6 @@ impl ParserContext<'_> { Ok(FunctionInput::Variable(FunctionInputVariable { const_: const_.is_some(), mutable: const_.is_none(), - private, public, type_, span: name.span.clone(), diff --git a/compiler/parser/src/parser/input.rs b/compiler/parser/src/parser/input.rs index 66366625ed..8fbbfa98fd 100644 --- a/compiler/parser/src/parser/input.rs +++ b/compiler/parser/src/parser/input.rs @@ -17,7 +17,6 @@ use super::*; use leo_errors::{ParserError, Result}; -use leo_span::sym; impl ParserContext<'_> { /// Returns a [`ParsedInputFile`] struct filled with the data acquired in the file. @@ -50,11 +49,11 @@ impl ParserContext<'_> { let mut definitions = Vec::new(); while let Some(SpannedToken { - token: Token::Const | Token::Private | Token::Public | Token::Ident(_), + token: Token::Const | Token::Public | Token::Ident(_), .. }) = self.peek_option() { - definitions.push(self.parse_input_definition(section.name == sym::main)?); + definitions.push(self.parse_input_definition()?); } Ok(Section { @@ -67,18 +66,10 @@ impl ParserContext<'_> { /// Parses a single parameter definition: /// ` : = ;` /// Returns [`Definition`]. - pub fn parse_input_definition(&mut self, is_main: bool) -> Result { + pub fn parse_input_definition(&mut self) -> Result { let const_ = self.eat(Token::Const).is_some(); - let private = self.eat(Token::Private).is_some(); let public = self.eat(Token::Public).is_some(); - match (const_, private, public) { - (true, false, false) | (false, true, false) | (false, false, true) if is_main => {} - (false, false, false) if is_main => return Err(ParserError::inputs_no_variable_type_specified().into()), - _ if is_main => return Err(ParserError::inputs_multpe_variable_types_specified().into()), - _ => {} - } - let name = self.expect_ident()?; self.expect(Token::Colon)?; let (type_, span) = self.parse_type()?; @@ -88,7 +79,6 @@ impl ParserContext<'_> { Ok(Definition { const_, - private, public, name, type_, diff --git a/compiler/parser/src/tokenizer/lexer.rs b/compiler/parser/src/tokenizer/lexer.rs index 46b84611ad..571931ea45 100644 --- a/compiler/parser/src/tokenizer/lexer.rs +++ b/compiler/parser/src/tokenizer/lexer.rs @@ -421,7 +421,6 @@ impl Token { "input" => Token::Input, "let" => Token::Let, "mut" => Token::Mut, - "private" => Token::Private, "public" => Token::Public, "return" => Token::Return, "true" => Token::True, diff --git a/compiler/parser/src/tokenizer/token.rs b/compiler/parser/src/tokenizer/token.rs index 43c906b94b..8e227499c4 100644 --- a/compiler/parser/src/tokenizer/token.rs +++ b/compiler/parser/src/tokenizer/token.rs @@ -128,8 +128,6 @@ pub enum Token { In, Let, Mut, - /// For private inputs. - Private, /// For public inputs. Public, Return, @@ -162,6 +160,7 @@ pub const KEYWORD_TOKENS: &[Token] = &[ Token::Input, Token::Let, Token::Mut, + Token::Public, Token::Return, Token::True, Token::Type, @@ -202,7 +201,6 @@ impl Token { Token::Input => sym::input, Token::Let => sym::Let, Token::Mut => sym::Mut, - Token::Private => sym::Private, Token::Public => sym::Public, Token::Return => sym::Return, Token::True => sym::True, @@ -300,7 +298,6 @@ impl fmt::Display for Token { In => write!(f, "in"), Let => write!(f, "let"), Mut => write!(f, "mut"), - Private => write!(f, "private"), Public => write!(f, "public"), Return => write!(f, "return"), Type => write!(f, "type"), diff --git a/leo/errors/src/parser/parser_errors.rs b/leo/errors/src/parser/parser_errors.rs index 3570158e90..9ce55319ca 100644 --- a/leo/errors/src/parser/parser_errors.rs +++ b/leo/errors/src/parser/parser_errors.rs @@ -358,20 +358,4 @@ create_errors!( msg: format!("Found the char `{}`, but expected `{}`", found, expected), help: None, } - - /// For when a user does not specify a type of input. - @backtraced - inputs_no_variable_type_specified { - args: (), - msg: "An input must be either const, private, or public.", - help: None, - } - - /// For when a user specified more than a type of input. - @backtraced - inputs_multpe_variable_types_specified { - args: (), - msg: "An input can only be one of const, private, or public.", - help: None, - } ); diff --git a/leo/span/src/symbol.rs b/leo/span/src/symbol.rs index d4dd9daa20..20d0b91200 100644 --- a/leo/span/src/symbol.rs +++ b/leo/span/src/symbol.rs @@ -131,7 +131,6 @@ symbols! { main, Mut: "mut", prelude, - Private: "private", Public: "public", Return: "return", Star: "*", From a675b81c0a50222bd05925755deb8768879c882b Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Tue, 5 Apr 2022 09:36:22 -0700 Subject: [PATCH 07/12] change tests --- compiler/parser/src/parser/file.rs | 2 +- compiler/parser/src/parser/input.rs | 2 +- .../functions/bounded_recursion.leo.out | 2 - .../parser/functions/const_param.leo.out | 4 - .../functions/const_public_param_fail.leo.out | 5 + .../functions/infinite_recursion.leo.out | 1 - .../parser/parser/functions/params.leo.out | 2 - .../parser/functions/params_return.leo.out | 2 - .../functions/public_const_param.leo.out | 145 +++++++++ .../parser/functions/public_param.leo.out | 145 +++++++++ .../inputs/input_const_public_fail.leo.out | 5 + .../parser/inputs/input_const_success.leo.out | 10 - .../inputs/input_public_const_success.leo.out | 285 ++++++++++++++++++ .../inputs/input_public_success.leo.out | 10 - .../functions/const_public_param_fail.leo | 12 + tests/parser/functions/public_const_param.leo | 12 + tests/parser/functions/public_param.leo | 12 + .../parser/inputs/input_const_public_fail.leo | 19 ++ ...ess.leo => input_public_const_success.leo} | 10 +- 19 files changed, 647 insertions(+), 38 deletions(-) create mode 100644 tests/expectations/parser/parser/functions/const_public_param_fail.leo.out create mode 100644 tests/expectations/parser/parser/functions/public_const_param.leo.out create mode 100644 tests/expectations/parser/parser/functions/public_param.leo.out create mode 100644 tests/expectations/parser/parser/inputs/input_const_public_fail.leo.out create mode 100644 tests/expectations/parser/parser/inputs/input_public_const_success.leo.out create mode 100644 tests/parser/functions/const_public_param_fail.leo create mode 100644 tests/parser/functions/public_const_param.leo create mode 100644 tests/parser/functions/public_param.leo create mode 100644 tests/parser/inputs/input_const_public_fail.leo rename tests/parser/inputs/{input_success.leo => input_public_const_success.leo} (50%) diff --git a/compiler/parser/src/parser/file.rs b/compiler/parser/src/parser/file.rs index a6863ce69c..8fc836d74e 100644 --- a/compiler/parser/src/parser/file.rs +++ b/compiler/parser/src/parser/file.rs @@ -65,9 +65,9 @@ impl ParserContext<'_> { /// Returns a [`FunctionInput`] AST node if the next tokens represent a function parameter. /// pub fn parse_function_parameters(&mut self) -> Result { + let public = self.eat(Token::Public).is_some(); let const_ = self.eat(Token::Const); let mutable = self.eat(Token::Mut); - let public = self.eat(Token::Public).is_some(); let name = self.expect_ident()?; diff --git a/compiler/parser/src/parser/input.rs b/compiler/parser/src/parser/input.rs index 8fbbfa98fd..8750b7d3c3 100644 --- a/compiler/parser/src/parser/input.rs +++ b/compiler/parser/src/parser/input.rs @@ -67,8 +67,8 @@ impl ParserContext<'_> { /// ` : = ;` /// Returns [`Definition`]. pub fn parse_input_definition(&mut self) -> Result { - let const_ = self.eat(Token::Const).is_some(); let public = self.eat(Token::Public).is_some(); + let const_ = self.eat(Token::Const).is_some(); let name = self.expect_ident()?; self.expect(Token::Colon)?; diff --git a/tests/expectations/parser/parser/functions/bounded_recursion.leo.out b/tests/expectations/parser/parser/functions/bounded_recursion.leo.out index dc914ea67a..b31de72c72 100644 --- a/tests/expectations/parser/parser/functions/bounded_recursion.leo.out +++ b/tests/expectations/parser/parser/functions/bounded_recursion.leo.out @@ -11,7 +11,6 @@ outputs: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const y: u32) {\\\"}\"}" const_: true - private: false public: false mutable: false type_: @@ -132,7 +131,6 @@ outputs: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":15,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(y: bool) -> bool {\\\"}\"}" const_: false - private: false public: false mutable: true type_: Boolean diff --git a/tests/expectations/parser/parser/functions/const_param.leo.out b/tests/expectations/parser/parser/functions/const_param.leo.out index 979a1f10af..245dd27192 100644 --- a/tests/expectations/parser/parser/functions/const_param.leo.out +++ b/tests/expectations/parser/parser/functions/const_param.leo.out @@ -11,7 +11,6 @@ outputs: - Variable: identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}" const_: false - private: false public: false mutable: true type_: @@ -26,7 +25,6 @@ outputs: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}" const_: true - private: false public: false mutable: false type_: @@ -82,7 +80,6 @@ outputs: - Variable: identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}" const_: true - private: false public: false mutable: false type_: @@ -97,7 +94,6 @@ outputs: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}" const_: false - private: false public: false mutable: true type_: diff --git a/tests/expectations/parser/parser/functions/const_public_param_fail.leo.out b/tests/expectations/parser/parser/functions/const_public_param_fail.leo.out new file mode 100644 index 0000000000..24c32456b2 --- /dev/null +++ b/tests/expectations/parser/parser/functions/const_public_param_fail.leo.out @@ -0,0 +1,5 @@ +--- +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 | ^^^^^^" diff --git a/tests/expectations/parser/parser/functions/infinite_recursion.leo.out b/tests/expectations/parser/parser/functions/infinite_recursion.leo.out index 8e4db4fe1c..5961f3fd16 100644 --- a/tests/expectations/parser/parser/functions/infinite_recursion.leo.out +++ b/tests/expectations/parser/parser/functions/infinite_recursion.leo.out @@ -53,7 +53,6 @@ outputs: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":15,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(y: bool) -> bool {\\\"}\"}" const_: false - private: false public: false mutable: true type_: Boolean diff --git a/tests/expectations/parser/parser/functions/params.leo.out b/tests/expectations/parser/parser/functions/params.leo.out index 447f73de83..e151c1272b 100644 --- a/tests/expectations/parser/parser/functions/params.leo.out +++ b/tests/expectations/parser/parser/functions/params.leo.out @@ -11,7 +11,6 @@ outputs: - Variable: identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" const_: false - private: false public: false mutable: true type_: @@ -26,7 +25,6 @@ outputs: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" const_: false - private: false public: false mutable: true type_: diff --git a/tests/expectations/parser/parser/functions/params_return.leo.out b/tests/expectations/parser/parser/functions/params_return.leo.out index 271407aae7..0cee2e9ffc 100644 --- a/tests/expectations/parser/parser/functions/params_return.leo.out +++ b/tests/expectations/parser/parser/functions/params_return.leo.out @@ -11,7 +11,6 @@ outputs: - Variable: identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}" const_: false - private: false public: false mutable: true type_: @@ -26,7 +25,6 @@ outputs: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}" const_: false - private: false public: false mutable: true type_: diff --git a/tests/expectations/parser/parser/functions/public_const_param.leo.out b/tests/expectations/parser/parser/functions/public_const_param.leo.out new file mode 100644 index 0000000000..978984bd39 --- /dev/null +++ b/tests/expectations/parser/parser/functions/public_const_param.leo.out @@ -0,0 +1,145 @@ +--- +namespace: Parse +expectation: Pass +outputs: + - name: "" + expected_input: [] + functions: + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, public const y: i32) {\\\"}\"}": + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, public const y: i32) {\\\"}\"}" + input: + - Variable: + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, public const y: i32) {\\\"}\"}" + const_: false + public: false + mutable: true + type_: + IntegerType: U32 + span: + line_start: 3 + line_stop: 3 + col_start: 12 + col_stop: 13 + path: "" + content: "function x(x: u32, public const y: i32) {" + - Variable: + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":33,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, public const y: i32) {\\\"}\"}" + const_: true + public: true + mutable: false + type_: + IntegerType: I32 + span: + line_start: 3 + line_stop: 3 + col_start: 33 + col_stop: 34 + path: "" + content: "function x(x: u32, public const y: i32) {" + const_: false + output: ~ + core_mapping: ~ + block: + statements: + - Return: + expression: + Value: + Implicit: + - "0" + - span: + line_start: 4 + line_stop: 4 + col_start: 12 + col_stop: 13 + path: "" + content: " return 0;" + span: + line_start: 4 + line_stop: 4 + col_start: 5 + col_stop: 13 + path: "" + content: " return 0;" + span: + line_start: 3 + line_stop: 5 + col_start: 41 + col_stop: 2 + path: "" + content: "function x(x: u32, public const y: i32) {\n ...\n}" + span: + line_start: 3 + line_stop: 5 + col_start: 1 + col_stop: 2 + path: "" + content: "function x(x: u32, public const y: i32) {\n ...\n}" + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(public const x: u32, y: i32) {\\\"}\"}": + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(public const x: u32, y: i32) {\\\"}\"}" + input: + - Variable: + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":25,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(public const x: u32, y: i32) {\\\"}\"}" + const_: true + public: true + mutable: false + type_: + IntegerType: U32 + span: + line_start: 7 + line_stop: 7 + col_start: 25 + col_stop: 26 + path: "" + content: "function x(public const x: u32, y: i32) {" + - Variable: + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":33,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(public const x: u32, y: i32) {\\\"}\"}" + const_: false + public: false + mutable: true + type_: + IntegerType: I32 + span: + line_start: 7 + line_stop: 7 + col_start: 33 + col_stop: 34 + path: "" + content: "function x(public const x: u32, y: i32) {" + const_: false + output: ~ + core_mapping: ~ + block: + statements: + - Return: + expression: + Value: + Implicit: + - "0" + - span: + line_start: 8 + line_stop: 8 + col_start: 12 + col_stop: 13 + path: "" + content: " return 0;" + span: + line_start: 8 + line_stop: 8 + col_start: 5 + col_stop: 13 + path: "" + content: " return 0;" + span: + line_start: 7 + line_stop: 9 + col_start: 41 + col_stop: 2 + path: "" + content: "function x(public const x: u32, y: i32) {\n ...\n}" + span: + line_start: 7 + line_stop: 9 + col_start: 1 + col_stop: 2 + path: "" + content: "function x(public const x: u32, y: i32) {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/public_param.leo.out b/tests/expectations/parser/parser/functions/public_param.leo.out new file mode 100644 index 0000000000..18a113e1c7 --- /dev/null +++ b/tests/expectations/parser/parser/functions/public_param.leo.out @@ -0,0 +1,145 @@ +--- +namespace: Parse +expectation: Pass +outputs: + - name: "" + expected_input: [] + functions: + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, public y: i32) {\\\"}\"}": + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, public y: i32) {\\\"}\"}" + input: + - Variable: + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, public y: i32) {\\\"}\"}" + const_: false + public: false + mutable: true + type_: + IntegerType: U32 + span: + line_start: 3 + line_stop: 3 + col_start: 12 + col_stop: 13 + path: "" + content: "function x(x: u32, public y: i32) {" + - Variable: + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":27,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, public y: i32) {\\\"}\"}" + const_: false + public: true + mutable: true + type_: + IntegerType: I32 + span: + line_start: 3 + line_stop: 3 + col_start: 27 + col_stop: 28 + path: "" + content: "function x(x: u32, public y: i32) {" + const_: false + output: ~ + core_mapping: ~ + block: + statements: + - Return: + expression: + Value: + Implicit: + - "0" + - span: + line_start: 4 + line_stop: 4 + col_start: 12 + col_stop: 13 + path: "" + content: " return 0;" + span: + line_start: 4 + line_stop: 4 + col_start: 5 + col_stop: 13 + path: "" + content: " return 0;" + span: + line_start: 3 + line_stop: 5 + col_start: 35 + col_stop: 2 + path: "" + content: "function x(x: u32, public y: i32) {\n ...\n}" + span: + line_start: 3 + line_stop: 5 + col_start: 1 + col_stop: 2 + path: "" + content: "function x(x: u32, public y: i32) {\n ...\n}" + "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(public x: u32, y: i32) {\\\"}\"}": + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(public x: u32, y: i32) {\\\"}\"}" + input: + - Variable: + identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(public x: u32, y: i32) {\\\"}\"}" + const_: false + public: true + mutable: true + type_: + IntegerType: U32 + span: + line_start: 7 + line_stop: 7 + col_start: 19 + col_stop: 20 + path: "" + content: "function x(public x: u32, y: i32) {" + - Variable: + identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":27,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(public x: u32, y: i32) {\\\"}\"}" + const_: false + public: false + mutable: true + type_: + IntegerType: I32 + span: + line_start: 7 + line_stop: 7 + col_start: 27 + col_stop: 28 + path: "" + content: "function x(public x: u32, y: i32) {" + const_: false + output: ~ + core_mapping: ~ + block: + statements: + - Return: + expression: + Value: + Implicit: + - "0" + - span: + line_start: 8 + line_stop: 8 + col_start: 12 + col_stop: 13 + path: "" + content: " return 0;" + span: + line_start: 8 + line_stop: 8 + col_start: 5 + col_stop: 13 + path: "" + content: " return 0;" + span: + line_start: 7 + line_stop: 9 + col_start: 35 + col_stop: 2 + path: "" + content: "function x(public x: u32, y: i32) {\n ...\n}" + span: + line_start: 7 + line_stop: 9 + col_start: 1 + col_stop: 2 + path: "" + content: "function x(public x: u32, y: i32) {\n ...\n}" diff --git a/tests/expectations/parser/parser/inputs/input_const_public_fail.leo.out b/tests/expectations/parser/parser/inputs/input_const_public_fail.leo.out new file mode 100644 index 0000000000..c06dc8bb66 --- /dev/null +++ b/tests/expectations/parser/parser/inputs/input_const_public_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Input +expectation: Fail +outputs: + - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'public'\n --> test:4:7\n |\n 4 | const public a: bool = true; \n | ^^^^^^" diff --git a/tests/expectations/parser/parser/inputs/input_const_success.leo.out b/tests/expectations/parser/parser/inputs/input_const_success.leo.out index 55bd221b09..4eea3f8ffa 100644 --- a/tests/expectations/parser/parser/inputs/input_const_success.leo.out +++ b/tests/expectations/parser/parser/inputs/input_const_success.leo.out @@ -6,7 +6,6 @@ outputs: - name: main definitions: - const_: true - private: false public: false type_: Boolean name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const a: bool = true; \\\"}\"}" @@ -29,7 +28,6 @@ outputs: path: "" content: "const a: bool = true; " - const_: true - private: false public: false type_: IntegerType: U8 @@ -53,7 +51,6 @@ outputs: path: "" content: "const b: u8 = 2; " - const_: true - private: false public: false type_: Field name: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const c: field = 0; \\\"}\"}" @@ -76,7 +73,6 @@ outputs: path: "" content: "const c: field = 0; " - const_: true - private: false public: false type_: Group name: "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const d: group = (0, 1)group; \\\"}\"}" @@ -119,7 +115,6 @@ outputs: path: "" content: "const d: group = (0, 1)group; " - const_: true - private: false public: false type_: Address name: "{\"name\":\"e\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" @@ -151,7 +146,6 @@ outputs: - name: registers definitions: - const_: false - private: false public: false type_: Boolean name: "{\"name\":\"r0\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r0: bool = true; \\\"}\"}" @@ -174,7 +168,6 @@ outputs: path: "" content: "r0: bool = true; " - const_: false - private: false public: false type_: IntegerType: U8 @@ -198,7 +191,6 @@ outputs: path: "" content: "r1: u8 = 2; " - const_: false - private: false public: false type_: Field name: "{\"name\":\"r2\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r2: field = 0; \\\"}\"}" @@ -221,7 +213,6 @@ outputs: path: "" content: "r2: field = 0; " - const_: false - private: false public: false type_: Group name: "{\"name\":\"r3\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r3: group = (0, 1)group; \\\"}\"}" @@ -264,7 +255,6 @@ outputs: path: "" content: "r3: group = (0, 1)group; " - const_: false - private: false public: false type_: Address name: "{\"name\":\"r4\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" diff --git a/tests/expectations/parser/parser/inputs/input_public_const_success.leo.out b/tests/expectations/parser/parser/inputs/input_public_const_success.leo.out new file mode 100644 index 0000000000..48594a616e --- /dev/null +++ b/tests/expectations/parser/parser/inputs/input_public_const_success.leo.out @@ -0,0 +1,285 @@ +--- +namespace: Input +expectation: Pass +outputs: + - sections: + - name: main + definitions: + - const_: true + public: true + type_: Boolean + name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public const a: bool = true; \\\"}\"}" + value: + Value: + Boolean: + - "true" + - span: + line_start: 4 + line_stop: 4 + col_start: 25 + col_stop: 29 + path: "" + content: "public const a: bool = true; " + span: + line_start: 4 + line_stop: 4 + col_start: 17 + col_stop: 21 + path: "" + content: "public const a: bool = true; " + - const_: true + public: true + type_: + IntegerType: U8 + name: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public const b: u8 = 2; \\\"}\"}" + value: + Value: + Implicit: + - "2" + - span: + line_start: 5 + line_stop: 5 + col_start: 25 + col_stop: 26 + path: "" + content: "public const b: u8 = 2; " + span: + line_start: 5 + line_stop: 5 + col_start: 17 + col_stop: 19 + path: "" + content: "public const b: u8 = 2; " + - const_: true + public: true + type_: Field + name: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public const c: field = 0; \\\"}\"}" + value: + Value: + Implicit: + - "0" + - span: + line_start: 6 + line_stop: 6 + col_start: 25 + col_stop: 26 + path: "" + content: "public const c: field = 0; " + span: + line_start: 6 + line_stop: 6 + col_start: 17 + col_stop: 22 + path: "" + content: "public const c: field = 0; " + - const_: true + public: true + type_: Group + name: "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public const d: group = (0, 1)group; \\\"}\"}" + value: + Value: + Group: + Tuple: + x: + Number: + - "0" + - span: + line_start: 7 + line_stop: 7 + col_start: 26 + col_stop: 27 + path: "" + content: "public const d: group = (0, 1)group; " + y: + Number: + - "1" + - span: + line_start: 7 + line_stop: 7 + col_start: 29 + col_stop: 30 + path: "" + content: "public const d: group = (0, 1)group; " + span: + line_start: 7 + line_stop: 7 + col_start: 26 + col_stop: 36 + path: "" + content: "public const d: group = (0, 1)group; " + span: + line_start: 7 + line_stop: 7 + col_start: 17 + col_stop: 22 + path: "" + content: "public const d: group = (0, 1)group; " + - const_: true + public: true + type_: Address + name: "{\"name\":\"e\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public const e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" + value: + Value: + Address: + - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 + - span: + line_start: 8 + line_stop: 8 + col_start: 27 + col_stop: 90 + path: "" + content: "public const e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + span: + line_start: 8 + line_stop: 8 + col_start: 17 + col_stop: 24 + path: "" + content: "public const e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + span: + line_start: 3 + line_stop: 3 + col_start: 2 + col_stop: 6 + path: "" + content: "[main]" + - name: registers + definitions: + - const_: false + public: false + type_: Boolean + name: "{\"name\":\"r0\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r0: bool = true; \\\"}\"}" + value: + Value: + Boolean: + - "true" + - span: + line_start: 11 + line_stop: 11 + col_start: 13 + col_stop: 17 + path: "" + content: "r0: bool = true; " + span: + line_start: 11 + line_stop: 11 + col_start: 5 + col_stop: 9 + path: "" + content: "r0: bool = true; " + - const_: false + public: false + type_: + IntegerType: U8 + name: "{\"name\":\"r1\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r1: u8 = 2; \\\"}\"}" + value: + Value: + Implicit: + - "2" + - span: + line_start: 12 + line_stop: 12 + col_start: 13 + col_stop: 14 + path: "" + content: "r1: u8 = 2; " + span: + line_start: 12 + line_stop: 12 + col_start: 5 + col_stop: 7 + path: "" + content: "r1: u8 = 2; " + - const_: false + public: false + type_: Field + name: "{\"name\":\"r2\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r2: field = 0; \\\"}\"}" + value: + Value: + Implicit: + - "0" + - span: + line_start: 13 + line_stop: 13 + col_start: 13 + col_stop: 14 + path: "" + content: "r2: field = 0; " + span: + line_start: 13 + line_stop: 13 + col_start: 5 + col_stop: 10 + path: "" + content: "r2: field = 0; " + - const_: false + public: false + type_: Group + name: "{\"name\":\"r3\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r3: group = (0, 1)group; \\\"}\"}" + value: + Value: + Group: + Tuple: + x: + Number: + - "0" + - span: + line_start: 14 + line_stop: 14 + col_start: 14 + col_stop: 15 + path: "" + content: "r3: group = (0, 1)group; " + y: + Number: + - "1" + - span: + line_start: 14 + line_stop: 14 + col_start: 17 + col_stop: 18 + path: "" + content: "r3: group = (0, 1)group; " + span: + line_start: 14 + line_stop: 14 + col_start: 14 + col_stop: 24 + path: "" + content: "r3: group = (0, 1)group; " + span: + line_start: 14 + line_stop: 14 + col_start: 5 + col_stop: 10 + path: "" + content: "r3: group = (0, 1)group; " + - const_: false + public: false + type_: Address + name: "{\"name\":\"r4\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" + value: + Value: + Address: + - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 + - span: + line_start: 15 + line_stop: 15 + col_start: 15 + col_stop: 78 + path: "" + content: "r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + span: + line_start: 15 + line_stop: 15 + col_start: 5 + col_stop: 12 + path: "" + content: "r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + span: + line_start: 10 + line_stop: 10 + col_start: 2 + col_stop: 11 + path: "" + content: "[registers]" diff --git a/tests/expectations/parser/parser/inputs/input_public_success.leo.out b/tests/expectations/parser/parser/inputs/input_public_success.leo.out index 3233085279..a10ffc05f0 100644 --- a/tests/expectations/parser/parser/inputs/input_public_success.leo.out +++ b/tests/expectations/parser/parser/inputs/input_public_success.leo.out @@ -6,7 +6,6 @@ outputs: - name: main definitions: - const_: false - private: false public: true type_: Boolean name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public a: bool = true; \\\"}\"}" @@ -29,7 +28,6 @@ outputs: path: "" content: "public a: bool = true; " - const_: false - private: false public: true type_: IntegerType: U8 @@ -53,7 +51,6 @@ outputs: path: "" content: "public b: u8 = 2; " - const_: false - private: false public: true type_: Field name: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public c: field = 0; \\\"}\"}" @@ -76,7 +73,6 @@ outputs: path: "" content: "public c: field = 0; " - const_: false - private: false public: true type_: Group name: "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public d: group = (0, 1)group; \\\"}\"}" @@ -119,7 +115,6 @@ outputs: path: "" content: "public d: group = (0, 1)group; " - const_: false - private: false public: true type_: Address name: "{\"name\":\"e\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" @@ -151,7 +146,6 @@ outputs: - name: registers definitions: - const_: false - private: false public: false type_: Boolean name: "{\"name\":\"r0\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r0: bool = true; \\\"}\"}" @@ -174,7 +168,6 @@ outputs: path: "" content: "r0: bool = true; " - const_: false - private: false public: false type_: IntegerType: U8 @@ -198,7 +191,6 @@ outputs: path: "" content: "r1: u8 = 2; " - const_: false - private: false public: false type_: Field name: "{\"name\":\"r2\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r2: field = 0; \\\"}\"}" @@ -221,7 +213,6 @@ outputs: path: "" content: "r2: field = 0; " - const_: false - private: false public: false type_: Group name: "{\"name\":\"r3\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r3: group = (0, 1)group; \\\"}\"}" @@ -264,7 +255,6 @@ outputs: path: "" content: "r3: group = (0, 1)group; " - const_: false - private: false public: false type_: Address name: "{\"name\":\"r4\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" diff --git a/tests/parser/functions/const_public_param_fail.leo b/tests/parser/functions/const_public_param_fail.leo new file mode 100644 index 0000000000..9d91630c72 --- /dev/null +++ b/tests/parser/functions/const_public_param_fail.leo @@ -0,0 +1,12 @@ +/* +namespace: Parse +expectation: Fail +*/ + +function x(x: u32, const public y: i32) { + return 0; +} + +function x(const public x: u32, y: i32) { + return 0; +} \ No newline at end of file diff --git a/tests/parser/functions/public_const_param.leo b/tests/parser/functions/public_const_param.leo new file mode 100644 index 0000000000..4188889852 --- /dev/null +++ b/tests/parser/functions/public_const_param.leo @@ -0,0 +1,12 @@ +/* +namespace: Parse +expectation: Pass +*/ + +function x(x: u32, public const y: i32) { + return 0; +} + +function x(public const x: u32, y: i32) { + return 0; +} \ No newline at end of file diff --git a/tests/parser/functions/public_param.leo b/tests/parser/functions/public_param.leo new file mode 100644 index 0000000000..d1674d39fc --- /dev/null +++ b/tests/parser/functions/public_param.leo @@ -0,0 +1,12 @@ +/* +namespace: Parse +expectation: Pass +*/ + +function x(x: u32, public y: i32) { + return 0; +} + +function x(public x: u32, y: i32) { + return 0; +} \ No newline at end of file diff --git a/tests/parser/inputs/input_const_public_fail.leo b/tests/parser/inputs/input_const_public_fail.leo new file mode 100644 index 0000000000..d9721dd77b --- /dev/null +++ b/tests/parser/inputs/input_const_public_fail.leo @@ -0,0 +1,19 @@ +/* +namespace: Input +expectation: Fail +*/ + +[main] +const public a: bool = true; +const public b: u8 = 2; +const public c: field = 0; +const public d: group = (0, 1)group; +const public e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + +[registers] +r0: bool = true; +r1: u8 = 2; +r2: field = 0; +r3: group = (0, 1)group; +r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; + diff --git a/tests/parser/inputs/input_success.leo b/tests/parser/inputs/input_public_const_success.leo similarity index 50% rename from tests/parser/inputs/input_success.leo rename to tests/parser/inputs/input_public_const_success.leo index ada20e1c29..95861807b5 100644 --- a/tests/parser/inputs/input_success.leo +++ b/tests/parser/inputs/input_public_const_success.leo @@ -4,11 +4,11 @@ expectation: Pass */ [main] -private a: bool = true; -private b: u8 = 2; -private c: field = 0; -private d: group = (0, 1)group; -private e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; +public const a: bool = true; +public const b: u8 = 2; +public const c: field = 0; +public const d: group = (0, 1)group; +public const e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; [registers] r0: bool = true; From 1604170adcdc5f2d0f403c388209ef0dc7fa2ee4 Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Tue, 5 Apr 2022 09:38:21 -0700 Subject: [PATCH 08/12] update grammar --- docs/grammar/README.md | Bin 22077 -> 45888 bytes docs/grammar/abnf-grammar.txt | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/grammar/README.md b/docs/grammar/README.md index f2957eb7a8c584f27b8b767942e89afe485afc1e..9584e7ad31facd810fb1a9bd8cd9338ffc113104 100644 GIT binary patch literal 45888 zcmeHQ`Ey*w5uTq@mH%P0DF@qOeaNvLK#+2T?WD>9DiTEzLlGS-vq4vMU>m}}o}|BN zH8b<(=$@w)R;bjLwAb|4J$+5j@!tOD-)rvB9l6);*e%=(_q9896L;OMxf}Gn;_kS+ z?j1MtuU6>)#65C*Zca24w@y?i)PC;v>3QP*><-+vyXAiAe&IFR6V)-j+oxx=-X$DJ#BI)eo4IcxeSuDn&$W{F z@~QjCeM(qQsl|bBwMp8UxKD`l7QI@KY|sUs(c*;uLk{To=*KoEUS~V>+19x%!ubjD z<^Hb^`af|`eDBetP3ql(-W|BN31jYi0xO`G-}>j1^Y16_9(|VfA(ajY&<`|n-6M;h zfd=0aUhpVr^ff*2`IaS)>_2vkm+S}4EQnL^uCKi$&?Pj5{)>%YQp-JWgDvX$gmes@ z@6z)gX$Nw!S4`YzQ9wt~I{5#^Jtp)u;>;W#xj&L5&%89?&))gOzyFBZuG0h7 z{+OsBCAqK>n+O3l;qNBOzJh0D30m%ZEyb&=_mBb z2a$Fl+idW_XYvQhUXgB)&yYo)66z-T)js{_h#XR z5T{d;Y?b8Oq-W6m-9I)dIu6eLG^d#m*2G;S8ShXpK6DSsE1%FOx6eO)OrPU1qfzFL z|Bk<((D#Uc3u3=w|nGb6s0@8BaC1rDh%K-eJMnfrYtbG_H_L5u_6 z(KE22)tP_ZGW5Si9W?O{NhSSTrI_AG^jVh;nF1rmjCuzz+c8L#(*!w?7lItmNK3I@ z>vF)?j=h#P$%7#eBK(xR`k3Uicu9*s$oF9)-x_5qn|vn}b@1A`L6*=q@I}oNYi6A? zq>b|qc@2-^(8@pQHS&T*jv8ew)k-AQ)a1<=!;#Zaef7yxqm1Qw7|HXNNgmFVGm2P5 zmL;PMDFT1wj1{U(LoQjNQE^O;;fe%fHERns6_43BNA+sva|n8g8VBQ=9uvcU<`{a< zS7;0m+PLSlsx{*x+S%vz|H#WNok=}%yGwg{rV<@oG~bAB$8tzDAA219Z7tII;|~Ap z(RkY?ZF{UzwTH|uR#_#9t(jCbSIbUfp)K-|N?9#T#^haBK(G?-JoV*Mx^kWaL@F3Fo3RPQI-3o7YS|MZ)ncHKuz&sKa zqn_d0^sLR$Mk+k^;&ukKwaKyJ>0HC(75<)5Uoh)A^lK$wx#twsty=9%n(zOb#!Ae3 zj>+Pvz)>}0-Qv{0Z&BayGp6S>N)GE<4L7H_;l85zg7gE=`HbeJAK@WgsQPrfm8jTS z0fjBluKqFO338Ww2vTeIXz|dr)}qaAQIb&O(C(k`2zt}-LQ9K%;eD9-viIqhP200g zu>yDK$1?WjfX6ll_6~VAR%T|AJyR@;CF`6tt<)(+!!{{3J~kAKW$F^^R;tso#iq2D zaFg;cuM}ZsA=ar=TI_>4tqo1nqaDejOFNpbTRWEMx>wUP8b5aZh=B1y=6%qAyQWRQ zMedYZR4|rp?;*Zs)nR*yJ-bfJy3zPv6u)22+$|1RrqnO^JUE{K2Fz2ZGqAqj4|CjZwN%C`#Q(JYQN23iV#2lh-La`#2 z4mGFDnZ#?_bCP>$y%tkc{z)WWP)3 z_g%b4_lQ3Eo41@MDdw;*FC?jk5F~xzC4HDkx=E6LXOy%@f3db%0$roL?$Xu=d^go; zz7nQsM5_lhdZ|ma9%+0udP@z?yXiQe!u#JiVe^9ikQ1~s0Cn2nGrTu-&+p!$2F7|h z_VeB``3%-)WM{rdvNByRRlKhWsUDi7!s)43ew@cigmJplF<9D`j(IMzNtWUjt10bf zhS%HCYmCOy24lFqmN7(&h`JP-kJc$I-npPU0#zeMf37Sn>+dBh)@GVjZqk}IR%%0D zV!hO57QKDtb$G*ji_GluXZX78FLMpcCz^(}BWh0mMykO%c^A%)q2lEchtK>-OUQgk z+4z=!*m7FvrDn5OBNi*+loQrsae@eytd=*@_H3EEROi?Ap7*dcW~1&!_QJ^-tlXyB z)8#^?*+O7Rhtk7`xR&S2hkZmo;rcQCjH{aTGp=FM&!l3R(D~e41Npd>N~T#kZEdl0 zOEj0I9bu-?xtZ zylsav2}b-GMX}7|`ZZ$5YH27)a5XfPjt%`{)CuA-$nIecAoZ9$ zAE)ae{qnZyV|gJLkB5->KFvRQTyM_=I3v`@oO0I9`zb3k;q+{OUv&)bFLG$5wags@)ypYV$ZE? zPgy0+&u+oedEKgif|&=n@l_329Vy8^r#4ub#Y)OWIN@X^=2?qN=7ah#oItnrDb0d; zP1Ym3=C3_i5*xC1-tQZlG~=3q#>|O*QlTHf7v}rb9^pWd-t(dZ#`(KyjUBv=&^M= zuvc0;Rw}FPIcd7Zyc1V!>Z7slk#?-$n|F*lMV7KxL%OVecr0%%Q>Hc@Q;DJ8t7Vhr zpljJ;tkhb>kHzhY(y=`3u{D;1JtDv%jn#aF*KDYbR~o(4Y(2Wyc=like_JGIoNXw= z)9wozUptcU)?!HGsL=}_yEkea?MTAgmOC}RHWW+!)ic-AN0T13bew)g;~%akEA7Kh zXw6C63AN-69Yxc-jv#g}_e8@lQ(5fTJ0H|-*^8Lk^UQtkEsFiN2L}7$wCWG$8i?<# zf)&c)>Z9H-oc6}`_$6xYLoH+Cj9`lz6-v7DSwpgTYmHX(p&FgVi+Xx@F-_;X!d)F? zt*6$9Wv(#(6l;s%(UTMV>nm{RjZ};G^+>IGWDl0)&+(q1Ni!Z2w{(V*h`xP_I+dlQ{$r}2(P+NYdq?df^GMA zjh7usc(?L}#;rvg@axs3j$fx0d@bi`JT!VsUO%BLSoZ0}Azx3Tox+P-bKai1U-`KK zvhURWh8}VPWa|D!4_;kPcZa#{`~E&+e4+vzZC? zbnY_P3nx^|EqQn2Ms&i8Tc+7M-{ru)B5-mQyCRxzg|_Tj>512&T+mwS%xO`%T=M zJty`g_(^*A1PJDKE3X}0%%lE4?dJX_@B8SZn6lR&x`)M?o#ID=i*X>0T;%@TR<(u%|0voc-W ztIIm+Z0Qx&-Y^HiogQ%y2YbJ2l-#qHJrUDot>hBt*}6=r#ZZ|_qOvZnhFho1BQ*D^ zxIVXQzC;!KQ~2IC%7;_WJ@zkA#ZrXtZBpP~QhZNkj2pQ6XS>TE+w?41-DlyGL2p41 zJlcf5gl{aqT0+!3szf7xT9QM+3dJ)T#wy{Z6S``p%U8)v!ESa>k$;2nXaJSRG5u!}Ta^NaCz6%0h_ZD=|5vN5n z;x*Op5JCDFpV1dhT4J|`uEj=;PGYXzGabE^C51;#w;FnlPHn^g|kk-w4y_O;v=?(M zSq*yT6(GH(ZJj39v4*T^U8A?yp;y~!d)8@dHATh+o3$Xr2@aQgcBaGXeCDOP$l zC~W)EdL?2oT@SClLp7IrV;`;L;!-b>f6J@*Eon;q!3+`eeO^DqJ-2Z0IQ-5FkDXXa zIq~ab+L&09Q}d4!jbs#yTpGRwL->`nqv4lm1TVF{hLpCpM1!Sodj7MZq_qL6tdiYu zdJR>WR0icXsKK~S2mAq=7EU@QSmH9XMa1997nDHxgV|}Y1lRd0QhyC8ho(G>B zBcI%-_-f0@=RA64yy|h%Z!axc`w=Y}npZfnS97uWvEgvc^!KDEau6+6X{L@>#IBM= zTycz(NQ(-aUNld%p~#5Q-xH00KcXcPc!d_LrdWT(6)>EWdgs|T9F7E=CNIzX`7Ga? zmV(c{y=f`rEaRJ&gHKLcbC{)OwDm}fIva{5(&qm6HZc>xxHEo^X~W@2vqfcZq}fn0 zACMEaHj2xWgU|NzFAU<|Y3*!h@h)4BH1D#ZSiB4SHV5t>(dyns<^?@yG9$pR$!gx+ zW8p9h=#wU#0k=hp#o9d*Xg2S`l4`=%6OFSC#o}%Ji}uU%wjMP0wjLdh^SM5m1&O{{{_$M(SzoHJy;emWG?_J=5fe>7g=ZPL1QoM>CaE&g}Bl}R^QSJ9-}c|lToVg zEuPrZ+vR$~+tjD$#d(Rwr_@)AXO-ym-IWqmoUd%2YOzI+uWCB#!LsNM*H`jspMA0! zb`*8Zjt9dj*NI?1EitVAP`Ej`vS zq@BgqGU{qsQn$4gDYkW>`Mk_2$>1b={L9|KXwWBd<(0+Y8aaSYII|CD025}PAFMl z>@|petY^x1?M#hIg->Dgx=&1{<=`@#T^%8e)mYVu!LMx)sWFvCqaW*kk#6 z%u>|BpXC}LP2(kcO*II znx{Tlb9$CmuHwS@70#HXSNmWFF!tIRyAQM^(0rjq+v^jODf;v)RIJt5azh_W^HOe? z+%xiuGRDslG;Ou1OBrj}haL_?T8lk~G__qU-9}cVICh6Lh~QEU+#Z4Ad9%EhXu}m| zLoPEKuVBkfzgNijh&`cp;p#JFRJr@0)YJVkggJ)A(?V;_=Aor{kgbOrt_?+amh7Z) zDA5R>=vl*%cH_LeWce|^UBY3{wrFvftHnXNwMB=y z|CO;cy;^Z>zPuoRvfQ@@_isT<*2~StS(CJShh|#$ynN!T-hCR!P6>NGsw>Cc`%-v; zFaGis8Tmy6US-`j^**OzJzS%EHr%29J#>#qddwp6$wRl6yn9S7?ozua=MTswWBl;> zJ^BWb4Bx`+9uOAIs`nA0BHT`}5X4_!d5| zOW|G-JwDNk7-at5IHPNE*rsSa^wwOS)MZSO`-i3II{nQbJv+B_kYcf%d8D?YZ5Vxc zk0@?&&Aofs97_JUY#wD>=aHY!Cfm9xd8Iz0VdbNiOG=1RN3>Bl$=T}+N4nni|^ lB`+dH2~Xt6JzwLLQ`l;Tnzb$x%^bZqn~|5sJA4&?{{>XhLQMbw literal 22077 zcmdU1VRPKJ5&eF@0%fPIq?$TOZtNtoolzVs@r;{zEO|Pqok^%Wp2UVCuO!cwn&!Xv zEx;pz$K_dy)tNS#ktOWg#qQe$2!bG=mdooZJHKem*3)fsu($tNe6V+LV2<*%G$+?} zlU~;5c`@6aoL*$LS!8)?@b5CI8dEMzbCH@CK<3$5l~mWe6TpHN0WYdFHFddY-X~T1 zxw$S^W|kDDO6OVKRN2|8fz8Gw#e7;;=CYh;i|Yv*R>eH6Y!^*h!Hu@RufKh5zD|p@ zN^Wk$J~cDH(6nWxG0w?et|*6_CCvVbC#M_ zoi0}Sy$MJ#e|vuV&3CU)&C$2to4*~sdUf>e>Gy{~HWwwN>ATd~$u5_9hWNl{l@!f2 z+@AdP*{i4D0Dtu5^B2!gzlZ1M`1$F#&rVLv@prGxk$HLa>h$^3*DsD**8tGKt&&@av28 zDx0AszOItX%cSZ=9pX`9isUkV9L+A0Dw!dL(UV8hI9uJ+=u z9v&Z?DSmynx3?GX?;YbmW6Ys>U1YOzo+4iSSe9AQ)F4RynxojuOY{2lIQ~@ZP9|Ni z7iE?Gt1Ox%kDKI-x(!I>p)-CZXi^n38kdT?Ja$O&Q_{C6nRl;@Mo2UEqdu4JTlO1-V^ZqIxm4rbWY5ynWBS=`1m}6Kwx@h$~1pRlmQ;npB(IdI7?5Gu_nC+&y)1 z_Pmh)A)H+brJeV^HCC`O^kUJljxo+QQk=8$@)DfUNN-ya;aOhJeg?A^g%qX5JT4cp z?Xqp9-~tVHArOkAiapj*AQVJkl|l(*2q>EFL|CxYjf4>hDGn9GzNsMcPQ{RyDn`5= zb2d&E$hf_Djm)J}Sw&gEjlx}nIl^_jBun+u^MrLjgdeqeBSSZ#*>mnDjC*ifD$xkH z-j!M~E2)`r^B zyk^)UOY=Fwa685=t70ZMrqq01m8&JSWuJ1x{sV5gf50sd{=zN$2LnS3#;`wm$`QAB zAKe(Uw656lYT)8(;NoiF;>x-h-hQo?%e0y$bsEDL%$`(KESBV7{bfJ?#N9_7#eb*L z$;NfqPhGkOMR|u$adp%ViLAFRa6I8oIaz&Mt9# zJI~HDUQ`4!O9t*|?z?;3z4$XCqnycYvS!DVbXMH$-Cq2VtX!m5NzgCld?1I#0FNb4 zltl9L%>JC&pL6>&wLek#w#>TKX`s*i1wtY(n`0%GVbF7B_5!%q7R1ih`nT!O;~yil z-3=>ykvX(?rkESCN3)*Xa5It^nZ{CV#pPJ<%66JGV&iXrcXyZKavgI(u9YGwR+nOo z$ZlH^!~Rad10`)$)Y*BF&M}Q!pU4c0VQ+1DOD1N_Ajp^ef|;ZJ4Kqgj8)k~N6q6We z3X|7b;wal@3Ui~Ip^%-#OzhmqIw!Nv$*glSlWFYZoU|8_5h??j=OV~!uRR~Z&ax`! zt63A<3(<%JDkgNKy^ei^BW;O~xIj{Lj_8|eWkA(!7mI2*$%Y;azv#w&X~M139|%_X*4Z5T|)6H+}((#=@u)kB(8GTv2>KSkaf! z*c!D-v%x4%sz`2tyj{XzYbBf?y_L8@I%?TrPvhQrTF;VYx=|;oXIXYTm6h8?9x8>^ zu3Kg@b(ExFBM)q5BiJQW<%aEyP-qt!BVn_NF?y&}f)u+%QIRMJlt=V73d$cfaA@AP zd&J%4+}C9XeHl3w>@liNDTvl7U*en^tTDXpb9TztCa1bh(OC6}#nzp-yzk!MT&YG_ z3?rCD-{N*4oI+_6PxnX%wI*>R6q*co&UA|^rZtEgl+a+Y%JaeCq}oz3mbpDPH!>v1 z;0OvP{c>xg8=aAGN%3mr!)VU^2E&};4NyIQ8x+*^Y{0AR({+qP;{n5RnWA*ZSyM-e zzCu1LD-h9C8DL!%B-)%CR%E&8s2sAQ3KDIlC|Os5(8Q!)yJ%qOpmywD;o(Yu%V-8S zc2pAsIr}^SNUUBDjQ2zo+t^i%q8o#?@vVM|aNG1?;FgJg9ZWMgQBjBUbc|h!Y(Ir)81i8^6)Y?$*n?DNd8zW=%K6c@=vsU~tVK z&UCZPo{q93c2oFlW+PW_1pkjM=P_kp zMmLf}0NoZ20sZYpyYn%Ggd>8>%57AyiQ__`{w4L~Gi#7oGzLDh&Hx}<0mG~j2nDSY z&RQx+w8Lz(S}3*nU`8C^1F7J--dKa>Jn>y$p5e(scH{5I zYT6rR{Bh4V?Yf`tpF{h{=l16pJ~noq{phvfreNFO+vzqtn)2tA&m`G4(9>>Rwq8t4 zzcbo3h4Vw#>=@<&6HGLm$k39czVD8)y+m-Wn+$53ZPD3;Gr&1X1(T;&*s7s|agAWa zF@w_--6Q(`gaSp|Lb%hmS-i5wSZ*6d+8bs_FLAziC+~2i;^Z0!-td5GHg+s8j=ggi z-Qa1immG5-L+GfW+wAo^Ho7uvCjzA(PvUyH&1Nn2f`ftSIUdw2-S{H(6Gqovv_z5e z==sNq@I;caz$Rk@A=R9lk`)? z;(Rh5np#cFSbc}YVUJ>3dWkUD8(>^75uEP?BYhe1yuQFHT=^o$mb5U{>ub7Vz!y0K zZ42Azuh@!}Q0VMP8yms?Xr8Eb?n$6-g1E544zrD%1%6{G<;VX?#l!ly2(Bc%2waP{qIP)q0og^#APinLja=g7kKL>u>Z(NPJG&D)w)n>weQYE{n9!#(syDO?WvwP zsm}2<9q$)VrS$fggkB<5F*L;ZAwu+eUl`v@1lI=6pthN~A9h9D4*~5^f8!H~!w+)% z(Fba_WuijU5BOi`4X30Y$Zqx$@^n>ftPvL5alv&pEC$S-xWQv(6^B`OfD5A<)+t9f zL`cTiENiixm;q&FAtzOEKBuRT@~DHr5*r`J?uLZyrG*)=x2%$LrT1aJ6%fa%o4Nyr zE?0Sz;SH@B-ZFcaj*~Qs15dhhV{C!5sTnsX$B6INAodVO42CtTgKnOQ(U{o8D3Gcb ztHNw^RulyCF=}5;iCx8VKX%=8Cw4G5jN1tlphUyeDG(V1qdl+}-hs22>Eq3xB%RguCZd9O3cp6Dp@ z3U3zU+X+}HlT%$gd~)wV$ZJ{->SbnX-eJosk=LYgIux60_L~I(0B%4NuRLx5bRp|~ zGf%DyY>CBT+O% zz*>vx*Ay8ex*_kZ6-ouqg~A#v7agsBSWm-H9b1m6hHV?_H^PHK92#k>S2>Krevus( z!z8xrT&q9FnCS2hZtAsQ$srBmoWh$9k+%(GWD>Odv=J5^{S5S5Jw?9yjTO#PFOj@T zuZ)m3%9}PjP_!DvMQbJhU-9DmGsTQQuHYJ7OxYqxl&xW!pllm+Ya505KFbX0CBq~P zXW(HLh8Vc)eD`MjaJR4x4dcbWJLulkzA;*z3vb1S>z|o$t-_Yt1H)AiaTv~qL|!O# ziI$fnwV^sB2jpc%P!-WG&NB4r9IE`6%I5CJzjqgsNF%@F+A_ zE(5-p1My{4{k~|#Dcd17N@{!tL%x5J=V94S@z4fOp`9eW)A4lJCr>1#_9htEOUQN4 z0(tI99FeX8JZ|};?{4<;oqy{`3*<>Cbk3wzB{PV9i!d+Gc{n(g?!k;|u#>`~#1tOf zGiK8xjNt=}P@DM=rIdp{IjWy+=@1JPAzc%o;Or`wPR`y}0j;xltfOXulw2 zg($LlI|HDmD3Q)F%1!8MbdfqLHFVP8@bnz=@kq6AJp|i zI9K-6vV*|;lwhhZA=ZAWs&e(v$Hkr%eREeOksf5z{) ztS<3U!xMW}cKn>5e233F>n8`(v05B_Kdx(+F^rG!;e!d7iLV~I4~ji})_#XC7>0+q z_|8*&`%%6{g^xSfPcFK75yvhtij8|&4T!3o;jw=@$JZaPX6dpqzsO7PzdA;{B@dR6 z2nkyo_K5|G1Rp=d2Pc^w9R8P=B(eB5zDYqz*oiN5W*^|kC0M>&LrT_o{ diff --git a/docs/grammar/abnf-grammar.txt b/docs/grammar/abnf-grammar.txt index ba86642858..6181893379 100644 --- a/docs/grammar/abnf-grammar.txt +++ b/docs/grammar/abnf-grammar.txt @@ -313,7 +313,7 @@ function-declaration = %s"function" identifier function-parameters = function-parameter *( "," function-parameter ) [ "," ] -function-parameter = [ %s"const" ] identifier ":" type +function-parameter = [ %s"public" ] [ %s"const" ] identifier ":" type declaration = function-declaration From cc5552c7efe387c49fe9725fbc960a7b2182e31c Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Wed, 6 Apr 2022 10:20:43 -0700 Subject: [PATCH 09/12] make suggested changes --- .../ast/src/functions/input/function_input.rs | 37 +++++++++++-------- compiler/ast/src/input/definition.rs | 5 +-- .../ast/src/reducer/reconstructing_reducer.rs | 4 +- compiler/parser/src/parser/file.rs | 19 +++++++--- compiler/parser/src/parser/input.rs | 6 +-- leo/errors/src/parser/parser_errors.rs | 8 ++++ leo/span/src/symbol.rs | 2 +- 7 files changed, 49 insertions(+), 32 deletions(-) diff --git a/compiler/ast/src/functions/input/function_input.rs b/compiler/ast/src/functions/input/function_input.rs index 0da279d029..4aa10eec78 100644 --- a/compiler/ast/src/functions/input/function_input.rs +++ b/compiler/ast/src/functions/input/function_input.rs @@ -20,17 +20,32 @@ use leo_span::Span; use serde::{Deserialize, Serialize}; use std::fmt; +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +pub enum ParamMode { + Const, + Private, + Public, +} + +impl fmt::Display for ParamMode { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + use ParamMode::*; + + match self { + Const => write!(f, "const"), + Private => write!(f, "private"), + Public => write!(f, "public"), + } + } +} + /// A function parameter. #[derive(Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct FunctionInputVariable { /// The name the parameter is accessible as in the function's body. pub identifier: Identifier, /// Is it a const parameter? - pub const_: bool, - /// Is it a public parameter? - pub public: bool, - /// Is it a mutable parameter? - pub mutable: bool, + pub mode: ParamMode, /// What's the parameter's type? pub type_: Type, /// The parameters span from any annotations to its type. @@ -39,17 +54,7 @@ pub struct FunctionInputVariable { impl FunctionInputVariable { fn format(&self, f: &mut fmt::Formatter) -> fmt::Result { - if self.public { - write!(f, "public ")?; - } else { - write!(f, "private ")?; - } - if self.const_ { - write!(f, "const ")?; - } - if self.mutable { - write!(f, "mut ")?; - } + write!(f, "{} ", self.mode)?; write!(f, "{}: ", self.identifier)?; write!(f, "{}", self.type_) } diff --git a/compiler/ast/src/input/definition.rs b/compiler/ast/src/input/definition.rs index 9090111b5e..6be63b04d3 100644 --- a/compiler/ast/src/input/definition.rs +++ b/compiler/ast/src/input/definition.rs @@ -15,14 +15,13 @@ // along with the Leo library. If not, see . use super::*; -use crate::{Expression, Identifier, Type}; +use crate::{Expression, Identifier, ParamMode, Type}; /// A single definition inside a section in a state or an input file. /// Definitions should be structured as: `: = ;` #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Definition { - pub const_: bool, - pub public: bool, + pub mode: ParamMode, pub type_: Type, pub name: Identifier, pub value: Expression, diff --git a/compiler/ast/src/reducer/reconstructing_reducer.rs b/compiler/ast/src/reducer/reconstructing_reducer.rs index 1af16ec488..d47053ad4e 100644 --- a/compiler/ast/src/reducer/reconstructing_reducer.rs +++ b/compiler/ast/src/reducer/reconstructing_reducer.rs @@ -274,9 +274,7 @@ pub trait ReconstructingReducer { ) -> Result { Ok(FunctionInputVariable { identifier, - const_: variable.const_, - mutable: variable.mutable, - public: variable.public, + mode: variable.mode, type_, span: variable.span.clone(), }) diff --git a/compiler/parser/src/parser/file.rs b/compiler/parser/src/parser/file.rs index 8fc836d74e..effb6b13a3 100644 --- a/compiler/parser/src/parser/file.rs +++ b/compiler/parser/src/parser/file.rs @@ -61,12 +61,23 @@ impl ParserContext<'_> { ) } + pub fn parse_function_parameter_mode(&mut self) -> Result { + let public = self.eat(Token::Public); + let const_ = self.eat(Token::Const); + + match (public, const_) { + (None, Some(_)) => Ok(ParamMode::Const), + (None, None) => Ok(ParamMode::Private), + (Some(_), None) => Ok(ParamMode::Public), + (Some(p), Some(c)) => Err(ParserError::inputs_multiple_variable_types_specified(&(p.span + c.span)).into()), + } + } + /// /// Returns a [`FunctionInput`] AST node if the next tokens represent a function parameter. /// pub fn parse_function_parameters(&mut self) -> Result { - let public = self.eat(Token::Public).is_some(); - let const_ = self.eat(Token::Const); + let mode = self.parse_function_parameter_mode()?; let mutable = self.eat(Token::Mut); let name = self.expect_ident()?; @@ -78,9 +89,7 @@ impl ParserContext<'_> { self.expect(Token::Colon)?; let type_ = self.parse_type()?.0; Ok(FunctionInput::Variable(FunctionInputVariable { - const_: const_.is_some(), - mutable: const_.is_none(), - public, + mode, type_, span: name.span.clone(), identifier: name, diff --git a/compiler/parser/src/parser/input.rs b/compiler/parser/src/parser/input.rs index 8750b7d3c3..2c0b68d6f8 100644 --- a/compiler/parser/src/parser/input.rs +++ b/compiler/parser/src/parser/input.rs @@ -67,8 +67,7 @@ impl ParserContext<'_> { /// ` : = ;` /// Returns [`Definition`]. pub fn parse_input_definition(&mut self) -> Result { - let public = self.eat(Token::Public).is_some(); - let const_ = self.eat(Token::Const).is_some(); + let mode = self.parse_function_parameter_mode()?; let name = self.expect_ident()?; self.expect(Token::Colon)?; @@ -78,8 +77,7 @@ impl ParserContext<'_> { self.expect(Token::Semicolon)?; Ok(Definition { - const_, - public, + mode, name, type_, value, diff --git a/leo/errors/src/parser/parser_errors.rs b/leo/errors/src/parser/parser_errors.rs index 9ce55319ca..217e305152 100644 --- a/leo/errors/src/parser/parser_errors.rs +++ b/leo/errors/src/parser/parser_errors.rs @@ -358,4 +358,12 @@ create_errors!( msg: format!("Found the char `{}`, but expected `{}`", found, expected), help: None, } + + /// For when a user specified more than a type on a parameter. + @formatted + inputs_multiple_variable_types_specified { + args: (), + msg: "A parameter cannot be both public and const.", + help: None, + } ); diff --git a/leo/span/src/symbol.rs b/leo/span/src/symbol.rs index 20d0b91200..095f0f83b6 100644 --- a/leo/span/src/symbol.rs +++ b/leo/span/src/symbol.rs @@ -131,7 +131,7 @@ symbols! { main, Mut: "mut", prelude, - Public: "public", + Public, Return: "return", Star: "*", std, From 3936e6c202dcafba923c4d450585b4fff4a32ba1 Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Wed, 6 Apr 2022 10:23:20 -0700 Subject: [PATCH 10/12] doc new fn, test updates --- compiler/parser/src/parser/file.rs | 3 + .../parser/parser/circuits/big_self.leo.out | 57 -- .../parser/circuits/const_functions.leo.out | 253 ------- .../parser/parser/circuits/consts.leo.out | 165 ----- .../parser/circuits/consts_fail.leo.out | 5 - .../parser/parser/circuits/empty.leo.out | 15 - .../circuits/field_and_functions.leo.out | 116 --- .../parser/parser/circuits/fields.leo.out | 21 - .../parser/circuits/fields_fail.leo.out | 5 - .../parser/parser/circuits/functions.leo.out | 138 ---- .../parser/circuits/mixed_order_fail.leo.out | 5 - .../parser/parser/circuits/mut_self.leo.out | 56 -- .../parser/circuits/mut_self_fail.leo.out | 5 - .../parser/parser/circuits/ref_self.leo.out | 57 -- .../parser/parser/circuits/self.leo.out | 57 -- .../circuits/self_not_first_fail.leo.out | 5 - .../parser/circuits/struct_fail.leo.out | 5 - .../circuits/token_circuit_name.leo.out | 15 - .../parser/parser/circuits/types_fail.leo.out | 5 - .../expression/access/array_access.leo.out | 254 ------- .../access/array_range_access.leo.out | 446 ------------ .../parser/expression/access/circuit.leo.out | 103 --- .../expression/access/circuit_static.leo.out | 137 ---- .../parser/expression/access/tuple.leo.out | 118 --- .../parser/expression/array_init.leo.out | 157 ---- .../parser/expression/array_inline.leo.out | 334 --------- .../parser/expression/array_len.leo.out | 245 ------- .../parser/parser/expression/cast.leo.out | 187 ----- .../parser/expression/circuit_init.leo.out | 113 --- .../parser/expression/literal/access.leo.out | 618 ---------------- .../expression/literal/static_fail.leo.out | 19 - .../expression/literal/string_parse.leo.out | 200 ------ .../parser/parser/expression/tuple.leo.out | 98 --- .../parser/parser/functions/annotated.leo.out | 217 ------ .../annotated_arg_not_ident_int.leo.out | 5 - .../parser/functions/annotated_fail.leo.out | 5 - .../parser/functions/annotated_param.leo.out | 63 -- .../parser/functions/annotated_twice.leo.out | 72 -- .../functions/bounded_recursion.leo.out | 8 +- .../functions/bounded_recursion_fail.leo.out | 208 ------ .../parser/functions/const_param.leo.out | 16 +- .../parser/functions/const_self_bad.leo.out | 53 -- .../parser/parser/functions/empty.leo.out | 47 -- .../functions/infinite_recursion.leo.out | 4 +- .../functions/infinite_recursion_fail.leo.out | 120 ---- .../parser/parser/functions/mut_input.leo.out | 5 - .../parser/functions/param_array.leo.out | 66 -- .../parser/functions/param_circuit.leo.out | 64 -- .../parser/functions/param_tuple.leo.out | 62 -- .../parser/parser/functions/params.leo.out | 8 +- .../parser/functions/params_return.leo.out | 8 +- .../functions/public_const_param.leo.out | 145 ---- .../functions/public_const_param_fail.leo.out | 5 + .../parser/functions/public_param.leo.out | 16 +- .../parser/functions/return_tuple.leo.out | 50 -- .../parser/parser/import/alias.leo.out | 25 - .../parser/parser/import/basic.leo.out | 46 -- .../import/import_empty_list_fail.leo.out | 6 - .../parser/parser/import/invalid.leo.out | 5 - .../parser/import/invalid_chars_fail.leo.out | 6 - .../parser/parser/import/keyword_fail.leo.out | 6 - .../parser/parser/import/many_import.leo.out | 130 ---- .../parser/import/many_import_star.leo.out | 137 ---- .../parser/parser/import/names.leo.out | 67 -- .../parser/import/names_underscore.leo.out | 25 - .../parser/parser/import/star.leo.out | 5 - ...st_success.leo.out => input_const.leo.out} | 30 +- .../inputs/input_const_section_fail .leo.out | 5 - ...c_success.leo.out => input_public.leo.out} | 30 +- .../inputs/input_public_const_fail.leo.out | 5 + .../inputs/input_public_const_success.leo.out | 285 -------- .../parser/inputs/input_success.leo.out | 295 -------- .../serialize/linear_regression.leo.out | 677 ------------------ .../parser/serialize/palindrome.leo.out | 547 -------------- .../parser/serialize/pedersen_hash.leo.out | 169 ----- .../parser/parser/statement/alias.leo.out | 42 -- .../parser/statement/global_const.leo.out | 106 --- .../statement/test_keyword_fail.leo.out | 5 - .../unreachable/eat_ident_bad_ident.leo.out | 5 - .../parser/unreachable/eat_ident_semi.leo.out | 5 - .../unreachable/equality_expression.leo.out | 52 -- .../parser/parser/unreachable/math_op.leo.out | 6 - .../parser/parser/unreachable/postfix.leo.out | 5 - ..._param.leo => public_const_param_fail.leo} | 2 +- ...nput_const_success.leo => input_const.leo} | 0 ...ut_public_success.leo => input_public.leo} | 0 ...uccess.leo => input_public_const_fail.leo} | 2 +- 87 files changed, 50 insertions(+), 7945 deletions(-) delete mode 100644 tests/expectations/parser/parser/circuits/big_self.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/const_functions.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/consts.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/consts_fail.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/empty.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/field_and_functions.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/fields.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/fields_fail.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/functions.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/mixed_order_fail.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/mut_self.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/mut_self_fail.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/ref_self.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/self.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/self_not_first_fail.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/struct_fail.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/token_circuit_name.leo.out delete mode 100644 tests/expectations/parser/parser/circuits/types_fail.leo.out delete mode 100644 tests/expectations/parser/parser/expression/access/array_access.leo.out delete mode 100644 tests/expectations/parser/parser/expression/access/array_range_access.leo.out delete mode 100644 tests/expectations/parser/parser/expression/access/circuit.leo.out delete mode 100644 tests/expectations/parser/parser/expression/access/circuit_static.leo.out delete mode 100644 tests/expectations/parser/parser/expression/access/tuple.leo.out delete mode 100644 tests/expectations/parser/parser/expression/array_init.leo.out delete mode 100644 tests/expectations/parser/parser/expression/array_inline.leo.out delete mode 100644 tests/expectations/parser/parser/expression/array_len.leo.out delete mode 100644 tests/expectations/parser/parser/expression/cast.leo.out delete mode 100644 tests/expectations/parser/parser/expression/circuit_init.leo.out delete mode 100644 tests/expectations/parser/parser/expression/literal/access.leo.out delete mode 100644 tests/expectations/parser/parser/expression/literal/static_fail.leo.out delete mode 100644 tests/expectations/parser/parser/expression/literal/string_parse.leo.out delete mode 100644 tests/expectations/parser/parser/expression/tuple.leo.out delete mode 100644 tests/expectations/parser/parser/functions/annotated.leo.out delete mode 100644 tests/expectations/parser/parser/functions/annotated_arg_not_ident_int.leo.out delete mode 100644 tests/expectations/parser/parser/functions/annotated_fail.leo.out delete mode 100644 tests/expectations/parser/parser/functions/annotated_param.leo.out delete mode 100644 tests/expectations/parser/parser/functions/annotated_twice.leo.out delete mode 100644 tests/expectations/parser/parser/functions/bounded_recursion_fail.leo.out delete mode 100644 tests/expectations/parser/parser/functions/const_self_bad.leo.out delete mode 100644 tests/expectations/parser/parser/functions/empty.leo.out delete mode 100644 tests/expectations/parser/parser/functions/infinite_recursion_fail.leo.out delete mode 100644 tests/expectations/parser/parser/functions/mut_input.leo.out delete mode 100644 tests/expectations/parser/parser/functions/param_array.leo.out delete mode 100644 tests/expectations/parser/parser/functions/param_circuit.leo.out delete mode 100644 tests/expectations/parser/parser/functions/param_tuple.leo.out delete mode 100644 tests/expectations/parser/parser/functions/public_const_param.leo.out create mode 100644 tests/expectations/parser/parser/functions/public_const_param_fail.leo.out delete mode 100644 tests/expectations/parser/parser/functions/return_tuple.leo.out delete mode 100644 tests/expectations/parser/parser/import/alias.leo.out delete mode 100644 tests/expectations/parser/parser/import/basic.leo.out delete mode 100644 tests/expectations/parser/parser/import/import_empty_list_fail.leo.out delete mode 100644 tests/expectations/parser/parser/import/invalid.leo.out delete mode 100644 tests/expectations/parser/parser/import/invalid_chars_fail.leo.out delete mode 100644 tests/expectations/parser/parser/import/keyword_fail.leo.out delete mode 100644 tests/expectations/parser/parser/import/many_import.leo.out delete mode 100644 tests/expectations/parser/parser/import/many_import_star.leo.out delete mode 100644 tests/expectations/parser/parser/import/names.leo.out delete mode 100644 tests/expectations/parser/parser/import/names_underscore.leo.out delete mode 100644 tests/expectations/parser/parser/import/star.leo.out rename tests/expectations/parser/parser/inputs/{input_const_success.leo.out => input_const.leo.out} (95%) delete mode 100644 tests/expectations/parser/parser/inputs/input_const_section_fail .leo.out rename tests/expectations/parser/parser/inputs/{input_public_success.leo.out => input_public.leo.out} (95%) create mode 100644 tests/expectations/parser/parser/inputs/input_public_const_fail.leo.out delete mode 100644 tests/expectations/parser/parser/inputs/input_public_const_success.leo.out delete mode 100644 tests/expectations/parser/parser/inputs/input_success.leo.out delete mode 100644 tests/expectations/parser/parser/serialize/linear_regression.leo.out delete mode 100644 tests/expectations/parser/parser/serialize/palindrome.leo.out delete mode 100644 tests/expectations/parser/parser/serialize/pedersen_hash.leo.out delete mode 100644 tests/expectations/parser/parser/statement/alias.leo.out delete mode 100644 tests/expectations/parser/parser/statement/global_const.leo.out delete mode 100644 tests/expectations/parser/parser/statement/test_keyword_fail.leo.out delete mode 100644 tests/expectations/parser/parser/unreachable/eat_ident_bad_ident.leo.out delete mode 100644 tests/expectations/parser/parser/unreachable/eat_ident_semi.leo.out delete mode 100644 tests/expectations/parser/parser/unreachable/equality_expression.leo.out delete mode 100644 tests/expectations/parser/parser/unreachable/math_op.leo.out delete mode 100644 tests/expectations/parser/parser/unreachable/postfix.leo.out rename tests/parser/functions/{public_const_param.leo => public_const_param_fail.leo} (88%) rename tests/parser/inputs/{input_const_success.leo => input_const.leo} (100%) rename tests/parser/inputs/{input_public_success.leo => input_public.leo} (100%) rename tests/parser/inputs/{input_public_const_success.leo => input_public_const_fail.leo} (96%) diff --git a/compiler/parser/src/parser/file.rs b/compiler/parser/src/parser/file.rs index effb6b13a3..c1211d93ba 100644 --- a/compiler/parser/src/parser/file.rs +++ b/compiler/parser/src/parser/file.rs @@ -61,6 +61,9 @@ impl ParserContext<'_> { ) } + /// + /// Returns a [`ParamMode`] AST node if the next tokens represent a function parameter mode. + /// pub fn parse_function_parameter_mode(&mut self) -> Result { let public = self.eat(Token::Public); let const_ = self.eat(Token::Const); diff --git a/tests/expectations/parser/parser/circuits/big_self.leo.out b/tests/expectations/parser/parser/circuits/big_self.leo.out deleted file mode 100644 index 8d6223649f..0000000000 --- a/tests/expectations/parser/parser/circuits/big_self.leo.out +++ /dev/null @@ -1,57 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" - members: - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x() -> Self {\\\"}\"}" - input: [] - const_: false - output: SelfType - core_mapping: ~ - block: - statements: - - Return: - expression: - CircuitInit: - name: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self {};\\\"}\"}" - members: [] - span: - line_start: 5 - line_stop: 5 - col_start: 16 - col_stop: 23 - path: "" - content: " return Self {};" - span: - line_start: 5 - line_stop: 5 - col_start: 9 - col_stop: 23 - path: "" - content: " return Self {};" - span: - line_start: 4 - line_stop: 6 - col_start: 26 - col_stop: 6 - path: "" - content: " function x() -> Self {\n ...\n }" - span: - line_start: 4 - line_stop: 6 - col_start: 5 - col_stop: 6 - path: "" - content: " function x() -> Self {\n ...\n }" - global_consts: {} - functions: {} diff --git a/tests/expectations/parser/parser/circuits/const_functions.leo.out b/tests/expectations/parser/parser/circuits/const_functions.leo.out deleted file mode 100644 index 0cd2d5e744..0000000000 --- a/tests/expectations/parser/parser/circuits/const_functions.leo.out +++ /dev/null @@ -1,253 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" - members: - - CircuitVariable: - - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x: u32\\\"}\"}" - - IntegerType: U32 - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function x() { \\\"}\"}" - input: [] - const_: true - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 6 - line_stop: 6 - col_start: 16 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 6 - line_stop: 6 - col_start: 9 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 5 - line_stop: 7 - col_start: 24 - col_stop: 6 - path: "" - content: " const function x() { \n ...\n }" - span: - line_start: 5 - line_stop: 7 - col_start: 11 - col_stop: 6 - path: "" - content: " const function x() { \n ...\n }" - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function x(self) { \\\"}\"}" - input: - - SelfKeyword: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":22,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function x(self) { \\\"}\"}" - const_: true - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 9 - line_stop: 9 - col_start: 16 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 9 - line_stop: 9 - col_start: 9 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 8 - line_stop: 10 - col_start: 28 - col_stop: 6 - path: "" - content: " const function x(self) { \n ...\n }" - span: - line_start: 8 - line_stop: 10 - col_start: 11 - col_stop: 6 - path: "" - content: " const function x(self) { \n ...\n }" - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function c(const self) { \\\"}\"}" - input: - - ConstSelfKeyword: "{\"name\":\"const self\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":22,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function c(const self) { \\\"}\"}" - const_: true - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 12 - line_stop: 12 - col_start: 16 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 12 - line_stop: 12 - col_start: 9 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 11 - line_stop: 13 - col_start: 34 - col_stop: 6 - path: "" - content: " const function c(const self) { \n ...\n }" - span: - line_start: 11 - line_stop: 13 - col_start: 11 - col_stop: 6 - path: "" - content: " const function c(const self) { \n ...\n }" - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function b(const self, x: u32) {\\\"}\"}" - input: - - ConstSelfKeyword: "{\"name\":\"const self\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":22,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function b(const self, x: u32) {\\\"}\"}" - - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":34,\\\"col_stop\\\":35,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function b(const self, x: u32) {\\\"}\"}" - const_: false - mutable: true - type_: - IntegerType: U32 - span: - line_start: 14 - line_stop: 14 - col_start: 34 - col_stop: 35 - path: "" - content: " const function b(const self, x: u32) {" - const_: true - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 15 - line_stop: 15 - col_start: 16 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 15 - line_stop: 15 - col_start: 9 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 14 - line_stop: 16 - col_start: 42 - col_stop: 6 - path: "" - content: " const function b(const self, x: u32) {\n ...\n }" - span: - line_start: 14 - line_stop: 16 - col_start: 11 - col_stop: 6 - path: "" - content: " const function b(const self, x: u32) {\n ...\n }" - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":17,\\\"line_stop\\\":17,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function b(const self, const x: u32) {\\\"}\"}" - input: - - ConstSelfKeyword: "{\"name\":\"const self\",\"span\":\"{\\\"line_start\\\":17,\\\"line_stop\\\":17,\\\"col_start\\\":22,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function b(const self, const x: u32) {\\\"}\"}" - - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":17,\\\"line_stop\\\":17,\\\"col_start\\\":40,\\\"col_stop\\\":41,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function b(const self, const x: u32) {\\\"}\"}" - const_: true - mutable: false - type_: - IntegerType: U32 - span: - line_start: 17 - line_stop: 17 - col_start: 40 - col_stop: 41 - path: "" - content: " const function b(const self, const x: u32) {" - const_: true - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 18 - line_stop: 18 - col_start: 16 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 18 - line_stop: 18 - col_start: 9 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 17 - line_stop: 19 - col_start: 48 - col_stop: 6 - path: "" - content: " const function b(const self, const x: u32) {\n ...\n }" - span: - line_start: 17 - line_stop: 19 - col_start: 11 - col_stop: 6 - path: "" - content: " const function b(const self, const x: u32) {\n ...\n }" - global_consts: {} - functions: {} diff --git a/tests/expectations/parser/parser/circuits/consts.leo.out b/tests/expectations/parser/parser/circuits/consts.leo.out deleted file mode 100644 index b641879948..0000000000 --- a/tests/expectations/parser/parser/circuits/consts.leo.out +++ /dev/null @@ -1,165 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" - members: - - CircuitConst: - - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const x: u32 = 2;\\\"}\"}" - - IntegerType: U32 - - Value: - Implicit: - - "2" - - span: - line_start: 4 - line_stop: 4 - col_start: 27 - col_stop: 28 - path: "" - content: " static const x: u32 = 2;" - - CircuitConst: - - "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const y: u32 = 5;\\\"}\"}" - - IntegerType: U32 - - Value: - Implicit: - - "5" - - span: - line_start: 5 - line_stop: 5 - col_start: 27 - col_stop: 28 - path: "" - content: " static const y: u32 = 5;" - - CircuitConst: - - "{\"name\":\"G\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const G: u8 = G;\\\"}\"}" - - IntegerType: U8 - - Identifier: "{\"name\":\"G\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const G: u8 = G;\\\"}\"}" - - CircuitConst: - - "{\"name\":\"FOO\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":18,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const FOO: Foo = Foo {};\\\"}\"}" - - Identifier: "{\"name\":\"Foo\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":23,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const FOO: Foo = Foo {};\\\"}\"}" - - CircuitInit: - name: "{\"name\":\"Foo\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":29,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const FOO: Foo = Foo {};\\\"}\"}" - members: [] - span: - line_start: 7 - line_stop: 7 - col_start: 29 - col_stop: 35 - path: "" - content: " static const FOO: Foo = Foo {};" - - CircuitConst: - - "{\"name\":\"INDEXED\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":18,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const INDEXED: Foo = A[0];\\\"}\"}" - - Identifier: "{\"name\":\"Foo\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":27,\\\"col_stop\\\":30,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const INDEXED: Foo = A[0];\\\"}\"}" - - Access: - Array: - array: - Identifier: "{\"name\":\"A\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":33,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const INDEXED: Foo = A[0];\\\"}\"}" - index: - Value: - Implicit: - - "0" - - span: - line_start: 8 - line_stop: 8 - col_start: 35 - col_stop: 36 - path: "" - content: " static const INDEXED: Foo = A[0];" - span: - line_start: 8 - line_stop: 8 - col_start: 33 - col_stop: 37 - path: "" - content: " static const INDEXED: Foo = A[0];" - - CircuitConst: - - "{\"name\":\"TINDEXED\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":18,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const TINDEXED: Foo = T.0;\\\"}\"}" - - Identifier: "{\"name\":\"Foo\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":28,\\\"col_stop\\\":31,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const TINDEXED: Foo = T.0;\\\"}\"}" - - Access: - Tuple: - tuple: - Identifier: "{\"name\":\"T\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":34,\\\"col_stop\\\":35,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const TINDEXED: Foo = T.0;\\\"}\"}" - index: - value: "0" - span: - line_start: 9 - line_stop: 9 - col_start: 34 - col_stop: 37 - path: "" - content: " static const TINDEXED: Foo = T.0;" - - CircuitConst: - - "{\"name\":\"TWO\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":18,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const TWO: i8 = 1i8 + 1i8;\\\"}\"}" - - IntegerType: I8 - - Binary: - left: - Value: - Integer: - - I8 - - "1" - - span: - line_start: 10 - line_stop: 10 - col_start: 28 - col_stop: 31 - path: "" - content: " static const TWO: i8 = 1i8 + 1i8;" - right: - Value: - Integer: - - I8 - - "1" - - span: - line_start: 10 - line_stop: 10 - col_start: 34 - col_stop: 37 - path: "" - content: " static const TWO: i8 = 1i8 + 1i8;" - op: Add - span: - line_start: 10 - line_stop: 10 - col_start: 28 - col_stop: 37 - path: "" - content: " static const TWO: i8 = 1i8 + 1i8;" - - CircuitConst: - - "{\"name\":\"mult\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":18,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const mult: i8 = x * y;\\\"}\"}" - - IntegerType: I8 - - Binary: - left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":29,\\\"col_stop\\\":30,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const mult: i8 = x * y;\\\"}\"}" - right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":33,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const mult: i8 = x * y;\\\"}\"}" - op: Mul - span: - line_start: 11 - line_stop: 11 - col_start: 29 - col_stop: 34 - path: "" - content: " static const mult: i8 = x * y;" - - CircuitConst: - - "{\"name\":\"mult\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":18,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const mult: i8 = one();\\\"}\"}" - - IntegerType: I8 - - Call: - function: - Identifier: "{\"name\":\"one\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":29,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const mult: i8 = one();\\\"}\"}" - arguments: [] - span: - line_start: 12 - line_stop: 12 - col_start: 29 - col_stop: 34 - path: "" - content: " static const mult: i8 = one();" - global_consts: {} - functions: {} diff --git a/tests/expectations/parser/parser/circuits/consts_fail.leo.out b/tests/expectations/parser/parser/circuits/consts_fail.leo.out deleted file mode 100644 index 9614d661e4..0000000000 --- a/tests/expectations/parser/parser/circuits/consts_fail.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - "Error [EPAR0370000]: Function calls not allowed in circuit members.\n --> test:4:27\n |\n 4 | static const x: u32 = foo();\n | ^^^^^" diff --git a/tests/expectations/parser/parser/circuits/empty.leo.out b/tests/expectations/parser/parser/circuits/empty.leo.out deleted file mode 100644 index eb759bfecd..0000000000 --- a/tests/expectations/parser/parser/circuits/empty.leo.out +++ /dev/null @@ -1,15 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" - members: [] - global_consts: {} - functions: {} diff --git a/tests/expectations/parser/parser/circuits/field_and_functions.leo.out b/tests/expectations/parser/parser/circuits/field_and_functions.leo.out deleted file mode 100644 index db42615815..0000000000 --- a/tests/expectations/parser/parser/circuits/field_and_functions.leo.out +++ /dev/null @@ -1,116 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" - members: - - CircuitConst: - - "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" static const a: u8 = 10;\\\"}\"}" - - IntegerType: U8 - - Value: - Implicit: - - "10" - - span: - line_start: 4 - line_stop: 4 - col_start: 26 - col_stop: 28 - path: "" - content: " static const a: u8 = 10;" - - CircuitVariable: - - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x: u32,\\\"}\"}" - - IntegerType: U32 - - CircuitVariable: - - "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y: u32\\\"}\"}" - - IntegerType: U32 - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x() {\\\"}\"}" - input: [] - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 8 - line_stop: 8 - col_start: 16 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 8 - line_stop: 8 - col_start: 9 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 7 - line_stop: 9 - col_start: 18 - col_stop: 6 - path: "" - content: " function x() {\n ...\n }" - span: - line_start: 7 - line_stop: 9 - col_start: 5 - col_stop: 6 - path: "" - content: " function x() {\n ...\n }" - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function y() {\\\"}\"}" - input: [] - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 11 - line_stop: 11 - col_start: 16 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 11 - line_stop: 11 - col_start: 9 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 10 - line_stop: 12 - col_start: 18 - col_stop: 6 - path: "" - content: " function y() {\n ...\n }" - span: - line_start: 10 - line_stop: 12 - col_start: 5 - col_stop: 6 - path: "" - content: " function y() {\n ...\n }" - global_consts: {} - functions: {} diff --git a/tests/expectations/parser/parser/circuits/fields.leo.out b/tests/expectations/parser/parser/circuits/fields.leo.out deleted file mode 100644 index 7f5a0460a1..0000000000 --- a/tests/expectations/parser/parser/circuits/fields.leo.out +++ /dev/null @@ -1,21 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" - members: - - CircuitVariable: - - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x: u32;\\\"}\"}" - - IntegerType: U32 - - CircuitVariable: - - "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y: u32;\\\"}\"}" - - IntegerType: U32 - global_consts: {} - functions: {} diff --git a/tests/expectations/parser/parser/circuits/fields_fail.leo.out b/tests/expectations/parser/parser/circuits/fields_fail.leo.out deleted file mode 100644 index 2225346003..0000000000 --- a/tests/expectations/parser/parser/circuits/fields_fail.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - "Error [EPAR0370006]: Cannot mix use of commas and semi-colons for circuit member variable declarations.\n --> test:10:11\n |\n 10 | y: u32;\n | ^\nError [EPAR0370006]: Cannot mix use of commas and semi-colons for circuit member variable declarations.\n --> test:11:5\n |\n 11 | , // recovery witness\n | ^" diff --git a/tests/expectations/parser/parser/circuits/functions.leo.out b/tests/expectations/parser/parser/circuits/functions.leo.out deleted file mode 100644 index c6db22f69c..0000000000 --- a/tests/expectations/parser/parser/circuits/functions.leo.out +++ /dev/null @@ -1,138 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" - members: - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x() {\\\"}\"}" - input: [] - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 5 - line_stop: 5 - col_start: 16 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 5 - line_stop: 5 - col_start: 9 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 4 - line_stop: 6 - col_start: 18 - col_stop: 6 - path: "" - content: " function x() {\n ...\n }" - span: - line_start: 4 - line_stop: 6 - col_start: 5 - col_stop: 6 - path: "" - content: " function x() {\n ...\n }" - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function y() {\\\"}\"}" - input: [] - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 8 - line_stop: 8 - col_start: 16 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 8 - line_stop: 8 - col_start: 9 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 7 - line_stop: 9 - col_start: 18 - col_stop: 6 - path: "" - content: " function y() {\n ...\n }" - span: - line_start: 7 - line_stop: 9 - col_start: 5 - col_stop: 6 - path: "" - content: " function y() {\n ...\n }" - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function z() {\\\"}\"}" - input: [] - const_: true - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 11 - line_stop: 11 - col_start: 16 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 11 - line_stop: 11 - col_start: 9 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 10 - line_stop: 12 - col_start: 24 - col_stop: 6 - path: "" - content: " const function z() {\n ...\n }" - span: - line_start: 10 - line_stop: 12 - col_start: 11 - col_stop: 6 - path: "" - content: " const function z() {\n ...\n }" - global_consts: {} - functions: {} diff --git a/tests/expectations/parser/parser/circuits/mixed_order_fail.leo.out b/tests/expectations/parser/parser/circuits/mixed_order_fail.leo.out deleted file mode 100644 index f29639b5a2..0000000000 --- a/tests/expectations/parser/parser/circuits/mixed_order_fail.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - "Error [EPAR0370021]: Member functions must come after member variables.\n --> test:7:5\n |\n 7 | foo: u8,\n | ^^^\nError [EPAR0370020]: Member functions must come after member consts.\n --> test:9:18\n |\n 9 | static const BAR: u8 = 0u8;\n | ^^^^^^^^^^^^^\nError [EPAR0370019]: Member variables must come after member consts.\n --> test:15:18\n |\n 15 | static const BAR: u8 = 0u8;\n | ^^^^^^^^^^^^^" diff --git a/tests/expectations/parser/parser/circuits/mut_self.leo.out b/tests/expectations/parser/parser/circuits/mut_self.leo.out deleted file mode 100644 index 6369246184..0000000000 --- a/tests/expectations/parser/parser/circuits/mut_self.leo.out +++ /dev/null @@ -1,56 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" - core_mapping: ~ - members: - - CircuitFunction: - annotations: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x(mut self) {\\\"}\"}" - input: - - MutSelfKeyword: "{\"name\":\"mut self\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":16,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x(mut self) {\\\"}\"}" - output: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 5 - line_stop: 5 - col_start: 16 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 5 - line_stop: 5 - col_start: 9 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 4 - line_stop: 6 - col_start: 26 - col_stop: 6 - path: "" - content: " function x(mut self) {\n ...\n }" - span: - line_start: 4 - line_stop: 6 - col_start: 5 - col_stop: 6 - path: "" - content: " function x(mut self) {\n ...\n }" - global_consts: {} - functions: {} diff --git a/tests/expectations/parser/parser/circuits/mut_self_fail.leo.out b/tests/expectations/parser/parser/circuits/mut_self_fail.leo.out deleted file mode 100644 index 0007ae6240..0000000000 --- a/tests/expectations/parser/parser/circuits/mut_self_fail.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - "Error [EPAR0370018]: `mut self` is no longer accepted. Use `&self` if you would like to pass in a mutable reference to `self`\n --> test:4:16\n |\n 4 | function x(mut self) {\n | ^^^^^^^^" diff --git a/tests/expectations/parser/parser/circuits/ref_self.leo.out b/tests/expectations/parser/parser/circuits/ref_self.leo.out deleted file mode 100644 index 36a7f97eae..0000000000 --- a/tests/expectations/parser/parser/circuits/ref_self.leo.out +++ /dev/null @@ -1,57 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" - members: - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x(&self) {\\\"}\"}" - input: - - RefSelfKeyword: "{\"name\":\"&self\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":16,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x(&self) {\\\"}\"}" - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 5 - line_stop: 5 - col_start: 16 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 5 - line_stop: 5 - col_start: 9 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 4 - line_stop: 6 - col_start: 23 - col_stop: 6 - path: "" - content: " function x(&self) {\n ...\n }" - span: - line_start: 4 - line_stop: 6 - col_start: 5 - col_stop: 6 - path: "" - content: " function x(&self) {\n ...\n }" - global_consts: {} - functions: {} diff --git a/tests/expectations/parser/parser/circuits/self.leo.out b/tests/expectations/parser/parser/circuits/self.leo.out deleted file mode 100644 index ab817ab360..0000000000 --- a/tests/expectations/parser/parser/circuits/self.leo.out +++ /dev/null @@ -1,57 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - circuits: - "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}": - circuit_name: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit X {\\\"}\"}" - members: - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x(self) {\\\"}\"}" - input: - - SelfKeyword: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x(self) {\\\"}\"}" - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 5 - line_stop: 5 - col_start: 16 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 5 - line_stop: 5 - col_start: 9 - col_stop: 18 - path: "" - content: " return ();" - span: - line_start: 4 - line_stop: 6 - col_start: 22 - col_stop: 6 - path: "" - content: " function x(self) {\n ...\n }" - span: - line_start: 4 - line_stop: 6 - col_start: 5 - col_stop: 6 - path: "" - content: " function x(self) {\n ...\n }" - global_consts: {} - functions: {} diff --git a/tests/expectations/parser/parser/circuits/self_not_first_fail.leo.out b/tests/expectations/parser/parser/circuits/self_not_first_fail.leo.out deleted file mode 100644 index 7959437526..0000000000 --- a/tests/expectations/parser/parser/circuits/self_not_first_fail.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - "Error [EPAR0370036]: A function received a self argument as not the first argument." diff --git a/tests/expectations/parser/parser/circuits/struct_fail.leo.out b/tests/expectations/parser/parser/circuits/struct_fail.leo.out deleted file mode 100644 index aee38799dc..0000000000 --- a/tests/expectations/parser/parser/circuits/struct_fail.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - "Error [EPAR0370005]: expected circuit -- got 'struct'\n --> test:3:1\n |\n 3 | struct A {}\n | ^^^^^^\nError [EPAR0370005]: expected circuit -- got 'class'\n --> test:5:1\n |\n 5 | class C {}\n | ^^^^^" diff --git a/tests/expectations/parser/parser/circuits/token_circuit_name.leo.out b/tests/expectations/parser/parser/circuits/token_circuit_name.leo.out deleted file mode 100644 index cb22bdf26f..0000000000 --- a/tests/expectations/parser/parser/circuits/token_circuit_name.leo.out +++ /dev/null @@ -1,15 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - circuits: - "{\"name\":\"u32\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit u32 {}\\\"}\"}": - circuit_name: "{\"name\":\"u32\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit u32 {}\\\"}\"}" - members: [] - global_consts: {} - functions: {} diff --git a/tests/expectations/parser/parser/circuits/types_fail.leo.out b/tests/expectations/parser/parser/circuits/types_fail.leo.out deleted file mode 100644 index da52e8669f..0000000000 --- a/tests/expectations/parser/parser/circuits/types_fail.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'address'\n --> test:3:9\n |\n 3 | circuit address {}\n | ^^^^^^^" diff --git a/tests/expectations/parser/parser/expression/access/array_access.leo.out b/tests/expectations/parser/parser/expression/access/array_access.leo.out deleted file mode 100644 index 5d9ff7c8fc..0000000000 --- a/tests/expectations/parser/parser/expression/access/array_access.leo.out +++ /dev/null @@ -1,254 +0,0 @@ ---- -namespace: ParseExpression -expectation: Pass -outputs: - - Access: - Array: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0]\\\"}\"}" - index: - Value: - Implicit: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 4 - path: "" - content: "x[0]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: "x[0]" - - Access: - Array: - array: - Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X[1]\\\"}\"}" - index: - Value: - Implicit: - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 4 - path: "" - content: "X[1]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: "X[1]" - - Access: - Array: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0u8]\\\"}\"}" - index: - Value: - Integer: - - U8 - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 6 - path: "" - content: "x[0u8]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: "x[0u8]" - - Access: - Array: - array: - Access: - Array: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[1u8][2u8]\\\"}\"}" - index: - Value: - Integer: - - U8 - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 6 - path: "" - content: "x[1u8][2u8]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: "x[1u8][2u8]" - index: - Value: - Integer: - - U8 - - "2" - - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 11 - path: "" - content: "x[1u8][2u8]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: "x[1u8][2u8]" - - Access: - Array: - array: - Access: - Array: - array: - Access: - Array: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" - index: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: "x[x][y][z]" - index: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 8 - path: "" - content: "x[x][y][z]" - index: - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x][y][z]\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 11 - path: "" - content: "x[x][y][z]" - - Call: - function: - Access: - Array: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0]()\\\"}\"}" - index: - Value: - Implicit: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 4 - path: "" - content: "x[0]()" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: "x[0]()" - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: "x[0]()" - - Access: - Array: - array: - Call: - function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x()[0]\\\"}\"}" - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: "x()[0]" - index: - Value: - Implicit: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 5 - col_stop: 6 - path: "" - content: "x()[0]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: "x()[0]" - - Access: - Array: - array: - Access: - Tuple: - tuple: - Access: - Array: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x].0[x]\\\"}\"}" - index: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x].0[x]\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: "x[x].0[x]" - index: - value: "0" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: "x[x].0[x]" - index: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x].0[x]\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 10 - path: "" - content: "x[x].0[x]" diff --git a/tests/expectations/parser/parser/expression/access/array_range_access.leo.out b/tests/expectations/parser/parser/expression/access/array_range_access.leo.out deleted file mode 100644 index d930ff5e17..0000000000 --- a/tests/expectations/parser/parser/expression/access/array_range_access.leo.out +++ /dev/null @@ -1,446 +0,0 @@ ---- -namespace: ParseExpression -expectation: Pass -outputs: - - Access: - ArrayRange: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..]\\\"}\"}" - left: ~ - right: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 6 - path: "" - content: "x[..]" - - Access: - ArrayRange: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[1..]\\\"}\"}" - left: - Value: - Implicit: - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 4 - path: "" - content: "x[1..]" - right: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: "x[1..]" - - Access: - ArrayRange: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..1]\\\"}\"}" - left: ~ - right: - Value: - Implicit: - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 5 - col_stop: 6 - path: "" - content: "x[..1]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: "x[..1]" - - Access: - ArrayRange: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[1..1]\\\"}\"}" - left: - Value: - Implicit: - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 4 - path: "" - content: "x[1..1]" - right: - Value: - Implicit: - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 6 - col_stop: 7 - path: "" - content: "x[1..1]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 8 - path: "" - content: "x[1..1]" - - Access: - ArrayRange: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0..100]\\\"}\"}" - left: - Value: - Implicit: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 4 - path: "" - content: "x[0..100]" - right: - Value: - Implicit: - - "100" - - span: - line_start: 1 - line_stop: 1 - col_start: 6 - col_stop: 9 - path: "" - content: "x[0..100]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 10 - path: "" - content: "x[0..100]" - - Access: - Array: - array: - Access: - Array: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[323452345.2345234523453453][323452345.2345234523453453]\\\"}\"}" - index: - Access: - Tuple: - tuple: - Value: - Implicit: - - "323452345" - - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 12 - path: "" - content: "x[323452345.2345234523453453][323452345.2345234523453453]" - index: - value: "2345234523453453" - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 29 - path: "" - content: "x[323452345.2345234523453453][323452345.2345234523453453]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 30 - path: "" - content: "x[323452345.2345234523453453][323452345.2345234523453453]" - index: - Access: - Tuple: - tuple: - Value: - Implicit: - - "323452345" - - span: - line_start: 1 - line_stop: 1 - col_start: 31 - col_stop: 40 - path: "" - content: "x[323452345.2345234523453453][323452345.2345234523453453]" - index: - value: "2345234523453453" - span: - line_start: 1 - line_stop: 1 - col_start: 31 - col_stop: 57 - path: "" - content: "x[323452345.2345234523453453][323452345.2345234523453453]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 58 - path: "" - content: "x[323452345.2345234523453453][323452345.2345234523453453]" - - Access: - ArrayRange: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0u8..1u8]\\\"}\"}" - left: - Value: - Integer: - - U8 - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 6 - path: "" - content: "x[0u8..1u8]" - right: - Value: - Integer: - - U8 - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 11 - path: "" - content: "x[0u8..1u8]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: "x[0u8..1u8]" - - Access: - ArrayRange: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[0u8..]\\\"}\"}" - left: - Value: - Integer: - - U8 - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 6 - path: "" - content: "x[0u8..]" - right: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 9 - path: "" - content: "x[0u8..]" - - Access: - ArrayRange: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..0u8]\\\"}\"}" - left: ~ - right: - Value: - Integer: - - U8 - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 5 - col_stop: 8 - path: "" - content: "x[..0u8]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 9 - path: "" - content: "x[..0u8]" - - Access: - ArrayRange: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..]\\\"}\"}" - left: ~ - right: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 6 - path: "" - content: "x[..]" - - Access: - ArrayRange: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..]\\\"}\"}" - left: - Access: - Member: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..]\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..]\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 6 - path: "" - content: "x[x.y..]" - type_: ~ - right: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 9 - path: "" - content: "x[x.y..]" - - Access: - ArrayRange: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..y.x]\\\"}\"}" - left: ~ - right: - Access: - Member: - inner: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..y.x]\\\"}\"}" - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[..y.x]\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 5 - col_stop: 8 - path: "" - content: "x[..y.x]" - type_: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 9 - path: "" - content: "x[..y.x]" - - Access: - ArrayRange: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" - left: - Access: - Member: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 6 - path: "" - content: "x[x.y..y.x]" - type_: ~ - right: - Access: - Member: - inner: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y..y.x]\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 11 - path: "" - content: "x[x.y..y.x]" - type_: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: "x[x.y..y.x]" - - Access: - ArrayRange: - array: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" - left: - Access: - Member: - inner: - Access: - Member: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 6 - path: "" - content: "x[x.y.x..y.x.y]" - type_: ~ - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 8 - path: "" - content: "x[x.y.x..y.x.y]" - type_: ~ - right: - Access: - Member: - inner: - Access: - Member: - inner: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 10 - col_stop: 13 - path: "" - content: "x[x.y.x..y.x.y]" - type_: ~ - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 10 - col_stop: 15 - path: "" - content: "x[x.y.x..y.x.y]" - type_: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 16 - path: "" - content: "x[x.y.x..y.x.y]" diff --git a/tests/expectations/parser/parser/expression/access/circuit.leo.out b/tests/expectations/parser/parser/expression/access/circuit.leo.out deleted file mode 100644 index 0314c4ef11..0000000000 --- a/tests/expectations/parser/parser/expression/access/circuit.leo.out +++ /dev/null @@ -1,103 +0,0 @@ ---- -namespace: ParseExpression -expectation: Pass -outputs: - - Access: - Member: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: x.y - type_: ~ - - Access: - Member: - inner: - Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X.Y\\\"}\"}" - name: "{\"name\":\"Y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X.Y\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: X.Y - type_: ~ - - Access: - Member: - inner: - Access: - Member: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y.z\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y.z\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: x.y.z - type_: ~ - name: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y.z\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 6 - path: "" - content: x.y.z - type_: ~ - - Call: - function: - Access: - Member: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y()\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: x.y() - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 6 - path: "" - content: x.y() - - Access: - Tuple: - tuple: - Access: - Member: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y.0\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y.0\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: x.y.0 - type_: ~ - index: - value: "0" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 6 - path: "" - content: x.y.0 diff --git a/tests/expectations/parser/parser/expression/access/circuit_static.leo.out b/tests/expectations/parser/parser/expression/access/circuit_static.leo.out deleted file mode 100644 index f01ebb1773..0000000000 --- a/tests/expectations/parser/parser/expression/access/circuit_static.leo.out +++ /dev/null @@ -1,137 +0,0 @@ ---- -namespace: ParseExpression -expectation: Pass -outputs: - - Access: - Static: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y\\\"}\"}" - type_: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: "x::y" - - Access: - Static: - inner: - Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X::Y\\\"}\"}" - name: "{\"name\":\"Y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X::Y\\\"}\"}" - type_: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: "X::Y" - - Access: - Static: - inner: - Access: - Static: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y::z\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y::z\\\"}\"}" - type_: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: "x::y::z" - name: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y::z\\\"}\"}" - type_: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 8 - path: "" - content: "x::y::z" - - Call: - function: - Access: - Static: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y()\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y()\\\"}\"}" - type_: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: "x::y()" - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: "x::y()" - - Access: - Tuple: - tuple: - Access: - Static: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y.0\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y.0\\\"}\"}" - type_: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: "x::y.0" - index: - value: "0" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: "x::y.0" - - Access: - Array: - array: - Access: - Static: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y[1]\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y[1]\\\"}\"}" - type_: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: "x::y[1]" - index: - Value: - Implicit: - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 6 - col_stop: 7 - path: "" - content: "x::y[1]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 8 - path: "" - content: "x::y[1]" diff --git a/tests/expectations/parser/parser/expression/access/tuple.leo.out b/tests/expectations/parser/parser/expression/access/tuple.leo.out deleted file mode 100644 index e904278a34..0000000000 --- a/tests/expectations/parser/parser/expression/access/tuple.leo.out +++ /dev/null @@ -1,118 +0,0 @@ ---- -namespace: ParseExpression -expectation: Pass -outputs: - - Access: - Tuple: - tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.0\\\"}\"}" - index: - value: "0" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: x.0 - - Access: - Tuple: - tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.1\\\"}\"}" - index: - value: "1" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: x.1 - - Access: - Tuple: - tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.2\\\"}\"}" - index: - value: "2" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: x.2 - - Access: - Tuple: - tuple: - Access: - Tuple: - tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.0.0\\\"}\"}" - index: - value: "0" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: x.0.0 - index: - value: "0" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 6 - path: "" - content: x.0.0 - - Access: - Tuple: - tuple: - Access: - Tuple: - tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.1.1\\\"}\"}" - index: - value: "1" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: x.1.1 - index: - value: "1" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 6 - path: "" - content: x.1.1 - - Access: - Tuple: - tuple: - Access: - Tuple: - tuple: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.2.2\\\"}\"}" - index: - value: "2" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: x.2.2 - index: - value: "2" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 6 - path: "" - content: x.2.2 diff --git a/tests/expectations/parser/parser/expression/array_init.leo.out b/tests/expectations/parser/parser/expression/array_init.leo.out deleted file mode 100644 index cd7972a8d9..0000000000 --- a/tests/expectations/parser/parser/expression/array_init.leo.out +++ /dev/null @@ -1,157 +0,0 @@ ---- -namespace: ParseExpression -expectation: Pass -outputs: - - ArrayInit: - element: - Value: - Integer: - - U8 - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 5 - path: "" - content: "[0u8; 1]" - dimensions: - - value: "1" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 9 - path: "" - content: "[0u8; 1]" - - ArrayInit: - element: - Value: - Implicit: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 3 - path: "" - content: "[0; 1]" - dimensions: - - value: "1" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: "[0; 1]" - - ArrayInit: - element: - Value: - Implicit: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 3 - path: "" - content: "[0; (1, 2)]" - dimensions: - - value: "1" - - value: "2" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: "[0; (1, 2)]" - - ArrayInit: - element: - Value: - Implicit: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 3 - path: "" - content: "[0; (1, 2,)]" - dimensions: - - value: "1" - - value: "2" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 13 - path: "" - content: "[0; (1, 2,)]" - - ArrayInit: - element: - Value: - Implicit: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 3 - path: "" - content: "[0; (1, 2, 3)]" - dimensions: - - value: "1" - - value: "2" - - value: "3" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 15 - path: "" - content: "[0; (1, 2, 3)]" - - ArrayInit: - element: - ArrayInit: - element: - ArrayInit: - element: - Value: - Implicit: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 4 - col_stop: 5 - path: "" - content: "[[[0; 3]; 2]; 1]" - dimensions: - - value: "3" - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 9 - path: "" - content: "[[[0; 3]; 2]; 1]" - dimensions: - - value: "2" - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 13 - path: "" - content: "[[[0; 3]; 2]; 1]" - dimensions: - - value: "1" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 17 - path: "" - content: "[[[0; 3]; 2]; 1]" diff --git a/tests/expectations/parser/parser/expression/array_inline.leo.out b/tests/expectations/parser/parser/expression/array_inline.leo.out deleted file mode 100644 index 227406ce93..0000000000 --- a/tests/expectations/parser/parser/expression/array_inline.leo.out +++ /dev/null @@ -1,334 +0,0 @@ ---- -namespace: ParseExpression -expectation: Pass -outputs: - - ArrayInline: - elements: - - Expression: - Value: - Integer: - - U8 - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 5 - path: "" - content: "[0u8, 1, 2, 3]" - - Expression: - Value: - Implicit: - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 7 - col_stop: 8 - path: "" - content: "[0u8, 1, 2, 3]" - - Expression: - Value: - Implicit: - - "2" - - span: - line_start: 1 - line_stop: 1 - col_start: 10 - col_stop: 11 - path: "" - content: "[0u8, 1, 2, 3]" - - Expression: - Value: - Implicit: - - "3" - - span: - line_start: 1 - line_stop: 1 - col_start: 13 - col_stop: 14 - path: "" - content: "[0u8, 1, 2, 3]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 15 - path: "" - content: "[0u8, 1, 2, 3]" - - ArrayInline: - elements: - - Expression: - Value: - Implicit: - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 3 - path: "" - content: "[1]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: "[1]" - - ArrayInline: - elements: - - Expression: - Value: - Integer: - - U8 - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 5 - path: "" - content: "[1u8]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 6 - path: "" - content: "[1u8]" - - ArrayInline: - elements: - - Expression: - Value: - Integer: - - U8 - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 5 - path: "" - content: "[1u8,]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: "[1u8,]" - - ArrayInline: - elements: - - Expression: - Value: - Implicit: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 3 - path: "" - content: "[0, 1,]" - - Expression: - Value: - Implicit: - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 5 - col_stop: 6 - path: "" - content: "[0, 1,]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 8 - path: "" - content: "[0, 1,]" - - ArrayInline: - elements: - - Expression: - Value: - Implicit: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 3 - path: "" - content: "[0,1,]" - - Expression: - Value: - Implicit: - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 4 - col_stop: 5 - path: "" - content: "[0,1,]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: "[0,1,]" - - ArrayInline: - elements: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 3 - path: "" - content: "[]" - - ArrayInline: - elements: - - Expression: - ArrayInline: - elements: - - Expression: - Value: - Implicit: - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 4 - path: "" - content: "[[1,2,3],[1,2,3]]" - - Expression: - Value: - Implicit: - - "2" - - span: - line_start: 1 - line_stop: 1 - col_start: 5 - col_stop: 6 - path: "" - content: "[[1,2,3],[1,2,3]]" - - Expression: - Value: - Implicit: - - "3" - - span: - line_start: 1 - line_stop: 1 - col_start: 7 - col_stop: 8 - path: "" - content: "[[1,2,3],[1,2,3]]" - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 9 - path: "" - content: "[[1,2,3],[1,2,3]]" - - Expression: - ArrayInline: - elements: - - Expression: - Value: - Implicit: - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 11 - col_stop: 12 - path: "" - content: "[[1,2,3],[1,2,3]]" - - Expression: - Value: - Implicit: - - "2" - - span: - line_start: 1 - line_stop: 1 - col_start: 13 - col_stop: 14 - path: "" - content: "[[1,2,3],[1,2,3]]" - - Expression: - Value: - Implicit: - - "3" - - span: - line_start: 1 - line_stop: 1 - col_start: 15 - col_stop: 16 - path: "" - content: "[[1,2,3],[1,2,3]]" - span: - line_start: 1 - line_stop: 1 - col_start: 10 - col_stop: 17 - path: "" - content: "[[1,2,3],[1,2,3]]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 18 - path: "" - content: "[[1,2,3],[1,2,3]]" - - ArrayInline: - elements: - - Expression: - ArrayInline: - elements: [] - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 4 - path: "" - content: "[[]]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: "[[]]" - - ArrayInline: - elements: - - Expression: - ArrayInline: - elements: [] - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 4 - path: "" - content: "[[], []]" - - Expression: - ArrayInline: - elements: [] - span: - line_start: 1 - line_stop: 1 - col_start: 6 - col_stop: 8 - path: "" - content: "[[], []]" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 9 - path: "" - content: "[[], []]" diff --git a/tests/expectations/parser/parser/expression/array_len.leo.out b/tests/expectations/parser/parser/expression/array_len.leo.out deleted file mode 100644 index 1007e7ea87..0000000000 --- a/tests/expectations/parser/parser/expression/array_len.leo.out +++ /dev/null @@ -1,245 +0,0 @@ ---- -namespace: ParseExpression -expectation: Pass -outputs: - - Call: - function: - Access: - Member: - inner: - ArrayInit: - element: - Value: - Integer: - - U8 - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 5 - path: "" - content: "[0u8; 1].len()" - dimensions: - - value: "1" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 9 - path: "" - content: "[0u8; 1].len()" - name: "{\"name\":\"len\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"[0u8; 1].len()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 13 - path: "" - content: "[0u8; 1].len()" - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 15 - path: "" - content: "[0u8; 1].len()" - - Call: - function: - Access: - Member: - inner: - ArrayInit: - element: - Value: - Implicit: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 3 - path: "" - content: "[0; 1].len()" - dimensions: - - value: "1" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: "[0; 1].len()" - name: "{\"name\":\"len\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"[0; 1].len()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 11 - path: "" - content: "[0; 1].len()" - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 13 - path: "" - content: "[0; 1].len()" - - Call: - function: - Access: - Member: - inner: - ArrayInit: - element: - Value: - Implicit: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 3 - path: "" - content: "[0; (1, 2)].len()" - dimensions: - - value: "1" - - value: "2" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: "[0; (1, 2)].len()" - name: "{\"name\":\"len\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"[0; (1, 2)].len()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 16 - path: "" - content: "[0; (1, 2)].len()" - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 18 - path: "" - content: "[0; (1, 2)].len()" - - Call: - function: - Access: - Member: - inner: - ArrayInit: - element: - Value: - Implicit: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 3 - path: "" - content: "[0; (1, 2, 3)].len()" - dimensions: - - value: "1" - - value: "2" - - value: "3" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 15 - path: "" - content: "[0; (1, 2, 3)].len()" - name: "{\"name\":\"len\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"[0; (1, 2, 3)].len()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 19 - path: "" - content: "[0; (1, 2, 3)].len()" - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 21 - path: "" - content: "[0; (1, 2, 3)].len()" - - Call: - function: - Access: - Member: - inner: - ArrayInit: - element: - ArrayInit: - element: - ArrayInit: - element: - Value: - Implicit: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 4 - col_stop: 5 - path: "" - content: "[[[0; 3]; 2]; 1].len()" - dimensions: - - value: "3" - span: - line_start: 1 - line_stop: 1 - col_start: 3 - col_stop: 9 - path: "" - content: "[[[0; 3]; 2]; 1].len()" - dimensions: - - value: "2" - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 13 - path: "" - content: "[[[0; 3]; 2]; 1].len()" - dimensions: - - value: "1" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 17 - path: "" - content: "[[[0; 3]; 2]; 1].len()" - name: "{\"name\":\"len\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":18,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"[[[0; 3]; 2]; 1].len()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 21 - path: "" - content: "[[[0; 3]; 2]; 1].len()" - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 23 - path: "" - content: "[[[0; 3]; 2]; 1].len()" diff --git a/tests/expectations/parser/parser/expression/cast.leo.out b/tests/expectations/parser/parser/expression/cast.leo.out deleted file mode 100644 index aa3da7a147..0000000000 --- a/tests/expectations/parser/parser/expression/cast.leo.out +++ /dev/null @@ -1,187 +0,0 @@ ---- -namespace: ParseExpression -expectation: Pass -outputs: - - Cast: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x as u8\\\"}\"}" - target_type: - IntegerType: U8 - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 8 - path: "" - content: x as u8 - - Cast: - inner: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"y as id\\\"}\"}" - target_type: - Identifier: "{\"name\":\"id\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"y as id\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 8 - path: "" - content: y as id - - Cast: - inner: - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"z as u32\\\"}\"}" - target_type: - IntegerType: U32 - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 9 - path: "" - content: z as u32 - - Cast: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x as i128\\\"}\"}" - target_type: - IntegerType: I128 - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 10 - path: "" - content: x as i128 - - Cast: - inner: - Cast: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x as u8 as u128\\\"}\"}" - target_type: - IntegerType: U8 - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 8 - path: "" - content: x as u8 as u128 - target_type: - IntegerType: U128 - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 16 - path: "" - content: x as u8 as u128 - - Cast: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x as field\\\"}\"}" - target_type: Field - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 11 - path: "" - content: x as field - - Cast: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x as group\\\"}\"}" - target_type: Group - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 11 - path: "" - content: x as group - - Binary: - left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ** y as u32 ** z\\\"}\"}" - right: - Binary: - left: - Cast: - inner: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ** y as u32 ** z\\\"}\"}" - target_type: - IntegerType: U32 - span: - line_start: 1 - line_stop: 1 - col_start: 6 - col_stop: 14 - path: "" - content: x ** y as u32 ** z - right: - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x ** y as u32 ** z\\\"}\"}" - op: Pow - span: - line_start: 1 - line_stop: 1 - col_start: 6 - col_stop: 19 - path: "" - content: x ** y as u32 ** z - op: Pow - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 19 - path: "" - content: x ** y as u32 ** z - - Value: - Implicit: - - "" - - span: - line_start: 0 - line_stop: 0 - col_start: 0 - col_stop: 0 - path: "" - content: "" - - Cast: - inner: - Unary: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"!x as u32\\\"}\"}" - op: Not - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 3 - path: "" - content: "!x as u32" - target_type: - IntegerType: U32 - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 10 - path: "" - content: "!x as u32" - - Cast: - inner: - Unary: - inner: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"-x as u32\\\"}\"}" - op: Negate - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 3 - path: "" - content: "-x as u32" - target_type: - IntegerType: U32 - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 10 - path: "" - content: "-x as u32" diff --git a/tests/expectations/parser/parser/expression/circuit_init.leo.out b/tests/expectations/parser/parser/expression/circuit_init.leo.out deleted file mode 100644 index 8290a7825b..0000000000 --- a/tests/expectations/parser/parser/expression/circuit_init.leo.out +++ /dev/null @@ -1,113 +0,0 @@ ---- -namespace: ParseExpression -expectation: Pass -outputs: - - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x {}\\\"}\"}" - members: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: "x {}" - - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x {y}\\\"}\"}" - members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x {y}\\\"}\"}" - expression: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 6 - path: "" - content: "x {y}" - - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y}\\\"}\"}" - members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y}\\\"}\"}" - expression: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: "x{y}" - - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{}\\\"}\"}" - members: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: "x{}" - - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: y}\\\"}\"}" - members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: y}\\\"}\"}" - expression: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: y}\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 8 - path: "" - content: "x{y: y}" - - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: x}\\\"}\"}" - members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: x}\\\"}\"}" - expression: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: x}\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 8 - path: "" - content: "x{y: x}" - - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: x,}\\\"}\"}" - members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: x,}\\\"}\"}" - expression: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y: x,}\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 9 - path: "" - content: "x{y: x,}" - - CircuitInit: - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" - members: - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":3,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" - expression: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" - - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" - expression: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x{y:x, x:y,}\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 13 - path: "" - content: "x{y:x, x:y,}" - - CircuitInit: - name: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"Self {}\\\"}\"}" - members: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 8 - path: "" - content: "Self {}" diff --git a/tests/expectations/parser/parser/expression/literal/access.leo.out b/tests/expectations/parser/parser/expression/literal/access.leo.out deleted file mode 100644 index 7dcf1796a5..0000000000 --- a/tests/expectations/parser/parser/expression/literal/access.leo.out +++ /dev/null @@ -1,618 +0,0 @@ ---- -namespace: ParseExpression -expectation: Pass -outputs: - - Value: - Implicit: - - "" - - span: - line_start: 0 - line_stop: 0 - col_start: 0 - col_stop: 0 - path: "" - content: "" - - Call: - function: - Access: - Member: - inner: - Value: - Address: - - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 64 - path: "" - content: aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8.call() - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":65,\\\"col_stop\\\":69,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 69 - path: "" - content: aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8.call() - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 71 - path: "" - content: aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8.call() - - Value: - Implicit: - - "" - - span: - line_start: 0 - line_stop: 0 - col_start: 0 - col_stop: 0 - path: "" - content: "" - - Call: - function: - Access: - Member: - inner: - Value: - Boolean: - - "true" - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: true.call() - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"true.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 10 - path: "" - content: true.call() - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: true.call() - - Value: - Implicit: - - "" - - span: - line_start: 0 - line_stop: 0 - col_start: 0 - col_stop: 0 - path: "" - content: "" - - Call: - function: - Access: - Member: - inner: - Value: - Char: - character: - Scalar: 97 - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: "'a'.call()" - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"'a'.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 9 - path: "" - content: "'a'.call()" - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 11 - path: "" - content: "'a'.call()" - - Value: - Implicit: - - "" - - span: - line_start: 0 - line_stop: 0 - col_start: 0 - col_stop: 0 - path: "" - content: "" - - Call: - function: - Access: - Member: - inner: - Value: - Field: - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: 1field.call() - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"1field.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: 1field.call() - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 14 - path: "" - content: 1field.call() - - Value: - Implicit: - - "" - - span: - line_start: 0 - line_stop: 0 - col_start: 0 - col_stop: 0 - path: "" - content: "" - - Call: - function: - Access: - Member: - inner: - Value: - Group: - Single: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: 0group.call() - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"0group.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: 0group.call() - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 14 - path: "" - content: 0group.call() - - Call: - function: - Access: - Member: - inner: - Value: - Group: - Tuple: - x: - Number: - - "0" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 3 - path: "" - content: "(0, 1)group.call()" - y: - Number: - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 5 - col_stop: 6 - path: "" - content: "(0, 1)group.call()" - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 12 - path: "" - content: "(0, 1)group.call()" - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(0, 1)group.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 17 - path: "" - content: "(0, 1)group.call()" - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 19 - path: "" - content: "(0, 1)group.call()" - - Value: - Implicit: - - "" - - span: - line_start: 0 - line_stop: 0 - col_start: 0 - col_stop: 0 - path: "" - content: "" - - Call: - function: - Access: - Member: - inner: - Value: - Integer: - - I8 - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: 1i8.call() - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"1i8.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 9 - path: "" - content: 1i8.call() - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 11 - path: "" - content: 1i8.call() - - Call: - function: - Access: - Member: - inner: - Value: - Integer: - - I16 - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: 1i16.call() - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"1i16.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 10 - path: "" - content: 1i16.call() - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: 1i16.call() - - Call: - function: - Access: - Member: - inner: - Value: - Integer: - - I32 - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: 1i32.call() - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"1i32.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 10 - path: "" - content: 1i32.call() - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: 1i32.call() - - Call: - function: - Access: - Member: - inner: - Value: - Integer: - - I64 - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: 1i64.call() - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"1i64.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 10 - path: "" - content: 1i64.call() - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: 1i64.call() - - Call: - function: - Access: - Member: - inner: - Value: - Integer: - - I128 - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 6 - path: "" - content: 1i128.call() - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"1i128.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 11 - path: "" - content: 1i128.call() - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 13 - path: "" - content: 1i128.call() - - Value: - Implicit: - - "" - - span: - line_start: 0 - line_stop: 0 - col_start: 0 - col_stop: 0 - path: "" - content: "" - - Call: - function: - Access: - Member: - inner: - Value: - Integer: - - U8 - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 4 - path: "" - content: 1u8.call() - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"1u8.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 9 - path: "" - content: 1u8.call() - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 11 - path: "" - content: 1u8.call() - - Call: - function: - Access: - Member: - inner: - Value: - Integer: - - U16 - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: 1u16.call() - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"1u16.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 10 - path: "" - content: 1u16.call() - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: 1u16.call() - - Call: - function: - Access: - Member: - inner: - Value: - Integer: - - U32 - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: 1u32.call() - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"1u32.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 10 - path: "" - content: 1u32.call() - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: 1u32.call() - - Call: - function: - Access: - Member: - inner: - Value: - Integer: - - U64 - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 5 - path: "" - content: 1u64.call() - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"1u64.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 10 - path: "" - content: 1u64.call() - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: 1u64.call() - - Call: - function: - Access: - Member: - inner: - Value: - Integer: - - U128 - - "1" - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 6 - path: "" - content: 1u128.call() - name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"1u128.call()\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 11 - path: "" - content: 1u128.call() - type_: ~ - arguments: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 13 - path: "" - content: 1u128.call() diff --git a/tests/expectations/parser/parser/expression/literal/static_fail.leo.out b/tests/expectations/parser/parser/expression/literal/static_fail.leo.out deleted file mode 100644 index 424ff34fa8..0000000000 --- a/tests/expectations/parser/parser/expression/literal/static_fail.leo.out +++ /dev/null @@ -1,19 +0,0 @@ ---- -namespace: ParseExpression -expectation: Fail -outputs: - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'address'\n --> test:1:1\n |\n 1 | address::call()\n | ^^^^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'bool'\n --> test:1:1\n |\n 1 | bool::call()\n | ^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'char'\n --> test:1:1\n |\n 1 | char::call()\n | ^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'field'\n --> test:1:1\n |\n 1 | field::call()\n | ^^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'group'\n --> test:1:1\n |\n 1 | group::call()\n | ^^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'i8'\n --> test:1:1\n |\n 1 | i8::call()\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'i16'\n --> test:1:1\n |\n 1 | i16::call()\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'i32'\n --> test:1:1\n |\n 1 | i32::call()\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'i64'\n --> test:1:1\n |\n 1 | i64::call()\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'i128'\n --> test:1:1\n |\n 1 | i128::call()\n | ^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'u8'\n --> test:1:1\n |\n 1 | u8::call()\n | ^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'u16'\n --> test:1:1\n |\n 1 | u16::call()\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'u32'\n --> test:1:1\n |\n 1 | u32::call()\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'u64'\n --> test:1:1\n |\n 1 | u64::call()\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'u128'\n --> test:1:1\n |\n 1 | u128::call()\n | ^^^^" diff --git a/tests/expectations/parser/parser/expression/literal/string_parse.leo.out b/tests/expectations/parser/parser/expression/literal/string_parse.leo.out deleted file mode 100644 index cd98aa67b8..0000000000 --- a/tests/expectations/parser/parser/expression/literal/string_parse.leo.out +++ /dev/null @@ -1,200 +0,0 @@ ---- -namespace: ParseExpression -expectation: Pass -outputs: - - Value: - String: - - - Scalar: 115 - - Scalar: 116 - - Scalar: 114 - - Scalar: 105 - - Scalar: 110 - - Scalar: 103 - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 9 - path: "" - content: "\"string\"" - - Value: - String: - - - Scalar: 97 - - Scalar: 110 - - Scalar: 111 - - Scalar: 116 - - Scalar: 104 - - Scalar: 101 - - Scalar: 114 - - Scalar: 32 - - Scalar: 123 - - Scalar: 32 - - Scalar: 125 - - Scalar: 32 - - Scalar: 115 - - Scalar: 116 - - Scalar: 114 - - Scalar: 105 - - Scalar: 110 - - Scalar: 103 - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 21 - path: "" - content: "\"another { } string\"" - - Value: - String: - - - Scalar: 123 - - Scalar: 32 - - Scalar: 93 - - Scalar: 32 - - Scalar: 91 - - Scalar: 32 - - Scalar: 59 - - Scalar: 32 - - Scalar: 97 - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: "\"{ ] [ ; a\"" - - Value: - String: - - - Scalar: 4090 - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 10 - path: "" - content: "\"\\u{FFA}\"" - - Value: - String: - - - Scalar: 719610 - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 12 - path: "" - content: "\"\\u{afafa}\"" - - Value: - String: - - - Scalar: 44975 - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 11 - path: "" - content: "\"\\u{afaf}\"" - - Value: - String: - - - Scalar: 2810 - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 10 - path: "" - content: "\"\\u{afa}\"" - - Value: - String: - - - Scalar: 175 - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 9 - path: "" - content: "\"\\u{af}\"" - - Value: - String: - - - Scalar: 10 - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 8 - path: "" - content: "\"\\u{a}\"" - - Value: - String: - - - Scalar: 10 - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: "\"\\x0A\"" - - Value: - String: - - - Scalar: 127 - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 7 - path: "" - content: "\"\\x7F\"" - - Value: - String: - - - Scalar: 97 - - Scalar: 97 - - Scalar: 32 - - Scalar: 92 - - Scalar: 32 - - Scalar: 34 - - Scalar: 32 - - Scalar: 32 - - Scalar: 10 - - Scalar: 32 - - Scalar: 97 - - Scalar: 97 - - Scalar: 32 - - Scalar: 9 - - Scalar: 32 - - Scalar: 13 - - Scalar: 32 - - Scalar: 32 - - Scalar: 0 - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 28 - path: "" - content: "\"aa \\\\ \\\" \\n aa \\t \\r \\0\"" - - Value: - String: - - - Scalar: 116 - - Scalar: 101 - - Scalar: 115 - - Scalar: 116 - - Scalar: 32 - - Scalar: 128530 - - Scalar: 8364 - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 15 - path: "" - content: "\"test 😒€\"" - - Value: - String: - - - Scalar: 128557 - - Scalar: 128514 - - Scalar: 128536 - - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 15 - path: "" - content: "\"😭😂😘\"" diff --git a/tests/expectations/parser/parser/expression/tuple.leo.out b/tests/expectations/parser/parser/expression/tuple.leo.out deleted file mode 100644 index 4327b56b7b..0000000000 --- a/tests/expectations/parser/parser/expression/tuple.leo.out +++ /dev/null @@ -1,98 +0,0 @@ ---- -namespace: ParseExpression -expectation: Pass -outputs: - - Value: - Implicit: - - "" - - span: - line_start: 0 - line_stop: 0 - col_start: 0 - col_stop: 0 - path: "" - content: "" - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x)\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(y)\\\"}\"}" - - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(z)\\\"}\"}" - - Value: - Implicit: - - "" - - span: - line_start: 0 - line_stop: 0 - col_start: 0 - col_stop: 0 - path: "" - content: "" - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x,)\\\"}\"}" - - TupleInit: - elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x,y)\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x,y)\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 6 - path: "" - content: "(x,y)" - - TupleInit: - elements: - - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x,y,z)\\\"}\"}" - - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x,y,z)\\\"}\"}" - - Identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"(x,y,z)\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 8 - path: "" - content: "(x,y,z)" - - TupleInit: - elements: - - Value: - Implicit: - - "123" - - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 5 - path: "" - content: "(123,123)" - - Value: - Implicit: - - "123" - - span: - line_start: 1 - line_stop: 1 - col_start: 6 - col_stop: 9 - path: "" - content: "(123,123)" - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 10 - path: "" - content: "(123,123)" - - TupleInit: - elements: [] - span: - line_start: 1 - line_stop: 1 - col_start: 1 - col_stop: 3 - path: "" - content: () - - TupleInit: - elements: [] - span: - line_start: 1 - line_stop: 1 - col_start: 2 - col_stop: 4 - path: "" - content: (()) diff --git a/tests/expectations/parser/parser/functions/annotated.leo.out b/tests/expectations/parser/parser/functions/annotated.leo.out deleted file mode 100644 index 7680179979..0000000000 --- a/tests/expectations/parser/parser/functions/annotated.leo.out +++ /dev/null @@ -1,217 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - global_consts: {} - functions: - "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function a() {\\\"}\"}": - annotations: - test: - span: - line_start: 3 - line_stop: 3 - col_start: 1 - col_stop: 6 - path: "" - content: "@test" - name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test\\\"}\"}" - arguments: [] - identifier: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function a() {\\\"}\"}" - input: [] - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 5 - line_stop: 5 - col_start: 12 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 5 - line_stop: 5 - col_start: 5 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 4 - line_stop: 6 - col_start: 14 - col_stop: 2 - path: "" - content: "function a() {\n ...\n}" - span: - line_start: 4 - line_stop: 6 - col_start: 1 - col_stop: 2 - path: "" - content: "function a() {\n ...\n}" - "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function b() {\\\"}\"}": - annotations: - test: - span: - line_start: 8 - line_stop: 8 - col_start: 1 - col_stop: 12 - path: "" - content: "@test(test)" - name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test(test)\\\"}\"}" - arguments: - - test - identifier: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function b() {\\\"}\"}" - input: [] - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 10 - line_stop: 10 - col_start: 12 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 10 - line_stop: 10 - col_start: 5 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 9 - line_stop: 11 - col_start: 14 - col_stop: 2 - path: "" - content: "function b() {\n ...\n}" - span: - line_start: 9 - line_stop: 11 - col_start: 1 - col_stop: 2 - path: "" - content: "function b() {\n ...\n}" - "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function c() {\\\"}\"}": - annotations: - test: - span: - line_start: 13 - line_stop: 13 - col_start: 1 - col_stop: 13 - path: "" - content: "@test(test,)" - name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test(test,)\\\"}\"}" - arguments: - - test - identifier: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function c() {\\\"}\"}" - input: [] - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 15 - line_stop: 15 - col_start: 12 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 15 - line_stop: 15 - col_start: 5 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 14 - line_stop: 16 - col_start: 14 - col_stop: 2 - path: "" - content: "function c() {\n ...\n}" - span: - line_start: 14 - line_stop: 16 - col_start: 1 - col_stop: 2 - path: "" - content: "function c() {\n ...\n}" - "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function d() {\\\"}\"}": - annotations: - test: - span: - line_start: 18 - line_stop: 18 - col_start: 1 - col_stop: 8 - path: "" - content: "@test()" - name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":18,\\\"line_stop\\\":18,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test()\\\"}\"}" - arguments: [] - identifier: "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function d() {\\\"}\"}" - input: [] - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 20 - line_stop: 20 - col_start: 12 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 20 - line_stop: 20 - col_start: 5 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 19 - line_stop: 21 - col_start: 14 - col_stop: 2 - path: "" - content: "function d() {\n ...\n}" - span: - line_start: 19 - line_stop: 21 - col_start: 1 - col_stop: 2 - path: "" - content: "function d() {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/annotated_arg_not_ident_int.leo.out b/tests/expectations/parser/parser/functions/annotated_arg_not_ident_int.leo.out deleted file mode 100644 index 4c32e5ad4b..0000000000 --- a/tests/expectations/parser/parser/functions/annotated_arg_not_ident_int.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - "Error [EPAR0370009]: unexpected string: expected 'ident', got '?'\n --> test:3:6\n |\n 3 | @foo(?, bar, ?)\n | ^\nError [EPAR0370009]: unexpected string: expected 'ident', got '?'\n --> test:3:14\n |\n 3 | @foo(?, bar, ?)\n | ^\nError [EPAR0370017]: \"@context(...)\" is deprecated. Did you mean @test annotation?\n --> test:8:2\n |\n 8 | @context // recovery witness\n | ^^^^^^^" diff --git a/tests/expectations/parser/parser/functions/annotated_fail.leo.out b/tests/expectations/parser/parser/functions/annotated_fail.leo.out deleted file mode 100644 index f3bf4dee20..0000000000 --- a/tests/expectations/parser/parser/functions/annotated_fail.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - "Error [EPAR0370005]: expected 'identifier', 'number' -- got ')'\n --> test:3:12\n |\n 3 | @test(test,)\n | ^" diff --git a/tests/expectations/parser/parser/functions/annotated_param.leo.out b/tests/expectations/parser/parser/functions/annotated_param.leo.out deleted file mode 100644 index f5201f6956..0000000000 --- a/tests/expectations/parser/parser/functions/annotated_param.leo.out +++ /dev/null @@ -1,63 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - global_consts: {} - functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": - annotations: - test: - span: - line_start: 3 - line_stop: 3 - col_start: 1 - col_stop: 12 - path: "" - content: "@test(test)" - name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test(test)\\\"}\"}" - arguments: - - test - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" - input: [] - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 5 - line_stop: 5 - col_start: 12 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 5 - line_stop: 5 - col_start: 5 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 4 - line_stop: 6 - col_start: 14 - col_stop: 2 - path: "" - content: "function x() {\n ...\n}" - span: - line_start: 4 - line_stop: 6 - col_start: 1 - col_stop: 2 - path: "" - content: "function x() {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/annotated_twice.leo.out b/tests/expectations/parser/parser/functions/annotated_twice.leo.out deleted file mode 100644 index 2ab2a1eff1..0000000000 --- a/tests/expectations/parser/parser/functions/annotated_twice.leo.out +++ /dev/null @@ -1,72 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - global_consts: {} - functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": - annotations: - test: - span: - line_start: 3 - line_stop: 3 - col_start: 1 - col_stop: 6 - path: "" - content: "@test @test2" - name: "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test @test2\\\"}\"}" - arguments: [] - test2: - span: - line_start: 3 - line_stop: 3 - col_start: 7 - col_stop: 13 - path: "" - content: "@test @test2" - name: "{\"name\":\"test2\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test @test2\\\"}\"}" - arguments: [] - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" - input: [] - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 5 - line_stop: 5 - col_start: 12 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 5 - line_stop: 5 - col_start: 5 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 4 - line_stop: 6 - col_start: 14 - col_stop: 2 - path: "" - content: "function x() {\n ...\n}" - span: - line_start: 4 - line_stop: 6 - col_start: 1 - col_stop: 2 - path: "" - content: "function x() {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/bounded_recursion.leo.out b/tests/expectations/parser/parser/functions/bounded_recursion.leo.out index b31de72c72..a788043e32 100644 --- a/tests/expectations/parser/parser/functions/bounded_recursion.leo.out +++ b/tests/expectations/parser/parser/functions/bounded_recursion.leo.out @@ -10,9 +10,7 @@ outputs: input: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const y: u32) {\\\"}\"}" - const_: true - public: false - mutable: false + mode: Const type_: IntegerType: U32 span: @@ -130,9 +128,7 @@ outputs: input: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":15,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(y: bool) -> bool {\\\"}\"}" - const_: false - public: false - mutable: true + mode: Private type_: Boolean span: line_start: 9 diff --git a/tests/expectations/parser/parser/functions/bounded_recursion_fail.leo.out b/tests/expectations/parser/parser/functions/bounded_recursion_fail.leo.out deleted file mode 100644 index aed18632e6..0000000000 --- a/tests/expectations/parser/parser/functions/bounded_recursion_fail.leo.out +++ /dev/null @@ -1,208 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - circuits: {} - global_consts: {} - functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const y: u32) {\\\"}\"}": - annotations: {} - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const y: u32) {\\\"}\"}" - input: - - Variable: - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const y: u32) {\\\"}\"}" - const_: true - mutable: false - type_: - IntegerType: U32 - span: - line_start: 3 - line_stop: 3 - col_start: 18 - col_stop: 19 - path: "" - content: "function x(const y: u32) {" - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Conditional: - condition: - Binary: - left: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if y < 999u32 {\\\"}\"}" - right: - Value: - Integer: - - U32 - - "999" - - span: - line_start: 4 - line_stop: 4 - col_start: 12 - col_stop: 18 - path: "" - content: " if y < 999u32 {" - op: Lt - span: - line_start: 4 - line_stop: 4 - col_start: 8 - col_stop: 18 - path: "" - content: " if y < 999u32 {" - block: - statements: - - Expression: - expression: - Call: - function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x(y+1);\\\"}\"}" - arguments: - - Binary: - left: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x(y+1);\\\"}\"}" - right: - Value: - Implicit: - - "1" - - span: - line_start: 5 - line_stop: 5 - col_start: 13 - col_stop: 14 - path: "" - content: " x(y+1);" - op: Add - span: - line_start: 5 - line_stop: 5 - col_start: 11 - col_stop: 14 - path: "" - content: " x(y+1);" - span: - line_start: 5 - line_stop: 5 - col_start: 9 - col_stop: 15 - path: "" - content: " x(y+1);" - span: - line_start: 5 - line_stop: 5 - col_start: 9 - col_stop: 15 - path: "" - content: " x(y+1);" - span: - line_start: 4 - line_stop: 6 - col_start: 19 - col_stop: 6 - path: "" - content: " if y < 999u32 {\n ...\n }" - next: ~ - span: - line_start: 4 - line_stop: 6 - col_start: 5 - col_stop: 6 - path: "" - content: " if y < 999u32 {\n ...\n }" - span: - line_start: 3 - line_stop: 7 - col_start: 26 - col_stop: 2 - path: "" - content: "function x(const y: u32) {\n ...\n ...\n ...\n}" - span: - line_start: 3 - line_stop: 7 - col_start: 1 - col_stop: 2 - path: "" - content: "function x(const y: u32) {\n ...\n ...\n ...\n}" - "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(y: bool) -> bool {\\\"}\"}": - annotations: {} - identifier: "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(y: bool) -> bool {\\\"}\"}" - input: - - Variable: - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":15,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(y: bool) -> bool {\\\"}\"}" - const_: false - mutable: true - type_: Boolean - span: - line_start: 9 - line_stop: 9 - col_start: 15 - col_stop: 16 - path: "" - content: "function main(y: bool) -> bool {" - const_: false - output: Boolean - core_mapping: ~ - block: - statements: - - Expression: - expression: - Call: - function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x(1u32);\\\"}\"}" - arguments: - - Value: - Integer: - - U32 - - "1" - - span: - line_start: 10 - line_stop: 10 - col_start: 7 - col_stop: 11 - path: "" - content: " x(1u32);" - span: - line_start: 10 - line_stop: 10 - col_start: 5 - col_stop: 12 - path: "" - content: " x(1u32);" - span: - line_start: 10 - line_stop: 10 - col_start: 5 - col_stop: 12 - path: "" - content: " x(1u32);" - - Return: - expression: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return y;\\\"}\"}" - span: - line_start: 11 - line_stop: 11 - col_start: 5 - col_stop: 13 - path: "" - content: " return y;" - span: - line_start: 9 - line_stop: 12 - col_start: 32 - col_stop: 2 - path: "" - content: "function main(y: bool) -> bool {\n ...\n ...\n}" - span: - line_start: 9 - line_stop: 12 - col_start: 1 - col_stop: 2 - path: "" - content: "function main(y: bool) -> bool {\n ...\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/const_param.leo.out b/tests/expectations/parser/parser/functions/const_param.leo.out index 245dd27192..7d45b0007a 100644 --- a/tests/expectations/parser/parser/functions/const_param.leo.out +++ b/tests/expectations/parser/parser/functions/const_param.leo.out @@ -10,9 +10,7 @@ outputs: input: - Variable: identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}" - const_: false - public: false - mutable: true + mode: Private type_: IntegerType: U32 span: @@ -24,9 +22,7 @@ outputs: content: "function x(x: u32, const y: i32) {" - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}" - const_: true - public: false - mutable: false + mode: Const type_: IntegerType: I32 span: @@ -79,9 +75,7 @@ outputs: input: - Variable: identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}" - const_: true - public: false - mutable: false + mode: Const type_: IntegerType: U32 span: @@ -93,9 +87,7 @@ outputs: content: "function x(const x: u32, y: i32) {" - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const x: u32, y: i32) {\\\"}\"}" - const_: false - public: false - mutable: true + mode: Private type_: IntegerType: I32 span: diff --git a/tests/expectations/parser/parser/functions/const_self_bad.leo.out b/tests/expectations/parser/parser/functions/const_self_bad.leo.out deleted file mode 100644 index bbf0acc44a..0000000000 --- a/tests/expectations/parser/parser/functions/const_self_bad.leo.out +++ /dev/null @@ -1,53 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - global_consts: {} - functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}": - annotations: {} - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}" - input: - - ConstSelfKeyword: "{\"name\":\"const self\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}" - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 4 - line_stop: 4 - col_start: 12 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 4 - line_stop: 4 - col_start: 5 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 3 - line_stop: 5 - col_start: 24 - col_stop: 2 - path: "" - content: "function x(const self) {\n ...\n}" - span: - line_start: 3 - line_stop: 5 - col_start: 1 - col_stop: 2 - path: "" - content: "function x(const self) {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/empty.leo.out b/tests/expectations/parser/parser/functions/empty.leo.out deleted file mode 100644 index 090289cdca..0000000000 --- a/tests/expectations/parser/parser/functions/empty.leo.out +++ /dev/null @@ -1,47 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" - input: [] - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 4 - line_stop: 4 - col_start: 12 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 4 - line_stop: 4 - col_start: 5 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 3 - line_stop: 5 - col_start: 14 - col_stop: 2 - path: "" - content: "function x() {\n ...\n}" - span: - line_start: 3 - line_stop: 5 - col_start: 1 - col_stop: 2 - path: "" - content: "function x() {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/infinite_recursion.leo.out b/tests/expectations/parser/parser/functions/infinite_recursion.leo.out index 5961f3fd16..6dc533620d 100644 --- a/tests/expectations/parser/parser/functions/infinite_recursion.leo.out +++ b/tests/expectations/parser/parser/functions/infinite_recursion.leo.out @@ -52,9 +52,7 @@ outputs: input: - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":15,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(y: bool) -> bool {\\\"}\"}" - const_: false - public: false - mutable: true + mode: Private type_: Boolean span: line_start: 7 diff --git a/tests/expectations/parser/parser/functions/infinite_recursion_fail.leo.out b/tests/expectations/parser/parser/functions/infinite_recursion_fail.leo.out deleted file mode 100644 index 93a823f907..0000000000 --- a/tests/expectations/parser/parser/functions/infinite_recursion_fail.leo.out +++ /dev/null @@ -1,120 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - circuits: {} - global_consts: {} - functions: - "{\"name\":\"inf\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function inf() {\\\"}\"}": - annotations: {} - identifier: "{\"name\":\"inf\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function inf() {\\\"}\"}" - input: [] - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Expression: - expression: - Call: - function: - Identifier: "{\"name\":\"inf\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" inf();\\\"}\"}" - arguments: [] - span: - line_start: 4 - line_stop: 4 - col_start: 5 - col_stop: 10 - path: "" - content: " inf();" - span: - line_start: 4 - line_stop: 4 - col_start: 5 - col_stop: 10 - path: "" - content: " inf();" - span: - line_start: 3 - line_stop: 5 - col_start: 16 - col_stop: 2 - path: "" - content: "function inf() {\n ...\n}" - span: - line_start: 3 - line_stop: 5 - col_start: 1 - col_stop: 2 - path: "" - content: "function inf() {\n ...\n}" - "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(y: bool) -> bool {\\\"}\"}": - annotations: {} - identifier: "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(y: bool) -> bool {\\\"}\"}" - input: - - Variable: - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":15,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(y: bool) -> bool {\\\"}\"}" - const_: false - mutable: true - type_: Boolean - span: - line_start: 7 - line_stop: 7 - col_start: 15 - col_stop: 16 - path: "" - content: "function main(y: bool) -> bool {" - const_: false - output: Boolean - core_mapping: ~ - block: - statements: - - Expression: - expression: - Call: - function: - Identifier: "{\"name\":\"inf\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" inf();\\\"}\"}" - arguments: [] - span: - line_start: 8 - line_stop: 8 - col_start: 5 - col_stop: 10 - path: "" - content: " inf();" - span: - line_start: 8 - line_stop: 8 - col_start: 5 - col_stop: 10 - path: "" - content: " inf();" - - Return: - expression: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return y;\\\"}\"}" - span: - line_start: 9 - line_stop: 9 - col_start: 5 - col_stop: 13 - path: "" - content: " return y;" - span: - line_start: 7 - line_stop: 10 - col_start: 32 - col_stop: 2 - path: "" - content: "function main(y: bool) -> bool {\n ...\n ...\n}" - span: - line_start: 7 - line_stop: 10 - col_start: 1 - col_stop: 2 - path: "" - content: "function main(y: bool) -> bool {\n ...\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/mut_input.leo.out b/tests/expectations/parser/parser/functions/mut_input.leo.out deleted file mode 100644 index 96efaffce6..0000000000 --- a/tests/expectations/parser/parser/functions/mut_input.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - "Error [EPAR0370013]: function func(mut a: u32) { ... } is deprecated. Passed variables are mutable by default.\n --> test:3:12\n |\n 3 | function f(mut a: u8) {}\n | ^^^^^" diff --git a/tests/expectations/parser/parser/functions/param_array.leo.out b/tests/expectations/parser/parser/functions/param_array.leo.out deleted file mode 100644 index e0b27ae7a2..0000000000 --- a/tests/expectations/parser/parser/functions/param_array.leo.out +++ /dev/null @@ -1,66 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - global_consts: {} - functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: [u8; 12]) {\\\"}\"}": - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: [u8; 12]) {\\\"}\"}" - input: - - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: [u8; 12]) {\\\"}\"}" - const_: false - mutable: true - type_: - Array: - - IntegerType: U8 - - - value: "12" - span: - line_start: 3 - line_stop: 3 - col_start: 12 - col_stop: 13 - path: "" - content: "function x(x: [u8; 12]) {" - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 4 - line_stop: 4 - col_start: 12 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 4 - line_stop: 4 - col_start: 5 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 3 - line_stop: 5 - col_start: 25 - col_stop: 2 - path: "" - content: "function x(x: [u8; 12]) {\n ...\n}" - span: - line_start: 3 - line_stop: 5 - col_start: 1 - col_stop: 2 - path: "" - content: "function x(x: [u8; 12]) {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/param_circuit.leo.out b/tests/expectations/parser/parser/functions/param_circuit.leo.out deleted file mode 100644 index d05ebf1548..0000000000 --- a/tests/expectations/parser/parser/functions/param_circuit.leo.out +++ /dev/null @@ -1,64 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - global_consts: {} - functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}": - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}" - input: - - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}" - const_: false - mutable: true - type_: - Identifier: "{\"name\":\"MyCircuit\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":15,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: MyCircuit) {\\\"}\"}" - span: - line_start: 3 - line_stop: 3 - col_start: 12 - col_stop: 13 - path: "" - content: "function x(x: MyCircuit) {" - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 4 - line_stop: 4 - col_start: 12 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 4 - line_stop: 4 - col_start: 5 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 3 - line_stop: 5 - col_start: 26 - col_stop: 2 - path: "" - content: "function x(x: MyCircuit) {\n ...\n}" - span: - line_start: 3 - line_stop: 5 - col_start: 1 - col_stop: 2 - path: "" - content: "function x(x: MyCircuit) {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/param_tuple.leo.out b/tests/expectations/parser/parser/functions/param_tuple.leo.out deleted file mode 100644 index d9952c25e2..0000000000 --- a/tests/expectations/parser/parser/functions/param_tuple.leo.out +++ /dev/null @@ -1,62 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}": - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}" - input: - - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}" - const_: false - mutable: true - type_: - Tuple: - - IntegerType: U32 - - IntegerType: I32 - span: - line_start: 3 - line_stop: 3 - col_start: 12 - col_stop: 13 - path: "" - content: "function x(x: (u32, i32)) {" - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 4 - line_stop: 4 - col_start: 12 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 4 - line_stop: 4 - col_start: 5 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 3 - line_stop: 5 - col_start: 27 - col_stop: 2 - path: "" - content: "function x(x: (u32, i32)) {\n ...\n}" - span: - line_start: 3 - line_stop: 5 - col_start: 1 - col_stop: 2 - path: "" - content: "function x(x: (u32, i32)) {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/params.leo.out b/tests/expectations/parser/parser/functions/params.leo.out index e151c1272b..d015e041e3 100644 --- a/tests/expectations/parser/parser/functions/params.leo.out +++ b/tests/expectations/parser/parser/functions/params.leo.out @@ -10,9 +10,7 @@ outputs: input: - Variable: identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" - const_: false - public: false - mutable: true + mode: Private type_: IntegerType: U32 span: @@ -24,9 +22,7 @@ outputs: content: "function x(x: u32, y: i32) {" - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" - const_: false - public: false - mutable: true + mode: Private type_: IntegerType: I32 span: diff --git a/tests/expectations/parser/parser/functions/params_return.leo.out b/tests/expectations/parser/parser/functions/params_return.leo.out index 0cee2e9ffc..76450c197f 100644 --- a/tests/expectations/parser/parser/functions/params_return.leo.out +++ b/tests/expectations/parser/parser/functions/params_return.leo.out @@ -10,9 +10,7 @@ outputs: input: - Variable: identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}" - const_: false - public: false - mutable: true + mode: Private type_: IntegerType: U32 span: @@ -24,9 +22,7 @@ outputs: content: "function x(x: u32, y: i32) -> u32 {" - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}" - const_: false - public: false - mutable: true + mode: Private type_: IntegerType: I32 span: diff --git a/tests/expectations/parser/parser/functions/public_const_param.leo.out b/tests/expectations/parser/parser/functions/public_const_param.leo.out deleted file mode 100644 index 978984bd39..0000000000 --- a/tests/expectations/parser/parser/functions/public_const_param.leo.out +++ /dev/null @@ -1,145 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, public const y: i32) {\\\"}\"}": - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, public const y: i32) {\\\"}\"}" - input: - - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, public const y: i32) {\\\"}\"}" - const_: false - public: false - mutable: true - type_: - IntegerType: U32 - span: - line_start: 3 - line_stop: 3 - col_start: 12 - col_stop: 13 - path: "" - content: "function x(x: u32, public const y: i32) {" - - Variable: - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":33,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, public const y: i32) {\\\"}\"}" - const_: true - public: true - mutable: false - type_: - IntegerType: I32 - span: - line_start: 3 - line_stop: 3 - col_start: 33 - col_stop: 34 - path: "" - content: "function x(x: u32, public const y: i32) {" - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - Value: - Implicit: - - "0" - - span: - line_start: 4 - line_stop: 4 - col_start: 12 - col_stop: 13 - path: "" - content: " return 0;" - span: - line_start: 4 - line_stop: 4 - col_start: 5 - col_stop: 13 - path: "" - content: " return 0;" - span: - line_start: 3 - line_stop: 5 - col_start: 41 - col_stop: 2 - path: "" - content: "function x(x: u32, public const y: i32) {\n ...\n}" - span: - line_start: 3 - line_stop: 5 - col_start: 1 - col_stop: 2 - path: "" - content: "function x(x: u32, public const y: i32) {\n ...\n}" - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(public const x: u32, y: i32) {\\\"}\"}": - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(public const x: u32, y: i32) {\\\"}\"}" - input: - - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":25,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(public const x: u32, y: i32) {\\\"}\"}" - const_: true - public: true - mutable: false - type_: - IntegerType: U32 - span: - line_start: 7 - line_stop: 7 - col_start: 25 - col_stop: 26 - path: "" - content: "function x(public const x: u32, y: i32) {" - - Variable: - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":33,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(public const x: u32, y: i32) {\\\"}\"}" - const_: false - public: false - mutable: true - type_: - IntegerType: I32 - span: - line_start: 7 - line_stop: 7 - col_start: 33 - col_stop: 34 - path: "" - content: "function x(public const x: u32, y: i32) {" - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Return: - expression: - Value: - Implicit: - - "0" - - span: - line_start: 8 - line_stop: 8 - col_start: 12 - col_stop: 13 - path: "" - content: " return 0;" - span: - line_start: 8 - line_stop: 8 - col_start: 5 - col_stop: 13 - path: "" - content: " return 0;" - span: - line_start: 7 - line_stop: 9 - col_start: 41 - col_stop: 2 - path: "" - content: "function x(public const x: u32, y: i32) {\n ...\n}" - span: - line_start: 7 - line_stop: 9 - col_start: 1 - col_stop: 2 - path: "" - content: "function x(public const x: u32, y: i32) {\n ...\n}" diff --git a/tests/expectations/parser/parser/functions/public_const_param_fail.leo.out b/tests/expectations/parser/parser/functions/public_const_param_fail.leo.out new file mode 100644 index 0000000000..98cce4b400 --- /dev/null +++ b/tests/expectations/parser/parser/functions/public_const_param_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Parse +expectation: Fail +outputs: + - "Error [EPAR0370041]: A parameter cannot be both public and const.\n --> test:3:20\n |\n 3 | function x(x: u32, public const y: i32) {\n | ^^^^^^^^^^^^" diff --git a/tests/expectations/parser/parser/functions/public_param.leo.out b/tests/expectations/parser/parser/functions/public_param.leo.out index 18a113e1c7..645b1a38b1 100644 --- a/tests/expectations/parser/parser/functions/public_param.leo.out +++ b/tests/expectations/parser/parser/functions/public_param.leo.out @@ -10,9 +10,7 @@ outputs: input: - Variable: identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, public y: i32) {\\\"}\"}" - const_: false - public: false - mutable: true + mode: Private type_: IntegerType: U32 span: @@ -24,9 +22,7 @@ outputs: content: "function x(x: u32, public y: i32) {" - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":27,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, public y: i32) {\\\"}\"}" - const_: false - public: true - mutable: true + mode: Public type_: IntegerType: I32 span: @@ -79,9 +75,7 @@ outputs: input: - Variable: identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":19,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(public x: u32, y: i32) {\\\"}\"}" - const_: false - public: true - mutable: true + mode: Public type_: IntegerType: U32 span: @@ -93,9 +87,7 @@ outputs: content: "function x(public x: u32, y: i32) {" - Variable: identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":27,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(public x: u32, y: i32) {\\\"}\"}" - const_: false - public: false - mutable: true + mode: Private type_: IntegerType: I32 span: diff --git a/tests/expectations/parser/parser/functions/return_tuple.leo.out b/tests/expectations/parser/parser/functions/return_tuple.leo.out deleted file mode 100644 index 37cef6e6e3..0000000000 --- a/tests/expectations/parser/parser/functions/return_tuple.leo.out +++ /dev/null @@ -1,50 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - functions: - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() -> (u32, u32) {\\\"}\"}": - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() -> (u32, u32) {\\\"}\"}" - input: [] - const_: false - output: - Tuple: - - IntegerType: U32 - - IntegerType: U32 - core_mapping: ~ - block: - statements: - - Return: - expression: - TupleInit: - elements: [] - span: - line_start: 4 - line_stop: 4 - col_start: 12 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 4 - line_stop: 4 - col_start: 5 - col_stop: 14 - path: "" - content: " return ();" - span: - line_start: 3 - line_stop: 5 - col_start: 28 - col_stop: 2 - path: "" - content: "function x() -> (u32, u32) {\n ...\n}" - span: - line_start: 3 - line_stop: 5 - col_start: 1 - col_stop: 2 - path: "" - content: "function x() -> (u32, u32) {\n ...\n}" diff --git a/tests/expectations/parser/parser/import/alias.leo.out b/tests/expectations/parser/parser/import/alias.leo.out deleted file mode 100644 index 0aed27aec6..0000000000 --- a/tests/expectations/parser/parser/import/alias.leo.out +++ /dev/null @@ -1,25 +0,0 @@ ---- -namespace: ParseImport -expectation: Pass -outputs: - - tree: - base: - - "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a.b as bar;\\\"}\"}" - - "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a.b as bar;\\\"}\"}" - kind: - Leaf: - alias: "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":15,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a.b as bar;\\\"}\"}" - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 18 - path: "" - content: import a.b as bar; - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 18 - path: "" - content: import a.b as bar; diff --git a/tests/expectations/parser/parser/import/basic.leo.out b/tests/expectations/parser/parser/import/basic.leo.out deleted file mode 100644 index 02412948b5..0000000000 --- a/tests/expectations/parser/parser/import/basic.leo.out +++ /dev/null @@ -1,46 +0,0 @@ ---- -namespace: ParseImport -expectation: Pass -outputs: - - tree: - base: - - "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a.b;\\\"}\"}" - - "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a.b;\\\"}\"}" - kind: - Leaf: - alias: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 11 - path: "" - content: import a.b; - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 11 - path: "" - content: import a.b; - - tree: - base: - - "{\"name\":\"AB\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import AB.c;\\\"}\"}" - - "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import AB.c;\\\"}\"}" - kind: - Leaf: - alias: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 12 - path: "" - content: import AB.c; - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 12 - path: "" - content: import AB.c; diff --git a/tests/expectations/parser/parser/import/import_empty_list_fail.leo.out b/tests/expectations/parser/parser/import/import_empty_list_fail.leo.out deleted file mode 100644 index 6b6c98c602..0000000000 --- a/tests/expectations/parser/parser/import/import_empty_list_fail.leo.out +++ /dev/null @@ -1,6 +0,0 @@ ---- -namespace: ParseImport -expectation: Fail -outputs: - - "Error [EPAR0370002]: Cannot import empty list\n --> test:1:10\n |\n 1 | import a.();\n | ^^" - - "Error [EPAR0370002]: Cannot import empty list\n --> test:1:10\n |\n 1 | import a.();\n | ^^" diff --git a/tests/expectations/parser/parser/import/invalid.leo.out b/tests/expectations/parser/parser/import/invalid.leo.out deleted file mode 100644 index 6a622f4188..0000000000 --- a/tests/expectations/parser/parser/import/invalid.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: ParseImport -expectation: Fail -outputs: - - "did not consume all input: 'import' @ 2:1-7\n'*' @ 2:8-9\n';' @ 2:9-10\n" diff --git a/tests/expectations/parser/parser/import/invalid_chars_fail.leo.out b/tests/expectations/parser/parser/import/invalid_chars_fail.leo.out deleted file mode 100644 index a533f14747..0000000000 --- a/tests/expectations/parser/parser/import/invalid_chars_fail.leo.out +++ /dev/null @@ -1,6 +0,0 @@ ---- -namespace: ParseImport -expectation: Fail -outputs: - - "Error [EPAR0370009]: unexpected string: expected 'package name', got 'import'\n --> test:1:1\n |\n 1 | import AB.c;\n | ^^^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'package name', got 'import'\n --> test:1:1\n |\n 1 | import AB.c;\n | ^^^^^^" diff --git a/tests/expectations/parser/parser/import/keyword_fail.leo.out b/tests/expectations/parser/parser/import/keyword_fail.leo.out deleted file mode 100644 index 45f5f6c351..0000000000 --- a/tests/expectations/parser/parser/import/keyword_fail.leo.out +++ /dev/null @@ -1,6 +0,0 @@ ---- -namespace: ParseImport -expectation: Fail -outputs: - - "Error [EPAR0370009]: unexpected string: expected 'package name', got 'function'\n --> test:1:8\n |\n 1 | import function.a;\n | ^^^^^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'package name', got 'import'\n --> test:1:8\n |\n 1 | import import.a;\n | ^^^^^^" diff --git a/tests/expectations/parser/parser/import/many_import.leo.out b/tests/expectations/parser/parser/import/many_import.leo.out deleted file mode 100644 index 731114c76a..0000000000 --- a/tests/expectations/parser/parser/import/many_import.leo.out +++ /dev/null @@ -1,130 +0,0 @@ ---- -namespace: ParseImport -expectation: Pass -outputs: - - tree: - base: - - "{\"name\":\"tes_import\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import tes_import.(\\\"}\"}" - kind: - Nested: - tree: - - base: - - "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"Point,\\\"}\"}" - kind: - Leaf: - alias: ~ - span: - line_start: 2 - line_stop: 2 - col_start: 1 - col_stop: 6 - path: "" - content: "Point," - - base: - - "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"foo,\\\"}\"}" - kind: - Leaf: - alias: ~ - span: - line_start: 3 - line_stop: 3 - col_start: 1 - col_stop: 4 - path: "" - content: "foo," - span: - line_start: 1 - line_stop: 4 - col_start: 8 - col_stop: 2 - path: "" - content: "import tes_import.(\n ...\n ...\n);" - span: - line_start: 1 - line_stop: 4 - col_start: 8 - col_stop: 2 - path: "" - content: "import tes_import.(\n ...\n ...\n);" - - tree: - base: - - "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.(\\\"}\"}" - kind: - Nested: - tree: - - base: - - "{\"name\":\"Bar\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"Bar,\\\"}\"}" - kind: - Leaf: - alias: ~ - span: - line_start: 2 - line_stop: 2 - col_start: 1 - col_stop: 4 - path: "" - content: "Bar," - - base: - - "{\"name\":\"baz\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"baz.(Baz, Bazzar),\\\"}\"}" - kind: - Nested: - tree: - - base: - - "{\"name\":\"Baz\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":6,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"baz.(Baz, Bazzar),\\\"}\"}" - kind: - Leaf: - alias: ~ - span: - line_start: 3 - line_stop: 3 - col_start: 6 - col_stop: 9 - path: "" - content: "baz.(Baz, Bazzar)," - - base: - - "{\"name\":\"Bazzar\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":11,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"baz.(Baz, Bazzar),\\\"}\"}" - kind: - Leaf: - alias: ~ - span: - line_start: 3 - line_stop: 3 - col_start: 11 - col_stop: 17 - path: "" - content: "baz.(Baz, Bazzar)," - span: - line_start: 3 - line_stop: 3 - col_start: 1 - col_stop: 18 - path: "" - content: "baz.(Baz, Bazzar)," - - base: - - "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"bat.bat.Bat,\\\"}\"}" - - "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"bat.bat.Bat,\\\"}\"}" - - "{\"name\":\"Bat\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":9,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"bat.bat.Bat,\\\"}\"}" - kind: - Leaf: - alias: ~ - span: - line_start: 4 - line_stop: 4 - col_start: 1 - col_stop: 12 - path: "" - content: "bat.bat.Bat," - span: - line_start: 1 - line_stop: 5 - col_start: 8 - col_stop: 2 - path: "" - content: "import bar.(\n ...\n ...\n ...\n);" - span: - line_start: 1 - line_stop: 5 - col_start: 8 - col_stop: 2 - path: "" - content: "import bar.(\n ...\n ...\n ...\n);" diff --git a/tests/expectations/parser/parser/import/many_import_star.leo.out b/tests/expectations/parser/parser/import/many_import_star.leo.out deleted file mode 100644 index ff2a51d9b8..0000000000 --- a/tests/expectations/parser/parser/import/many_import_star.leo.out +++ /dev/null @@ -1,137 +0,0 @@ ---- -namespace: ParseImport -expectation: Pass -outputs: - - tree: - base: - - "{\"name\":\"test_import\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import test_import.*; // local import\\\"}\"}" - kind: - Glob: - span: - line_start: 1 - line_stop: 1 - col_start: 20 - col_stop: 21 - path: "" - content: import test_import.*; // local import - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 21 - path: "" - content: import test_import.*; // local import - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 21 - path: "" - content: import test_import.*; // local import - - tree: - base: - - "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.*; // imports directory import\\\"}\"}" - kind: - Glob: - span: - line_start: 1 - line_stop: 1 - col_start: 12 - col_stop: 13 - path: "" - content: import bar.*; // imports directory import - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 13 - path: "" - content: import bar.*; // imports directory import - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 13 - path: "" - content: import bar.*; // imports directory import - - tree: - base: - - "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.baz.*; // imports directory import\\\"}\"}" - - "{\"name\":\"baz\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.baz.*; // imports directory import\\\"}\"}" - kind: - Glob: - span: - line_start: 1 - line_stop: 1 - col_start: 16 - col_stop: 17 - path: "" - content: import bar.baz.*; // imports directory import - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 17 - path: "" - content: import bar.baz.*; // imports directory import - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 17 - path: "" - content: import bar.baz.*; // imports directory import - - tree: - base: - - "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.bat.bat.*; // imports directory import\\\"}\"}" - - "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.bat.bat.*; // imports directory import\\\"}\"}" - - "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.bat.bat.*; // imports directory import\\\"}\"}" - kind: - Glob: - span: - line_start: 1 - line_stop: 1 - col_start: 20 - col_stop: 21 - path: "" - content: import bar.bat.bat.*; // imports directory import - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 21 - path: "" - content: import bar.bat.bat.*; // imports directory import - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 21 - path: "" - content: import bar.bat.bat.*; // imports directory import - - tree: - base: - - "{\"name\":\"car\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import car.*; // imports directory import\\\"}\"}" - kind: - Glob: - span: - line_start: 1 - line_stop: 1 - col_start: 12 - col_stop: 13 - path: "" - content: import car.*; // imports directory import - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 13 - path: "" - content: import car.*; // imports directory import - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 13 - path: "" - content: import car.*; // imports directory import diff --git a/tests/expectations/parser/parser/import/names.leo.out b/tests/expectations/parser/parser/import/names.leo.out deleted file mode 100644 index b0cedd3e09..0000000000 --- a/tests/expectations/parser/parser/import/names.leo.out +++ /dev/null @@ -1,67 +0,0 @@ ---- -namespace: ParseImport -expectation: Pass -outputs: - - tree: - base: - - "{\"name\":\"a0_f\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a0_f.foo;\\\"}\"}" - - "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a0_f.foo;\\\"}\"}" - kind: - Leaf: - alias: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 16 - path: "" - content: import a0_f.foo; - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 16 - path: "" - content: import a0_f.foo; - - tree: - base: - - "{\"name\":\"a_9\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a_9.bar;\\\"}\"}" - - "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a_9.bar;\\\"}\"}" - kind: - Leaf: - alias: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 15 - path: "" - content: import a_9.bar; - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 15 - path: "" - content: import a_9.bar; - - tree: - base: - - "{\"name\":\"hello_world\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import hello_world.hello;\\\"}\"}" - - "{\"name\":\"hello\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":20,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import hello_world.hello;\\\"}\"}" - kind: - Leaf: - alias: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 25 - path: "" - content: import hello_world.hello; - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 25 - path: "" - content: import hello_world.hello; diff --git a/tests/expectations/parser/parser/import/names_underscore.leo.out b/tests/expectations/parser/parser/import/names_underscore.leo.out deleted file mode 100644 index 25c42ab9f4..0000000000 --- a/tests/expectations/parser/parser/import/names_underscore.leo.out +++ /dev/null @@ -1,25 +0,0 @@ ---- -namespace: ParseImport -expectation: Pass -outputs: - - tree: - base: - - "{\"name\":\"hello_world\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import hello_world.foo;\\\"}\"}" - - "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":20,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import hello_world.foo;\\\"}\"}" - kind: - Leaf: - alias: ~ - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 23 - path: "" - content: import hello_world.foo; - span: - line_start: 1 - line_stop: 1 - col_start: 8 - col_stop: 23 - path: "" - content: import hello_world.foo; diff --git a/tests/expectations/parser/parser/import/star.leo.out b/tests/expectations/parser/parser/import/star.leo.out deleted file mode 100644 index 222dd3bfb4..0000000000 --- a/tests/expectations/parser/parser/import/star.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: ParseImport -expectation: Fail -outputs: - - "Error [EPAR0370005]: expected ; -- got '-'\n --> test:1:12\n |\n 1 | import test-import.*;\n | ^" diff --git a/tests/expectations/parser/parser/inputs/input_const_success.leo.out b/tests/expectations/parser/parser/inputs/input_const.leo.out similarity index 95% rename from tests/expectations/parser/parser/inputs/input_const_success.leo.out rename to tests/expectations/parser/parser/inputs/input_const.leo.out index 4eea3f8ffa..ad0b1a231a 100644 --- a/tests/expectations/parser/parser/inputs/input_const_success.leo.out +++ b/tests/expectations/parser/parser/inputs/input_const.leo.out @@ -5,8 +5,7 @@ outputs: - sections: - name: main definitions: - - const_: true - public: false + - mode: Const type_: Boolean name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const a: bool = true; \\\"}\"}" value: @@ -27,8 +26,7 @@ outputs: col_stop: 14 path: "" content: "const a: bool = true; " - - const_: true - public: false + - mode: Const type_: IntegerType: U8 name: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const b: u8 = 2; \\\"}\"}" @@ -50,8 +48,7 @@ outputs: col_stop: 12 path: "" content: "const b: u8 = 2; " - - const_: true - public: false + - mode: Const type_: Field name: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const c: field = 0; \\\"}\"}" value: @@ -72,8 +69,7 @@ outputs: col_stop: 15 path: "" content: "const c: field = 0; " - - const_: true - public: false + - mode: Const type_: Group name: "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const d: group = (0, 1)group; \\\"}\"}" value: @@ -114,8 +110,7 @@ outputs: col_stop: 15 path: "" content: "const d: group = (0, 1)group; " - - const_: true - public: false + - mode: Const type_: Address name: "{\"name\":\"e\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" value: @@ -145,8 +140,7 @@ outputs: content: "[main]" - name: registers definitions: - - const_: false - public: false + - mode: Private type_: Boolean name: "{\"name\":\"r0\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r0: bool = true; \\\"}\"}" value: @@ -167,8 +161,7 @@ outputs: col_stop: 9 path: "" content: "r0: bool = true; " - - const_: false - public: false + - mode: Private type_: IntegerType: U8 name: "{\"name\":\"r1\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r1: u8 = 2; \\\"}\"}" @@ -190,8 +183,7 @@ outputs: col_stop: 7 path: "" content: "r1: u8 = 2; " - - const_: false - public: false + - mode: Private type_: Field name: "{\"name\":\"r2\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r2: field = 0; \\\"}\"}" value: @@ -212,8 +204,7 @@ outputs: col_stop: 10 path: "" content: "r2: field = 0; " - - const_: false - public: false + - mode: Private type_: Group name: "{\"name\":\"r3\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r3: group = (0, 1)group; \\\"}\"}" value: @@ -254,8 +245,7 @@ outputs: col_stop: 10 path: "" content: "r3: group = (0, 1)group; " - - const_: false - public: false + - mode: Private type_: Address name: "{\"name\":\"r4\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" value: diff --git a/tests/expectations/parser/parser/inputs/input_const_section_fail .leo.out b/tests/expectations/parser/parser/inputs/input_const_section_fail .leo.out deleted file mode 100644 index 0673b242df..0000000000 --- a/tests/expectations/parser/parser/inputs/input_const_section_fail .leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Input -expectation: Fail -outputs: - - "Error [EPAR0370000]: c0\n --> test:4:1\n |\n 4 | c0: bool = true; \n | ^^" diff --git a/tests/expectations/parser/parser/inputs/input_public_success.leo.out b/tests/expectations/parser/parser/inputs/input_public.leo.out similarity index 95% rename from tests/expectations/parser/parser/inputs/input_public_success.leo.out rename to tests/expectations/parser/parser/inputs/input_public.leo.out index a10ffc05f0..e4de3dbbdc 100644 --- a/tests/expectations/parser/parser/inputs/input_public_success.leo.out +++ b/tests/expectations/parser/parser/inputs/input_public.leo.out @@ -5,8 +5,7 @@ outputs: - sections: - name: main definitions: - - const_: false - public: true + - mode: Public type_: Boolean name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public a: bool = true; \\\"}\"}" value: @@ -27,8 +26,7 @@ outputs: col_stop: 15 path: "" content: "public a: bool = true; " - - const_: false - public: true + - mode: Public type_: IntegerType: U8 name: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public b: u8 = 2; \\\"}\"}" @@ -50,8 +48,7 @@ outputs: col_stop: 13 path: "" content: "public b: u8 = 2; " - - const_: false - public: true + - mode: Public type_: Field name: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public c: field = 0; \\\"}\"}" value: @@ -72,8 +69,7 @@ outputs: col_stop: 16 path: "" content: "public c: field = 0; " - - const_: false - public: true + - mode: Public type_: Group name: "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public d: group = (0, 1)group; \\\"}\"}" value: @@ -114,8 +110,7 @@ outputs: col_stop: 16 path: "" content: "public d: group = (0, 1)group; " - - const_: false - public: true + - mode: Public type_: Address name: "{\"name\":\"e\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" value: @@ -145,8 +140,7 @@ outputs: content: "[main]" - name: registers definitions: - - const_: false - public: false + - mode: Private type_: Boolean name: "{\"name\":\"r0\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r0: bool = true; \\\"}\"}" value: @@ -167,8 +161,7 @@ outputs: col_stop: 9 path: "" content: "r0: bool = true; " - - const_: false - public: false + - mode: Private type_: IntegerType: U8 name: "{\"name\":\"r1\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r1: u8 = 2; \\\"}\"}" @@ -190,8 +183,7 @@ outputs: col_stop: 7 path: "" content: "r1: u8 = 2; " - - const_: false - public: false + - mode: Private type_: Field name: "{\"name\":\"r2\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r2: field = 0; \\\"}\"}" value: @@ -212,8 +204,7 @@ outputs: col_stop: 10 path: "" content: "r2: field = 0; " - - const_: false - public: false + - mode: Private type_: Group name: "{\"name\":\"r3\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r3: group = (0, 1)group; \\\"}\"}" value: @@ -254,8 +245,7 @@ outputs: col_stop: 10 path: "" content: "r3: group = (0, 1)group; " - - const_: false - public: false + - mode: Private type_: Address name: "{\"name\":\"r4\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" value: diff --git a/tests/expectations/parser/parser/inputs/input_public_const_fail.leo.out b/tests/expectations/parser/parser/inputs/input_public_const_fail.leo.out new file mode 100644 index 0000000000..410702f056 --- /dev/null +++ b/tests/expectations/parser/parser/inputs/input_public_const_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Input +expectation: Fail +outputs: + - "Error [EPAR0370041]: A parameter cannot be both public and const.\n --> test:4:1\n |\n 4 | public const a: bool = true; \n | ^^^^^^^^^^^^" diff --git a/tests/expectations/parser/parser/inputs/input_public_const_success.leo.out b/tests/expectations/parser/parser/inputs/input_public_const_success.leo.out deleted file mode 100644 index 48594a616e..0000000000 --- a/tests/expectations/parser/parser/inputs/input_public_const_success.leo.out +++ /dev/null @@ -1,285 +0,0 @@ ---- -namespace: Input -expectation: Pass -outputs: - - sections: - - name: main - definitions: - - const_: true - public: true - type_: Boolean - name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public const a: bool = true; \\\"}\"}" - value: - Value: - Boolean: - - "true" - - span: - line_start: 4 - line_stop: 4 - col_start: 25 - col_stop: 29 - path: "" - content: "public const a: bool = true; " - span: - line_start: 4 - line_stop: 4 - col_start: 17 - col_stop: 21 - path: "" - content: "public const a: bool = true; " - - const_: true - public: true - type_: - IntegerType: U8 - name: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public const b: u8 = 2; \\\"}\"}" - value: - Value: - Implicit: - - "2" - - span: - line_start: 5 - line_stop: 5 - col_start: 25 - col_stop: 26 - path: "" - content: "public const b: u8 = 2; " - span: - line_start: 5 - line_stop: 5 - col_start: 17 - col_stop: 19 - path: "" - content: "public const b: u8 = 2; " - - const_: true - public: true - type_: Field - name: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public const c: field = 0; \\\"}\"}" - value: - Value: - Implicit: - - "0" - - span: - line_start: 6 - line_stop: 6 - col_start: 25 - col_stop: 26 - path: "" - content: "public const c: field = 0; " - span: - line_start: 6 - line_stop: 6 - col_start: 17 - col_stop: 22 - path: "" - content: "public const c: field = 0; " - - const_: true - public: true - type_: Group - name: "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public const d: group = (0, 1)group; \\\"}\"}" - value: - Value: - Group: - Tuple: - x: - Number: - - "0" - - span: - line_start: 7 - line_stop: 7 - col_start: 26 - col_stop: 27 - path: "" - content: "public const d: group = (0, 1)group; " - y: - Number: - - "1" - - span: - line_start: 7 - line_stop: 7 - col_start: 29 - col_stop: 30 - path: "" - content: "public const d: group = (0, 1)group; " - span: - line_start: 7 - line_stop: 7 - col_start: 26 - col_stop: 36 - path: "" - content: "public const d: group = (0, 1)group; " - span: - line_start: 7 - line_stop: 7 - col_start: 17 - col_stop: 22 - path: "" - content: "public const d: group = (0, 1)group; " - - const_: true - public: true - type_: Address - name: "{\"name\":\"e\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"public const e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" - value: - Value: - Address: - - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 - - span: - line_start: 8 - line_stop: 8 - col_start: 27 - col_stop: 90 - path: "" - content: "public const e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" - span: - line_start: 8 - line_stop: 8 - col_start: 17 - col_stop: 24 - path: "" - content: "public const e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" - span: - line_start: 3 - line_stop: 3 - col_start: 2 - col_stop: 6 - path: "" - content: "[main]" - - name: registers - definitions: - - const_: false - public: false - type_: Boolean - name: "{\"name\":\"r0\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r0: bool = true; \\\"}\"}" - value: - Value: - Boolean: - - "true" - - span: - line_start: 11 - line_stop: 11 - col_start: 13 - col_stop: 17 - path: "" - content: "r0: bool = true; " - span: - line_start: 11 - line_stop: 11 - col_start: 5 - col_stop: 9 - path: "" - content: "r0: bool = true; " - - const_: false - public: false - type_: - IntegerType: U8 - name: "{\"name\":\"r1\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r1: u8 = 2; \\\"}\"}" - value: - Value: - Implicit: - - "2" - - span: - line_start: 12 - line_stop: 12 - col_start: 13 - col_stop: 14 - path: "" - content: "r1: u8 = 2; " - span: - line_start: 12 - line_stop: 12 - col_start: 5 - col_stop: 7 - path: "" - content: "r1: u8 = 2; " - - const_: false - public: false - type_: Field - name: "{\"name\":\"r2\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r2: field = 0; \\\"}\"}" - value: - Value: - Implicit: - - "0" - - span: - line_start: 13 - line_stop: 13 - col_start: 13 - col_stop: 14 - path: "" - content: "r2: field = 0; " - span: - line_start: 13 - line_stop: 13 - col_start: 5 - col_stop: 10 - path: "" - content: "r2: field = 0; " - - const_: false - public: false - type_: Group - name: "{\"name\":\"r3\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r3: group = (0, 1)group; \\\"}\"}" - value: - Value: - Group: - Tuple: - x: - Number: - - "0" - - span: - line_start: 14 - line_stop: 14 - col_start: 14 - col_stop: 15 - path: "" - content: "r3: group = (0, 1)group; " - y: - Number: - - "1" - - span: - line_start: 14 - line_stop: 14 - col_start: 17 - col_stop: 18 - path: "" - content: "r3: group = (0, 1)group; " - span: - line_start: 14 - line_stop: 14 - col_start: 14 - col_stop: 24 - path: "" - content: "r3: group = (0, 1)group; " - span: - line_start: 14 - line_stop: 14 - col_start: 5 - col_stop: 10 - path: "" - content: "r3: group = (0, 1)group; " - - const_: false - public: false - type_: Address - name: "{\"name\":\"r4\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" - value: - Value: - Address: - - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 - - span: - line_start: 15 - line_stop: 15 - col_start: 15 - col_stop: 78 - path: "" - content: "r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" - span: - line_start: 15 - line_stop: 15 - col_start: 5 - col_stop: 12 - path: "" - content: "r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" - span: - line_start: 10 - line_stop: 10 - col_start: 2 - col_stop: 11 - path: "" - content: "[registers]" diff --git a/tests/expectations/parser/parser/inputs/input_success.leo.out b/tests/expectations/parser/parser/inputs/input_success.leo.out deleted file mode 100644 index 276903324a..0000000000 --- a/tests/expectations/parser/parser/inputs/input_success.leo.out +++ /dev/null @@ -1,295 +0,0 @@ ---- -namespace: Input -expectation: Pass -outputs: - - sections: - - name: main - definitions: - - const_: false - private: true - public: false - type_: Boolean - name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"private a: bool = true; \\\"}\"}" - value: - Value: - Boolean: - - "true" - - span: - line_start: 4 - line_stop: 4 - col_start: 20 - col_stop: 24 - path: "" - content: "private a: bool = true; " - span: - line_start: 4 - line_stop: 4 - col_start: 12 - col_stop: 16 - path: "" - content: "private a: bool = true; " - - const_: false - private: true - public: false - type_: - IntegerType: U8 - name: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"private b: u8 = 2; \\\"}\"}" - value: - Value: - Implicit: - - "2" - - span: - line_start: 5 - line_stop: 5 - col_start: 20 - col_stop: 21 - path: "" - content: "private b: u8 = 2; " - span: - line_start: 5 - line_stop: 5 - col_start: 12 - col_stop: 14 - path: "" - content: "private b: u8 = 2; " - - const_: false - private: true - public: false - type_: Field - name: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"private c: field = 0; \\\"}\"}" - value: - Value: - Implicit: - - "0" - - span: - line_start: 6 - line_stop: 6 - col_start: 20 - col_stop: 21 - path: "" - content: "private c: field = 0; " - span: - line_start: 6 - line_stop: 6 - col_start: 12 - col_stop: 17 - path: "" - content: "private c: field = 0; " - - const_: false - private: true - public: false - type_: Group - name: "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"private d: group = (0, 1)group; \\\"}\"}" - value: - Value: - Group: - Tuple: - x: - Number: - - "0" - - span: - line_start: 7 - line_stop: 7 - col_start: 21 - col_stop: 22 - path: "" - content: "private d: group = (0, 1)group; " - y: - Number: - - "1" - - span: - line_start: 7 - line_stop: 7 - col_start: 24 - col_stop: 25 - path: "" - content: "private d: group = (0, 1)group; " - span: - line_start: 7 - line_stop: 7 - col_start: 21 - col_stop: 31 - path: "" - content: "private d: group = (0, 1)group; " - span: - line_start: 7 - line_stop: 7 - col_start: 12 - col_stop: 17 - path: "" - content: "private d: group = (0, 1)group; " - - const_: false - private: true - public: false - type_: Address - name: "{\"name\":\"e\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"private e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" - value: - Value: - Address: - - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 - - span: - line_start: 8 - line_stop: 8 - col_start: 22 - col_stop: 85 - path: "" - content: "private e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" - span: - line_start: 8 - line_stop: 8 - col_start: 12 - col_stop: 19 - path: "" - content: "private e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" - span: - line_start: 3 - line_stop: 3 - col_start: 2 - col_stop: 6 - path: "" - content: "[main]" - - name: registers - definitions: - - const_: false - private: false - public: false - type_: Boolean - name: "{\"name\":\"r0\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r0: bool = true; \\\"}\"}" - value: - Value: - Boolean: - - "true" - - span: - line_start: 11 - line_stop: 11 - col_start: 13 - col_stop: 17 - path: "" - content: "r0: bool = true; " - span: - line_start: 11 - line_stop: 11 - col_start: 5 - col_stop: 9 - path: "" - content: "r0: bool = true; " - - const_: false - private: false - public: false - type_: - IntegerType: U8 - name: "{\"name\":\"r1\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r1: u8 = 2; \\\"}\"}" - value: - Value: - Implicit: - - "2" - - span: - line_start: 12 - line_stop: 12 - col_start: 13 - col_stop: 14 - path: "" - content: "r1: u8 = 2; " - span: - line_start: 12 - line_stop: 12 - col_start: 5 - col_stop: 7 - path: "" - content: "r1: u8 = 2; " - - const_: false - private: false - public: false - type_: Field - name: "{\"name\":\"r2\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r2: field = 0; \\\"}\"}" - value: - Value: - Implicit: - - "0" - - span: - line_start: 13 - line_stop: 13 - col_start: 13 - col_stop: 14 - path: "" - content: "r2: field = 0; " - span: - line_start: 13 - line_stop: 13 - col_start: 5 - col_stop: 10 - path: "" - content: "r2: field = 0; " - - const_: false - private: false - public: false - type_: Group - name: "{\"name\":\"r3\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r3: group = (0, 1)group; \\\"}\"}" - value: - Value: - Group: - Tuple: - x: - Number: - - "0" - - span: - line_start: 14 - line_stop: 14 - col_start: 14 - col_stop: 15 - path: "" - content: "r3: group = (0, 1)group; " - y: - Number: - - "1" - - span: - line_start: 14 - line_stop: 14 - col_start: 17 - col_stop: 18 - path: "" - content: "r3: group = (0, 1)group; " - span: - line_start: 14 - line_stop: 14 - col_start: 14 - col_stop: 24 - path: "" - content: "r3: group = (0, 1)group; " - span: - line_start: 14 - line_stop: 14 - col_start: 5 - col_stop: 10 - path: "" - content: "r3: group = (0, 1)group; " - - const_: false - private: false - public: false - type_: Address - name: "{\"name\":\"r4\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" - value: - Value: - Address: - - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 - - span: - line_start: 15 - line_stop: 15 - col_start: 15 - col_stop: 78 - path: "" - content: "r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" - span: - line_start: 15 - line_stop: 15 - col_start: 5 - col_stop: 12 - path: "" - content: "r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" - span: - line_start: 10 - line_stop: 10 - col_start: 2 - col_stop: 11 - path: "" - content: "[registers]" diff --git a/tests/expectations/parser/parser/serialize/linear_regression.leo.out b/tests/expectations/parser/parser/serialize/linear_regression.leo.out deleted file mode 100644 index 91a060a842..0000000000 --- a/tests/expectations/parser/parser/serialize/linear_regression.leo.out +++ /dev/null @@ -1,677 +0,0 @@ ---- -namespace: Serialize -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - circuits: - "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit Point {\\\"}\"}": - circuit_name: "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit Point {\\\"}\"}" - members: - - CircuitVariable: - - "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x: i32,\\\"}\"}" - - IntegerType: I32 - - CircuitVariable: - - "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y: i32,\\\"}\"}" - - IntegerType: I32 - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":14,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(x: i32, y: i32) -> Self { \\\"}\"}" - input: - - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":18,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(x: i32, y: i32) -> Self { \\\"}\"}" - const_: false - mutable: true - type_: - IntegerType: I32 - - Variable: - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(x: i32, y: i32) -> Self { \\\"}\"}" - const_: false - mutable: true - type_: - IntegerType: I32 - const_: false - output: SelfType - core_mapping: ~ - block: - statements: - - Return: - expression: - CircuitInit: - name: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { x, y };\\\"}\"}" - members: - - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { x, y };\\\"}\"}" - expression: ~ - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { x, y };\\\"}\"}" - expression: ~ - "{\"name\":\"LinearRegression\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":9,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit LinearRegression {\\\"}\"}": - circuit_name: "{\"name\":\"LinearRegression\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":9,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit LinearRegression {\\\"}\"}" - members: - - CircuitVariable: - - "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":5,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" points: [Point; 5],\\\"}\"}" - - Array: - - Identifier: "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":14,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" points: [Point; 5],\\\"}\"}" - - - value: "5" - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":14,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(points: [Point; 5]) -> Self { \\\"}\"}" - input: - - Variable: - identifier: "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":18,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(points: [Point; 5]) -> Self { \\\"}\"}" - const_: false - mutable: true - type_: - Array: - - Identifier: "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":27,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(points: [Point; 5]) -> Self { \\\"}\"}" - - - value: "5" - const_: false - output: SelfType - core_mapping: ~ - block: - statements: - - Return: - expression: - CircuitInit: - name: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":17,\\\"line_stop\\\":17,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { points };\\\"}\"}" - members: - - identifier: "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":17,\\\"line_stop\\\":17,\\\"col_start\\\":23,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { points };\\\"}\"}" - expression: ~ - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":14,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function slope(self) -> i32 { \\\"}\"}" - input: - - SelfKeyword: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":20,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function slope(self) -> i32 { \\\"}\"}" - const_: false - output: - IntegerType: I32 - core_mapping: ~ - block: - statements: - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":13,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let num_points = 5i32;\\\"}\"}" - type_: ~ - value: - Value: - Integer: - - I32 - - "5" - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let x_sum = 0i32; \\\"}\"}" - type_: ~ - value: - Value: - Integer: - - I32 - - "0" - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":26,\\\"line_stop\\\":26,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let y_sum = 0i32; \\\"}\"}" - type_: ~ - value: - Value: - Integer: - - I32 - - "0" - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"xy_sum\",\"span\":\"{\\\"line_start\\\":27,\\\"line_stop\\\":27,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let xy_sum = 0i32; \\\"}\"}" - type_: ~ - value: - Value: - Integer: - - I32 - - "0" - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"x2_sum\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let x2_sum = 0i32; \\\"}\"}" - type_: ~ - value: - Value: - Integer: - - I32 - - "0" - - Iteration: - variable: "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for i in 0..5 {\\\"}\"}" - start: - Value: - Implicit: "0" - stop: - Value: - Implicit: "5" - inclusive: false - block: - statements: - - Assign: - operation: Add - assignee: - identifier: "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" - accesses: [] - value: - Access: - Member: - inner: - Access: - Array: - array: - Access: - Member: - inner: - Identifier: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":22,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" - name: "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":27,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" - type_: ~ - index: - Identifier: "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":34,\\\"col_stop\\\":35,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":37,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" - type_: ~ - - Assign: - operation: Add - assignee: - identifier: "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y;\\\"}\"}" - accesses: [] - value: - Access: - Member: - inner: - Access: - Array: - array: - Access: - Member: - inner: - Identifier: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":22,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y;\\\"}\"}" - name: "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":27,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y;\\\"}\"}" - type_: ~ - index: - Identifier: "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":34,\\\"col_stop\\\":35,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y;\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":37,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y;\\\"}\"}" - type_: ~ - - Assign: - operation: Add - assignee: - identifier: "{\"name\":\"xy_sum\",\"span\":\"{\\\"line_start\\\":32,\\\"line_stop\\\":32,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" - accesses: [] - value: - Binary: - left: - Access: - Member: - inner: - Access: - Array: - array: - Access: - Member: - inner: - Identifier: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":32,\\\"line_stop\\\":32,\\\"col_start\\\":23,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" - name: "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":32,\\\"line_stop\\\":32,\\\"col_start\\\":28,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" - type_: ~ - index: - Identifier: "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":32,\\\"line_stop\\\":32,\\\"col_start\\\":35,\\\"col_stop\\\":36,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":32,\\\"line_stop\\\":32,\\\"col_start\\\":38,\\\"col_stop\\\":39,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" - type_: ~ - right: - Access: - Member: - inner: - Access: - Array: - array: - Access: - Member: - inner: - Identifier: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":32,\\\"line_stop\\\":32,\\\"col_start\\\":42,\\\"col_stop\\\":46,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" - name: "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":32,\\\"line_stop\\\":32,\\\"col_start\\\":47,\\\"col_stop\\\":53,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" - type_: ~ - index: - Identifier: "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":32,\\\"line_stop\\\":32,\\\"col_start\\\":54,\\\"col_stop\\\":55,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":32,\\\"line_stop\\\":32,\\\"col_start\\\":57,\\\"col_stop\\\":58,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" xy_sum += self.points[i].x * self.points[i].y;\\\"}\"}" - type_: ~ - op: Mul - - Assign: - operation: Add - assignee: - identifier: "{\"name\":\"x2_sum\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" - accesses: [] - value: - Binary: - left: - Access: - Member: - inner: - Access: - Array: - array: - Access: - Member: - inner: - Identifier: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":23,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" - name: "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":28,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" - type_: ~ - index: - Identifier: "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":35,\\\"col_stop\\\":36,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":38,\\\"col_stop\\\":39,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" - type_: ~ - right: - Access: - Member: - inner: - Access: - Array: - array: - Access: - Member: - inner: - Identifier: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":42,\\\"col_stop\\\":46,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" - name: "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":47,\\\"col_stop\\\":53,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" - type_: ~ - index: - Identifier: "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":54,\\\"col_stop\\\":55,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":33,\\\"line_stop\\\":33,\\\"col_start\\\":57,\\\"col_stop\\\":58,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x2_sum += self.points[i].x * self.points[i].x;\\\"}\"}" - type_: ~ - op: Mul - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"numerator\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":13,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" - type_: ~ - value: - Binary: - left: - Binary: - left: - Identifier: "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":26,\\\"col_stop\\\":36,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" - right: - Identifier: "{\"name\":\"xy_sum\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":39,\\\"col_stop\\\":45,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" - op: Mul - right: - Binary: - left: - Identifier: "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":50,\\\"col_stop\\\":55,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" - right: - Identifier: "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":58,\\\"col_stop\\\":63,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" - op: Mul - op: Sub - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"denominator\",\"span\":\"{\\\"line_start\\\":36,\\\"line_stop\\\":36,\\\"col_start\\\":13,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" - type_: ~ - value: - Binary: - left: - Binary: - left: - Identifier: "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":36,\\\"line_stop\\\":36,\\\"col_start\\\":28,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" - right: - Identifier: "{\"name\":\"x2_sum\",\"span\":\"{\\\"line_start\\\":36,\\\"line_stop\\\":36,\\\"col_start\\\":41,\\\"col_stop\\\":47,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" - op: Mul - right: - Binary: - left: - Identifier: "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":36,\\\"line_stop\\\":36,\\\"col_start\\\":52,\\\"col_stop\\\":57,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" - right: - Identifier: "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":36,\\\"line_stop\\\":36,\\\"col_start\\\":60,\\\"col_stop\\\":65,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" - op: Mul - op: Sub - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":37,\\\"line_stop\\\":37,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = numerator / denominator;\\\"}\"}" - type_: ~ - value: - Binary: - left: - Identifier: "{\"name\":\"numerator\",\"span\":\"{\\\"line_start\\\":37,\\\"line_stop\\\":37,\\\"col_start\\\":21,\\\"col_stop\\\":30,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = numerator / denominator;\\\"}\"}" - right: - Identifier: "{\"name\":\"denominator\",\"span\":\"{\\\"line_start\\\":37,\\\"line_stop\\\":37,\\\"col_start\\\":33,\\\"col_stop\\\":44,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = numerator / denominator;\\\"}\"}" - op: Div - - Return: - expression: - Identifier: "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":38,\\\"line_stop\\\":38,\\\"col_start\\\":16,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return slope;\\\"}\"}" - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"offset\",\"span\":\"{\\\"line_start\\\":41,\\\"line_stop\\\":41,\\\"col_start\\\":14,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function offset(self, slope: i32) -> i32 {\\\"}\"}" - input: - - SelfKeyword: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":41,\\\"line_stop\\\":41,\\\"col_start\\\":21,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function offset(self, slope: i32) -> i32 {\\\"}\"}" - - Variable: - identifier: "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":41,\\\"line_stop\\\":41,\\\"col_start\\\":27,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function offset(self, slope: i32) -> i32 {\\\"}\"}" - const_: false - mutable: true - type_: - IntegerType: I32 - const_: false - output: - IntegerType: I32 - core_mapping: ~ - block: - statements: - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":42,\\\"line_stop\\\":42,\\\"col_start\\\":13,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let num_points = 5i32; \\\"}\"}" - type_: ~ - value: - Value: - Integer: - - I32 - - "5" - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":44,\\\"line_stop\\\":44,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let x_sum = 0i32;\\\"}\"}" - type_: ~ - value: - Value: - Integer: - - I32 - - "0" - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":45,\\\"line_stop\\\":45,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let y_sum = 0i32;\\\"}\"}" - type_: ~ - value: - Value: - Integer: - - I32 - - "0" - - Iteration: - variable: "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":46,\\\"line_stop\\\":46,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for i in 0..5 {\\\"}\"}" - start: - Value: - Implicit: "0" - stop: - Value: - Implicit: "5" - inclusive: false - block: - statements: - - Assign: - operation: Add - assignee: - identifier: "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":47,\\\"line_stop\\\":47,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" - accesses: [] - value: - Access: - Member: - inner: - Access: - Array: - array: - Access: - Member: - inner: - Identifier: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":47,\\\"line_stop\\\":47,\\\"col_start\\\":22,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" - name: "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":47,\\\"line_stop\\\":47,\\\"col_start\\\":27,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" - type_: ~ - index: - Identifier: "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":47,\\\"line_stop\\\":47,\\\"col_start\\\":34,\\\"col_stop\\\":35,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" - name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":47,\\\"line_stop\\\":47,\\\"col_start\\\":37,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" x_sum += self.points[i].x;\\\"}\"}" - type_: ~ - - Assign: - operation: Add - assignee: - identifier: "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y; \\\"}\"}" - accesses: [] - value: - Access: - Member: - inner: - Access: - Array: - array: - Access: - Member: - inner: - Identifier: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":22,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y; \\\"}\"}" - name: "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":27,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y; \\\"}\"}" - type_: ~ - index: - Identifier: "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":34,\\\"col_stop\\\":35,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y; \\\"}\"}" - name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":37,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" y_sum += self.points[i].y; \\\"}\"}" - type_: ~ - - Return: - expression: - Binary: - left: - Binary: - left: - Identifier: "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":50,\\\"line_stop\\\":50,\\\"col_start\\\":17,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return (y_sum - slope * x_sum) / num_points;\\\"}\"}" - right: - Binary: - left: - Identifier: "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":50,\\\"line_stop\\\":50,\\\"col_start\\\":25,\\\"col_stop\\\":30,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return (y_sum - slope * x_sum) / num_points;\\\"}\"}" - right: - Identifier: "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":50,\\\"line_stop\\\":50,\\\"col_start\\\":33,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return (y_sum - slope * x_sum) / num_points;\\\"}\"}" - op: Mul - op: Sub - right: - Identifier: "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":50,\\\"line_stop\\\":50,\\\"col_start\\\":42,\\\"col_stop\\\":52,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return (y_sum - slope * x_sum) / num_points;\\\"}\"}" - op: Div - global_consts: {} - functions: - "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main (x: i32, y: i32) -> [i32; 2] {\\\"}\"}": - annotations: {} - identifier: "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main (x: i32, y: i32) -> [i32; 2] {\\\"}\"}" - input: - - Variable: - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main (x: i32, y: i32) -> [i32; 2] {\\\"}\"}" - const_: false - mutable: true - type_: - IntegerType: I32 - - Variable: - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":24,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main (x: i32, y: i32) -> [i32; 2] {\\\"}\"}" - const_: false - mutable: true - type_: - IntegerType: I32 - const_: false - output: - Array: - - IntegerType: I32 - - - value: "2" - core_mapping: ~ - block: - statements: - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":7,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let points: [Point; 5] = [\\\"}\"}" - type_: - Array: - - Identifier: "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":16,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let points: [Point; 5] = [\\\"}\"}" - - - value: "5" - value: - ArrayInline: - elements: - - Expression: - CircuitInit: - name: "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 1, y: y + 1},\\\"}\"}" - members: - - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 1, y: y + 1},\\\"}\"}" - expression: - Binary: - left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 1, y: y + 1},\\\"}\"}" - right: - Value: - Implicit: "1" - op: Add - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 1, y: y + 1},\\\"}\"}" - expression: - Binary: - left: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 1, y: y + 1},\\\"}\"}" - right: - Value: - Implicit: "1" - op: Add - - Expression: - CircuitInit: - name: "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 2, y: y + 2},\\\"}\"}" - members: - - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 2, y: y + 2},\\\"}\"}" - expression: - Binary: - left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 2, y: y + 2},\\\"}\"}" - right: - Value: - Implicit: "2" - op: Add - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 2, y: y + 2},\\\"}\"}" - expression: - Binary: - left: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 2, y: y + 2},\\\"}\"}" - right: - Value: - Implicit: "2" - op: Add - - Expression: - CircuitInit: - name: "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 3, y: y + 3},\\\"}\"}" - members: - - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 3, y: y + 3},\\\"}\"}" - expression: - Binary: - left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 3, y: y + 3},\\\"}\"}" - right: - Value: - Implicit: "3" - op: Add - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 3, y: y + 3},\\\"}\"}" - expression: - Binary: - left: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 3, y: y + 3},\\\"}\"}" - right: - Value: - Implicit: "3" - op: Add - - Expression: - CircuitInit: - name: "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":60,\\\"line_stop\\\":60,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 4, y: y + 4},\\\"}\"}" - members: - - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":60,\\\"line_stop\\\":60,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 4, y: y + 4},\\\"}\"}" - expression: - Binary: - left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":60,\\\"line_stop\\\":60,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 4, y: y + 4},\\\"}\"}" - right: - Value: - Implicit: "4" - op: Add - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":60,\\\"line_stop\\\":60,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 4, y: y + 4},\\\"}\"}" - expression: - Binary: - left: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":60,\\\"line_stop\\\":60,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 4, y: y + 4},\\\"}\"}" - right: - Value: - Implicit: "4" - op: Add - - Expression: - CircuitInit: - name: "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":61,\\\"line_stop\\\":61,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 5, y: y + 5}\\\"}\"}" - members: - - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":61,\\\"line_stop\\\":61,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 5, y: y + 5}\\\"}\"}" - expression: - Binary: - left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":61,\\\"line_stop\\\":61,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 5, y: y + 5}\\\"}\"}" - right: - Value: - Implicit: "5" - op: Add - - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":61,\\\"line_stop\\\":61,\\\"col_start\\\":23,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 5, y: y + 5}\\\"}\"}" - expression: - Binary: - left: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":61,\\\"line_stop\\\":61,\\\"col_start\\\":26,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point{x: x + 5, y: y + 5}\\\"}\"}" - right: - Value: - Implicit: "5" - op: Add - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"reg\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":7,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let reg = LinearRegression::new(points);\\\"}\"}" - type_: ~ - value: - Call: - function: - Access: - Static: - inner: - Identifier: "{\"name\":\"LinearRegression\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":13,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let reg = LinearRegression::new(points);\\\"}\"}" - name: "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":31,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let reg = LinearRegression::new(points);\\\"}\"}" - type_: ~ - arguments: - - Identifier: "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":35,\\\"col_stop\\\":41,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let reg = LinearRegression::new(points);\\\"}\"}" - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":64,\\\"line_stop\\\":64,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = reg.slope();\\\"}\"}" - type_: ~ - value: - Call: - function: - Access: - Member: - inner: - Identifier: "{\"name\":\"reg\",\"span\":\"{\\\"line_start\\\":64,\\\"line_stop\\\":64,\\\"col_start\\\":15,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = reg.slope();\\\"}\"}" - name: "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":64,\\\"line_stop\\\":64,\\\"col_start\\\":19,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = reg.slope();\\\"}\"}" - type_: ~ - arguments: [] - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"offset\",\"span\":\"{\\\"line_start\\\":65,\\\"line_stop\\\":65,\\\"col_start\\\":7,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let offset = reg.offset(slope);\\\"}\"}" - type_: ~ - value: - Call: - function: - Access: - Member: - inner: - Identifier: "{\"name\":\"reg\",\"span\":\"{\\\"line_start\\\":65,\\\"line_stop\\\":65,\\\"col_start\\\":16,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let offset = reg.offset(slope);\\\"}\"}" - name: "{\"name\":\"offset\",\"span\":\"{\\\"line_start\\\":65,\\\"line_stop\\\":65,\\\"col_start\\\":20,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let offset = reg.offset(slope);\\\"}\"}" - type_: ~ - arguments: - - Identifier: "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":65,\\\"line_stop\\\":65,\\\"col_start\\\":27,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let offset = reg.offset(slope);\\\"}\"}" - - Return: - expression: - ArrayInline: - elements: - - Expression: - Identifier: "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":66,\\\"line_stop\\\":66,\\\"col_start\\\":11,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return [slope, offset];\\\"}\"}" - - Expression: - Identifier: "{\"name\":\"offset\",\"span\":\"{\\\"line_start\\\":66,\\\"line_stop\\\":66,\\\"col_start\\\":18,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return [slope, offset];\\\"}\"}" diff --git a/tests/expectations/parser/parser/serialize/palindrome.leo.out b/tests/expectations/parser/parser/serialize/palindrome.leo.out deleted file mode 100644 index 2d21cc251e..0000000000 --- a/tests/expectations/parser/parser/serialize/palindrome.leo.out +++ /dev/null @@ -1,547 +0,0 @@ ---- -namespace: Serialize -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - global_consts: {} - functions: - "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(str: [char; 20]) -> bool {\\\"}\"}": - identifier: "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(str: [char; 20]) -> bool {\\\"}\"}" - input: - - Variable: - identifier: "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":15,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(str: [char; 20]) -> bool {\\\"}\"}" - const_: false - mutable: true - type_: - Array: - - Char - - - value: "20" - const_: false - output: Boolean - core_mapping: ~ - block: - statements: - - Return: - expression: - Call: - function: - Identifier: "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":12,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return is_palindrome(str);\\\"}\"}" - arguments: - - Identifier: "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":26,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return is_palindrome(str);\\\"}\"}" - "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":10,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function is_palindrome(str: [char; 20]) -> bool {\\\"}\"}": - identifier: "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":10,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function is_palindrome(str: [char; 20]) -> bool {\\\"}\"}" - input: - - Variable: - identifier: "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":24,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function is_palindrome(str: [char; 20]) -> bool {\\\"}\"}" - const_: false - mutable: true - type_: - Array: - - Char - - - value: "20" - const_: false - output: Boolean - core_mapping: ~ - block: - statements: - - Definition: - declaration_type: Const - variable_names: - - mutable: false - identifier: "{\"name\":\"str_len\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":11,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const str_len = 20u32; // saving const for convenience\\\"}\"}" - type_: ~ - value: - Value: - Integer: - - U32 - - "20" - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = true;\\\"}\"}" - type_: ~ - value: - Value: - Boolean: "true" - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":9,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let processed = 0u8;\\\"}\"}" - type_: ~ - value: - Value: - Integer: - - U8 - - "0" - - Iteration: - variable: "{\"name\":\"start\",\"span\":\"{\\\"line_start\\\":17,\\\"line_stop\\\":17,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for start in 0..(str_len / 2) {\\\"}\"}" - start: - Value: - Implicit: "0" - stop: - Binary: - left: - Identifier: "{\"name\":\"str_len\",\"span\":\"{\\\"line_start\\\":17,\\\"line_stop\\\":17,\\\"col_start\\\":22,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for start in 0..(str_len / 2) {\\\"}\"}" - right: - Value: - Implicit: "2" - op: Div - inclusive: false - block: - statements: - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":18,\\\"line_stop\\\":18,\\\"col_start\\\":13,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let start_sym = str[start];\\\"}\"}" - type_: ~ - value: - Access: - Array: - array: - Identifier: "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":18,\\\"line_stop\\\":18,\\\"col_start\\\":25,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let start_sym = str[start];\\\"}\"}" - index: - Identifier: "{\"name\":\"start\",\"span\":\"{\\\"line_start\\\":18,\\\"line_stop\\\":18,\\\"col_start\\\":29,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let start_sym = str[start];\\\"}\"}" - - Conditional: - condition: - Binary: - left: - Identifier: "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":12,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if start_sym != ' ' {\\\"}\"}" - right: - Value: - Char: - character: - Scalar: 32 - op: Ne - block: - statements: - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":20,\\\"line_stop\\\":20,\\\"col_start\\\":17,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let skipped = 0u8;\\\"}\"}" - type_: ~ - value: - Value: - Integer: - - U8 - - "0" - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"end_empty\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":17,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let end_empty = 0u8;\\\"}\"}" - type_: ~ - value: - Value: - Integer: - - U8 - - "0" - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":17,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let end_sym = ' ';\\\"}\"}" - type_: ~ - value: - Value: - Char: - character: - Scalar: 32 - - Iteration: - variable: "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":17,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for end in (str_len - 1)..start {\\\"}\"}" - start: - Binary: - left: - Identifier: "{\"name\":\"str_len\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":25,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for end in (str_len - 1)..start {\\\"}\"}" - right: - Value: - Implicit: "1" - op: Sub - stop: - Identifier: "{\"name\":\"start\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":39,\\\"col_stop\\\":44,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for end in (str_len - 1)..start {\\\"}\"}" - inclusive: false - block: - statements: - - Conditional: - condition: - Binary: - left: - Binary: - left: - Binary: - left: - Access: - Array: - array: - Identifier: "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":20,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}" - index: - Identifier: "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":24,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}" - right: - Value: - Char: - character: - Scalar: 32 - op: Ne - right: - Binary: - left: - Identifier: "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":39,\\\"col_stop\\\":46,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}" - right: - Identifier: "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":50,\\\"col_stop\\\":59,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}" - op: Eq - op: And - right: - Binary: - left: - Identifier: "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":63,\\\"col_stop\\\":70,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}" - right: - Value: - Char: - character: - Scalar: 32 - op: Eq - op: And - block: - statements: - - Assign: - operation: Assign - assignee: - identifier: "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":26,\\\"line_stop\\\":26,\\\"col_start\\\":21,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" end_sym = str[end];\\\"}\"}" - accesses: [] - value: - Access: - Array: - array: - Identifier: "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":26,\\\"line_stop\\\":26,\\\"col_start\\\":31,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" end_sym = str[end];\\\"}\"}" - index: - Identifier: "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":26,\\\"line_stop\\\":26,\\\"col_start\\\":35,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" end_sym = str[end];\\\"}\"}" - next: - Block: - statements: - - Assign: - operation: Assign - assignee: - identifier: "{\"name\":\"end_empty\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":21,\\\"col_stop\\\":30,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" end_empty = end_empty + 1;\\\"}\"}" - accesses: [] - value: - Binary: - left: - Identifier: "{\"name\":\"end_empty\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":33,\\\"col_stop\\\":42,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" end_empty = end_empty + 1;\\\"}\"}" - right: - Value: - Implicit: "1" - op: Add - - Conditional: - condition: - Binary: - left: - Access: - Array: - array: - Identifier: "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":24,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' {\\\"}\"}" - index: - Identifier: "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":28,\\\"col_stop\\\":31,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' {\\\"}\"}" - right: - Value: - Char: - character: - Scalar: 32 - op: Ne - block: - statements: - - Assign: - operation: Assign - assignee: - identifier: "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":25,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" skipped = skipped + 1;\\\"}\"}" - accesses: [] - value: - Binary: - left: - Identifier: "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":35,\\\"col_stop\\\":42,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" skipped = skipped + 1;\\\"}\"}" - right: - Value: - Implicit: "1" - op: Add - next: ~ - - Conditional: - condition: - Binary: - left: - Identifier: "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":36,\\\"line_stop\\\":36,\\\"col_start\\\":16,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if end_sym != ' ' {\\\"}\"}" - right: - Value: - Char: - character: - Scalar: 32 - op: Ne - block: - statements: - - Console: - function: - Log: - string: - - Scalar: 67 - - Scalar: 111 - - Scalar: 109 - - Scalar: 112 - - Scalar: 97 - - Scalar: 114 - - Scalar: 105 - - Scalar: 110 - - Scalar: 103 - - Scalar: 58 - - Scalar: 32 - - Scalar: 123 - - Scalar: 125 - - Scalar: 32 - - Scalar: 63 - - Scalar: 32 - - Scalar: 123 - - Scalar: 125 - parameters: - - Identifier: "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":37,\\\"line_stop\\\":37,\\\"col_start\\\":51,\\\"col_stop\\\":60,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.log(\\\\\\\"Comparing: {} ? {}\\\\\\\", start_sym, end_sym);\\\"}\"}" - - Identifier: "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":37,\\\"line_stop\\\":37,\\\"col_start\\\":62,\\\"col_stop\\\":69,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.log(\\\\\\\"Comparing: {} ? {}\\\\\\\", start_sym, end_sym);\\\"}\"}" - - Conditional: - condition: - Identifier: "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":39,\\\"line_stop\\\":39,\\\"col_start\\\":20,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if result {\\\"}\"}" - block: - statements: - - Assign: - operation: Assign - assignee: - identifier: "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":40,\\\"line_stop\\\":40,\\\"col_start\\\":21,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" result = (start_sym == end_sym);\\\"}\"}" - accesses: [] - value: - Binary: - left: - Identifier: "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":40,\\\"line_stop\\\":40,\\\"col_start\\\":31,\\\"col_stop\\\":40,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" result = (start_sym == end_sym);\\\"}\"}" - right: - Identifier: "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":40,\\\"line_stop\\\":40,\\\"col_start\\\":44,\\\"col_stop\\\":51,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" result = (start_sym == end_sym);\\\"}\"}" - op: Eq - next: ~ - - Assign: - operation: Assign - assignee: - identifier: "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":43,\\\"line_stop\\\":43,\\\"col_start\\\":17,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" processed = processed + 1;\\\"}\"}" - accesses: [] - value: - Binary: - left: - Identifier: "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":43,\\\"line_stop\\\":43,\\\"col_start\\\":29,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" processed = processed + 1;\\\"}\"}" - right: - Value: - Implicit: "1" - op: Add - next: ~ - next: ~ - - Console: - function: - Log: - string: - - Scalar: 82 - - Scalar: 101 - - Scalar: 115 - - Scalar: 117 - - Scalar: 108 - - Scalar: 116 - - Scalar: 32 - - Scalar: 105 - - Scalar: 115 - - Scalar: 58 - - Scalar: 32 - - Scalar: 123 - - Scalar: 125 - parameters: - - Identifier: "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":34,\\\"col_stop\\\":40,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.log(\\\\\\\"Result is: {}\\\\\\\", result);\\\"}\"}" - - Return: - expression: - Identifier: "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":50,\\\"line_stop\\\":50,\\\"col_start\\\":12,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return result;\\\"}\"}" - "{\"name\":\"test_is_palindrome\",\"span\":\"{\\\"line_start\\\":53,\\\"line_stop\\\":53,\\\"col_start\\\":10,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function test_is_palindrome() {\\\"}\"}": - identifier: "{\"name\":\"test_is_palindrome\",\"span\":\"{\\\"line_start\\\":53,\\\"line_stop\\\":53,\\\"col_start\\\":10,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function test_is_palindrome() {\\\"}\"}" - input: [] - const_: false - output: ~ - core_mapping: ~ - block: - statements: - - Console: - function: - Assert: - Call: - function: - Identifier: "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":54,\\\"line_stop\\\":54,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"a b a \\\\\\\"));\\\"}\"}" - arguments: - - Value: - String: - - Scalar: 97 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 98 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 97 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Console: - function: - Assert: - Call: - function: - Identifier: "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"😀😀😀😀😀 😀😀😀😀😀\\\\\\\"));\\\"}\"}" - arguments: - - Value: - String: - - Scalar: 128512 - - Scalar: 128512 - - Scalar: 128512 - - Scalar: 128512 - - Scalar: 128512 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 128512 - - Scalar: 128512 - - Scalar: 128512 - - Scalar: 128512 - - Scalar: 128512 - - Console: - function: - Assert: - Call: - function: - Identifier: "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"borrow or rob \\\\\\\"));\\\"}\"}" - arguments: - - Value: - String: - - Scalar: 98 - - Scalar: 111 - - Scalar: 114 - - Scalar: 114 - - Scalar: 111 - - Scalar: 119 - - Scalar: 32 - - Scalar: 111 - - Scalar: 114 - - Scalar: 32 - - Scalar: 114 - - Scalar: 111 - - Scalar: 98 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Console: - function: - Assert: - Call: - function: - Identifier: "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"bbbb aaaa aaaa bbbb\\\\\\\"));\\\"}\"}" - arguments: - - Value: - String: - - Scalar: 98 - - Scalar: 98 - - Scalar: 98 - - Scalar: 98 - - Scalar: 32 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 32 - - Scalar: 32 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 32 - - Scalar: 98 - - Scalar: 98 - - Scalar: 98 - - Scalar: 98 - - Console: - function: - Assert: - Call: - function: - Identifier: "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"aaaaaaaaaaaaaaaaaaaa\\\\\\\"));\\\"}\"}" - arguments: - - Value: - String: - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Scalar: 97 - - Console: - function: - Assert: - Call: - function: - Identifier: "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":59,\\\"line_stop\\\":59,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"taco cat \\\\\\\"));\\\"}\"}" - arguments: - - Value: - String: - - Scalar: 116 - - Scalar: 97 - - Scalar: 99 - - Scalar: 111 - - Scalar: 32 - - Scalar: 99 - - Scalar: 97 - - Scalar: 116 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 - - Scalar: 32 diff --git a/tests/expectations/parser/parser/serialize/pedersen_hash.leo.out b/tests/expectations/parser/parser/serialize/pedersen_hash.leo.out deleted file mode 100644 index 9ac6f544ab..0000000000 --- a/tests/expectations/parser/parser/serialize/pedersen_hash.leo.out +++ /dev/null @@ -1,169 +0,0 @@ ---- -namespace: Serialize -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: [] - imports: {} - aliases: {} - circuits: - "{\"name\":\"PedersenHash\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit PedersenHash {\\\"}\"}": - circuit_name: "{\"name\":\"PedersenHash\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":9,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"circuit PedersenHash {\\\"}\"}" - members: - - CircuitVariable: - - "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" parameters: [group; 256];\\\"}\"}" - - Array: - - Group - - - value: "256" - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":14,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(parameters: [group; 256]) -> Self {\\\"}\"}" - input: - - Variable: - identifier: "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":18,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function new(parameters: [group; 256]) -> Self {\\\"}\"}" - const_: false - mutable: true - type_: - Array: - - Group - - - value: "256" - const_: false - output: SelfType - core_mapping: ~ - block: - statements: - - Return: - expression: - CircuitInit: - name: "{\"name\":\"Self\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { parameters: parameters };\\\"}\"}" - members: - - identifier: "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":23,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { parameters: parameters };\\\"}\"}" - expression: - Identifier: "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":35,\\\"col_stop\\\":45,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return Self { parameters: parameters };\\\"}\"}" - - CircuitFunction: - annotations: {} - identifier: "{\"name\":\"hash\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":14,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function hash(self, bits: [bool; 256]) -> group {\\\"}\"}" - input: - - SelfKeyword: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":19,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function hash(self, bits: [bool; 256]) -> group {\\\"}\"}" - - Variable: - identifier: "{\"name\":\"bits\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":25,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function hash(self, bits: [bool; 256]) -> group {\\\"}\"}" - const_: false - mutable: true - type_: - Array: - - Boolean - - - value: "256" - const_: false - output: Group - core_mapping: ~ - block: - statements: - - Definition: - declaration_type: Let - variable_names: - - mutable: true - identifier: "{\"name\":\"digest\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let digest: group = 0group;\\\"}\"}" - type_: Group - value: - Value: - Group: - Single: "0" - - Iteration: - variable: "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":13,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for i in 0..256 {\\\"}\"}" - start: - Value: - Implicit: "0" - stop: - Value: - Implicit: "256" - inclusive: false - block: - statements: - - Conditional: - condition: - Access: - Array: - array: - Identifier: "{\"name\":\"bits\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if bits[i] {\\\"}\"}" - index: - Identifier: "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":21,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if bits[i] {\\\"}\"}" - block: - statements: - - Assign: - operation: Add - assignee: - identifier: "{\"name\":\"digest\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":17,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" digest += self.parameters[i];\\\"}\"}" - accesses: [] - value: - Access: - Array: - array: - Access: - Member: - inner: - Identifier: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":27,\\\"col_stop\\\":31,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" digest += self.parameters[i];\\\"}\"}" - name: "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":32,\\\"col_stop\\\":42,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" digest += self.parameters[i];\\\"}\"}" - type_: ~ - index: - Identifier: "{\"name\":\"i\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":43,\\\"col_stop\\\":44,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" digest += self.parameters[i];\\\"}\"}" - next: ~ - - Return: - expression: - Identifier: "{\"name\":\"digest\",\"span\":\"{\\\"line_start\\\":18,\\\"line_stop\\\":18,\\\"col_start\\\":16,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return digest;\\\"}\"}" - global_consts: {} - functions: - "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(hash_input: [bool; 256], const parameters: [group; 256]) -> group {\\\"}\"}": - annotations: {} - identifier: "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(hash_input: [bool; 256], const parameters: [group; 256]) -> group {\\\"}\"}" - input: - - Variable: - identifier: "{\"name\":\"hash_input\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":15,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(hash_input: [bool; 256], const parameters: [group; 256]) -> group {\\\"}\"}" - const_: false - mutable: true - type_: - Array: - - Boolean - - - value: "256" - - Variable: - identifier: "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":46,\\\"col_stop\\\":56,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(hash_input: [bool; 256], const parameters: [group; 256]) -> group {\\\"}\"}" - const_: true - mutable: false - type_: - Array: - - Group - - - value: "256" - const_: false - output: Group - core_mapping: ~ - block: - statements: - - Definition: - declaration_type: Const - variable_names: - - mutable: false - identifier: "{\"name\":\"pedersen\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":11,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const pedersen = PedersenHash::new(parameters);\\\"}\"}" - type_: ~ - value: - Call: - function: - Access: - Static: - inner: - Identifier: "{\"name\":\"PedersenHash\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":22,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const pedersen = PedersenHash::new(parameters);\\\"}\"}" - name: "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":36,\\\"col_stop\\\":39,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const pedersen = PedersenHash::new(parameters);\\\"}\"}" - type_: ~ - arguments: - - Identifier: "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":40,\\\"col_stop\\\":50,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const pedersen = PedersenHash::new(parameters);\\\"}\"}" - - Return: - expression: - Call: - function: - Access: - Member: - inner: - Identifier: "{\"name\":\"pedersen\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":12,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return pedersen.hash(hash_input);\\\"}\"}" - name: "{\"name\":\"hash\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":21,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return pedersen.hash(hash_input);\\\"}\"}" - type_: ~ - arguments: - - Identifier: "{\"name\":\"hash_input\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":26,\\\"col_stop\\\":36,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return pedersen.hash(hash_input);\\\"}\"}" diff --git a/tests/expectations/parser/parser/statement/alias.leo.out b/tests/expectations/parser/parser/statement/alias.leo.out deleted file mode 100644 index 7ece282aab..0000000000 --- a/tests/expectations/parser/parser/statement/alias.leo.out +++ /dev/null @@ -1,42 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - aliases: - "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"type a = u32;\\\"}\"}": - name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"type a = u32;\\\"}\"}" - span: - line_start: 3 - line_stop: 3 - col_start: 1 - col_stop: 14 - path: "" - content: type a = u32; - represents: - IntegerType: U32 - "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"type b = string;\\\"}\"}": - name: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"type b = string;\\\"}\"}" - span: - line_start: 5 - line_stop: 5 - col_start: 1 - col_stop: 17 - path: "" - content: type b = string; - represents: - Identifier: "{\"name\":\"string\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":10,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"type b = string;\\\"}\"}" - "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"type c = a;\\\"}\"}": - name: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"type c = a;\\\"}\"}" - span: - line_start: 7 - line_stop: 7 - col_start: 1 - col_stop: 12 - path: "" - content: type c = a; - represents: - Identifier: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"type c = a;\\\"}\"}" - global_consts: {} - functions: {} diff --git a/tests/expectations/parser/parser/statement/global_const.leo.out b/tests/expectations/parser/parser/statement/global_const.leo.out deleted file mode 100644 index 52e7673324..0000000000 --- a/tests/expectations/parser/parser/statement/global_const.leo.out +++ /dev/null @@ -1,106 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - aliases: {} - global_consts: - x: - declaration_type: Const - variable_names: - - mutable: false - identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x: char = 'b';\\\"}\"}" - span: - line_start: 11 - line_stop: 11 - col_start: 7 - col_stop: 8 - path: "" - content: "const x: char = 'b';" - type_: Char - value: - Value: - Char: - character: - Scalar: 98 - span: - line_start: 11 - line_stop: 11 - col_start: 17 - col_stop: 20 - path: "" - content: "const x: char = 'b';" - span: - line_start: 11 - line_stop: 11 - col_start: 1 - col_stop: 20 - path: "" - content: "const x: char = 'b';" - f: - declaration_type: Const - variable_names: - - mutable: false - identifier: "{\"name\":\"f\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const f: u32 = x;\\\"}\"}" - span: - line_start: 5 - line_stop: 5 - col_start: 7 - col_stop: 8 - path: "" - content: "const f: u32 = x;" - type_: - IntegerType: U32 - value: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const f: u32 = x;\\\"}\"}" - span: - line_start: 5 - line_stop: 5 - col_start: 1 - col_stop: 17 - path: "" - content: "const f: u32 = x;" - y: - declaration_type: Const - variable_names: - - mutable: false - identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const y: string = \\\\\\\"hello world\\\\\\\";\\\"}\"}" - span: - line_start: 9 - line_stop: 9 - col_start: 7 - col_stop: 8 - path: "" - content: "const y: string = \"hello world\";" - type_: - Identifier: "{\"name\":\"string\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":10,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const y: string = \\\\\\\"hello world\\\\\\\";\\\"}\"}" - value: - Value: - String: - - - Scalar: 104 - - Scalar: 101 - - Scalar: 108 - - Scalar: 108 - - Scalar: 111 - - Scalar: 32 - - Scalar: 119 - - Scalar: 111 - - Scalar: 114 - - Scalar: 108 - - Scalar: 100 - - span: - line_start: 9 - line_stop: 9 - col_start: 19 - col_stop: 32 - path: "" - content: "const y: string = \"hello world\";" - span: - line_start: 9 - line_stop: 9 - col_start: 1 - col_stop: 32 - path: "" - content: "const y: string = \"hello world\";" - functions: {} diff --git a/tests/expectations/parser/parser/statement/test_keyword_fail.leo.out b/tests/expectations/parser/parser/statement/test_keyword_fail.leo.out deleted file mode 100644 index 22e16133ed..0000000000 --- a/tests/expectations/parser/parser/statement/test_keyword_fail.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - "Error [EPAR0370015]: \"test function...\" is deprecated. Did you mean @test annotation?\n --> test:3:1\n |\n 3 | test main() {}\n | ^^^^" diff --git a/tests/expectations/parser/parser/unreachable/eat_ident_bad_ident.leo.out b/tests/expectations/parser/parser/unreachable/eat_ident_bad_ident.leo.out deleted file mode 100644 index cb16998106..0000000000 --- a/tests/expectations/parser/parser/unreachable/eat_ident_bad_ident.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - "Error [EPAR0370009]: unexpected string: expected 'ident', got ';'\n --> test:3:9\n |\n 3 | circuit ;\n | ^" diff --git a/tests/expectations/parser/parser/unreachable/eat_ident_semi.leo.out b/tests/expectations/parser/parser/unreachable/eat_ident_semi.leo.out deleted file mode 100644 index a979c804ac..0000000000 --- a/tests/expectations/parser/parser/unreachable/eat_ident_semi.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - "Error [EPAR0370005]: expected { -- got 'circuit'\n --> test:4:1\n |\n 4 | circuit ;\n | ^^^^^^^" diff --git a/tests/expectations/parser/parser/unreachable/equality_expression.leo.out b/tests/expectations/parser/parser/unreachable/equality_expression.leo.out deleted file mode 100644 index 3a65a32f09..0000000000 --- a/tests/expectations/parser/parser/unreachable/equality_expression.leo.out +++ /dev/null @@ -1,52 +0,0 @@ ---- -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 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 | ^^" diff --git a/tests/expectations/parser/parser/unreachable/math_op.leo.out b/tests/expectations/parser/parser/unreachable/math_op.leo.out deleted file mode 100644 index d2d7bfdec0..0000000000 --- a/tests/expectations/parser/parser/unreachable/math_op.leo.out +++ /dev/null @@ -1,6 +0,0 @@ ---- -namespace: ParseStatement -expectation: Fail -outputs: - - "did not consume all input: 'b' @ 1:13-14\n';' @ 1:14-15\n'let' @ 2:1-4\n'x' @ 2:5-6\n'=' @ 2:7-8\n'a' @ 2:9-10\n'.' @ 2:11-12\n'b' @ 2:13-14\n';' @ 2:14-15\n'let' @ 3:1-4\n'x' @ 3:5-6\n'=' @ 3:7-8\n'a' @ 3:9-10\n'import' @ 3:11-17\n'b' @ 3:18-19\n';' @ 3:19-20\n'let' @ 4:1-4\n'x' @ 4:5-6\n'=' @ 4:7-8\n'a' @ 4:9-10\n',' @ 4:11-12\n'b' @ 4:13-14\n';' @ 4:14-15\n'let' @ 5:1-4\n'x' @ 5:5-6\n'=' @ 5:7-8\n'a' @ 5:9-10\n'[' @ 5:11-12\n'b' @ 5:13-14\n';' @ 5:14-15\n'let' @ 6:1-4\n'x' @ 6:5-6\n'=' @ 6:7-8\n'a' @ 6:9-10\n']' @ 6:11-12\n'b' @ 6:13-14\n';' @ 6:14-15\n'let' @ 7:1-4\n'x' @ 7:5-6\n'=' @ 7:7-8\n'a' @ 7:9-10\n'{' @ 7:11-12\n'b' @ 7:13-14\n';' @ 7:14-15\n'let' @ 8:1-4\n'x' @ 8:5-6\n'=' @ 8:7-8\n'a' @ 8:9-10\n'}' @ 8:11-12\n'b' @ 8:13-14\n';' @ 8:14-15\n'let' @ 9:1-4\n'x' @ 9:5-6\n'=' @ 9:7-8\n'a' @ 9:9-10\n'(' @ 9:11-12\n'b' @ 9:13-14\n';' @ 9:14-15\n'let' @ 10:1-4\n'x' @ 10:5-6\n'=' @ 10:7-8\n'a' @ 10:9-10\n')' @ 10:11-12\n'b' @ 10:13-14\n';' @ 10:14-15\n'let' @ 11:1-4\n'x' @ 11:5-6\n'=' @ 11:7-8\n'a' @ 11:9-10\n':' @ 11:11-12\n'b' @ 11:13-14\n';' @ 11:14-15\n'let' @ 12:1-4\n'x' @ 12:5-6\n'=' @ 12:7-8\n'a' @ 12:9-10\n'::' @ 12:11-13\n'b' @ 12:14-15\n';' @ 12:15-16\n'let' @ 13:1-4\n'x' @ 13:5-6\n'=' @ 13:7-8\n'a' @ 13:9-10\n'?' @ 13:11-12\n'b' @ 13:13-14\n';' @ 13:14-15\n'let' @ 14:1-4\n'x' @ 14:5-6\n'=' @ 14:7-8\n'a' @ 14:9-10\n'_' @ 14:11-12\n'b' @ 14:13-14\n';' @ 14:14-15\n'let' @ 15:1-4\n'x' @ 15:5-6\n'=' @ 15:7-8\n'a' @ 15:9-10\n'=' @ 15:11-12\n'b' @ 15:13-14\n';' @ 15:14-15\n'let' @ 16:1-4\n'x' @ 16:5-6\n'=' @ 16:7-8\n'a' @ 16:9-10\n'==' @ 16:11-13\n'b' @ 16:14-15\n';' @ 16:15-16\n'let' @ 17:1-4\n'x' @ 17:5-6\n'=' @ 17:7-8\n'a' @ 17:9-10\n'!' @ 17:11-12\n'b' @ 17:13-14\n';' @ 17:14-15\n'let' @ 18:1-4\n'x' @ 18:5-6\n'=' @ 18:7-8\n'a' @ 18:9-10\n'!=' @ 18:11-13\n'b' @ 18:14-15\n';' @ 18:15-16\n'let' @ 19:1-4\n'x' @ 19:5-6\n'=' @ 19:7-8\n'a' @ 19:9-10\n'>' @ 19:11-12\n'b' @ 19:13-14\n';' @ 19:14-15\n'let' @ 20:1-4\n'x' @ 20:5-6\n'=' @ 20:7-8\n'a' @ 20:9-10\n'>=' @ 20:11-13\n'b' @ 20:14-15\n';' @ 20:15-16\n'let' @ 21:1-4\n'x' @ 21:5-6\n'=' @ 21:7-8\n'a' @ 21:9-10\n'<' @ 21:11-12\n'b' @ 21:13-14\n';' @ 21:14-15\n'let' @ 22:1-4\n'x' @ 22:5-6\n'=' @ 22:7-8\n'a' @ 22:9-10\n'<=' @ 22:11-13\n'b' @ 22:14-15\n';' @ 22:15-16\n'let' @ 23:1-4\n'x' @ 23:5-6\n'=' @ 23:7-8\n'a' @ 23:9-10\n'>' @ 23:11-12\n'b' @ 23:13-14\n';' @ 23:14-15\n'let' @ 24:1-4\n'x' @ 24:5-6\n'=' @ 24:7-8\n'a' @ 24:9-10\n'..' @ 24:11-13\n'b' @ 24:14-15\n';' @ 24:15-16\n'let' @ 25:1-4\n'x' @ 25:5-6\n'=' @ 25:7-8\n'a' @ 25:9-10\n'as' @ 25:11-13\n'b' @ 25:14-15\n';' @ 25:15-16\n'let' @ 26:1-4\n'x' @ 26:5-6\n'=' @ 26:7-8\n'a' @ 26:9-10\n'console' @ 26:11-18\n'b' @ 26:19-20\n';' @ 26:20-21\n'let' @ 27:1-4\n'x' @ 27:5-6\n'=' @ 27:7-8\n'a' @ 27:9-10\n'const' @ 27:11-16\n'b' @ 27:17-18\n';' @ 27:18-19\n'let' @ 28:1-4\n'x' @ 28:5-6\n'=' @ 28:7-8\n'a' @ 28:9-10\n'let' @ 28:11-14\n'b' @ 28:15-16\n';' @ 28:16-17\n'let' @ 29:1-4\n'x' @ 29:5-6\n'=' @ 29:7-8\n'a' @ 29:9-10\n'for' @ 29:11-14\n'b' @ 29:15-16\n';' @ 29:16-17\n'let' @ 30:1-4\n'x' @ 30:5-6\n'=' @ 30:7-8\n'a' @ 30:9-10\n'if' @ 30:11-13\n'b' @ 30:14-15\n';' @ 30:15-16\n'let' @ 31:1-4\n'x' @ 31:5-6\n'=' @ 31:7-8\n'a' @ 31:9-10\n'else' @ 31:11-15\n'b' @ 31:16-17\n';' @ 31:17-18\n'let' @ 32:1-4\n'x' @ 32:5-6\n'=' @ 32:7-8\n'a' @ 32:9-10\n'i8' @ 32:11-13\n'b' @ 32:14-15\n';' @ 32:15-16\n'let' @ 33:1-4\n'x' @ 33:5-6\n'=' @ 33:7-8\n'a' @ 33:9-10\n'i16' @ 33:11-14\n'b' @ 33:15-16\n';' @ 33:16-17\n'let' @ 34:1-4\n'x' @ 34:5-6\n'=' @ 34:7-8\n'a' @ 34:9-10\n'i32' @ 34:11-14\n'b' @ 34:15-16\n';' @ 34:16-17\n'let' @ 35:1-4\n'x' @ 35:5-6\n'=' @ 35:7-8\n'a' @ 35:9-10\n'i64' @ 35:11-14\n'b' @ 35:15-16\n';' @ 35:16-17\n'let' @ 36:1-4\n'x' @ 36:5-6\n'=' @ 36:7-8\n'a' @ 36:9-10\n'i128' @ 36:11-15\n'b' @ 36:16-17\n';' @ 36:17-18\n'let' @ 37:1-4\n'x' @ 37:5-6\n'=' @ 37:7-8\n'a' @ 37:9-10\n'u8' @ 37:11-13\n'b' @ 37:14-15\n';' @ 37:15-16\n'let' @ 38:1-4\n'x' @ 38:5-6\n'=' @ 38:7-8\n'a' @ 38:9-10\n'u16' @ 38:11-14\n'b' @ 38:15-16\n';' @ 38:16-17\n'let' @ 39:1-4\n'x' @ 39:5-6\n'=' @ 39:7-8\n'a' @ 39:9-10\n'u32' @ 39:11-14\n'b' @ 39:15-16\n';' @ 39:16-17\n'let' @ 40:1-4\n'x' @ 40:5-6\n'=' @ 40:7-8\n'a' @ 40:9-10\n'u64' @ 40:11-14\n'b' @ 40:15-16\n';' @ 40:16-17\n'let' @ 41:1-4\n'x' @ 41:5-6\n'=' @ 41:7-8\n'a' @ 41:9-10\n'u128' @ 41:11-15\n'b' @ 41:16-17\n';' @ 41:17-18\n'let' @ 42:1-4\n'x' @ 42:5-6\n'=' @ 42:7-8\n'a' @ 42:9-10\n'&' @ 42:11-12\n'b' @ 42:13-14\n';' @ 42:14-15\n'let' @ 43:1-4\n'x' @ 43:5-6\n'=' @ 43:7-8\n'a' @ 43:9-10\n'return' @ 43:11-17\n'b' @ 43:18-19\n';' @ 43:19-20\n'let' @ 44:1-4\n'x' @ 44:5-6\n'=' @ 44:7-8\n'a' @ 44:9-10\n'self' @ 44:11-15\n'b' @ 44:16-17\n';' @ 44:17-18\n'let' @ 45:1-4\n'x' @ 45:5-6\n'=' @ 45:7-8\n'a' @ 45:9-10\n'Self' @ 45:11-15\n'b' @ 45:16-17\n';' @ 45:17-18\n'let' @ 46:1-4\n'x' @ 46:5-6\n'=' @ 46:7-8\n'a' @ 46:9-10\n'true' @ 46:11-15\n'b' @ 46:16-17\n';' @ 46:17-18\n'let' @ 47:1-4\n'x' @ 47:5-6\n'=' @ 47:7-8\n'a' @ 47:9-10\n'false' @ 47:11-16\n'b' @ 47:17-18\n';' @ 47:18-19\n'let' @ 48:1-4\n'x' @ 48:5-6\n'=' @ 48:7-8\n'a' @ 48:9-10\n'0' @ 48:11-12\n'b' @ 48:13-14\n';' @ 48:14-15\n" - - "did not consume all input: '=' @ 1:3-4\n'b' @ 1:4-5\n';' @ 1:5-6\n'x' @ 2:1-2\n'.' @ 2:2-3\n'=' @ 2:3-4\n'b' @ 2:4-5\n';' @ 2:5-6\n'ximport' @ 3:1-8\n'=' @ 3:8-9\n'b' @ 3:9-10\n';' @ 3:10-11\n'x' @ 4:1-2\n',' @ 4:2-3\n'=' @ 4:3-4\n'b' @ 4:4-5\n';' @ 4:5-6\n'x' @ 5:1-2\n'[' @ 5:2-3\n'=' @ 5:3-4\n'b' @ 5:4-5\n';' @ 5:5-6\n'x' @ 6:1-2\n']' @ 6:2-3\n'=' @ 6:3-4\n'b' @ 6:4-5\n';' @ 6:5-6\n'x' @ 7:1-2\n'{' @ 7:2-3\n'=' @ 7:3-4\n'b' @ 7:4-5\n';' @ 7:5-6\n'x' @ 8:1-2\n'}' @ 8:2-3\n'=' @ 8:3-4\n'b' @ 8:4-5\n';' @ 8:5-6\n'x' @ 9:1-2\n'=' @ 9:2-3\n'(' @ 9:3-4\n';' @ 9:4-5\n'x' @ 10:1-2\n'=' @ 10:2-3\n')' @ 10:3-4\n';' @ 10:4-5\n'x' @ 11:1-2\n'=' @ 11:2-3\n':' @ 11:3-4\n';' @ 11:4-5\n'x' @ 12:1-2\n'=' @ 12:2-3\n'::' @ 12:3-5\n';' @ 12:5-6\n'x' @ 13:1-2\n'?' @ 13:2-3\n'=' @ 13:3-4\n'b' @ 13:4-5\n';' @ 13:5-6\n'x_' @ 14:1-3\n'=' @ 14:3-4\n'b' @ 14:4-5\n';' @ 14:5-6\n'x' @ 15:1-2\n'==' @ 15:2-4\n'b' @ 15:4-5\n';' @ 15:5-6\n'x' @ 16:1-2\n'==' @ 16:2-4\n'b' @ 16:4-5\n';' @ 16:5-6\n'x' @ 17:1-2\n'!=' @ 17:2-4\n'b' @ 17:4-5\n';' @ 17:5-6\n'x' @ 18:1-2\n'!=' @ 18:2-4\n'=' @ 18:4-5\n'b' @ 18:5-6\n';' @ 18:6-7\n'x' @ 19:1-2\n'>=' @ 19:2-4\n'b' @ 19:4-5\n';' @ 19:5-6\n'x' @ 20:1-2\n'>=' @ 20:2-4\n'=' @ 20:4-5\n'b' @ 20:5-6\n';' @ 20:6-7\n'x' @ 21:1-2\n'<=' @ 21:2-4\n'b' @ 21:4-5\n';' @ 21:5-6\n'x' @ 22:1-2\n'<=' @ 22:2-4\n'=' @ 22:4-5\n'b' @ 22:5-6\n';' @ 22:6-7\n'x' @ 23:1-2\n'>=' @ 23:2-4\n'b' @ 23:4-5\n';' @ 23:5-6\n'x' @ 24:1-2\n'..' @ 24:2-4\n'=' @ 24:4-5\n'b' @ 24:5-6\n';' @ 24:6-7\n'xas' @ 25:1-4\n'=' @ 25:4-5\n'b' @ 25:5-6\n';' @ 25:6-7\n'xconsole' @ 26:1-9\n'=' @ 26:9-10\n'b' @ 26:10-11\n';' @ 26:11-12\n'xconst' @ 27:1-7\n'=' @ 27:7-8\n'b' @ 27:8-9\n';' @ 27:9-10\n'xlet' @ 28:1-5\n'=' @ 28:5-6\n'b' @ 28:6-7\n';' @ 28:7-8\n'xfor' @ 29:1-5\n'=' @ 29:5-6\n'b' @ 29:6-7\n';' @ 29:7-8\n'xif' @ 30:1-4\n'=' @ 30:4-5\n'b' @ 30:5-6\n';' @ 30:6-7\n'xelse' @ 31:1-6\n'=' @ 31:6-7\n'b' @ 31:7-8\n';' @ 31:8-9\n'xi8' @ 32:1-4\n'=' @ 32:4-5\n'b' @ 32:5-6\n';' @ 32:6-7\n'xi16' @ 33:1-5\n'=' @ 33:5-6\n'b' @ 33:6-7\n';' @ 33:7-8\n'xi32' @ 34:1-5\n'=' @ 34:5-6\n'b' @ 34:6-7\n';' @ 34:7-8\n'xi64' @ 35:1-5\n'=' @ 35:5-6\n'b' @ 35:6-7\n';' @ 35:7-8\n'xi128' @ 36:1-6\n'=' @ 36:6-7\n'b' @ 36:7-8\n';' @ 36:8-9\n'xu8' @ 37:1-4\n'=' @ 37:4-5\n'b' @ 37:5-6\n';' @ 37:6-7\n'xu16' @ 38:1-5\n'=' @ 38:5-6\n'b' @ 38:6-7\n';' @ 38:7-8\n'xu32' @ 39:1-5\n'=' @ 39:5-6\n'b' @ 39:6-7\n';' @ 39:7-8\n'xu64' @ 40:1-5\n'=' @ 40:5-6\n'b' @ 40:6-7\n';' @ 40:7-8\n'xu128' @ 41:1-6\n'=' @ 41:6-7\n'b' @ 41:7-8\n';' @ 41:8-9\n'x' @ 42:1-2\n'&' @ 42:2-3\n'=' @ 42:3-4\n'b' @ 42:4-5\n';' @ 42:5-6\n'xreturn' @ 43:1-8\n'=' @ 43:8-9\n'b' @ 43:9-10\n';' @ 43:10-11\n'xself' @ 44:1-6\n'=' @ 44:6-7\n'b' @ 44:7-8\n';' @ 44:8-9\n'xSelf' @ 45:1-6\n'=' @ 45:6-7\n'b' @ 45:7-8\n';' @ 45:8-9\n'xtrue' @ 46:1-6\n'=' @ 46:6-7\n'b' @ 46:7-8\n';' @ 46:8-9\n'xfalse' @ 47:1-7\n'=' @ 47:7-8\n'b' @ 47:8-9\n';' @ 47:9-10\n'x0' @ 48:1-3\n'=' @ 48:3-4\n'b' @ 48:4-5\n';' @ 48:5-6\n" diff --git a/tests/expectations/parser/parser/unreachable/postfix.leo.out b/tests/expectations/parser/parser/unreachable/postfix.leo.out deleted file mode 100644 index d55371f772..0000000000 --- a/tests/expectations/parser/parser/unreachable/postfix.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: ParseStatement -expectation: Fail -outputs: - - "did not consume all input: ';' @ 1:11-12\n'let' @ 2:1-4\n'x' @ 2:5-6\n'=' @ 2:7-8\n'a' @ 2:9-10\n'.' @ 2:10-11\n';' @ 2:11-12\n'let' @ 3:1-4\n'x' @ 3:5-6\n'=' @ 3:7-8\n'aimport' @ 3:9-16\n';' @ 3:16-17\n'let' @ 4:1-4\n'x' @ 4:5-6\n'=' @ 4:7-8\n'a' @ 4:9-10\n',' @ 4:10-11\n';' @ 4:11-12\n'let' @ 5:1-4\n'x' @ 5:5-6\n'=' @ 5:7-8\n'a' @ 5:9-10\n'[' @ 5:10-11\n';' @ 5:11-12\n'let' @ 6:1-4\n'x' @ 6:5-6\n'=' @ 6:7-8\n'a' @ 6:9-10\n']' @ 6:10-11\n';' @ 6:11-12\n'let' @ 7:1-4\n'x' @ 7:5-6\n'=' @ 7:7-8\n'a' @ 7:9-10\n'{' @ 7:10-11\n';' @ 7:11-12\n'let' @ 8:1-4\n'x' @ 8:5-6\n'=' @ 8:7-8\n'a' @ 8:9-10\n'}' @ 8:10-11\n';' @ 8:11-12\n'let' @ 9:1-4\n'x' @ 9:5-6\n'=' @ 9:7-8\n'a' @ 9:9-10\n')' @ 9:10-11\n';' @ 9:11-12\n'let' @ 10:1-4\n'x' @ 10:5-6\n'=' @ 10:7-8\n'a' @ 10:9-10\n':' @ 10:10-11\n';' @ 10:11-12\n'let' @ 11:1-4\n'x' @ 11:5-6\n'=' @ 11:7-8\n'a' @ 11:9-10\n'?' @ 11:10-11\n';' @ 11:11-12\n'let' @ 12:1-4\n'x' @ 12:5-6\n'=' @ 12:7-8\n'a_' @ 12:9-11\n';' @ 12:11-12\n'let' @ 13:1-4\n'x' @ 13:5-6\n'=' @ 13:7-8\n'a' @ 13:9-10\n'=' @ 13:10-11\n';' @ 13:11-12\n'let' @ 14:1-4\n'x' @ 14:5-6\n'=' @ 14:7-8\n'a' @ 14:9-10\n'==' @ 14:10-12\n';' @ 14:12-13\n'let' @ 15:1-4\n'x' @ 15:5-6\n'=' @ 15:7-8\n'a' @ 15:9-10\n'!' @ 15:10-11\n';' @ 15:11-12\n'let' @ 16:1-4\n'x' @ 16:5-6\n'=' @ 16:7-8\n'a' @ 16:9-10\n'!=' @ 16:10-12\n';' @ 16:12-13\n'let' @ 17:1-4\n'x' @ 17:5-6\n'=' @ 17:7-8\n'a' @ 17:9-10\n'>' @ 17:10-11\n';' @ 17:11-12\n'let' @ 18:1-4\n'x' @ 18:5-6\n'=' @ 18:7-8\n'a' @ 18:9-10\n'>=' @ 18:10-12\n';' @ 18:12-13\n'let' @ 19:1-4\n'x' @ 19:5-6\n'=' @ 19:7-8\n'a' @ 19:9-10\n'<' @ 19:10-11\n';' @ 19:11-12\n'let' @ 20:1-4\n'x' @ 20:5-6\n'=' @ 20:7-8\n'a' @ 20:9-10\n'<=' @ 20:10-12\n';' @ 20:12-13\n'let' @ 21:1-4\n'x' @ 21:5-6\n'=' @ 21:7-8\n'a' @ 21:9-10\n'>' @ 21:10-11\n';' @ 21:11-12\n'let' @ 22:1-4\n'x' @ 22:5-6\n'=' @ 22:7-8\n'a' @ 22:9-10\n'..' @ 22:10-12\n';' @ 22:12-13\n'let' @ 23:1-4\n'x' @ 23:5-6\n'=' @ 23:7-8\n'aas' @ 23:9-12\n';' @ 23:12-13\n'let' @ 24:1-4\n'x' @ 24:5-6\n'=' @ 24:7-8\n'aconsole' @ 24:9-17\n';' @ 24:17-18\n'let' @ 25:1-4\n'x' @ 25:5-6\n'=' @ 25:7-8\n'aconst' @ 25:9-15\n';' @ 25:15-16\n'let' @ 26:1-4\n'x' @ 26:5-6\n'=' @ 26:7-8\n'alet' @ 26:9-13\n';' @ 26:13-14\n'let' @ 27:1-4\n'x' @ 27:5-6\n'=' @ 27:7-8\n'afor' @ 27:9-13\n';' @ 27:13-14\n'let' @ 28:1-4\n'x' @ 28:5-6\n'=' @ 28:7-8\n'aif' @ 28:9-12\n';' @ 28:12-13\n'let' @ 29:1-4\n'x' @ 29:5-6\n'=' @ 29:7-8\n'aelse' @ 29:9-14\n';' @ 29:14-15\n'let' @ 30:1-4\n'x' @ 30:5-6\n'=' @ 30:7-8\n'ai8' @ 30:9-12\n';' @ 30:12-13\n'let' @ 31:1-4\n'x' @ 31:5-6\n'=' @ 31:7-8\n'ai16' @ 31:9-13\n';' @ 31:13-14\n'let' @ 32:1-4\n'x' @ 32:5-6\n'=' @ 32:7-8\n'ai32' @ 32:9-13\n';' @ 32:13-14\n'let' @ 33:1-4\n'x' @ 33:5-6\n'=' @ 33:7-8\n'ai64' @ 33:9-13\n';' @ 33:13-14\n'let' @ 34:1-4\n'x' @ 34:5-6\n'=' @ 34:7-8\n'ai128' @ 34:9-14\n';' @ 34:14-15\n'let' @ 35:1-4\n'x' @ 35:5-6\n'=' @ 35:7-8\n'au8' @ 35:9-12\n';' @ 35:12-13\n'let' @ 36:1-4\n'x' @ 36:5-6\n'=' @ 36:7-8\n'au16' @ 36:9-13\n';' @ 36:13-14\n'let' @ 37:1-4\n'x' @ 37:5-6\n'=' @ 37:7-8\n'au32' @ 37:9-13\n';' @ 37:13-14\n'let' @ 38:1-4\n'x' @ 38:5-6\n'=' @ 38:7-8\n'au64' @ 38:9-13\n';' @ 38:13-14\n'let' @ 39:1-4\n'x' @ 39:5-6\n'=' @ 39:7-8\n'au128' @ 39:9-14\n';' @ 39:14-15\n'let' @ 40:1-4\n'x' @ 40:5-6\n'=' @ 40:7-8\n'a' @ 40:9-10\n'&' @ 40:10-11\n';' @ 40:11-12\n'let' @ 41:1-4\n'x' @ 41:5-6\n'=' @ 41:7-8\n'areturn' @ 41:9-16\n';' @ 41:16-17\n'let' @ 42:1-4\n'x' @ 42:5-6\n'=' @ 42:7-8\n'aself' @ 42:9-14\n';' @ 42:14-15\n'let' @ 43:1-4\n'x' @ 43:5-6\n'=' @ 43:7-8\n'aSelf' @ 43:9-14\n';' @ 43:14-15\n'let' @ 44:1-4\n'x' @ 44:5-6\n'=' @ 44:7-8\n'atrue' @ 44:9-14\n';' @ 44:14-15\n'let' @ 45:1-4\n'x' @ 45:5-6\n'=' @ 45:7-8\n'afalse' @ 45:9-15\n';' @ 45:15-16\n'let' @ 46:1-4\n'x' @ 46:5-6\n'=' @ 46:7-8\n'a0' @ 46:9-11\n';' @ 46:11-12\n" diff --git a/tests/parser/functions/public_const_param.leo b/tests/parser/functions/public_const_param_fail.leo similarity index 88% rename from tests/parser/functions/public_const_param.leo rename to tests/parser/functions/public_const_param_fail.leo index 4188889852..d9bc818a6d 100644 --- a/tests/parser/functions/public_const_param.leo +++ b/tests/parser/functions/public_const_param_fail.leo @@ -1,6 +1,6 @@ /* namespace: Parse -expectation: Pass +expectation: Fail */ function x(x: u32, public const y: i32) { diff --git a/tests/parser/inputs/input_const_success.leo b/tests/parser/inputs/input_const.leo similarity index 100% rename from tests/parser/inputs/input_const_success.leo rename to tests/parser/inputs/input_const.leo diff --git a/tests/parser/inputs/input_public_success.leo b/tests/parser/inputs/input_public.leo similarity index 100% rename from tests/parser/inputs/input_public_success.leo rename to tests/parser/inputs/input_public.leo diff --git a/tests/parser/inputs/input_public_const_success.leo b/tests/parser/inputs/input_public_const_fail.leo similarity index 96% rename from tests/parser/inputs/input_public_const_success.leo rename to tests/parser/inputs/input_public_const_fail.leo index 95861807b5..b775eb9c51 100644 --- a/tests/parser/inputs/input_public_const_success.leo +++ b/tests/parser/inputs/input_public_const_fail.leo @@ -1,6 +1,6 @@ /* namespace: Input -expectation: Pass +expectation: Fail */ [main] From 8482430299a1b81504e667b643670a604e1e83cf Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Wed, 6 Apr 2022 10:41:18 -0700 Subject: [PATCH 11/12] update abnf to reflect recent changes --- docs/grammar/README.md | Bin 45990 -> 45986 bytes docs/grammar/abnf-grammar.txt | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/grammar/README.md b/docs/grammar/README.md index 9af4a38e19864a76bcd3076a67e155fbe6448305..23b59d10fc20ef7e57f2839b2180aa2c8026c0d8 100644 GIT binary patch delta 16 YcmZ4XoN3W>rVR^LFzRn!x`L4#07fzgPXGV_ delta 20 ccmZ4VoN3u}rVR^Lu*NbdFhp-&xPp-z0AM@^_y7O^ diff --git a/docs/grammar/abnf-grammar.txt b/docs/grammar/abnf-grammar.txt index cd50022c52..baa1be8052 100644 --- a/docs/grammar/abnf-grammar.txt +++ b/docs/grammar/abnf-grammar.txt @@ -314,7 +314,7 @@ function-declaration = %s"function" identifier function-parameters = function-parameter *( "," function-parameter ) [ "," ] -function-parameter = [ %s"public" ] [ %s"const" ] identifier ":" type +function-parameter = [ %s"public" / %s"const" ] identifier ":" type declaration = function-declaration From 016b669a8d1500fe69e44349748352930aa3b7c8 Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Thu, 7 Apr 2022 11:18:58 -0700 Subject: [PATCH 12/12] make fields not public --- .../ast/src/functions/input/function_input.rs | 25 ++++++++++++++++--- .../src/reducer/reconstructing_director.rs | 2 +- .../ast/src/reducer/reconstructing_reducer.rs | 8 +++--- compiler/parser/src/parser/file.rs | 8 +++--- 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/compiler/ast/src/functions/input/function_input.rs b/compiler/ast/src/functions/input/function_input.rs index 4aa10eec78..be5afef527 100644 --- a/compiler/ast/src/functions/input/function_input.rs +++ b/compiler/ast/src/functions/input/function_input.rs @@ -44,14 +44,33 @@ impl fmt::Display for ParamMode { pub struct FunctionInputVariable { /// The name the parameter is accessible as in the function's body. pub identifier: Identifier, - /// Is it a const parameter? - pub mode: ParamMode, + /// The mode of the function parameter. + mode: ParamMode, /// What's the parameter's type? - pub type_: Type, + type_: Type, /// The parameters span from any annotations to its type. pub span: Span, } +impl FunctionInputVariable { + pub fn new(identifier: Identifier, mode: ParamMode, type_: Type, span: Span) -> Self { + Self { + identifier, + mode, + type_, + span, + } + } + + pub fn mode(&self) -> ParamMode { + self.mode + } + + pub fn type_(&self) -> Type { + self.type_.clone() + } +} + impl FunctionInputVariable { fn format(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{} ", self.mode)?; diff --git a/compiler/ast/src/reducer/reconstructing_director.rs b/compiler/ast/src/reducer/reconstructing_director.rs index 06161ac65c..ad2da4acc1 100644 --- a/compiler/ast/src/reducer/reconstructing_director.rs +++ b/compiler/ast/src/reducer/reconstructing_director.rs @@ -282,7 +282,7 @@ impl ReconstructingDirector { variable: &FunctionInputVariable, ) -> Result { let identifier = self.reduce_identifier(&variable.identifier)?; - let type_ = self.reduce_type(&variable.type_, &variable.span)?; + let type_ = self.reduce_type(&variable.type_(), &variable.span)?; self.reducer.reduce_function_input_variable(variable, identifier, type_) } diff --git a/compiler/ast/src/reducer/reconstructing_reducer.rs b/compiler/ast/src/reducer/reconstructing_reducer.rs index d47053ad4e..9d0bc2e46d 100644 --- a/compiler/ast/src/reducer/reconstructing_reducer.rs +++ b/compiler/ast/src/reducer/reconstructing_reducer.rs @@ -272,12 +272,12 @@ pub trait ReconstructingReducer { identifier: Identifier, type_: Type, ) -> Result { - Ok(FunctionInputVariable { + Ok(FunctionInputVariable::new( identifier, - mode: variable.mode, + variable.mode(), type_, - span: variable.span.clone(), - }) + variable.span.clone(), + )) } fn reduce_function_input(&mut self, _input: &FunctionInput, new: FunctionInput) -> Result { diff --git a/compiler/parser/src/parser/file.rs b/compiler/parser/src/parser/file.rs index c1211d93ba..a90b35165f 100644 --- a/compiler/parser/src/parser/file.rs +++ b/compiler/parser/src/parser/file.rs @@ -91,12 +91,12 @@ impl ParserContext<'_> { self.expect(Token::Colon)?; let type_ = self.parse_type()?.0; - Ok(FunctionInput::Variable(FunctionInputVariable { + Ok(FunctionInput::Variable(FunctionInputVariable::new( + name.clone(), mode, type_, - span: name.span.clone(), - identifier: name, - })) + name.span, + ))) } /// Returns an [`(Identifier, Function)`] AST node if the next tokens represent a function name