From 2fbaf759db4e86b0367a26a765a4511ea0a179a9 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Fri, 13 May 2022 23:36:08 -0700 Subject: [PATCH 01/10] [parser] Remove mut and type keywords. As discussed, these are no longer in the grammar. If and when we need them, we will re-add them. This also removes some extra code that gives a specific error when mut is used. However, that is in fact another bug, because `mut` is a valid identifier in the current grammar, and thus this extra code unjustly rejects code that uses `mut` as an identifier. Adjust some tests and expectations. --- compiler/parser/src/parser/file.rs | 5 --- compiler/parser/src/parser/statement.rs | 5 +-- compiler/parser/src/tokenizer/lexer.rs | 2 - compiler/parser/src/tokenizer/token.rs | 8 ---- .../parser/expression/token_format.leo.out | 2 - .../parser/functions/mut_input_fail.leo.out | 2 +- .../parser/statement/definition_fail.leo.out | 40 +++++++++---------- tests/parser/expression/token_format.leo | 4 -- 8 files changed, 22 insertions(+), 46 deletions(-) diff --git a/compiler/parser/src/parser/file.rs b/compiler/parser/src/parser/file.rs index a64e526b5e..f40976bc57 100644 --- a/compiler/parser/src/parser/file.rs +++ b/compiler/parser/src/parser/file.rs @@ -85,14 +85,9 @@ impl ParserContext<'_> { /// Returns a [`FunctionInput`] AST node if the next tokens represent a function parameter. pub fn parse_function_parameter(&mut self) -> Result { let mode = self.parse_function_parameter_mode()?; - let mutable = self.eat(&Token::Mut).then(|| self.prev_token.clone()); let name = self.expect_ident()?; - if let Some(mutable) = &mutable { - self.emit_err(ParserError::mut_function_input(mutable.span + name.span)); - } - self.expect(&Token::Colon)?; let type_ = self.parse_type()?.0; Ok(FunctionInput::Variable(FunctionInputVariable::new( diff --git a/compiler/parser/src/parser/statement.rs b/compiler/parser/src/parser/statement.rs index b464bf21e2..273587be2e 100644 --- a/compiler/parser/src/parser/statement.rs +++ b/compiler/parser/src/parser/statement.rs @@ -219,10 +219,7 @@ impl ParserContext<'_> { /// Returns a [`VariableName`] AST node if the next tokens represent a variable name with /// valid keywords. - pub fn parse_variable_name(&mut self, decl_ty: Declare, span: Span) -> Result { - if self.eat(&Token::Mut) { - self.emit_err(ParserError::let_mut_statement(self.prev_token.span + span)); - } + pub fn parse_variable_name(&mut self, decl_ty: Declare, _span: Span) -> Result { let name = self.expect_ident()?; Ok(VariableName { diff --git a/compiler/parser/src/tokenizer/lexer.rs b/compiler/parser/src/tokenizer/lexer.rs index da372b9636..12680db01d 100644 --- a/compiler/parser/src/tokenizer/lexer.rs +++ b/compiler/parser/src/tokenizer/lexer.rs @@ -422,11 +422,9 @@ impl Token { "in" => Token::In, "input" => Token::Input, "let" => Token::Let, - "mut" => Token::Mut, "public" => Token::Public, "return" => Token::Return, "true" => Token::True, - "type" => Token::Type, "u8" => Token::U8, "u16" => Token::U16, "u32" => Token::U32, diff --git a/compiler/parser/src/tokenizer/token.rs b/compiler/parser/src/tokenizer/token.rs index 5a0d58aff6..76d69b9811 100644 --- a/compiler/parser/src/tokenizer/token.rs +++ b/compiler/parser/src/tokenizer/token.rs @@ -124,11 +124,9 @@ pub enum Token { If, In, Let, - Mut, /// For public inputs. Public, Return, - Type, // Meta Tokens Eof, @@ -156,11 +154,9 @@ pub const KEYWORD_TOKENS: &[Token] = &[ Token::In, Token::Input, Token::Let, - Token::Mut, Token::Public, Token::Return, Token::True, - Token::Type, Token::U8, Token::U16, Token::U32, @@ -198,11 +194,9 @@ impl Token { Token::In => sym::In, Token::Input => sym::input, Token::Let => sym::Let, - Token::Mut => sym::Mut, Token::Public => sym::Public, Token::Return => sym::Return, Token::True => sym::True, - Token::Type => sym::Type, Token::U8 => sym::u8, Token::U16 => sym::u16, Token::U32 => sym::u32, @@ -291,10 +285,8 @@ impl fmt::Display for Token { If => write!(f, "if"), In => write!(f, "in"), Let => write!(f, "let"), - Mut => write!(f, "mut"), Public => write!(f, "public"), Return => write!(f, "return"), - Type => write!(f, "type"), Eof => write!(f, ""), } } diff --git a/tests/expectations/parser/parser/expression/token_format.leo.out b/tests/expectations/parser/parser/expression/token_format.leo.out index 9d66a72ae5..3d9b7f4902 100644 --- a/tests/expectations/parser/parser/expression/token_format.leo.out +++ b/tests/expectations/parser/parser/expression/token_format.leo.out @@ -70,7 +70,5 @@ outputs: - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'in'\n --> test:1:1\n |\n 1 | in\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'let'\n --> test:1:1\n |\n 1 | let\n | ^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'mut'\n --> test:1:1\n |\n 1 | mut\n | ^^^" - "Error [EPAR0370023]: Expected more characters to lex but found none." - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'return'\n --> test:1:1\n |\n 1 | return\n | ^^^^^^" - - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'type'\n --> test:1:1\n |\n 1 | type\n | ^^^^" diff --git a/tests/expectations/parser/parser/functions/mut_input_fail.leo.out b/tests/expectations/parser/parser/functions/mut_input_fail.leo.out index 5714154f71..3f657a07e7 100644 --- a/tests/expectations/parser/parser/functions/mut_input_fail.leo.out +++ b/tests/expectations/parser/parser/functions/mut_input_fail.leo.out @@ -2,4 +2,4 @@ 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 | ^^^^^\nError [EPAR0370005]: expected -> -- got '{'\n --> test:3:23\n |\n 3 | function f(mut a: u8) {}\n | ^" + - "Error [EPAR0370005]: expected : -- got 'a'\n --> test:3:16\n |\n 3 | function f(mut a: u8) {}\n | ^" diff --git a/tests/expectations/parser/parser/statement/definition_fail.leo.out b/tests/expectations/parser/parser/statement/definition_fail.leo.out index 48074c2ff5..3d5f898659 100644 --- a/tests/expectations/parser/parser/statement/definition_fail.leo.out +++ b/tests/expectations/parser/parser/statement/definition_fail.leo.out @@ -2,26 +2,26 @@ namespace: ParseStatement expectation: Fail outputs: - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x = expr;\n | ^^^^^^^\nError [EPAR0370005]: expected : -- got '='\n --> test:1:11\n |\n 1 | let mut x = expr;\n | ^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x = ();\n | ^^^^^^^\nError [EPAR0370005]: expected : -- got '='\n --> test:1:11\n |\n 1 | let mut x = ();\n | ^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x = x+y;\n | ^^^^^^^\nError [EPAR0370005]: expected : -- got '='\n --> test:1:11\n |\n 1 | let mut x = x+y;\n | ^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x = (x,y);\n | ^^^^^^^\nError [EPAR0370005]: expected : -- got '='\n --> test:1:11\n |\n 1 | let mut x = (x,y);\n | ^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x = x();\n | ^^^^^^^\nError [EPAR0370005]: expected : -- got '='\n --> test:1:11\n |\n 1 | let mut x = x();\n | ^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x = expr;\n | ^^^^^^^^^\nError [EPAR0370005]: expected : -- got '='\n --> test:1:13\n |\n 1 | const mut x = expr;\n | ^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x = ();\n | ^^^^^^^^^\nError [EPAR0370005]: expected : -- got '='\n --> test:1:13\n |\n 1 | const mut x = ();\n | ^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x = x+y;\n | ^^^^^^^^^\nError [EPAR0370005]: expected : -- got '='\n --> test:1:13\n |\n 1 | const mut x = x+y;\n | ^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x = (x,y);\n | ^^^^^^^^^\nError [EPAR0370005]: expected : -- got '='\n --> test:1:13\n |\n 1 | const mut x = (x,y);\n | ^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x = x();\n | ^^^^^^^^^\nError [EPAR0370005]: expected : -- got '='\n --> test:1:13\n |\n 1 | const mut x = x();\n | ^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x: u32 = expr;\n | ^^^^^^^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x: u32 = ();\n | ^^^^^^^\nError [EPAR0370005]: expected A valid expression. -- got 'A tuple expression.'\n --> test:1:18\n |\n 1 | let mut x: u32 = ();\n | ^^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x: u32 = x+y;\n | ^^^^^^^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x: u32 = (x,y);\n | ^^^^^^^\nError [EPAR0370005]: expected A valid expression. -- got 'A tuple expression.'\n --> test:1:18\n |\n 1 | let mut x: u32 = (x,y);\n | ^^^^^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | let mut x: u32 = x();\n | ^^^^^^^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x: u32 = expr;\n | ^^^^^^^^^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x: u32 = ();\n | ^^^^^^^^^\nError [EPAR0370005]: expected A valid expression. -- got 'A tuple expression.'\n --> test:1:20\n |\n 1 | const mut x: u32 = ();\n | ^^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x: u32 = x+y;\n | ^^^^^^^^^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x: u32 = (x,y);\n | ^^^^^^^^^\nError [EPAR0370005]: expected A valid expression. -- got 'A tuple expression.'\n --> test:1:20\n |\n 1 | const mut x: u32 = (x,y);\n | ^^^^^" - - "Error [EPAR0370014]: let mut = ... is deprecated. `let` keyword implies mutabality by default.\n --> test:1:1\n |\n 1 | const mut x: u32 = x();\n | ^^^^^^^^^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x = expr;\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x = ();\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x = x+y;\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x = (x,y);\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x = x();\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x = expr;\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x = ();\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x = x+y;\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x = (x,y);\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x = x();\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x: u32 = expr;\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x: u32 = ();\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x: u32 = x+y;\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x: u32 = (x,y);\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:9\n |\n 1 | let mut x: u32 = x();\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x: u32 = expr;\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x: u32 = ();\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x: u32 = x+y;\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x: u32 = (x,y);\n | ^" + - "Error [EPAR0370005]: expected : -- got 'x'\n --> test:1:11\n |\n 1 | const mut x: u32 = x();\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:10\n |\n 1 | let (x,y,,) = ();\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:6\n |\n 1 | let (,x,y) = ();\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'ident', got ','\n --> test:1:8\n |\n 1 | let (x,,y) = ();\n | ^" diff --git a/tests/parser/expression/token_format.leo b/tests/parser/expression/token_format.leo index c0c8bc4eef..a114ea9773 100644 --- a/tests/parser/expression/token_format.leo +++ b/tests/parser/expression/token_format.leo @@ -139,10 +139,6 @@ in let -mut - & return - -type From 21616fe16747129e79963bb718fe0671d4632326 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Fri, 13 May 2022 23:50:33 -0700 Subject: [PATCH 02/10] [parser] Remove the `input` keyword. This is also not in the current grammar, and it does not look like it is going to be re-added. --- compiler/parser/src/parser/expression.rs | 2 -- compiler/parser/src/tokenizer/lexer.rs | 1 - compiler/parser/src/tokenizer/token.rs | 7 ------- .../parser/functions/const_input_kw_fail.leo.out | 5 ----- tests/parser/functions/const_input_kw_fail.leo | 12 ------------ 5 files changed, 27 deletions(-) delete mode 100644 tests/expectations/parser/parser/functions/const_input_kw_fail.leo.out delete mode 100644 tests/parser/functions/const_input_kw_fail.leo diff --git a/compiler/parser/src/parser/expression.rs b/compiler/parser/src/parser/expression.rs index fce644b3bb..a69528532f 100644 --- a/compiler/parser/src/parser/expression.rs +++ b/compiler/parser/src/parser/expression.rs @@ -17,7 +17,6 @@ use super::*; use leo_errors::{ParserError, Result}; -use leo_span::sym; const INT_TYPES: &[Token] = &[ Token::I8, @@ -317,7 +316,6 @@ impl ParserContext<'_> { let ident = Identifier { name, span }; Expression::Identifier(ident) } - Token::Input => Expression::Identifier(Identifier { name: sym::input, span }), t if crate::type_::TYPE_TOKENS.contains(&t) => Expression::Identifier(Identifier { name: t.keyword_to_symbol().unwrap(), span, diff --git a/compiler/parser/src/tokenizer/lexer.rs b/compiler/parser/src/tokenizer/lexer.rs index 12680db01d..619609a0d1 100644 --- a/compiler/parser/src/tokenizer/lexer.rs +++ b/compiler/parser/src/tokenizer/lexer.rs @@ -420,7 +420,6 @@ impl Token { "i128" => Token::I128, "if" => Token::If, "in" => Token::In, - "input" => Token::Input, "let" => Token::Let, "public" => Token::Public, "return" => Token::Return, diff --git a/compiler/parser/src/tokenizer/token.rs b/compiler/parser/src/tokenizer/token.rs index 76d69b9811..1ae0b660f3 100644 --- a/compiler/parser/src/tokenizer/token.rs +++ b/compiler/parser/src/tokenizer/token.rs @@ -109,9 +109,6 @@ pub enum Token { Address, Char, - // primary expresion - Input, - // Regular Keywords Console, /// Const variable and a const function. @@ -152,7 +149,6 @@ pub const KEYWORD_TOKENS: &[Token] = &[ Token::I128, Token::If, Token::In, - Token::Input, Token::Let, Token::Public, Token::Return, @@ -192,7 +188,6 @@ impl Token { Token::I128 => sym::i128, Token::If => sym::If, Token::In => sym::In, - Token::Input => sym::input, Token::Let => sym::Let, Token::Public => sym::Public, Token::Return => sym::Return, @@ -274,8 +269,6 @@ impl fmt::Display for Token { Address => write!(f, "address"), Char => write!(f, "char"), - Input => write!(f, "input"), - Console => write!(f, "console"), Const => write!(f, "const"), Constant => write!(f, "constant"), diff --git a/tests/expectations/parser/parser/functions/const_input_kw_fail.leo.out b/tests/expectations/parser/parser/functions/const_input_kw_fail.leo.out deleted file mode 100644 index d0d34e7510..0000000000 --- a/tests/expectations/parser/parser/functions/const_input_kw_fail.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - "Error [EPAR0370009]: unexpected string: expected 'ident', got 'input'\n --> test:3:18\n |\n 3 | function x(const input) {\n | ^^^^^" diff --git a/tests/parser/functions/const_input_kw_fail.leo b/tests/parser/functions/const_input_kw_fail.leo deleted file mode 100644 index ac4b998021..0000000000 --- a/tests/parser/functions/const_input_kw_fail.leo +++ /dev/null @@ -1,12 +0,0 @@ -/* -namespace: Parse -expectation: Fail -*/ - -function x(const input) { - return (); -} - -function y(constant input) { - return (); -} \ No newline at end of file From 4989c504091ded8b4b1a23f16637d7f343b84886 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Sat, 14 May 2022 00:03:55 -0700 Subject: [PATCH 03/10] [parser] Attempt to fix style check. --- compiler/parser/src/parser/statement.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/parser/src/parser/statement.rs b/compiler/parser/src/parser/statement.rs index 273587be2e..3c954832fb 100644 --- a/compiler/parser/src/parser/statement.rs +++ b/compiler/parser/src/parser/statement.rs @@ -220,7 +220,6 @@ impl ParserContext<'_> { /// Returns a [`VariableName`] AST node if the next tokens represent a variable name with /// valid keywords. pub fn parse_variable_name(&mut self, decl_ty: Declare, _span: Span) -> Result { - let name = self.expect_ident()?; Ok(VariableName { span: name.span, From dcf029e6455cdb86658b7d89978c65d2d80120fa Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Mon, 16 May 2022 10:34:27 -0700 Subject: [PATCH 04/10] [tests] Remove unused parser errors. Also revise expectations. The changes look extensive in the diff, but only the error codes have changed (at least, that's the expectation, and this has been visually checked in some places of the diff). --- leo/errors/src/errors/parser/parser_errors.rs | 16 -- .../compiler/char/invalid_char.leo.out | 2 +- .../parser/expression/binary/eq_fail.leo.out | 2 +- .../parser/expression/binary/ne_fail.leo.out | 2 +- .../expression/literal/char_fail.leo.out | 94 ++++---- .../expression/literal/comment_fail.leo.out | 18 +- .../expression/literal/group_fail.leo.out | 12 +- .../expression/literal/int_fail.leo.out | 6 +- .../literal/int_parse/field_fail.leo.out | 2 +- .../literal/int_parse/implicit.leo.out | 210 +++++++++--------- .../expression/literal/string_fail.leo.out | 28 +-- .../parser/expression/token_format.leo.out | 52 ++--- .../functions/annotated_arg_not_ident.leo.out | 2 +- .../functions/annotated_context_fail.leo.out | 2 +- .../parser/functions/escape_fail.leo.out | 2 +- .../functions/public_const_param_fail.leo.out | 2 +- .../functions/test_keyword_fail.leo.out | 2 +- .../inputs/input_public_constant_fail.leo.out | 2 +- .../parser/program/backslash_eof.leo.out | 2 +- .../program/bidi_comment_2_fail.leo.out | 2 +- .../parser/program/bidi_comment_fail.leo.out | 2 +- .../parser/parser/program/dollar_eof.leo.out | 2 +- .../parser/program/escape_u8_eof.leo.out | 2 +- .../parser/parser/program/hex_eof.leo.out | 2 +- .../parser/parser/program/pipe_eof.leo.out | 2 +- .../parser/parser/program/q_eof.leo.out | 2 +- .../parser/parser/program/sq_eof.leo.out | 2 +- .../parser/parser/program/tilde_eof.leo.out | 2 +- .../program/unclosed_unicode_eof_fail.leo.out | 2 +- .../parser/statement/assign_fail.leo.out | 4 +- .../parser/statement/console_fail.leo.out | 2 +- .../parser/statement/definition_fail.leo.out | 6 +- .../parser/statement/expression_fail.leo.out | 4 +- .../parser/statement/hex_int_fail.leo.out | 6 +- .../parser/statement/return_fail.leo.out | 2 +- .../parser/parser/unreachable/define.leo.out | 4 +- .../parser/unreachable/eat_ident.leo.out | 2 +- .../parser/parser/unreachable/eat_int.leo.out | 2 +- .../equality_and_order_expression.leo.out | 2 +- .../parser/unreachable/expect_ident.leo.out | 2 +- .../parser/unreachable/math_op_fail.leo.out | 4 +- 41 files changed, 251 insertions(+), 267 deletions(-) diff --git a/leo/errors/src/errors/parser/parser_errors.rs b/leo/errors/src/errors/parser/parser_errors.rs index bd7bae6151..f826d53091 100644 --- a/leo/errors/src/errors/parser/parser_errors.rs +++ b/leo/errors/src/errors/parser/parser_errors.rs @@ -136,22 +136,6 @@ create_messages!( help: None, } - /// For when the parser encountered a deprecated `mut` argument in a function. - @formatted - mut_function_input { - args: (), - msg: "function func(mut a: u32) { ... } is deprecated. Passed variables are mutable by default.", - help: None, - } - - /// For when the parser encountered a deprecated `mut` argument in a let statement. - @formatted - let_mut_statement { - args: (), - msg: "let mut = ... is deprecated. `let` keyword implies mutabality by default.", - help: None, - } - /// For when the parser encountered a deprecated `test function`. @formatted test_function { diff --git a/tests/expectations/compiler/compiler/char/invalid_char.leo.out b/tests/expectations/compiler/compiler/char/invalid_char.leo.out index 1f6e688849..143eb49cb3 100644 --- a/tests/expectations/compiler/compiler/char/invalid_char.leo.out +++ b/tests/expectations/compiler/compiler/char/invalid_char.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370026]: Expected a closed char but found `'`." + - "Error [EPAR0370024]: Expected a closed char but found `'`." diff --git a/tests/expectations/parser/parser/expression/binary/eq_fail.leo.out b/tests/expectations/parser/parser/expression/binary/eq_fail.leo.out index ba9df4ea97..24690c1d60 100644 --- a/tests/expectations/parser/parser/expression/binary/eq_fail.leo.out +++ b/tests/expectations/parser/parser/expression/binary/eq_fail.leo.out @@ -2,4 +2,4 @@ namespace: ParseExpression expectation: Fail outputs: - - "Error [EPAR0370032]: Could not parse the implicit value: 1.\n --> test:1:1\n |\n 1 | 1 == 2 == 3\n | ^" + - "Error [EPAR0370030]: Could not parse the implicit value: 1.\n --> test:1:1\n |\n 1 | 1 == 2 == 3\n | ^" diff --git a/tests/expectations/parser/parser/expression/binary/ne_fail.leo.out b/tests/expectations/parser/parser/expression/binary/ne_fail.leo.out index bbb63e997d..009a402a83 100644 --- a/tests/expectations/parser/parser/expression/binary/ne_fail.leo.out +++ b/tests/expectations/parser/parser/expression/binary/ne_fail.leo.out @@ -2,4 +2,4 @@ namespace: ParseExpression expectation: Fail outputs: - - "Error [EPAR0370032]: Could not parse the implicit value: 1.\n --> test:1:1\n |\n 1 | 1 != 2 != 3\n | ^" + - "Error [EPAR0370030]: Could not parse the implicit value: 1.\n --> test:1:1\n |\n 1 | 1 != 2 != 3\n | ^" diff --git a/tests/expectations/parser/parser/expression/literal/char_fail.leo.out b/tests/expectations/parser/parser/expression/literal/char_fail.leo.out index 2f17e3ad5f..c89f7d3099 100644 --- a/tests/expectations/parser/parser/expression/literal/char_fail.leo.out +++ b/tests/expectations/parser/parser/expression/literal/char_fail.leo.out @@ -2,50 +2,50 @@ namespace: Token expectation: Fail outputs: - - "Error [EPAR0370023]: Expected more characters to lex but found none." - - "Error [EPAR0370030]: Could not lex the following content: `\\`." - - "Error [EPAR0370023]: Expected more characters to lex but found none." - - "Error [EPAR0370030]: Could not lex the following content: `\\n`." - - "Error [EPAR0370023]: Expected more characters to lex but found none." - - "Error [EPAR0370023]: Expected more characters to lex but found none." - - "Error [EPAR0370023]: Expected more characters to lex but found none." - - "Error [EPAR0370031]: Expected a valid hex character but found `'`." - - "Error [EPAR0370031]: Expected a valid hex character but found `'`." - - "Error [EPAR0370031]: Expected a valid hex character but found `9A`." - - "Error [EPAR0370031]: Expected a valid hex character but found `7g`." - - "Error [EPAR0370031]: Expected a valid hex character but found `80`." - - "Error [EPAR0370031]: Expected a valid hex character but found `c1`." - - "Error [EPAR0370031]: Expected a valid hex character but found `c2`." - - "Error [EPAR0370031]: Expected a valid hex character but found `DF`." - - "Error [EPAR0370031]: Expected a valid hex character but found `C0`." - - "Error [EPAR0370031]: Expected a valid hex character but found `e0`." - - "Error [EPAR0370031]: Expected a valid hex character but found `9f`." - - "Error [EPAR0370026]: Expected a closed char but found `a`." - - "Error [EPAR0370024]: Expected a valid escape character but found `a`." - - "Error [EPAR0370024]: Expected a valid escape character but found `z`." - - "Error [EPAR0370024]: Expected a valid escape character but found `A`." - - "Error [EPAR0370024]: Expected a valid escape character but found `Z`." - - "Error [EPAR0370024]: Expected a valid escape character but found `1`." - - "Error [EPAR0370024]: Expected a valid escape character but found `9`." - - "Error [EPAR0370024]: Expected a valid escape character but found `*`." - - "Error [EPAR0370031]: Expected a valid hex character but found `'`." - - "Error [EPAR0370038]: There was no opening `{` after starting an escaped unicode `'`." - - "Error [EPAR0370026]: Expected a closed char but found `\t`." - - "Error [EPAR0370038]: There was no opening `{` after starting an escaped unicode `z`." - - "Error [EPAR0370038]: There was no opening `{` after starting an escaped unicode `1`." - - "Error [EPAR0370038]: There was no opening `{` after starting an escaped unicode `}`." - - "Error [EPAR0370026]: Expected a closed char but found `🦀`." - - "Error [EPAR0370038]: There was no opening `{` after starting an escaped unicode `1`." - - "Error [EPAR0370026]: Expected a closed char but found `🦀`." - - "Error [EPAR0370038]: There was no opening `{` after starting an escaped unicode `6`." - - "Error [EPAR0370033]: There was no closing `}` after a escaped unicode `af🦀'`." - - "Error [EPAR0370033]: There was no closing `}` after a escaped unicode `2764z'`." - - "Error [EPAR0370031]: Expected a valid hex character but found `276g`." - - "Error [EPAR0370038]: There was no opening `{` after starting an escaped unicode `9`." - - "Error [EPAR0370038]: There was no opening `{` after starting an escaped unicode `0`." - - "Error [EPAR0370038]: There was no opening `{` after starting an escaped unicode `0`." - - "Error [EPAR0370035]: The escaped unicode char `110000` is greater than 0x10FFFF." - - "Error [EPAR0370034]: The escaped unicode char `1234567890` is not within valid length of [1, 6]." - - "Error [EPAR0370026]: Expected a closed char but found `򻮻`." - - "Error [EPAR0370026]: Expected a closed char but found `😭`." - - "Error [EPAR0370044]: Unicode bidi override code point encountered." + - "Error [EPAR0370021]: Expected more characters to lex but found none." + - "Error [EPAR0370028]: Could not lex the following content: `\\`." + - "Error [EPAR0370021]: Expected more characters to lex but found none." + - "Error [EPAR0370028]: Could not lex the following content: `\\n`." + - "Error [EPAR0370021]: Expected more characters to lex but found none." + - "Error [EPAR0370021]: Expected more characters to lex but found none." + - "Error [EPAR0370021]: Expected more characters to lex but found none." + - "Error [EPAR0370029]: Expected a valid hex character but found `'`." + - "Error [EPAR0370029]: Expected a valid hex character but found `'`." + - "Error [EPAR0370029]: Expected a valid hex character but found `9A`." + - "Error [EPAR0370029]: Expected a valid hex character but found `7g`." + - "Error [EPAR0370029]: Expected a valid hex character but found `80`." + - "Error [EPAR0370029]: Expected a valid hex character but found `c1`." + - "Error [EPAR0370029]: Expected a valid hex character but found `c2`." + - "Error [EPAR0370029]: Expected a valid hex character but found `DF`." + - "Error [EPAR0370029]: Expected a valid hex character but found `C0`." + - "Error [EPAR0370029]: Expected a valid hex character but found `e0`." + - "Error [EPAR0370029]: Expected a valid hex character but found `9f`." + - "Error [EPAR0370024]: Expected a closed char but found `a`." + - "Error [EPAR0370022]: Expected a valid escape character but found `a`." + - "Error [EPAR0370022]: Expected a valid escape character but found `z`." + - "Error [EPAR0370022]: Expected a valid escape character but found `A`." + - "Error [EPAR0370022]: Expected a valid escape character but found `Z`." + - "Error [EPAR0370022]: Expected a valid escape character but found `1`." + - "Error [EPAR0370022]: Expected a valid escape character but found `9`." + - "Error [EPAR0370022]: Expected a valid escape character but found `*`." + - "Error [EPAR0370029]: Expected a valid hex character but found `'`." + - "Error [EPAR0370036]: There was no opening `{` after starting an escaped unicode `'`." + - "Error [EPAR0370024]: Expected a closed char but found `\t`." + - "Error [EPAR0370036]: There was no opening `{` after starting an escaped unicode `z`." + - "Error [EPAR0370036]: There was no opening `{` after starting an escaped unicode `1`." + - "Error [EPAR0370036]: There was no opening `{` after starting an escaped unicode `}`." + - "Error [EPAR0370024]: Expected a closed char but found `🦀`." + - "Error [EPAR0370036]: There was no opening `{` after starting an escaped unicode `1`." + - "Error [EPAR0370024]: Expected a closed char but found `🦀`." + - "Error [EPAR0370036]: There was no opening `{` after starting an escaped unicode `6`." + - "Error [EPAR0370031]: There was no closing `}` after a escaped unicode `af🦀'`." + - "Error [EPAR0370031]: There was no closing `}` after a escaped unicode `2764z'`." + - "Error [EPAR0370029]: Expected a valid hex character but found `276g`." + - "Error [EPAR0370036]: There was no opening `{` after starting an escaped unicode `9`." + - "Error [EPAR0370036]: There was no opening `{` after starting an escaped unicode `0`." + - "Error [EPAR0370036]: There was no opening `{` after starting an escaped unicode `0`." + - "Error [EPAR0370033]: The escaped unicode char `110000` is greater than 0x10FFFF." + - "Error [EPAR0370032]: The escaped unicode char `1234567890` is not within valid length of [1, 6]." + - "Error [EPAR0370024]: Expected a closed char but found `򻮻`." + - "Error [EPAR0370024]: Expected a closed char but found `😭`." + - "Error [EPAR0370042]: Unicode bidi override code point encountered." diff --git a/tests/expectations/parser/parser/expression/literal/comment_fail.leo.out b/tests/expectations/parser/parser/expression/literal/comment_fail.leo.out index 7507dd35ed..ce888b5df2 100644 --- a/tests/expectations/parser/parser/expression/literal/comment_fail.leo.out +++ b/tests/expectations/parser/parser/expression/literal/comment_fail.leo.out @@ -2,14 +2,14 @@ namespace: ParseExpression expectation: Fail outputs: - - "Error [EPAR0370028]: Empty block comment." - - "Error [EPAR0370029]: Block comment does not close with content: `/* test`." + - "Error [EPAR0370026]: Empty block comment." + - "Error [EPAR0370027]: Block comment does not close with content: `/* test`." - "Error [EPAR0370009]: unexpected string: expected 'expression', got '/'\n --> test:1:1\n |\n 1 | / /\n | ^" - - "Error [EPAR0370029]: Block comment does not close with content: `/*/`." + - "Error [EPAR0370027]: Block comment does not close with content: `/*/`." - "Error [EPAR0370009]: unexpected string: expected 'expression', got '*'\n --> test:1:1\n |\n 1 | */\n | ^" - - "Error [EPAR0370030]: Could not lex the following content: `🦀**/`." - - "Error [EPAR0370030]: Could not lex the following content: `🦀*/`." - - "Error [EPAR0370029]: Block comment does not close with content: `/*🦀/`." - - "Error [EPAR0370029]: Block comment does not close with content: `/**🦀`." - - "Error [EPAR0370029]: Block comment does not close with content: `/*🦀`." - - "Error [EPAR0370029]: Block comment does not close with content: `/*/*`." + - "Error [EPAR0370028]: Could not lex the following content: `🦀**/`." + - "Error [EPAR0370028]: Could not lex the following content: `🦀*/`." + - "Error [EPAR0370027]: Block comment does not close with content: `/*🦀/`." + - "Error [EPAR0370027]: Block comment does not close with content: `/**🦀`." + - "Error [EPAR0370027]: Block comment does not close with content: `/*🦀`." + - "Error [EPAR0370027]: Block comment does not close with content: `/*/*`." diff --git a/tests/expectations/parser/parser/expression/literal/group_fail.leo.out b/tests/expectations/parser/parser/expression/literal/group_fail.leo.out index 9475bfe15e..100c723c94 100644 --- a/tests/expectations/parser/parser/expression/literal/group_fail.leo.out +++ b/tests/expectations/parser/parser/expression/literal/group_fail.leo.out @@ -3,14 +3,14 @@ namespace: ParseExpression expectation: Fail outputs: - "Error [EPAR0370005]: expected A valid expression. -- got 'A tuple expression.'\n --> test:1:1\n |\n 1 | ()group\n | ^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123)group\n | ^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123)group\n | ^^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got ','\n --> test:1:2\n |\n 1 | (,)group\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '+'\n --> test:1:2\n |\n 1 | (+, -,)group\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got ','\n --> test:1:2\n |\n 1 | (,+, -)group\n | ^" - "Error [EPAR0370005]: expected A valid expression. -- got 'A tuple expression.'\n --> test:1:1\n |\n 1 | (x,y)group\n | ^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123,456u8)group\n | ^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123,456field)group\n | ^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123,456u8)group\n | ^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123,456field)group\n | ^^^" - "Error [EPAR0370004]: Unexpected white space between terms (123,456) and group\n --> test:1:11\n |\n 1 | (123, 456) group\n | ^" - - "Error [EPAR0370032]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123, )group\n | ^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123, 456, 789)group\n | ^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123, 456)bool\n | ^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123, )group\n | ^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123, 456, 789)group\n | ^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 123.\n --> test:1:2\n |\n 1 | (123, 456)bool\n | ^^^" diff --git a/tests/expectations/parser/parser/expression/literal/int_fail.leo.out b/tests/expectations/parser/parser/expression/literal/int_fail.leo.out index de9048e19e..13132f9d50 100644 --- a/tests/expectations/parser/parser/expression/literal/int_fail.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_fail.leo.out @@ -2,6 +2,6 @@ namespace: Token expectation: Fail outputs: - - "Error [EPAR0370036]: A hex number `0x..` was provided but hex is not allowed." - - "Error [EPAR0370036]: A hex number `0x..` was provided but hex is not allowed." - - "Error [EPAR0370036]: A hex number `0x..` was provided but hex is not allowed." + - "Error [EPAR0370034]: A hex number `0x..` was provided but hex is not allowed." + - "Error [EPAR0370034]: A hex number `0x..` was provided but hex is not allowed." + - "Error [EPAR0370034]: A hex number `0x..` was provided but hex is not allowed." diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/field_fail.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/field_fail.leo.out index b08d4ec497..7c32369ff6 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/field_fail.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/field_fail.leo.out @@ -2,4 +2,4 @@ namespace: ParseExpression expectation: Fail outputs: - - "Error [EPAR0370036]: A hex number `0x..` was provided but hex is not allowed." + - "Error [EPAR0370034]: A hex number `0x..` was provided but hex is not allowed." diff --git a/tests/expectations/parser/parser/expression/literal/int_parse/implicit.leo.out b/tests/expectations/parser/parser/expression/literal/int_parse/implicit.leo.out index 7235888979..512b57e2ed 100644 --- a/tests/expectations/parser/parser/expression/literal/int_parse/implicit.leo.out +++ b/tests/expectations/parser/parser/expression/literal/int_parse/implicit.leo.out @@ -2,108 +2,108 @@ namespace: ParseExpression expectation: Fail outputs: - - "Error [EPAR0370032]: Could not parse the implicit value: 123.\n --> test:1:1\n |\n 1 | 123\n | ^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 123.\n --> test:1:1\n |\n 1 | 123\n | ^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 456.\n --> test:1:1\n |\n 1 | 456\n | ^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 87377802873778028737780287377802873778028737780287377802873778028737780287377802.\n --> test:1:1\n |\n 1 | 87377802873778028737780287377802873778028737780287377802873778028737780287377802\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802.\n --> test:1:1\n |\n 1 | 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 340130024.\n --> test:1:1\n |\n 1 | 340130024\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 158951116.\n --> test:1:1\n |\n 1 | 158951116\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 155529659.\n --> test:1:1\n |\n 1 | 155529659\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 642023166.\n --> test:1:1\n |\n 1 | 642023166\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 228481736.\n --> test:1:1\n |\n 1 | 228481736\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 469712960.\n --> test:1:1\n |\n 1 | 469712960\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 929437719.\n --> test:1:1\n |\n 1 | 929437719\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 721072814.\n --> test:1:1\n |\n 1 | 721072814\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 363254789.\n --> test:1:1\n |\n 1 | 363254789\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 906732565.\n --> test:1:1\n |\n 1 | 906732565\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 288246391.\n --> test:1:1\n |\n 1 | 288246391\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 724940549.\n --> test:1:1\n |\n 1 | 724940549\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 487101620.\n --> test:1:1\n |\n 1 | 487101620\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 261373583.\n --> test:1:1\n |\n 1 | 261373583\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 891163927.\n --> test:1:1\n |\n 1 | 891163927\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 743967544.\n --> test:1:1\n |\n 1 | 743967544\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 8372586.\n --> test:1:1\n |\n 1 | 8372586\n | ^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 461793278.\n --> test:1:1\n |\n 1 | 461793278\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 806307045.\n --> test:1:1\n |\n 1 | 806307045\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 122764546.\n --> test:1:1\n |\n 1 | 122764546\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 356336181.\n --> test:1:1\n |\n 1 | 356336181\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 158370903.\n --> test:1:1\n |\n 1 | 158370903\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 774460877.\n --> test:1:1\n |\n 1 | 774460877\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 557174131.\n --> test:1:1\n |\n 1 | 557174131\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 492401267.\n --> test:1:1\n |\n 1 | 492401267\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 893445620.\n --> test:1:1\n |\n 1 | 893445620\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 957757048.\n --> test:1:1\n |\n 1 | 957757048\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 721540649.\n --> test:1:1\n |\n 1 | 721540649\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 390746493.\n --> test:1:1\n |\n 1 | 390746493\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 211251725.\n --> test:1:1\n |\n 1 | 211251725\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 938266114.\n --> test:1:1\n |\n 1 | 938266114\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 156985870.\n --> test:1:1\n |\n 1 | 156985870\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 703831126.\n --> test:1:1\n |\n 1 | 703831126\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 729964155.\n --> test:1:1\n |\n 1 | 729964155\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 988151305.\n --> test:1:1\n |\n 1 | 988151305\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 320872435.\n --> test:1:1\n |\n 1 | 320872435\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 719287167.\n --> test:1:1\n |\n 1 | 719287167\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 152289486.\n --> test:1:1\n |\n 1 | 152289486\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 740067975.\n --> test:1:1\n |\n 1 | 740067975\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 728627816.\n --> test:1:1\n |\n 1 | 728627816\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 385008978.\n --> test:1:1\n |\n 1 | 385008978\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 553967635.\n --> test:1:1\n |\n 1 | 553967635\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 71980713.\n --> test:1:1\n |\n 1 | 71980713\n | ^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 519444716.\n --> test:1:1\n |\n 1 | 519444716\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 116499965.\n --> test:1:1\n |\n 1 | 116499965\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 717422268.\n --> test:1:1\n |\n 1 | 717422268\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 18966279.\n --> test:1:1\n |\n 1 | 18966279\n | ^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 22458638.\n --> test:1:1\n |\n 1 | 22458638\n | ^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 857282620.\n --> test:1:1\n |\n 1 | 857282620\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 920675898.\n --> test:1:1\n |\n 1 | 920675898\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 762235516.\n --> test:1:1\n |\n 1 | 762235516\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 469018377.\n --> test:1:1\n |\n 1 | 469018377\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 199986521.\n --> test:1:1\n |\n 1 | 199986521\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 536679358.\n --> test:1:1\n |\n 1 | 536679358\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 591399452.\n --> test:1:1\n |\n 1 | 591399452\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 83083158.\n --> test:1:1\n |\n 1 | 83083158\n | ^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 599449051.\n --> test:1:1\n |\n 1 | 599449051\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 445442318.\n --> test:1:1\n |\n 1 | 445442318\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 585486590.\n --> test:1:1\n |\n 1 | 585486590\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 209278800.\n --> test:1:1\n |\n 1 | 209278800\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 873568117.\n --> test:1:1\n |\n 1 | 873568117\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 664470940.\n --> test:1:1\n |\n 1 | 664470940\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 465262783.\n --> test:1:1\n |\n 1 | 465262783\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 605652874.\n --> test:1:1\n |\n 1 | 605652874\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 376803940.\n --> test:1:1\n |\n 1 | 376803940\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 965247040.\n --> test:1:1\n |\n 1 | 965247040\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 598474509.\n --> test:1:1\n |\n 1 | 598474509\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 845119918.\n --> test:1:1\n |\n 1 | 845119918\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 648159133.\n --> test:1:1\n |\n 1 | 648159133\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 669051032.\n --> test:1:1\n |\n 1 | 669051032\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 800600261.\n --> test:1:1\n |\n 1 | 800600261\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 434689764.\n --> test:1:1\n |\n 1 | 434689764\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 520060080.\n --> test:1:1\n |\n 1 | 520060080\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 804659385.\n --> test:1:1\n |\n 1 | 804659385\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 537828058.\n --> test:1:1\n |\n 1 | 537828058\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 716600292.\n --> test:1:1\n |\n 1 | 716600292\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 387020273.\n --> test:1:1\n |\n 1 | 387020273\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 199375617.\n --> test:1:1\n |\n 1 | 199375617\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 680337189.\n --> test:1:1\n |\n 1 | 680337189\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 818479931.\n --> test:1:1\n |\n 1 | 818479931\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 893693281.\n --> test:1:1\n |\n 1 | 893693281\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 87377802.\n --> test:1:1\n |\n 1 | 87377802\n | ^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 84699261.\n --> test:1:1\n |\n 1 | 84699261\n | ^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 292826090.\n --> test:1:1\n |\n 1 | 292826090\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 569171405.\n --> test:1:1\n |\n 1 | 569171405\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 387436237.\n --> test:1:1\n |\n 1 | 387436237\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 150682190.\n --> test:1:1\n |\n 1 | 150682190\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 888770419.\n --> test:1:1\n |\n 1 | 888770419\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 824696431.\n --> test:1:1\n |\n 1 | 824696431\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 765659803.\n --> test:1:1\n |\n 1 | 765659803\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 270163693.\n --> test:1:1\n |\n 1 | 270163693\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 427940240.\n --> test:1:1\n |\n 1 | 427940240\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 504997332.\n --> test:1:1\n |\n 1 | 504997332\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 337808338.\n --> test:1:1\n |\n 1 | 337808338\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 907200008.\n --> test:1:1\n |\n 1 | 907200008\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 757177889.\n --> test:1:1\n |\n 1 | 757177889\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 696697188.\n --> test:1:1\n |\n 1 | 696697188\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 41376051.\n --> test:1:1\n |\n 1 | 41376051\n | ^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 496293518.\n --> test:1:1\n |\n 1 | 496293518\n | ^^^^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 251218820.\n --> test:1:1\n |\n 1 | 251218820\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 123.\n --> test:1:1\n |\n 1 | 123\n | ^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 123.\n --> test:1:1\n |\n 1 | 123\n | ^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 456.\n --> test:1:1\n |\n 1 | 456\n | ^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 87377802873778028737780287377802873778028737780287377802873778028737780287377802.\n --> test:1:1\n |\n 1 | 87377802873778028737780287377802873778028737780287377802873778028737780287377802\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802.\n --> test:1:1\n |\n 1 | 8737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802873778028737780287377802\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 340130024.\n --> test:1:1\n |\n 1 | 340130024\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 158951116.\n --> test:1:1\n |\n 1 | 158951116\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 155529659.\n --> test:1:1\n |\n 1 | 155529659\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 642023166.\n --> test:1:1\n |\n 1 | 642023166\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 228481736.\n --> test:1:1\n |\n 1 | 228481736\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 469712960.\n --> test:1:1\n |\n 1 | 469712960\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 929437719.\n --> test:1:1\n |\n 1 | 929437719\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 721072814.\n --> test:1:1\n |\n 1 | 721072814\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 363254789.\n --> test:1:1\n |\n 1 | 363254789\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 906732565.\n --> test:1:1\n |\n 1 | 906732565\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 288246391.\n --> test:1:1\n |\n 1 | 288246391\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 724940549.\n --> test:1:1\n |\n 1 | 724940549\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 487101620.\n --> test:1:1\n |\n 1 | 487101620\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 261373583.\n --> test:1:1\n |\n 1 | 261373583\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 891163927.\n --> test:1:1\n |\n 1 | 891163927\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 743967544.\n --> test:1:1\n |\n 1 | 743967544\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 8372586.\n --> test:1:1\n |\n 1 | 8372586\n | ^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 461793278.\n --> test:1:1\n |\n 1 | 461793278\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 806307045.\n --> test:1:1\n |\n 1 | 806307045\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 122764546.\n --> test:1:1\n |\n 1 | 122764546\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 356336181.\n --> test:1:1\n |\n 1 | 356336181\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 158370903.\n --> test:1:1\n |\n 1 | 158370903\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 774460877.\n --> test:1:1\n |\n 1 | 774460877\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 557174131.\n --> test:1:1\n |\n 1 | 557174131\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 492401267.\n --> test:1:1\n |\n 1 | 492401267\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 893445620.\n --> test:1:1\n |\n 1 | 893445620\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 957757048.\n --> test:1:1\n |\n 1 | 957757048\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 721540649.\n --> test:1:1\n |\n 1 | 721540649\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 390746493.\n --> test:1:1\n |\n 1 | 390746493\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 211251725.\n --> test:1:1\n |\n 1 | 211251725\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 938266114.\n --> test:1:1\n |\n 1 | 938266114\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 156985870.\n --> test:1:1\n |\n 1 | 156985870\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 703831126.\n --> test:1:1\n |\n 1 | 703831126\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 729964155.\n --> test:1:1\n |\n 1 | 729964155\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 988151305.\n --> test:1:1\n |\n 1 | 988151305\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 320872435.\n --> test:1:1\n |\n 1 | 320872435\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 719287167.\n --> test:1:1\n |\n 1 | 719287167\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 152289486.\n --> test:1:1\n |\n 1 | 152289486\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 740067975.\n --> test:1:1\n |\n 1 | 740067975\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 728627816.\n --> test:1:1\n |\n 1 | 728627816\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 385008978.\n --> test:1:1\n |\n 1 | 385008978\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 553967635.\n --> test:1:1\n |\n 1 | 553967635\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 71980713.\n --> test:1:1\n |\n 1 | 71980713\n | ^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 519444716.\n --> test:1:1\n |\n 1 | 519444716\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 116499965.\n --> test:1:1\n |\n 1 | 116499965\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 717422268.\n --> test:1:1\n |\n 1 | 717422268\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 18966279.\n --> test:1:1\n |\n 1 | 18966279\n | ^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 22458638.\n --> test:1:1\n |\n 1 | 22458638\n | ^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 857282620.\n --> test:1:1\n |\n 1 | 857282620\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 920675898.\n --> test:1:1\n |\n 1 | 920675898\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 762235516.\n --> test:1:1\n |\n 1 | 762235516\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 469018377.\n --> test:1:1\n |\n 1 | 469018377\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 199986521.\n --> test:1:1\n |\n 1 | 199986521\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 536679358.\n --> test:1:1\n |\n 1 | 536679358\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 591399452.\n --> test:1:1\n |\n 1 | 591399452\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 83083158.\n --> test:1:1\n |\n 1 | 83083158\n | ^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 599449051.\n --> test:1:1\n |\n 1 | 599449051\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 445442318.\n --> test:1:1\n |\n 1 | 445442318\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 585486590.\n --> test:1:1\n |\n 1 | 585486590\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 209278800.\n --> test:1:1\n |\n 1 | 209278800\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 873568117.\n --> test:1:1\n |\n 1 | 873568117\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 664470940.\n --> test:1:1\n |\n 1 | 664470940\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 465262783.\n --> test:1:1\n |\n 1 | 465262783\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 605652874.\n --> test:1:1\n |\n 1 | 605652874\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 376803940.\n --> test:1:1\n |\n 1 | 376803940\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 965247040.\n --> test:1:1\n |\n 1 | 965247040\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 598474509.\n --> test:1:1\n |\n 1 | 598474509\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 845119918.\n --> test:1:1\n |\n 1 | 845119918\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 648159133.\n --> test:1:1\n |\n 1 | 648159133\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 669051032.\n --> test:1:1\n |\n 1 | 669051032\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 800600261.\n --> test:1:1\n |\n 1 | 800600261\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 434689764.\n --> test:1:1\n |\n 1 | 434689764\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 520060080.\n --> test:1:1\n |\n 1 | 520060080\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 804659385.\n --> test:1:1\n |\n 1 | 804659385\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 537828058.\n --> test:1:1\n |\n 1 | 537828058\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 716600292.\n --> test:1:1\n |\n 1 | 716600292\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 387020273.\n --> test:1:1\n |\n 1 | 387020273\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 199375617.\n --> test:1:1\n |\n 1 | 199375617\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 680337189.\n --> test:1:1\n |\n 1 | 680337189\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 818479931.\n --> test:1:1\n |\n 1 | 818479931\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 893693281.\n --> test:1:1\n |\n 1 | 893693281\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 87377802.\n --> test:1:1\n |\n 1 | 87377802\n | ^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 84699261.\n --> test:1:1\n |\n 1 | 84699261\n | ^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 292826090.\n --> test:1:1\n |\n 1 | 292826090\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 569171405.\n --> test:1:1\n |\n 1 | 569171405\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 387436237.\n --> test:1:1\n |\n 1 | 387436237\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 150682190.\n --> test:1:1\n |\n 1 | 150682190\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 888770419.\n --> test:1:1\n |\n 1 | 888770419\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 824696431.\n --> test:1:1\n |\n 1 | 824696431\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 765659803.\n --> test:1:1\n |\n 1 | 765659803\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 270163693.\n --> test:1:1\n |\n 1 | 270163693\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 427940240.\n --> test:1:1\n |\n 1 | 427940240\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 504997332.\n --> test:1:1\n |\n 1 | 504997332\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 337808338.\n --> test:1:1\n |\n 1 | 337808338\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 907200008.\n --> test:1:1\n |\n 1 | 907200008\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 757177889.\n --> test:1:1\n |\n 1 | 757177889\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 696697188.\n --> test:1:1\n |\n 1 | 696697188\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 41376051.\n --> test:1:1\n |\n 1 | 41376051\n | ^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 496293518.\n --> test:1:1\n |\n 1 | 496293518\n | ^^^^^^^^^" + - "Error [EPAR0370030]: Could not parse the implicit value: 251218820.\n --> test:1:1\n |\n 1 | 251218820\n | ^^^^^^^^^" diff --git a/tests/expectations/parser/parser/expression/literal/string_fail.leo.out b/tests/expectations/parser/parser/expression/literal/string_fail.leo.out index f3378d3e83..71ef80e5fc 100644 --- a/tests/expectations/parser/parser/expression/literal/string_fail.leo.out +++ b/tests/expectations/parser/parser/expression/literal/string_fail.leo.out @@ -2,17 +2,17 @@ namespace: Token expectation: Fail outputs: - - "Error [EPAR0370025]: Expected a closed string but found `Hello world!`." - - "Error [EPAR0370025]: Expected a closed string but found `\"`." - - "Error [EPAR0370023]: Expected more characters to lex but found none." - - "Error [EPAR0370024]: Expected a valid escape character but found `l`." - - "Error [EPAR0370038]: There was no opening `{` after starting an escaped unicode `a`." - - "Error [EPAR0370038]: There was no opening `{` after starting an escaped unicode `\"`." - - "Error [EPAR0370031]: Expected a valid hex character but found `FF`." - - "Error [EPAR0370023]: Expected more characters to lex but found none." - - "Error [EPAR0370038]: There was no opening `{` after starting an escaped unicode `}`." - - "Error [EPAR0370038]: There was no opening `{` after starting an escaped unicode `6`." - - "Error [EPAR0370033]: There was no closing `}` after a escaped unicode `af🦀\"`." - - "Error [EPAR0370025]: Expected a closed string but found `\"`." - - "Error [EPAR0370025]: Expected a closed string but found `⭇😍;`." - - "Error [EPAR0370044]: Unicode bidi override code point encountered." + - "Error [EPAR0370023]: Expected a closed string but found `Hello world!`." + - "Error [EPAR0370023]: Expected a closed string but found `\"`." + - "Error [EPAR0370021]: Expected more characters to lex but found none." + - "Error [EPAR0370022]: Expected a valid escape character but found `l`." + - "Error [EPAR0370036]: There was no opening `{` after starting an escaped unicode `a`." + - "Error [EPAR0370036]: There was no opening `{` after starting an escaped unicode `\"`." + - "Error [EPAR0370029]: Expected a valid hex character but found `FF`." + - "Error [EPAR0370021]: Expected more characters to lex but found none." + - "Error [EPAR0370036]: There was no opening `{` after starting an escaped unicode `}`." + - "Error [EPAR0370036]: There was no opening `{` after starting an escaped unicode `6`." + - "Error [EPAR0370031]: There was no closing `}` after a escaped unicode `af🦀\"`." + - "Error [EPAR0370023]: Expected a closed string but found `\"`." + - "Error [EPAR0370023]: Expected a closed string but found `⭇😍;`." + - "Error [EPAR0370042]: Unicode bidi override code point encountered." diff --git a/tests/expectations/parser/parser/expression/token_format.leo.out b/tests/expectations/parser/parser/expression/token_format.leo.out index 3d9b7f4902..94bc4f2dd0 100644 --- a/tests/expectations/parser/parser/expression/token_format.leo.out +++ b/tests/expectations/parser/parser/expression/token_format.leo.out @@ -2,15 +2,15 @@ namespace: ParseExpression expectation: Fail outputs: - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `@test`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `@test`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." - "Error [EPAR0370009]: unexpected string: expected 'expression', got '&&'\n --> test:1:1\n |\n 1 | &&\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '||'\n --> test:1:1\n |\n 1 | ||\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '=='\n --> test:1:1\n |\n 1 | ==\n | ^^" @@ -46,22 +46,22 @@ outputs: - "Error [EPAR0370009]: unexpected string: expected 'expression', got '?'\n --> test:1:1\n |\n 1 | ?\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '->'\n --> test:1:1\n |\n 1 | ->\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '_'\n --> test:1:1\n |\n 1 | _\n | ^" - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." - - "Error [EPAR0370030]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'console'\n --> test:1:1\n |\n 1 | console\n | ^^^^^^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'const'\n --> test:1:1\n |\n 1 | const\n | ^^^^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'else'\n --> test:1:1\n |\n 1 | else\n | ^^^^" @@ -70,5 +70,5 @@ outputs: - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:1:1\n |\n 1 | if\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'in'\n --> test:1:1\n |\n 1 | in\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'let'\n --> test:1:1\n |\n 1 | let\n | ^^^" - - "Error [EPAR0370023]: Expected more characters to lex but found none." + - "Error [EPAR0370021]: Expected more characters to lex but found none." - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'return'\n --> test:1:1\n |\n 1 | return\n | ^^^^^^" diff --git a/tests/expectations/parser/parser/functions/annotated_arg_not_ident.leo.out b/tests/expectations/parser/parser/functions/annotated_arg_not_ident.leo.out index 090eba8942..219625ac5b 100644 --- a/tests/expectations/parser/parser/functions/annotated_arg_not_ident.leo.out +++ b/tests/expectations/parser/parser/functions/annotated_arg_not_ident.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370030]: Could not lex the following content: `@foo(?, bar, ?)\nfunction x() {\n return ();\n}\n\n@bar(123) // ints not vali\nfunction x() {\n return ();\n}\n\n\n@context // recovery witness\nfunction x() {\n return ();\n}\n`." + - "Error [EPAR0370028]: Could not lex the following content: `@foo(?, bar, ?)\nfunction x() {\n return ();\n}\n\n@bar(123) // ints not vali\nfunction x() {\n return ();\n}\n\n\n@context // recovery witness\nfunction x() {\n return ();\n}\n`." diff --git a/tests/expectations/parser/parser/functions/annotated_context_fail.leo.out b/tests/expectations/parser/parser/functions/annotated_context_fail.leo.out index 96ece07b38..7372d97c87 100644 --- a/tests/expectations/parser/parser/functions/annotated_context_fail.leo.out +++ b/tests/expectations/parser/parser/functions/annotated_context_fail.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370030]: Could not lex the following content: `@context\nfunction f() {\n return ();\n}\n\n@context // recovery witness\nfunction g() {\n return ();\n}\n`." + - "Error [EPAR0370028]: Could not lex the following content: `@context\nfunction f() {\n return ();\n}\n\n@context // recovery witness\nfunction g() {\n return ();\n}\n`." diff --git a/tests/expectations/parser/parser/functions/escape_fail.leo.out b/tests/expectations/parser/parser/functions/escape_fail.leo.out index 9fe177028c..59a1ceac77 100644 --- a/tests/expectations/parser/parser/functions/escape_fail.leo.out +++ b/tests/expectations/parser/parser/functions/escape_fail.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370030]: Could not lex the following content: `\\`." + - "Error [EPAR0370028]: Could not lex the following content: `\\`." 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 index 2a9735278c..4b8eed0e9e 100644 --- a/tests/expectations/parser/parser/functions/public_const_param_fail.leo.out +++ b/tests/expectations/parser/parser/functions/public_const_param_fail.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370042]: A parameter cannot be both public and const.\n --> test:3:20\n |\n 3 | function x(x: u32, public const y: i32) {\n | ^^^^^^^^^^^^" + - "Error [EPAR0370040]: 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/test_keyword_fail.leo.out b/tests/expectations/parser/parser/functions/test_keyword_fail.leo.out index 22e16133ed..e32ec52ec0 100644 --- a/tests/expectations/parser/parser/functions/test_keyword_fail.leo.out +++ b/tests/expectations/parser/parser/functions/test_keyword_fail.leo.out @@ -2,4 +2,4 @@ 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 | ^^^^" + - "Error [EPAR0370013]: \"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/inputs/input_public_constant_fail.leo.out b/tests/expectations/parser/parser/inputs/input_public_constant_fail.leo.out index a1a24549d6..ce7cea986e 100644 --- a/tests/expectations/parser/parser/inputs/input_public_constant_fail.leo.out +++ b/tests/expectations/parser/parser/inputs/input_public_constant_fail.leo.out @@ -2,4 +2,4 @@ namespace: Input expectation: Fail outputs: - - "Error [EPAR0370042]: A parameter cannot be both public and const.\n --> test:4:1\n |\n 4 | public constant a: bool = true;\n | ^^^^^^^^^^^^^^^" + - "Error [EPAR0370040]: A parameter cannot be both public and const.\n --> test:4:1\n |\n 4 | public constant a: bool = true;\n | ^^^^^^^^^^^^^^^" diff --git a/tests/expectations/parser/parser/program/backslash_eof.leo.out b/tests/expectations/parser/parser/program/backslash_eof.leo.out index 9fe177028c..59a1ceac77 100644 --- a/tests/expectations/parser/parser/program/backslash_eof.leo.out +++ b/tests/expectations/parser/parser/program/backslash_eof.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370030]: Could not lex the following content: `\\`." + - "Error [EPAR0370028]: Could not lex the following content: `\\`." diff --git a/tests/expectations/parser/parser/program/bidi_comment_2_fail.leo.out b/tests/expectations/parser/parser/program/bidi_comment_2_fail.leo.out index 7a30e47e4a..43e43fea7c 100644 --- a/tests/expectations/parser/parser/program/bidi_comment_2_fail.leo.out +++ b/tests/expectations/parser/parser/program/bidi_comment_2_fail.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370044]: Unicode bidi override code point encountered." + - "Error [EPAR0370042]: Unicode bidi override code point encountered." diff --git a/tests/expectations/parser/parser/program/bidi_comment_fail.leo.out b/tests/expectations/parser/parser/program/bidi_comment_fail.leo.out index 7a30e47e4a..43e43fea7c 100644 --- a/tests/expectations/parser/parser/program/bidi_comment_fail.leo.out +++ b/tests/expectations/parser/parser/program/bidi_comment_fail.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370044]: Unicode bidi override code point encountered." + - "Error [EPAR0370042]: Unicode bidi override code point encountered." diff --git a/tests/expectations/parser/parser/program/dollar_eof.leo.out b/tests/expectations/parser/parser/program/dollar_eof.leo.out index 1d418a4b25..fca13ec1c2 100644 --- a/tests/expectations/parser/parser/program/dollar_eof.leo.out +++ b/tests/expectations/parser/parser/program/dollar_eof.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370030]: Could not lex the following content: `$`." + - "Error [EPAR0370028]: Could not lex the following content: `$`." diff --git a/tests/expectations/parser/parser/program/escape_u8_eof.leo.out b/tests/expectations/parser/parser/program/escape_u8_eof.leo.out index 2973be8cc8..0848e02369 100644 --- a/tests/expectations/parser/parser/program/escape_u8_eof.leo.out +++ b/tests/expectations/parser/parser/program/escape_u8_eof.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370030]: Could not lex the following content: `\\1u8`." + - "Error [EPAR0370028]: Could not lex the following content: `\\1u8`." diff --git a/tests/expectations/parser/parser/program/hex_eof.leo.out b/tests/expectations/parser/parser/program/hex_eof.leo.out index f8cd3c63e8..2f139ed7c1 100644 --- a/tests/expectations/parser/parser/program/hex_eof.leo.out +++ b/tests/expectations/parser/parser/program/hex_eof.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370036]: A hex number `0x..` was provided but hex is not allowed." + - "Error [EPAR0370034]: A hex number `0x..` was provided but hex is not allowed." diff --git a/tests/expectations/parser/parser/program/pipe_eof.leo.out b/tests/expectations/parser/parser/program/pipe_eof.leo.out index 5c1018440c..fb661e441a 100644 --- a/tests/expectations/parser/parser/program/pipe_eof.leo.out +++ b/tests/expectations/parser/parser/program/pipe_eof.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370023]: Expected more characters to lex but found none." + - "Error [EPAR0370021]: Expected more characters to lex but found none." diff --git a/tests/expectations/parser/parser/program/q_eof.leo.out b/tests/expectations/parser/parser/program/q_eof.leo.out index 185a49721f..c03ef62046 100644 --- a/tests/expectations/parser/parser/program/q_eof.leo.out +++ b/tests/expectations/parser/parser/program/q_eof.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370025]: Expected a closed string but found ``." + - "Error [EPAR0370023]: Expected a closed string but found ``." diff --git a/tests/expectations/parser/parser/program/sq_eof.leo.out b/tests/expectations/parser/parser/program/sq_eof.leo.out index 5c1018440c..fb661e441a 100644 --- a/tests/expectations/parser/parser/program/sq_eof.leo.out +++ b/tests/expectations/parser/parser/program/sq_eof.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370023]: Expected more characters to lex but found none." + - "Error [EPAR0370021]: Expected more characters to lex but found none." diff --git a/tests/expectations/parser/parser/program/tilde_eof.leo.out b/tests/expectations/parser/parser/program/tilde_eof.leo.out index 02b455d02b..0bb6387226 100644 --- a/tests/expectations/parser/parser/program/tilde_eof.leo.out +++ b/tests/expectations/parser/parser/program/tilde_eof.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370030]: Could not lex the following content: `~`." + - "Error [EPAR0370028]: Could not lex the following content: `~`." diff --git a/tests/expectations/parser/parser/program/unclosed_unicode_eof_fail.leo.out b/tests/expectations/parser/parser/program/unclosed_unicode_eof_fail.leo.out index 5c1018440c..fb661e441a 100644 --- a/tests/expectations/parser/parser/program/unclosed_unicode_eof_fail.leo.out +++ b/tests/expectations/parser/parser/program/unclosed_unicode_eof_fail.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370023]: Expected more characters to lex but found none." + - "Error [EPAR0370021]: Expected more characters to lex but found none." diff --git a/tests/expectations/parser/parser/statement/assign_fail.leo.out b/tests/expectations/parser/parser/statement/assign_fail.leo.out index f41b61429d..03d733c0d4 100644 --- a/tests/expectations/parser/parser/statement/assign_fail.leo.out +++ b/tests/expectations/parser/parser/statement/assign_fail.leo.out @@ -3,7 +3,7 @@ namespace: ParseStatement expectation: Fail outputs: - "Error [EPAR0370005]: expected ; -- got ':'\n --> test:1:2\n |\n 1 | x::y = y;\n | ^" - - "Error [EPAR0370032]: Could not parse the implicit value: 5.\n --> test:1:1\n |\n 1 | 5 = y;\n | ^" + - "Error [EPAR0370030]: Could not parse the implicit value: 5.\n --> test:1:1\n |\n 1 | 5 = y;\n | ^" - "Error [EPAR0370011]: invalid assignment target\n --> test:1:1\n |\n 1 | x + x = y;\n | ^^^^^" - "Error [EPAR0370011]: invalid assignment target\n --> test:1:1\n |\n 1 | -x = y;\n | ^^" - "Error [EPAR0370011]: invalid assignment target\n --> test:1:1\n |\n 1 | !x = y;\n | ^^" @@ -15,4 +15,4 @@ outputs: - "Error [EPAR0370005]: expected ; -- got '{'\n --> test:1:3\n |\n 1 | x {x: y, y: z} = y;\n | ^" - "Error [EPAR0370011]: invalid assignment target\n --> test:1:1\n |\n 1 | x() = y;\n | ^^^" - "Error [EPAR0370009]: unexpected string: expected 'int or ident', got 'y'\n --> test:1:3\n |\n 1 | x.y() = y;\n | ^" - - "Error [EPAR0370030]: Could not lex the following content: `🦀 = y;`." + - "Error [EPAR0370028]: Could not lex the following content: `🦀 = y;`." diff --git a/tests/expectations/parser/parser/statement/console_fail.leo.out b/tests/expectations/parser/parser/statement/console_fail.leo.out index af7d33fe51..65e8563336 100644 --- a/tests/expectations/parser/parser/statement/console_fail.leo.out +++ b/tests/expectations/parser/parser/statement/console_fail.leo.out @@ -2,6 +2,6 @@ namespace: ParseStatement expectation: Fail outputs: - - "Error [EPAR0370044]: Unicode bidi override code point encountered." + - "Error [EPAR0370042]: Unicode bidi override code point encountered." - "Error [EPAR0370009]: unexpected string: expected 'formatted string', got '1'\n --> test:1:13\n |\n 1 | console.log(1);\n | ^" - "Error [EPAR0370007]: unexpected identifier: expected 'assert', 'error', 'log' -- got 'test'\n --> test:1:9\n |\n 1 | console.test();\n | ^^^^" diff --git a/tests/expectations/parser/parser/statement/definition_fail.leo.out b/tests/expectations/parser/parser/statement/definition_fail.leo.out index 3d5f898659..4334a325bf 100644 --- a/tests/expectations/parser/parser/statement/definition_fail.leo.out +++ b/tests/expectations/parser/parser/statement/definition_fail.leo.out @@ -43,6 +43,6 @@ outputs: - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool', 'char' -- got '['\n --> test:1:8\n |\n 1 | let x: [u8;\n | ^" - "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool', 'char' -- got '['\n --> test:1:8\n |\n 1 | let x: [u8; 1u8] = [1,\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got ']'\n --> test:1:15\n |\n 1 | let dbg: u8 = ];\n | ^" - - "Error [EPAR0370030]: Could not lex the following content: `🦀: u8 = 0;`." - - "Error [EPAR0370039]: do not put parens around single variable names\n --> test:1:6\n |\n 1 | let (x) = ...;\n | ^\nError [EPAR0370005]: expected : -- got '='\n --> test:1:9\n |\n 1 | let (x) = ...;\n | ^" - - "Error [EPAR0370039]: do not put parens around single variable names\n --> test:1:6\n |\n 1 | let (x,) = ...;\n | ^\nError [EPAR0370005]: expected : -- got '='\n --> test:1:10\n |\n 1 | let (x,) = ...;\n | ^" + - "Error [EPAR0370028]: Could not lex the following content: `🦀: u8 = 0;`." + - "Error [EPAR0370037]: do not put parens around single variable names\n --> test:1:6\n |\n 1 | let (x) = ...;\n | ^\nError [EPAR0370005]: expected : -- got '='\n --> test:1:9\n |\n 1 | let (x) = ...;\n | ^" + - "Error [EPAR0370037]: do not put parens around single variable names\n --> test:1:6\n |\n 1 | let (x,) = ...;\n | ^\nError [EPAR0370005]: expected : -- got '='\n --> test:1:10\n |\n 1 | let (x,) = ...;\n | ^" diff --git a/tests/expectations/parser/parser/statement/expression_fail.leo.out b/tests/expectations/parser/parser/statement/expression_fail.leo.out index e6d0ae895d..86bd39e2ac 100644 --- a/tests/expectations/parser/parser/statement/expression_fail.leo.out +++ b/tests/expectations/parser/parser/statement/expression_fail.leo.out @@ -4,7 +4,7 @@ expectation: Fail outputs: - "Error [EPAR0370009]: unexpected string: expected 'expression', got ']'\n --> test:1:2\n |\n 1 | (];\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [);\n | ^" - - "Error [EPAR0370030]: Could not lex the following content: `\\y;`." - - "Error [EPAR0370041]: Found the char `;`, but expected `|`" + - "Error [EPAR0370028]: Could not lex the following content: `\\y;`." + - "Error [EPAR0370039]: Found the char `;`, but expected `|`" - "Error [EPAR0370005]: expected ; -- got '['\n --> test:1:2\n |\n 1 | x[};\n | ^" - "Error [EPAR0370005]: expected ) -- got ']'\n --> test:1:6\n |\n 1 | (x, y];\n | ^" diff --git a/tests/expectations/parser/parser/statement/hex_int_fail.leo.out b/tests/expectations/parser/parser/statement/hex_int_fail.leo.out index dde7d447e2..0c852a4aca 100644 --- a/tests/expectations/parser/parser/statement/hex_int_fail.leo.out +++ b/tests/expectations/parser/parser/statement/hex_int_fail.leo.out @@ -2,6 +2,6 @@ namespace: ParseStatement expectation: Fail outputs: - - "Error [EPAR0370036]: A hex number `0x..` was provided but hex is not allowed." - - "Error [EPAR0370036]: A hex number `0x..` was provided but hex is not allowed." - - "Error [EPAR0370036]: A hex number `0x..` was provided but hex is not allowed." + - "Error [EPAR0370034]: A hex number `0x..` was provided but hex is not allowed." + - "Error [EPAR0370034]: A hex number `0x..` was provided but hex is not allowed." + - "Error [EPAR0370034]: A hex number `0x..` was provided but hex is not allowed." diff --git a/tests/expectations/parser/parser/statement/return_fail.leo.out b/tests/expectations/parser/parser/statement/return_fail.leo.out index 945e961690..d3f65e3412 100644 --- a/tests/expectations/parser/parser/statement/return_fail.leo.out +++ b/tests/expectations/parser/parser/statement/return_fail.leo.out @@ -3,5 +3,5 @@ namespace: ParseStatement expectation: Fail outputs: - "Error [EPAR0370009]: unexpected string: expected 'expression', got ''\n --> test:1:1\n |\n 1 | return\n | ^^^^^^" - - "Error [EPAR0370032]: Could not parse the implicit value: 5.\n --> test:1:8\n |\n 1 | return 5\n | ^" + - "Error [EPAR0370030]: Could not parse the implicit value: 5.\n --> test:1:8\n |\n 1 | return 5\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got 'if'\n --> test:2:1\n |\n 2 | if x {}\n | ^^" diff --git a/tests/expectations/parser/parser/unreachable/define.leo.out b/tests/expectations/parser/parser/unreachable/define.leo.out index 3c3046ebcc..724fb54225 100644 --- a/tests/expectations/parser/parser/unreachable/define.leo.out +++ b/tests/expectations/parser/parser/unreachable/define.leo.out @@ -41,10 +41,10 @@ outputs: - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:5\n |\n 1 | u32 x = 10u8;\n | ^" - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:5\n |\n 1 | u64 x = 10u8;\n | ^" - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:6\n |\n 1 | u128 x = 10u8;\n | ^" - - "Error [EPAR0370023]: Expected more characters to lex but found none." + - "Error [EPAR0370021]: Expected more characters to lex but found none." - "Error [EPAR0370005]: expected ; -- got '='\n --> test:1:10\n |\n 1 | return x = 10u8;\n | ^" - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:6\n |\n 1 | self x = 10u8;\n | ^" - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:6\n |\n 1 | Self x = 10u8;\n | ^" - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:6\n |\n 1 | true x = 10u8;\n | ^" - "Error [EPAR0370005]: expected ; -- got 'x'\n --> test:1:7\n |\n 1 | false x = 10u8;\n | ^" - - "Error [EPAR0370032]: Could not parse the implicit value: 0.\n --> test:1:1\n |\n 1 | 0 x = 10u8;\n | ^" + - "Error [EPAR0370030]: Could not parse the implicit value: 0.\n --> test:1:1\n |\n 1 | 0 x = 10u8;\n | ^" diff --git a/tests/expectations/parser/parser/unreachable/eat_ident.leo.out b/tests/expectations/parser/parser/unreachable/eat_ident.leo.out index 5c1018440c..fb661e441a 100644 --- a/tests/expectations/parser/parser/unreachable/eat_ident.leo.out +++ b/tests/expectations/parser/parser/unreachable/eat_ident.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370023]: Expected more characters to lex but found none." + - "Error [EPAR0370021]: Expected more characters to lex but found none." diff --git a/tests/expectations/parser/parser/unreachable/eat_int.leo.out b/tests/expectations/parser/parser/unreachable/eat_int.leo.out index 881cd8dfbe..b955c5e126 100644 --- a/tests/expectations/parser/parser/unreachable/eat_int.leo.out +++ b/tests/expectations/parser/parser/unreachable/eat_int.leo.out @@ -48,7 +48,7 @@ outputs: - "Error [EPAR0370009]: unexpected string: expected 'int or ident', got '0'\n --> test:1:3\n |\n 1 | x.0_u32\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'int or ident', got '0'\n --> test:1:3\n |\n 1 | x.0_u64\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'int or ident', got '0'\n --> test:1:3\n |\n 1 | x.0_u128\n | ^" - - "Error [EPAR0370023]: Expected more characters to lex but found none." + - "Error [EPAR0370021]: Expected more characters to lex but found none." - "Error [EPAR0370009]: unexpected string: expected 'int or ident', got '0'\n --> test:1:3\n |\n 1 | x.0_return\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'int or ident', got '0'\n --> test:1:3\n |\n 1 | x.0_self\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'int or ident', got '0'\n --> test:1:3\n |\n 1 | x.0_Self\n | ^" diff --git a/tests/expectations/parser/parser/unreachable/equality_and_order_expression.leo.out b/tests/expectations/parser/parser/unreachable/equality_and_order_expression.leo.out index 2fb078335f..a47e13e917 100644 --- a/tests/expectations/parser/parser/unreachable/equality_and_order_expression.leo.out +++ b/tests/expectations/parser/parser/unreachable/equality_and_order_expression.leo.out @@ -47,7 +47,7 @@ outputs: - "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 [EPAR0370023]: Expected more characters to lex but found none." + - "Error [EPAR0370021]: Expected more characters to lex but found none." - "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 | ^^" diff --git a/tests/expectations/parser/parser/unreachable/expect_ident.leo.out b/tests/expectations/parser/parser/unreachable/expect_ident.leo.out index 8041c9b1fd..671ce0d77f 100644 --- a/tests/expectations/parser/parser/unreachable/expect_ident.leo.out +++ b/tests/expectations/parser/parser/unreachable/expect_ident.leo.out @@ -47,7 +47,7 @@ outputs: - "Error [EPAR0370005]: expected ; -- got ':'\n --> test:1:2\n |\n 1 | x::u32\n | ^" - "Error [EPAR0370005]: expected ; -- got ':'\n --> test:1:2\n |\n 1 | x::u64\n | ^" - "Error [EPAR0370005]: expected ; -- got ':'\n --> test:1:2\n |\n 1 | x::u128\n | ^" - - "Error [EPAR0370023]: Expected more characters to lex but found none." + - "Error [EPAR0370021]: Expected more characters to lex but found none." - "Error [EPAR0370005]: expected ; -- got ':'\n --> test:1:2\n |\n 1 | x::return\n | ^" - "Error [EPAR0370005]: expected ; -- got ':'\n --> test:1:2\n |\n 1 | x::self\n | ^" - "Error [EPAR0370005]: expected ; -- got ':'\n --> test:1:2\n |\n 1 | x::Self\n | ^" diff --git a/tests/expectations/parser/parser/unreachable/math_op_fail.leo.out b/tests/expectations/parser/parser/unreachable/math_op_fail.leo.out index 43623c7643..8cd010cca0 100644 --- a/tests/expectations/parser/parser/unreachable/math_op_fail.leo.out +++ b/tests/expectations/parser/parser/unreachable/math_op_fail.leo.out @@ -33,7 +33,7 @@ outputs: - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a u32 b;\n | ^" - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a u64 b;\n | ^" - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a u128 b;\n | ^" - - "Error [EPAR0370023]: Expected more characters to lex but found none." + - "Error [EPAR0370021]: Expected more characters to lex but found none." - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a return b;\n | ^" - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a self b;\n | ^" - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a Self b;\n | ^" @@ -56,4 +56,4 @@ outputs: - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:4\n |\n 1 | x>==b;\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:4\n |\n 1 | x<==b;\n | ^" - "Error [EPAR0370005]: expected ; -- got '..'\n --> test:1:2\n |\n 1 | x..=b;\n | ^^" - - "Error [EPAR0370023]: Expected more characters to lex but found none." + - "Error [EPAR0370021]: Expected more characters to lex but found none." From 1761b805783cc844c5724a25e0a5476572a02939 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Mon, 16 May 2022 21:24:42 -0700 Subject: [PATCH 05/10] [parser] Fix to disallow including loop ending bound. This is not part of the current version of Leo (cf. ABNF grammar and Leo Reference). Adapt tests. --- compiler/parser/src/parser/statement.rs | 3 +- tests/compiler/statements/all_loops.leo | 12 +------ tests/compiler/statements/all_loops_fail.leo | 32 +++++++++++++++++++ .../compiler/statements/all_loops.leo.out | 6 ++-- .../statements/all_loops_fail.leo.out | 5 +++ 5 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 tests/compiler/statements/all_loops_fail.leo create mode 100644 tests/expectations/compiler/compiler/statements/all_loops_fail.leo.out diff --git a/compiler/parser/src/parser/statement.rs b/compiler/parser/src/parser/statement.rs index b464bf21e2..ece8a0da3e 100644 --- a/compiler/parser/src/parser/statement.rs +++ b/compiler/parser/src/parser/statement.rs @@ -140,7 +140,6 @@ impl ParserContext<'_> { // Parse iteration range. let start = self.parse_expression()?; self.expect(&Token::DotDot)?; - let inclusive = self.eat(&Token::Assign); self.disallow_circuit_construction = true; let stop = self.parse_conditional_expression()?; self.disallow_circuit_construction = false; @@ -153,7 +152,7 @@ impl ParserContext<'_> { type_: type_.0, start, stop, - inclusive, + inclusive : false, block, }) } diff --git a/tests/compiler/statements/all_loops.leo b/tests/compiler/statements/all_loops.leo index df25a12a61..d11de29a0e 100644 --- a/tests/compiler/statements/all_loops.leo +++ b/tests/compiler/statements/all_loops.leo @@ -15,15 +15,5 @@ function main(k: bool) -> bool { forward = forward + x; } - let reverse_inclusive: u32 = 0u32; - for a: u32 in 10u32..=0u32 { - reverse_inclusive = reverse_inclusive + a; - } - - let forward_inclusive: u32 = 0u32; - for b: u32 in 0u32..=10u32 { - forward_inclusive = forward_inclusive + b; - } - - return (reverse == forward) && (reverse_inclusive == forward_inclusive) && k; + return (reverse == forward) && k; } \ No newline at end of file diff --git a/tests/compiler/statements/all_loops_fail.leo b/tests/compiler/statements/all_loops_fail.leo new file mode 100644 index 0000000000..6887a32143 --- /dev/null +++ b/tests/compiler/statements/all_loops_fail.leo @@ -0,0 +1,32 @@ +/* +namespace: Compile +expectation: Fail +input_file: inputs/dummy.in + +# inclusive loops are currently disallowed + +*/ + +function main(k: bool) -> bool { + let reverse: u32 = 0u32; + for i: u32 in 9u32..0u32 { + reverse = reverse + i; + } + + let forward: u32 = 0u32; + for x: u32 in 0u32..10u32 { + forward = forward + x; + } + + let reverse_inclusive: u32 = 0u32; + for a: u32 in 10u32..=0u32 { + reverse_inclusive = reverse_inclusive + a; + } + + let forward_inclusive: u32 = 0u32; + for b: u32 in 0u32..=10u32 { + forward_inclusive = forward_inclusive + b; + } + + return (reverse == forward) && (reverse_inclusive == forward_inclusive) && k; +} \ No newline at end of file diff --git a/tests/expectations/compiler/compiler/statements/all_loops.leo.out b/tests/expectations/compiler/compiler/statements/all_loops.leo.out index 2d8cb99122..31974e91f9 100644 --- a/tests/expectations/compiler/compiler/statements/all_loops.leo.out +++ b/tests/expectations/compiler/compiler/statements/all_loops.leo.out @@ -3,6 +3,6 @@ namespace: Compile expectation: Pass outputs: - output: - - initial_input_ast: bddb7d656b6cfdeadae66e437c61090a2f14112e48fe4e23ea0e39e1ce03fed0 - initial_ast: 66baa9f7e32bb00b0c047250c97ff2710a128e9db63d0a7c0459f7673147e124 - symbol_table: 3f85b29e75222f03e70b83cbc2399746f23dbbeabd857acaa486db9e8076c03c + - initial_input_ast: 7f054d619f362422dce83ca5563d462fe3206845a29de38bb3721f3cd2c69c11 + initial_ast: 6b833755871962eb67f0a281ef1edd82bf84b0c9f03154f0b7b0330c554826d4 + symbol_table: bcf9d66217a3cbfc92d16af68089c9644a316cfb072e3bfd6bd76b5ccea0fc18 diff --git a/tests/expectations/compiler/compiler/statements/all_loops_fail.leo.out b/tests/expectations/compiler/compiler/statements/all_loops_fail.leo.out new file mode 100644 index 0000000000..4c3e127148 --- /dev/null +++ b/tests/expectations/compiler/compiler/statements/all_loops_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> compiler-test:15:26\n |\n 15 | for a: u32 in 10u32..=0u32 {\n | ^" From b1baf90719f38ff4d7e775893c2412726ad903de Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Mon, 16 May 2022 21:27:29 -0700 Subject: [PATCH 06/10] [parser] Adhere to style. --- compiler/parser/src/parser/statement.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/parser/src/parser/statement.rs b/compiler/parser/src/parser/statement.rs index ece8a0da3e..fe99cbf72a 100644 --- a/compiler/parser/src/parser/statement.rs +++ b/compiler/parser/src/parser/statement.rs @@ -152,7 +152,7 @@ impl ParserContext<'_> { type_: type_.0, start, stop, - inclusive : false, + inclusive: false, block, }) } From 7f435eba48621ff2078ebde9caac27fd094e7793 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Tue, 17 May 2022 14:41:30 +0200 Subject: [PATCH 07/10] remove expression statements --- .../ast/src/passes/reconstructing_director.rs | 6 - .../ast/src/passes/reconstructing_reducer.rs | 11 -- compiler/ast/src/passes/visitor.rs | 4 - compiler/ast/src/passes/visitor_director.rs | 7 - compiler/ast/src/statements/expression.rs | 38 ------ compiler/ast/src/statements/mod.rs | 3 - compiler/ast/src/statements/statement.rs | 16 ++- compiler/parser/src/parser/statement.rs | 8 +- compiler/parser/src/test.rs | 7 +- .../src/type_checker/check_statements.rs | 6 - leo/errors/src/errors/parser/parser_errors.rs | 8 ++ .../compiler/function/undefined_fail.leo.out | 2 +- .../functions/bounded_recursion.leo.out | 126 +----------------- .../functions/infinite_recursion.leo.out | 70 +--------- .../parser/statement/conditional.leo.out | 18 +-- .../parser/statement/expression.leo.out | 37 +---- .../parser/unreachable/math_op_fail.leo.out | 7 +- .../parser/unreachable/math_op_pass.leo.out | 70 ---------- tests/parser/functions/bounded_recursion.leo | 4 +- tests/parser/functions/infinite_recursion.leo | 4 +- tests/parser/statement/conditional.leo | 3 +- tests/parser/statement/expression.leo | 4 +- tests/parser/unreachable/math_op_fail.leo | 10 ++ tests/parser/unreachable/math_op_pass.leo | 10 -- 24 files changed, 62 insertions(+), 417 deletions(-) delete mode 100644 compiler/ast/src/statements/expression.rs diff --git a/compiler/ast/src/passes/reconstructing_director.rs b/compiler/ast/src/passes/reconstructing_director.rs index 5cd29a1510..466f89b282 100644 --- a/compiler/ast/src/passes/reconstructing_director.rs +++ b/compiler/ast/src/passes/reconstructing_director.rs @@ -126,7 +126,6 @@ impl ReconstructingDirector { Statement::Conditional(conditional) => Statement::Conditional(self.reduce_conditional(conditional)?), Statement::Iteration(iteration) => Statement::Iteration(Box::new(self.reduce_iteration(iteration)?)), Statement::Console(console) => Statement::Console(self.reduce_console(console)?), - Statement::Expression(expression) => Statement::Expression(self.reduce_expression_statement(expression)?), Statement::Block(block) => Statement::Block(self.reduce_block(block)?), }; @@ -241,11 +240,6 @@ impl ReconstructingDirector { self.reducer.reduce_console(console_function_call, function) } - pub fn reduce_expression_statement(&mut self, expression: &ExpressionStatement) -> Result { - let inner_expression = self.reduce_expression(&expression.expression)?; - self.reducer.reduce_expression_statement(expression, inner_expression) - } - pub fn reduce_block(&mut self, block: &Block) -> Result { let mut statements = vec![]; for statement in block.statements.iter() { diff --git a/compiler/ast/src/passes/reconstructing_reducer.rs b/compiler/ast/src/passes/reconstructing_reducer.rs index 5284ba47b5..8b09f97477 100644 --- a/compiler/ast/src/passes/reconstructing_reducer.rs +++ b/compiler/ast/src/passes/reconstructing_reducer.rs @@ -232,17 +232,6 @@ pub trait ReconstructingReducer { }) } - fn reduce_expression_statement( - &mut self, - expression_statement: &ExpressionStatement, - expression: Expression, - ) -> Result { - Ok(ExpressionStatement { - expression, - span: expression_statement.span, - }) - } - fn reduce_block(&mut self, block: &Block, statements: Vec) -> Result { Ok(Block { statements, diff --git a/compiler/ast/src/passes/visitor.rs b/compiler/ast/src/passes/visitor.rs index e1585c7029..79c449cd3d 100644 --- a/compiler/ast/src/passes/visitor.rs +++ b/compiler/ast/src/passes/visitor.rs @@ -92,10 +92,6 @@ pub trait StatementVisitor<'a> { Default::default() } - fn visit_expression_statement(&mut self, _input: &'a ExpressionStatement) -> VisitResult { - Default::default() - } - fn visit_block(&mut self, _input: &'a Block) -> VisitResult { Default::default() } diff --git a/compiler/ast/src/passes/visitor_director.rs b/compiler/ast/src/passes/visitor_director.rs index ede3a24a75..b5866b6ae1 100644 --- a/compiler/ast/src/passes/visitor_director.rs +++ b/compiler/ast/src/passes/visitor_director.rs @@ -91,7 +91,6 @@ impl<'a, V: ExpressionVisitor<'a> + StatementVisitor<'a>> VisitorDirector<'a, V> Statement::Conditional(stmt) => self.visit_conditional(stmt), Statement::Iteration(stmt) => self.visit_iteration(stmt), Statement::Console(stmt) => self.visit_console(stmt), - Statement::Expression(stmt) => self.visit_expression_statement(stmt), Statement::Block(stmt) => self.visit_block(stmt), } } @@ -144,12 +143,6 @@ impl<'a, V: ExpressionVisitor<'a> + StatementVisitor<'a>> VisitorDirector<'a, V> } } - pub fn visit_expression_statement(&mut self, input: &'a ExpressionStatement) { - if let VisitResult::VisitChildren = self.visitor.visit_expression_statement(input) { - self.visit_expression(&input.expression); - } - } - pub fn visit_block(&mut self, input: &'a Block) { if let VisitResult::VisitChildren = self.visitor.visit_block(input) { input.statements.iter().for_each(|stmt| self.visit_statement(stmt)); diff --git a/compiler/ast/src/statements/expression.rs b/compiler/ast/src/statements/expression.rs deleted file mode 100644 index 72c3e40c16..0000000000 --- a/compiler/ast/src/statements/expression.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{Expression, Node}; -use leo_span::Span; - -use serde::{Deserialize, Serialize}; -use std::fmt; - -/// An expression statement `expr;`. -#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)] -pub struct ExpressionStatement { - /// The expression to evaluate purely for its side-effects. - pub expression: Expression, - /// The span excluding the semicolon. - pub span: Span, -} - -impl fmt::Display for ExpressionStatement { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{};", self.expression) - } -} - -crate::simple_node_impl!(ExpressionStatement); diff --git a/compiler/ast/src/statements/mod.rs b/compiler/ast/src/statements/mod.rs index 7a43dcc81f..e609ec6fd9 100644 --- a/compiler/ast/src/statements/mod.rs +++ b/compiler/ast/src/statements/mod.rs @@ -29,9 +29,6 @@ pub use return_statement::*; pub mod iteration; pub use iteration::*; -pub mod expression; -pub use expression::*; - pub mod definition; pub use definition::*; diff --git a/compiler/ast/src/statements/statement.rs b/compiler/ast/src/statements/statement.rs index 01a4fad1d1..fbb1a656b5 100644 --- a/compiler/ast/src/statements/statement.rs +++ b/compiler/ast/src/statements/statement.rs @@ -36,13 +36,20 @@ pub enum Statement { Iteration(Box), /// A console logging statement. Console(ConsoleStatement), - /// An expression statement turning an expression into a statement, - /// using the expression only for its side-effects. - Expression(ExpressionStatement), /// A block statement. Block(Block), } +impl Statement { + /// Returns a dummy statement made from an empty block `{}`. + pub fn dummy(span: Span) -> Self { + Self::Block(Block { + statements: Vec::new(), + span, + }) + } +} + impl fmt::Display for Statement { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { @@ -52,7 +59,6 @@ impl fmt::Display for Statement { Statement::Conditional(x) => x.fmt(f), Statement::Iteration(x) => x.fmt(f), Statement::Console(x) => x.fmt(f), - Statement::Expression(x) => x.fmt(f), Statement::Block(x) => x.fmt(f), } } @@ -68,7 +74,6 @@ impl Node for Statement { Conditional(n) => n.span(), Iteration(n) => n.span(), Console(n) => n.span(), - Expression(n) => n.span(), Block(n) => n.span(), } } @@ -82,7 +87,6 @@ impl Node for Statement { Conditional(n) => n.set_span(span), Iteration(n) => n.set_span(span), Console(n) => n.set_span(span), - Expression(n) => n.set_span(span), Block(n) => n.set_span(span), } } diff --git a/compiler/parser/src/parser/statement.rs b/compiler/parser/src/parser/statement.rs index b464bf21e2..a214edce0c 100644 --- a/compiler/parser/src/parser/statement.rs +++ b/compiler/parser/src/parser/statement.rs @@ -70,11 +70,11 @@ impl ParserContext<'_> { value, }))) } else { + // Error on `expr;` but recover as an empty block `{}`. self.expect(&Token::Semicolon)?; - Ok(Statement::Expression(ExpressionStatement { - span: expr.span(), - expression: expr, - })) + let span = expr.span() + self.prev_token.span; + self.emit_err(ParserError::expr_stmts_disallowed(span)); + Ok(Statement::dummy(span)) } } diff --git a/compiler/parser/src/test.rs b/compiler/parser/src/test.rs index 8336e64d4f..ccffde5bb1 100644 --- a/compiler/parser/src/test.rs +++ b/compiler/parser/src/test.rs @@ -15,7 +15,7 @@ // along with the Leo library. If not, see . use crate::{tokenizer, ParserContext, SpannedToken}; -use leo_ast::{Expression, ExpressionStatement, Statement, ValueExpression}; +use leo_ast::Statement; use leo_errors::{emitter::Handler, LeoError}; use leo_span::{ source_map::FileName, @@ -122,10 +122,7 @@ impl Namespace for ParseStatementNamespace { create_session_if_not_set_then(|s| { let tokenizer = tokenize(test, s)?; if all_are_comments(&tokenizer) { - return Ok(yaml_or_fail(Statement::Expression(ExpressionStatement { - expression: Expression::Value(ValueExpression::String(Vec::new(), Default::default())), - span: Span::default(), - }))); + return Ok(yaml_or_fail(Statement::dummy(Span::default()))); } with_handler(tokenizer, |p| p.parse_statement()).map(yaml_or_fail) }) diff --git a/compiler/passes/src/type_checker/check_statements.rs b/compiler/passes/src/type_checker/check_statements.rs index 52e9e19c15..82e6afb341 100644 --- a/compiler/passes/src/type_checker/check_statements.rs +++ b/compiler/passes/src/type_checker/check_statements.rs @@ -123,11 +123,6 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { VisitResult::VisitChildren } - fn visit_expression_statement(&mut self, input: &'a ExpressionStatement) -> VisitResult { - self.compare_expr_type(&input.expression, None, input.span()); - VisitResult::SkipChildren - } - fn visit_block(&mut self, input: &'a Block) -> VisitResult { self.symbol_table.push_variable_scope(); // have to redo the logic here so we have scoping @@ -139,7 +134,6 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { Statement::Conditional(stmt) => self.visit_conditional(stmt), Statement::Iteration(stmt) => self.visit_iteration(stmt), Statement::Console(stmt) => self.visit_console(stmt), - Statement::Expression(stmt) => self.visit_expression_statement(stmt), Statement::Block(stmt) => self.visit_block(stmt), }; }); diff --git a/leo/errors/src/errors/parser/parser_errors.rs b/leo/errors/src/errors/parser/parser_errors.rs index bd7bae6151..8a96b70312 100644 --- a/leo/errors/src/errors/parser/parser_errors.rs +++ b/leo/errors/src/errors/parser/parser_errors.rs @@ -390,4 +390,12 @@ create_messages!( msg: "Unicode bidi override code point encountered.", help: None, } + + /// Previously, expression statements were allowed, but not anymore. + @formatted + expr_stmts_disallowed { + args: (), + msg: "Expression statements are no longer supported.", + help: None, + } ); diff --git a/tests/expectations/compiler/compiler/function/undefined_fail.leo.out b/tests/expectations/compiler/compiler/function/undefined_fail.leo.out index 1d76cbecb4..9be49fd311 100644 --- a/tests/expectations/compiler/compiler/function/undefined_fail.leo.out +++ b/tests/expectations/compiler/compiler/function/undefined_fail.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372003]: Unknown function `my_function`\n --> compiler-test:4:5\n |\n 4 | my_function();\n | ^^^^^^^^^^^\nError [ETYC0372003]: Unknown function `my_function`\n --> compiler-test:4:5\n |\n 4 | my_function();\n | ^^^^^^^^^^^" + - "Error [EPAR0370045]: Expression statements are no longer supported.\n --> compiler-test:4:5\n |\n 4 | my_function();\n | ^^^^^^^^^^^^^^" diff --git a/tests/expectations/parser/parser/functions/bounded_recursion.leo.out b/tests/expectations/parser/parser/functions/bounded_recursion.leo.out index ae03128631..6064028db5 100644 --- a/tests/expectations/parser/parser/functions/bounded_recursion.leo.out +++ b/tests/expectations/parser/parser/functions/bounded_recursion.leo.out @@ -1,127 +1,5 @@ --- namespace: Parse -expectation: Pass +expectation: Fail outputs: - - name: "" - expected_input: [] - functions: - "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":11,\\\"hi\\\":12}\"}": - identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":11,\\\"hi\\\":12}\"}" - input: - - Variable: - identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":22,\\\"hi\\\":23}\"}" - mode: Constant - type_: - IntegerType: U32 - span: - lo: 22 - hi: 23 - output: - IntegerType: U8 - core_mapping: ~ - block: - statements: - - Conditional: - condition: - Binary: - left: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":45,\\\"hi\\\":46}\"}" - right: - Value: - Integer: - - U32 - - "5" - - span: - lo: 49 - hi: 53 - op: Lt - span: - lo: 45 - hi: 53 - block: - statements: - - Expression: - expression: - Call: - function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":64,\\\"hi\\\":65}\"}" - arguments: - - Binary: - left: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":66,\\\"hi\\\":67}\"}" - right: - Value: - Integer: - - U32 - - "1" - - span: - lo: 68 - hi: 72 - op: Add - span: - lo: 66 - hi: 72 - span: - lo: 64 - hi: 73 - span: - lo: 64 - hi: 73 - span: - lo: 54 - hi: 80 - next: ~ - span: - lo: 42 - hi: 80 - span: - lo: 36 - hi: 82 - span: - lo: 2 - hi: 82 - "{\"name\":\"main\",\"span\":\"{\\\"lo\\\":93,\\\"hi\\\":97}\"}": - identifier: "{\"name\":\"main\",\"span\":\"{\\\"lo\\\":93,\\\"hi\\\":97}\"}" - input: - - Variable: - identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":98,\\\"hi\\\":99}\"}" - mode: Private - type_: Boolean - span: - lo: 98 - hi: 99 - output: Boolean - core_mapping: ~ - block: - statements: - - Expression: - expression: - Call: - function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":121,\\\"hi\\\":122}\"}" - arguments: - - Value: - Integer: - - U32 - - "1" - - span: - lo: 123 - hi: 127 - span: - lo: 121 - hi: 128 - span: - lo: 121 - hi: 128 - - Return: - expression: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":141,\\\"hi\\\":142}\"}" - span: - lo: 134 - hi: 142 - span: - lo: 115 - hi: 145 - span: - lo: 84 - hi: 145 + - "Error [EPAR0370045]: Expression statements are no longer supported.\n --> test:5:9\n |\n 5 | x(y+1u32);\n | ^^^^^^^^^^\nError [EPAR0370045]: Expression statements are no longer supported.\n --> test:10:5\n |\n 10 | x(1u32);\n | ^^^^^^^^" diff --git a/tests/expectations/parser/parser/functions/infinite_recursion.leo.out b/tests/expectations/parser/parser/functions/infinite_recursion.leo.out index 9ebf08be58..4b24f07728 100644 --- a/tests/expectations/parser/parser/functions/infinite_recursion.leo.out +++ b/tests/expectations/parser/parser/functions/infinite_recursion.leo.out @@ -1,71 +1,5 @@ --- namespace: Parse -expectation: Pass +expectation: Fail outputs: - - name: "" - expected_input: [] - functions: - "{\"name\":\"inf\",\"span\":\"{\\\"lo\\\":11,\\\"hi\\\":14}\"}": - identifier: "{\"name\":\"inf\",\"span\":\"{\\\"lo\\\":11,\\\"hi\\\":14}\"}" - input: [] - output: - IntegerType: U8 - core_mapping: ~ - block: - statements: - - Expression: - expression: - Call: - function: - Identifier: "{\"name\":\"inf\",\"span\":\"{\\\"lo\\\":29,\\\"hi\\\":32}\"}" - arguments: [] - span: - lo: 29 - hi: 34 - span: - lo: 29 - hi: 34 - span: - lo: 23 - hi: 37 - span: - lo: 2 - hi: 37 - "{\"name\":\"main\",\"span\":\"{\\\"lo\\\":48,\\\"hi\\\":52}\"}": - identifier: "{\"name\":\"main\",\"span\":\"{\\\"lo\\\":48,\\\"hi\\\":52}\"}" - input: - - Variable: - identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":53,\\\"hi\\\":54}\"}" - mode: Private - type_: Boolean - span: - lo: 53 - hi: 54 - output: Boolean - core_mapping: ~ - block: - statements: - - Expression: - expression: - Call: - function: - Identifier: "{\"name\":\"inf\",\"span\":\"{\\\"lo\\\":76,\\\"hi\\\":79}\"}" - arguments: [] - span: - lo: 76 - hi: 81 - span: - lo: 76 - hi: 81 - - Return: - expression: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":94,\\\"hi\\\":95}\"}" - span: - lo: 87 - hi: 95 - span: - lo: 70 - hi: 98 - span: - lo: 39 - hi: 98 + - "Error [EPAR0370045]: Expression statements are no longer supported.\n --> test:4:5\n |\n 4 | inf();\n | ^^^^^^\nError [EPAR0370045]: Expression statements are no longer supported.\n --> test:8:5\n |\n 8 | inf();\n | ^^^^^^" diff --git a/tests/expectations/parser/parser/statement/conditional.leo.out b/tests/expectations/parser/parser/statement/conditional.leo.out index 43b664b90e..c0e7b68f10 100644 --- a/tests/expectations/parser/parser/statement/conditional.leo.out +++ b/tests/expectations/parser/parser/statement/conditional.leo.out @@ -125,12 +125,6 @@ outputs: hi: 6 block: statements: - - Expression: - expression: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":13}\"}" - span: - lo: 9 - hi: 13 - Return: expression: Value: @@ -138,15 +132,15 @@ outputs: - U8 - "0" - span: - lo: 22 - hi: 25 + lo: 16 + hi: 19 span: - lo: 15 - hi: 25 + lo: 9 + hi: 19 span: lo: 7 - hi: 28 + hi: 22 next: ~ span: lo: 0 - hi: 28 + hi: 22 diff --git a/tests/expectations/parser/parser/statement/expression.leo.out b/tests/expectations/parser/parser/statement/expression.leo.out index d15843dd71..5405617d20 100644 --- a/tests/expectations/parser/parser/statement/expression.leo.out +++ b/tests/expectations/parser/parser/statement/expression.leo.out @@ -1,36 +1,7 @@ --- namespace: ParseStatement -expectation: Pass +expectation: Fail outputs: - - Expression: - expression: - Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":4}\"}" - span: - lo: 0 - hi: 4 - - Expression: - expression: - Binary: - left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}" - right: - Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}" - op: Add - span: - lo: 0 - hi: 3 - span: - lo: 0 - hi: 3 - - Expression: - expression: - Call: - function: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}" - arguments: [] - span: - lo: 0 - hi: 3 - span: - lo: 0 - hi: 3 + - "Error [EPAR0370045]: Expression statements are no longer supported.\n --> test:1:1\n |\n 1 | expr;\n | ^^^^^" + - "Error [EPAR0370045]: Expression statements are no longer supported.\n --> test:1:1\n |\n 1 | x+y;\n | ^^^^" + - "Error [EPAR0370045]: Expression statements are no longer supported.\n --> test:1:1\n |\n 1 | x();\n | ^^^^" diff --git a/tests/expectations/parser/parser/unreachable/math_op_fail.leo.out b/tests/expectations/parser/parser/unreachable/math_op_fail.leo.out index 43623c7643..eafce08b2d 100644 --- a/tests/expectations/parser/parser/unreachable/math_op_fail.leo.out +++ b/tests/expectations/parser/parser/unreachable/math_op_fail.leo.out @@ -40,7 +40,7 @@ outputs: - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a true b;\n | ^" - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a false b;\n | ^" - "Error [EPAR0370005]: expected : -- got '='\n --> test:1:7\n |\n 1 | let x = a 0 b;\n | ^" - - "did not consume all input: '=' @ 1:3-4\n'b' @ 1:4-5\n';' @ 1:5-6\n" + - "Error [EPAR0370045]: Expression statements are no longer supported.\n --> test:1:1\n |\n 1 | x;=b;\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'int or ident', got '='\n --> test:1:3\n |\n 1 | x.=b;\n | ^" - "Error [EPAR0370005]: expected ; -- got ','\n --> test:1:2\n |\n 1 | x,=b; // 43\n | ^" - "Error [EPAR0370005]: expected ; -- got '['\n --> test:1:2\n |\n 1 | x[=b;\n | ^" @@ -57,3 +57,8 @@ outputs: - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:4\n |\n 1 | x<==b;\n | ^" - "Error [EPAR0370005]: expected ; -- got '..'\n --> test:1:2\n |\n 1 | x..=b;\n | ^^" - "Error [EPAR0370023]: Expected more characters to lex but found none." + - "Error [EPAR0370045]: Expression statements are no longer supported.\n --> test:1:1\n |\n 1 | x==b;\n | ^^^^^" + - "Error [EPAR0370045]: Expression statements are no longer supported.\n --> test:1:1\n |\n 1 | x!=b;\n | ^^^^^" + - "Error [EPAR0370045]: Expression statements are no longer supported.\n --> test:1:1\n |\n 1 | x>=b;\n | ^^^^^" + - "Error [EPAR0370045]: Expression statements are no longer supported.\n --> test:1:1\n |\n 1 | x<=b;\n | ^^^^^" + - "Error [EPAR0370045]: Expression statements are no longer supported.\n --> test:1:1\n |\n 1 | x>=b;\n | ^^^^^" diff --git a/tests/expectations/parser/parser/unreachable/math_op_pass.leo.out b/tests/expectations/parser/parser/unreachable/math_op_pass.leo.out index 653e6c0ce5..5084db5caa 100644 --- a/tests/expectations/parser/parser/unreachable/math_op_pass.leo.out +++ b/tests/expectations/parser/parser/unreachable/math_op_pass.leo.out @@ -176,76 +176,6 @@ outputs: span: lo: 0 hi: 4 - - Expression: - expression: - Binary: - left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}" - right: - Identifier: "{\"name\":\"b\",\"span\":\"{\\\"lo\\\":3,\\\"hi\\\":4}\"}" - op: Eq - span: - lo: 0 - hi: 4 - span: - lo: 0 - hi: 4 - - Expression: - expression: - Binary: - left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}" - right: - Identifier: "{\"name\":\"b\",\"span\":\"{\\\"lo\\\":3,\\\"hi\\\":4}\"}" - op: Ne - span: - lo: 0 - hi: 4 - span: - lo: 0 - hi: 4 - - Expression: - expression: - Binary: - left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}" - right: - Identifier: "{\"name\":\"b\",\"span\":\"{\\\"lo\\\":3,\\\"hi\\\":4}\"}" - op: Ge - span: - lo: 0 - hi: 4 - span: - lo: 0 - hi: 4 - - Expression: - expression: - Binary: - left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}" - right: - Identifier: "{\"name\":\"b\",\"span\":\"{\\\"lo\\\":3,\\\"hi\\\":4}\"}" - op: Le - span: - lo: 0 - hi: 4 - span: - lo: 0 - hi: 4 - - Expression: - expression: - Binary: - left: - Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}" - right: - Identifier: "{\"name\":\"b\",\"span\":\"{\\\"lo\\\":3,\\\"hi\\\":4}\"}" - op: Ge - span: - lo: 0 - hi: 4 - span: - lo: 0 - hi: 4 - Assign: operation: Assign assignee: diff --git a/tests/parser/functions/bounded_recursion.leo b/tests/parser/functions/bounded_recursion.leo index 865b1db8ca..bc3469337c 100644 --- a/tests/parser/functions/bounded_recursion.leo +++ b/tests/parser/functions/bounded_recursion.leo @@ -1,6 +1,6 @@ /* namespace: Parse -expectation: Pass +expectation: Fail */ function x(constant y: u32) -> u8 { @@ -12,4 +12,4 @@ function x(constant y: u32) -> u8 { function main(y: bool) -> bool { x(1u32); return y; -} \ No newline at end of file +} diff --git a/tests/parser/functions/infinite_recursion.leo b/tests/parser/functions/infinite_recursion.leo index a5e75c96b9..c165b847fe 100644 --- a/tests/parser/functions/infinite_recursion.leo +++ b/tests/parser/functions/infinite_recursion.leo @@ -1,6 +1,6 @@ /* namespace: Parse -expectation: Pass +expectation: Fail */ function inf() -> u8 { @@ -10,4 +10,4 @@ function inf() -> u8 { function main(y: bool) -> bool { inf(); return y; -} \ No newline at end of file +} diff --git a/tests/parser/statement/conditional.leo b/tests/parser/statement/conditional.leo index 19e74a1837..babc32c1e6 100644 --- a/tests/parser/statement/conditional.leo +++ b/tests/parser/statement/conditional.leo @@ -16,6 +16,5 @@ if (x) {} else {} if x+y {} else if x+z {} else {} if x+y { - expr; return 0u8; -} \ No newline at end of file +} diff --git a/tests/parser/statement/expression.leo b/tests/parser/statement/expression.leo index 1a5b3b1fe1..373f1ec756 100644 --- a/tests/parser/statement/expression.leo +++ b/tests/parser/statement/expression.leo @@ -1,10 +1,10 @@ /* namespace: ParseStatement -expectation: Pass +expectation: Fail */ expr; x+y; -x(); \ No newline at end of file +x(); diff --git a/tests/parser/unreachable/math_op_fail.leo b/tests/parser/unreachable/math_op_fail.leo index 729bf30abb..3e6a77f7b3 100644 --- a/tests/parser/unreachable/math_op_fail.leo +++ b/tests/parser/unreachable/math_op_fail.leo @@ -113,3 +113,13 @@ x<==b; x..=b; x&=b; + +x==b; + +x!=b; + +x>=b; + +x<=b; + +x>=b; diff --git a/tests/parser/unreachable/math_op_pass.leo b/tests/parser/unreachable/math_op_pass.leo index f85dd305e4..25abd9e802 100644 --- a/tests/parser/unreachable/math_op_pass.leo +++ b/tests/parser/unreachable/math_op_pass.leo @@ -20,16 +20,6 @@ let x: u8 = a > b; x_=b; -x==b; - -x!=b; - -x>=b; - -x<=b; - -x>=b; - xconsole=b; xconst=b; From 5ec6d873a726e430daa1c7ee11121e0fd7489ca7 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Tue, 17 May 2022 16:07:43 +0200 Subject: [PATCH 08/10] fix #1811 --- leo/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leo/main.rs b/leo/main.rs index 676084f013..9f2455819f 100644 --- a/leo/main.rs +++ b/leo/main.rs @@ -207,7 +207,7 @@ fn set_panic_hook() { fn main() { set_panic_hook(); - handle_error(create_session_if_not_set_then(|_| run_with_args(Opt::from_args()))); + create_session_if_not_set_then(|_| handle_error(run_with_args(Opt::from_args()))); } /// Run command with custom build arguments. From 416d8d5ad921c4eec4c2512f0ff63e7324ff75b2 Mon Sep 17 00:00:00 2001 From: Collin Chin <16715212+collinc97@users.noreply.github.com> Date: Tue, 17 May 2022 11:36:04 -0400 Subject: [PATCH 09/10] fix nit --- tests/compiler/statements/all_loops_fail.leo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/compiler/statements/all_loops_fail.leo b/tests/compiler/statements/all_loops_fail.leo index 6887a32143..aa8316b366 100644 --- a/tests/compiler/statements/all_loops_fail.leo +++ b/tests/compiler/statements/all_loops_fail.leo @@ -29,4 +29,4 @@ function main(k: bool) -> bool { } return (reverse == forward) && (reverse_inclusive == forward_inclusive) && k; -} \ No newline at end of file +} From 560ea590a9d71065d8a51d06b646852fd98df2d4 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Thu, 19 May 2022 20:31:05 -0700 Subject: [PATCH 10/10] [tests] Change category of the `0x` tests --- tests/parser/expression/literal/int_fail.leo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parser/expression/literal/int_fail.leo b/tests/parser/expression/literal/int_fail.leo index b1bd6f4b43..88802af063 100644 --- a/tests/parser/expression/literal/int_fail.leo +++ b/tests/parser/expression/literal/int_fail.leo @@ -1,5 +1,5 @@ /* -namespace: Token +namespace: ParseExpression expectation: Fail */