From 1b4e262b8a5797cdef8d827a1b1824b7e430a98e Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Tue, 24 Oct 2023 16:06:54 +0200 Subject: [PATCH] refactor: Simplify peeking significant tokens in recovery --- crates/codegen/parser/runtime/src/lexer.rs | 19 ++++++++++++++++++ .../parser/runtime/src/support/recovery.rs | 14 +++---------- .../runtime/src/support/separated_helper.rs | 11 ++-------- .../cargo/crate/src/generated/lexer.rs | 19 ++++++++++++++++++ .../crate/src/generated/support/recovery.rs | 14 +++---------- .../src/generated/support/separated_helper.rs | 11 ++-------- .../outputs/npm/crate/src/generated/lexer.rs | 19 ++++++++++++++++++ .../crate/src/generated/support/recovery.rs | 14 +++---------- .../src/generated/support/separated_helper.rs | 11 ++-------- .../generated/0.4.11-failure.yml | 2 +- .../generated/0.6.2-success.yml | 4 ++-- .../generated/0.4.11-success.yml | 8 ++++---- .../generated/0.4.11-success.yml | 2 +- .../generated/0.4.11-failure.yml | 4 ++-- .../generated/0.4.11-success.yml | 4 ++-- .../generated/0.4.11-failure.yml | 2 +- .../generated/0.5.3-failure.yml | 2 +- .../generated/0.6.2-failure.yml | 2 +- .../generated/0.7.0-failure.yml | 2 +- .../generated/0.8.0-failure.yml | 6 +++--- .../generated/0.4.11-failure.yml | 4 ++-- .../generated/0.6.2-failure.yml | 6 +++--- .../generated/0.7.0-failure.yml | 6 +++--- .../generated/0.8.0-failure.yml | 6 +++--- .../transfer/generated/0.4.11-failure.yml | 2 +- .../generated/0.4.11-failure.yml | 2 +- .../generated/0.4.11-success.yml | 2 +- .../generated/0.4.11-success.yml | 2 +- .../everything/generated/0.8.13-success.yml | 4 ++-- .../generated/0.8.13-success.yml | 20 +++++++++---------- .../try_catch/generated/0.4.11-failure.yml | 4 ++-- .../empty/generated/0.4.11-success.yml | 2 +- .../generated/0.4.11-failure.yml | 10 +++++----- .../generated/0.8.13-failure.yml | 10 +++++----- .../generated/0.8.19-success.yml | 8 ++++---- .../generated/0.4.11-failure.yml | 4 ++-- .../generated/0.8.13-success.yml | 4 ++-- .../path_named/generated/0.4.11-failure.yml | 8 ++++---- .../path_named/generated/0.8.13-success.yml | 8 ++++---- .../path_unnamed/generated/0.4.11-success.yml | 4 ++-- .../generated/0.4.11-failure.yml | 10 +++++----- .../generated/0.8.13-failure.yml | 10 +++++----- .../generated/0.8.19-success.yml | 6 +++--- .../generated/0.4.11-failure.yml | 10 +++++----- .../generated/0.8.19-success.yml | 2 +- .../generated/0.4.11-failure.yml | 10 +++++----- .../generated/0.8.19-success.yml | 2 +- .../alternatives/generated/0.4.11-success.yml | 12 +++++------ .../generated/0.4.11-success.yml | 8 ++++---- .../generated/0.4.11-success.yml | 8 ++++---- .../ranges/generated/0.4.11-success.yml | 4 ++-- .../function_def/generated/0.4.11-success.yml | 10 +++++----- .../generated/0.4.11-failure.yml | 18 ++++++++--------- .../generated/0.6.0-failure.yml | 18 ++++++++--------- 54 files changed, 213 insertions(+), 201 deletions(-) diff --git a/crates/codegen/parser/runtime/src/lexer.rs b/crates/codegen/parser/runtime/src/lexer.rs index 5be957dfba..38cbd7fd55 100644 --- a/crates/codegen/parser/runtime/src/lexer.rs +++ b/crates/codegen/parser/runtime/src/lexer.rs @@ -14,8 +14,10 @@ pub trait Lexer { #[doc(hidden)] fn trailing_trivia(&self, input: &mut ParserContext) -> ParserResult; #[doc(hidden)] + /// Returns valid grouping delimiters in the given lexical context. fn delimiters() -> &'static [(TokenKind, TokenKind)]; + /// Peeks the next token, including trivia. Does not advance the input. fn peek_token(&self, input: &mut ParserContext) -> Option { let start = input.position(); let token = self.next_token::(input); @@ -23,6 +25,21 @@ pub trait Lexer { token } + /// Peeks the next significant (i.e. non-trivia) token. Does not advance the input. + fn peek_token_with_trivia( + &self, + input: &mut ParserContext, + ) -> Option { + let start = input.position(); + + let _ = self.leading_trivia(input); + let token = self.next_token::(input); + + input.set_position(start); + token + } + + /// Attempts to consume the next expected token. Advances the input only if the token matches. fn parse_token( &self, input: &mut ParserContext, @@ -41,6 +58,8 @@ pub trait Lexer { ) } + /// Attempts to consume the next significant token including both leading and trailing trivia. + /// Advances the input only if the token matches. fn parse_token_with_trivia( &self, input: &mut ParserContext, diff --git a/crates/codegen/parser/runtime/src/support/recovery.rs b/crates/codegen/parser/runtime/src/support/recovery.rs index 49dfacd734..b39bf10716 100644 --- a/crates/codegen/parser/runtime/src/support/recovery.rs +++ b/crates/codegen/parser/runtime/src/support/recovery.rs @@ -49,16 +49,6 @@ impl ParserResult { ) -> ParserResult { let before_recovery = input.position(); - let mut peek_token_after_trivia = || { - let start = input.position(); - - opt_parse(input, |input| lexer.leading_trivia(input)); - let token = lexer.next_token::(input); - - input.set_position(start); - token - }; - enum ParseResultKind { Match, Incomplete, @@ -71,7 +61,9 @@ impl ParserResult { result.expected_tokens, ParseResultKind::Incomplete, ), - ParserResult::Match(result) if peek_token_after_trivia() != Some(expected) => { + ParserResult::Match(result) + if lexer.peek_token_with_trivia::(input) != Some(expected) => + { (result.nodes, result.expected_tokens, ParseResultKind::Match) } ParserResult::NoMatch(result) if recover_from_no_match.as_bool() => { diff --git a/crates/codegen/parser/runtime/src/support/separated_helper.rs b/crates/codegen/parser/runtime/src/support/separated_helper.rs index bfdf575b07..117067ef1d 100644 --- a/crates/codegen/parser/runtime/src/support/separated_helper.rs +++ b/crates/codegen/parser/runtime/src/support/separated_helper.rs @@ -26,16 +26,9 @@ impl SeparatedHelper { ParserResult::Match(r#match) => { accum.extend(r#match.nodes); - // Parse the leading trivia so that we can peek the next significant token - if let ParserResult::Match(r#match) = lexer.leading_trivia(input) { - accum.extend(r#match.nodes); - } - - match lexer.peek_token::(input) { + match lexer.peek_token_with_trivia::(input) { Some(token) if token == separator => { - let separator = - lexer.parse_token_with_trivia::(input, separator); - match separator { + match lexer.parse_token_with_trivia::(input, separator) { ParserResult::Match(r#match) => { accum.extend(r#match.nodes); continue; diff --git a/crates/solidity/outputs/cargo/crate/src/generated/lexer.rs b/crates/solidity/outputs/cargo/crate/src/generated/lexer.rs index 93542cdc02..4661f4e2b7 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/lexer.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/lexer.rs @@ -16,8 +16,10 @@ pub trait Lexer { #[doc(hidden)] fn trailing_trivia(&self, input: &mut ParserContext) -> ParserResult; #[doc(hidden)] + /// Returns valid grouping delimiters in the given lexical context. fn delimiters() -> &'static [(TokenKind, TokenKind)]; + /// Peeks the next token, including trivia. Does not advance the input. fn peek_token(&self, input: &mut ParserContext) -> Option { let start = input.position(); let token = self.next_token::(input); @@ -25,6 +27,21 @@ pub trait Lexer { token } + /// Peeks the next significant (i.e. non-trivia) token. Does not advance the input. + fn peek_token_with_trivia( + &self, + input: &mut ParserContext, + ) -> Option { + let start = input.position(); + + let _ = self.leading_trivia(input); + let token = self.next_token::(input); + + input.set_position(start); + token + } + + /// Attempts to consume the next expected token. Advances the input only if the token matches. fn parse_token( &self, input: &mut ParserContext, @@ -43,6 +60,8 @@ pub trait Lexer { ) } + /// Attempts to consume the next significant token including both leading and trailing trivia. + /// Advances the input only if the token matches. fn parse_token_with_trivia( &self, input: &mut ParserContext, diff --git a/crates/solidity/outputs/cargo/crate/src/generated/support/recovery.rs b/crates/solidity/outputs/cargo/crate/src/generated/support/recovery.rs index 4a25cd9ac8..d6d3e1016b 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/support/recovery.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/support/recovery.rs @@ -51,16 +51,6 @@ impl ParserResult { ) -> ParserResult { let before_recovery = input.position(); - let mut peek_token_after_trivia = || { - let start = input.position(); - - opt_parse(input, |input| lexer.leading_trivia(input)); - let token = lexer.next_token::(input); - - input.set_position(start); - token - }; - enum ParseResultKind { Match, Incomplete, @@ -73,7 +63,9 @@ impl ParserResult { result.expected_tokens, ParseResultKind::Incomplete, ), - ParserResult::Match(result) if peek_token_after_trivia() != Some(expected) => { + ParserResult::Match(result) + if lexer.peek_token_with_trivia::(input) != Some(expected) => + { (result.nodes, result.expected_tokens, ParseResultKind::Match) } ParserResult::NoMatch(result) if recover_from_no_match.as_bool() => { diff --git a/crates/solidity/outputs/cargo/crate/src/generated/support/separated_helper.rs b/crates/solidity/outputs/cargo/crate/src/generated/support/separated_helper.rs index 0c79ed3751..58721ac557 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/support/separated_helper.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/support/separated_helper.rs @@ -28,16 +28,9 @@ impl SeparatedHelper { ParserResult::Match(r#match) => { accum.extend(r#match.nodes); - // Parse the leading trivia so that we can peek the next significant token - if let ParserResult::Match(r#match) = lexer.leading_trivia(input) { - accum.extend(r#match.nodes); - } - - match lexer.peek_token::(input) { + match lexer.peek_token_with_trivia::(input) { Some(token) if token == separator => { - let separator = - lexer.parse_token_with_trivia::(input, separator); - match separator { + match lexer.parse_token_with_trivia::(input, separator) { ParserResult::Match(r#match) => { accum.extend(r#match.nodes); continue; diff --git a/crates/solidity/outputs/npm/crate/src/generated/lexer.rs b/crates/solidity/outputs/npm/crate/src/generated/lexer.rs index 93542cdc02..4661f4e2b7 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/lexer.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/lexer.rs @@ -16,8 +16,10 @@ pub trait Lexer { #[doc(hidden)] fn trailing_trivia(&self, input: &mut ParserContext) -> ParserResult; #[doc(hidden)] + /// Returns valid grouping delimiters in the given lexical context. fn delimiters() -> &'static [(TokenKind, TokenKind)]; + /// Peeks the next token, including trivia. Does not advance the input. fn peek_token(&self, input: &mut ParserContext) -> Option { let start = input.position(); let token = self.next_token::(input); @@ -25,6 +27,21 @@ pub trait Lexer { token } + /// Peeks the next significant (i.e. non-trivia) token. Does not advance the input. + fn peek_token_with_trivia( + &self, + input: &mut ParserContext, + ) -> Option { + let start = input.position(); + + let _ = self.leading_trivia(input); + let token = self.next_token::(input); + + input.set_position(start); + token + } + + /// Attempts to consume the next expected token. Advances the input only if the token matches. fn parse_token( &self, input: &mut ParserContext, @@ -43,6 +60,8 @@ pub trait Lexer { ) } + /// Attempts to consume the next significant token including both leading and trailing trivia. + /// Advances the input only if the token matches. fn parse_token_with_trivia( &self, input: &mut ParserContext, diff --git a/crates/solidity/outputs/npm/crate/src/generated/support/recovery.rs b/crates/solidity/outputs/npm/crate/src/generated/support/recovery.rs index 4a25cd9ac8..d6d3e1016b 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/support/recovery.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/support/recovery.rs @@ -51,16 +51,6 @@ impl ParserResult { ) -> ParserResult { let before_recovery = input.position(); - let mut peek_token_after_trivia = || { - let start = input.position(); - - opt_parse(input, |input| lexer.leading_trivia(input)); - let token = lexer.next_token::(input); - - input.set_position(start); - token - }; - enum ParseResultKind { Match, Incomplete, @@ -73,7 +63,9 @@ impl ParserResult { result.expected_tokens, ParseResultKind::Incomplete, ), - ParserResult::Match(result) if peek_token_after_trivia() != Some(expected) => { + ParserResult::Match(result) + if lexer.peek_token_with_trivia::(input) != Some(expected) => + { (result.nodes, result.expected_tokens, ParseResultKind::Match) } ParserResult::NoMatch(result) if recover_from_no_match.as_bool() => { diff --git a/crates/solidity/outputs/npm/crate/src/generated/support/separated_helper.rs b/crates/solidity/outputs/npm/crate/src/generated/support/separated_helper.rs index 0c79ed3751..58721ac557 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/support/separated_helper.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/support/separated_helper.rs @@ -28,16 +28,9 @@ impl SeparatedHelper { ParserResult::Match(r#match) => { accum.extend(r#match.nodes); - // Parse the leading trivia so that we can peek the next significant token - if let ParserResult::Match(r#match) = lexer.leading_trivia(input) { - accum.extend(r#match.nodes); - } - - match lexer.peek_token::(input) { + match lexer.peek_token_with_trivia::(input) { Some(token) if token == separator => { - let separator = - lexer.parse_token_with_trivia::(input, separator); - match separator { + match lexer.parse_token_with_trivia::(input, separator) { ParserResult::Match(r#match) => { accum.extend(r#match.nodes); continue; diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.4.11-failure.yml index 126a86ff12..41b8661c2d 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.4.11-failure.yml @@ -90,7 +90,7 @@ Tree: - Statement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." - TupleDeconstructionStatement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." - OpenParen (Token): "(" # 206..207 - - TupleMembersList (Rule): # 207..221 "bool success, " + - TupleMembersList (Rule): # 207..220 "bool success," - TupleMember (Rule): # 207..219 "bool success" - TypeName (Rule): # 207..211 "bool" - BoolKeyword (Token): "bool" # 207..211 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.6.2-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.6.2-success.yml index dbdd6618f1..042b47fad3 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.6.2-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.6.2-success.yml @@ -82,7 +82,7 @@ Tree: - Statement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." - TupleDeconstructionStatement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." - OpenParen (Token): "(" # 206..207 - - TupleMembersList (Rule): # 207..221 "bool success, " + - TupleMembersList (Rule): # 207..220 "bool success," - TupleMember (Rule): # 207..219 "bool success" - TypeName (Rule): # 207..211 "bool" - BoolKeyword (Token): "bool" # 207..211 @@ -102,7 +102,7 @@ Tree: - FunctionCallOptions (Rule): # 239..256 "{ value: amount }" - NamedArgumentsDeclaration (Rule): # 239..256 "{ value: amount }" - OpenBrace (Token): "{" # 239..240 - - NamedArgumentsList (Rule): # 240..255 " value: amount " + - NamedArgumentsList (Rule): # 240..254 " value: amount" - NamedArgument (Rule): # 240..254 " value: amount" - Identifier (Token): "value" # 241..246 - Colon (Token): ":" # 246..247 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/inheritence_specifier/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/inheritence_specifier/generated/0.4.11-success.yml index 46a213597b..c52bf5eaa5 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/inheritence_specifier/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/inheritence_specifier/generated/0.4.11-success.yml @@ -9,9 +9,9 @@ Tree: - ContractDefinition (Rule): # 0..41 "contract Sample is Foo, Bar(1, 2), Baz {}" - ContractKeyword (Token): "contract" # 0..8 - Identifier (Token): "Sample" # 9..15 - - InheritanceSpecifier (Rule): # 15..39 " is Foo, Bar(1, 2), Baz " + - InheritanceSpecifier (Rule): # 15..38 " is Foo, Bar(1, 2), Baz" - IsKeyword (Token): "is" # 16..18 - - InheritanceTypesList (Rule): # 18..39 " Foo, Bar(1, 2), Baz " + - InheritanceTypesList (Rule): # 18..38 " Foo, Bar(1, 2), Baz" - InheritanceType (Rule): # 18..22 " Foo" - IdentifierPath (Rule): # 18..22 " Foo" - Identifier (Token): "Foo" # 19..22 @@ -31,8 +31,8 @@ Tree: - DecimalLiteral (Token): "2" # 31..32 - CloseParen (Token): ")" # 32..33 - Comma (Token): "," # 33..34 - - InheritanceType (Rule): # 34..39 " Baz " - - IdentifierPath (Rule): # 34..39 " Baz " + - InheritanceType (Rule): # 34..38 " Baz" + - IdentifierPath (Rule): # 34..38 " Baz" - Identifier (Token): "Baz" # 35..38 - OpenBrace (Token): "{" # 39..40 - CloseBrace (Token): "}" # 40..41 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_enum_definition/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_enum_definition/generated/0.4.11-success.yml index 75cb603aa0..5f7e784e79 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_enum_definition/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_enum_definition/generated/0.4.11-success.yml @@ -21,7 +21,7 @@ Tree: - EnumKeyword (Token): "enum" # 20..24 - Identifier (Token): "State" # 25..30 - OpenBrace (Token): "{" # 31..32 - - IdentifiersList (Rule): # 33..55 " A,\n B,\n C\n " + - IdentifiersList (Rule): # 33..53 " A,\n B,\n C\n" - Identifier (Token): "A" # 37..38 - Comma (Token): "," # 38..39 - Identifier (Token): "B" # 44..45 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.4.11-failure.yml index 5570e9a2b6..545b4d7d83 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.4.11-failure.yml @@ -22,8 +22,8 @@ Tree: - OpenBrace (Token): "{" # 16..17 - ContractMembersList (Rule): # 18..36 " error Error1();\n" - StateVariableDefinition (Rule): # 18..36 " error Error1();\n" - - TypeName (Rule): # 18..26 " error " - - IdentifierPath (Rule): # 18..26 " error " + - TypeName (Rule): # 18..25 " error" + - IdentifierPath (Rule): # 18..25 " error" - Identifier (Token): "error" # 20..25 - Identifier (Token): "Error1" # 26..32 - SKIPPED (Token): "()" # 32..34 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_using_directive/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_using_directive/generated/0.4.11-success.yml index adf0dd7617..157803ac80 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_using_directive/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_using_directive/generated/0.4.11-success.yml @@ -15,8 +15,8 @@ Tree: - ContractMembersList (Rule): # 18..35 " using x for *;\n" - UsingDirective (Rule): # 18..35 " using x for *;\n" - UsingKeyword (Token): "using" # 20..25 - - UsingDirectivePath (Rule): # 25..28 " x " - - IdentifierPath (Rule): # 25..28 " x " + - UsingDirectivePath (Rule): # 25..27 " x" + - IdentifierPath (Rule): # 25..27 " x" - Identifier (Token): "x" # 26..27 - ForKeyword (Token): "for" # 28..31 - Asterisk (Token): "*" # 32..33 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.4.11-failure.yml index 94e739ffbd..853d48d94a 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.4.11-failure.yml @@ -52,7 +52,7 @@ Tree: - Identifier (Token): "_transfer" # 30..39 - ParametersDeclaration (Rule): # 39..54 "(address while)" - OpenParen (Token): "(" # 39..40 - - ParametersList (Rule): # 40..48 "address " + - ParametersList (Rule): # 40..47 "address" - Parameter (Rule): # 40..47 "address" - TypeName (Rule): # 40..47 "address" - AddressType (Rule): # 40..47 "address" diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.3-failure.yml index 4a7a4061dd..7d913010da 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.3-failure.yml @@ -52,7 +52,7 @@ Tree: - Identifier (Token): "_transfer" # 30..39 - ParametersDeclaration (Rule): # 39..54 "(address while)" - OpenParen (Token): "(" # 39..40 - - ParametersList (Rule): # 40..48 "address " + - ParametersList (Rule): # 40..47 "address" - Parameter (Rule): # 40..47 "address" - TypeName (Rule): # 40..47 "address" - AddressType (Rule): # 40..47 "address" diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.6.2-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.6.2-failure.yml index aec50412cd..5857647b99 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.6.2-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.6.2-failure.yml @@ -59,7 +59,7 @@ Tree: - Identifier (Token): "_transfer" # 30..39 - ParametersDeclaration (Rule): # 39..54 "(address while)" - OpenParen (Token): "(" # 39..40 - - ParametersList (Rule): # 40..48 "address " + - ParametersList (Rule): # 40..47 "address" - Parameter (Rule): # 40..47 "address" - TypeName (Rule): # 40..47 "address" - AddressType (Rule): # 40..47 "address" diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.7.0-failure.yml index d477102c06..177cc0e0ff 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.7.0-failure.yml @@ -59,7 +59,7 @@ Tree: - Identifier (Token): "_transfer" # 30..39 - ParametersDeclaration (Rule): # 39..54 "(address while)" - OpenParen (Token): "(" # 39..40 - - ParametersList (Rule): # 40..48 "address " + - ParametersList (Rule): # 40..47 "address" - Parameter (Rule): # 40..47 "address" - TypeName (Rule): # 40..47 "address" - AddressType (Rule): # 40..47 "address" diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.8.0-failure.yml index b00a39aa93..3267d38264 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.8.0-failure.yml @@ -51,7 +51,7 @@ Tree: - Identifier (Token): "_transfer" # 30..39 - ParametersDeclaration (Rule): # 39..54 "(address while)" - OpenParen (Token): "(" # 39..40 - - ParametersList (Rule): # 40..48 "address " + - ParametersList (Rule): # 40..47 "address" - Parameter (Rule): # 40..47 "address" - TypeName (Rule): # 40..47 "address" - AddressType (Rule): # 40..47 "address" @@ -115,8 +115,8 @@ Tree: - Statement (Rule): # 187..205 " invalid sequence " - VariableDeclarationStatement (Rule): # 187..205 " invalid sequence " - VariableDeclaration (Rule): # 187..204 " invalid sequence" - - TypeName (Rule): # 187..196 " invalid " - - IdentifierPath (Rule): # 187..196 " invalid " + - TypeName (Rule): # 187..195 " invalid" + - IdentifierPath (Rule): # 187..195 " invalid" - Identifier (Token): "invalid" # 188..195 - Identifier (Token): "sequence" # 196..204 - SKIPPED (Token): "" # 205..205 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.4.11-failure.yml index efb895405d..88fef61f5c 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.4.11-failure.yml @@ -108,8 +108,8 @@ Tree: - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." - OverrideKeyword (Token): "override" # 15..23 - OpenParen (Token): "(" # 23..24 - - IdentifierPathsList (Rule): # 24..35 "some.ident " - - IdentifierPath (Rule): # 24..35 "some.ident " + - IdentifierPathsList (Rule): # 24..34 "some.ident" + - IdentifierPath (Rule): # 24..34 "some.ident" - Identifier (Token): "some" # 24..28 - Period (Token): "." # 28..29 - Identifier (Token): "ident" # 29..34 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.6.2-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.6.2-failure.yml index 1846ff20a1..e739e6c311 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.6.2-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.6.2-failure.yml @@ -124,8 +124,8 @@ Tree: - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." - OverrideKeyword (Token): "override" # 15..23 - OpenParen (Token): "(" # 23..24 - - IdentifierPathsList (Rule): # 24..35 "some.ident " - - IdentifierPath (Rule): # 24..35 "some.ident " + - IdentifierPathsList (Rule): # 24..34 "some.ident" + - IdentifierPath (Rule): # 24..34 "some.ident" - Identifier (Token): "some" # 24..28 - Period (Token): "." # 28..29 - Identifier (Token): "ident" # 29..34 @@ -238,7 +238,7 @@ Tree: - FunctionCallOptions (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - NamedArgumentsDeclaration (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - OpenBrace (Token): "{" # 247..248 - - NamedArgumentsList (Rule): # 248..255 "arg: 1 " + - NamedArgumentsList (Rule): # 248..254 "arg: 1" - NamedArgument (Rule): # 248..254 "arg: 1" - Identifier (Token): "arg" # 248..251 - Colon (Token): ":" # 251..252 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.7.0-failure.yml index fa0edcd3ed..6dc05f3059 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.7.0-failure.yml @@ -124,8 +124,8 @@ Tree: - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." - OverrideKeyword (Token): "override" # 15..23 - OpenParen (Token): "(" # 23..24 - - IdentifierPathsList (Rule): # 24..35 "some.ident " - - IdentifierPath (Rule): # 24..35 "some.ident " + - IdentifierPathsList (Rule): # 24..34 "some.ident" + - IdentifierPath (Rule): # 24..34 "some.ident" - Identifier (Token): "some" # 24..28 - Period (Token): "." # 28..29 - Identifier (Token): "ident" # 29..34 @@ -238,7 +238,7 @@ Tree: - FunctionCallOptions (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - NamedArgumentsDeclaration (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - OpenBrace (Token): "{" # 247..248 - - NamedArgumentsList (Rule): # 248..255 "arg: 1 " + - NamedArgumentsList (Rule): # 248..254 "arg: 1" - NamedArgument (Rule): # 248..254 "arg: 1" - Identifier (Token): "arg" # 248..251 - Colon (Token): ":" # 251..252 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.8.0-failure.yml index e302312b95..564c9af893 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembersList/separated_recovery/generated/0.8.0-failure.yml @@ -124,8 +124,8 @@ Tree: - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." - OverrideKeyword (Token): "override" # 15..23 - OpenParen (Token): "(" # 23..24 - - IdentifierPathsList (Rule): # 24..35 "some.ident " - - IdentifierPath (Rule): # 24..35 "some.ident " + - IdentifierPathsList (Rule): # 24..34 "some.ident" + - IdentifierPath (Rule): # 24..34 "some.ident" - Identifier (Token): "some" # 24..28 - Period (Token): "." # 28..29 - Identifier (Token): "ident" # 29..34 @@ -238,7 +238,7 @@ Tree: - FunctionCallOptions (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - NamedArgumentsDeclaration (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - OpenBrace (Token): "{" # 247..248 - - NamedArgumentsList (Rule): # 248..255 "arg: 1 " + - NamedArgumentsList (Rule): # 248..254 "arg: 1" - NamedArgument (Rule): # 248..254 "arg: 1" - Identifier (Token): "arg" # 248..251 - Colon (Token): ":" # 251..252 diff --git a/crates/solidity/testing/snapshots/cst_output/EventDefinition/transfer/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/EventDefinition/transfer/generated/0.4.11-failure.yml index a9434b00cf..589149e0e6 100644 --- a/crates/solidity/testing/snapshots/cst_output/EventDefinition/transfer/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/EventDefinition/transfer/generated/0.4.11-failure.yml @@ -18,7 +18,7 @@ Tree: - EventKeyword (Token): "event" # 0..5 - Identifier (Token): "Transfer" # 6..14 - OpenParen (Token): "(" # 14..15 - - EventParametersList (Rule): # 15..31 "address indexed " + - EventParametersList (Rule): # 15..30 "address indexed" - EventParameter (Rule): # 15..30 "address indexed" - TypeName (Rule): # 15..22 "address" - AddressType (Rule): # 15..22 "address" diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/from_contextual_keyword/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/from_contextual_keyword/generated/0.4.11-failure.yml index 810148f69f..842c29c973 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/from_contextual_keyword/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/from_contextual_keyword/generated/0.4.11-failure.yml @@ -19,7 +19,7 @@ Tree: - Identifier (Token): "transferFrom" # 9..21 - ParametersDeclaration (Rule): # 21..63 "(address from, address to, uint256 amount)" - OpenParen (Token): "(" # 21..22 - - ParametersList (Rule): # 22..30 "address " + - ParametersList (Rule): # 22..29 "address" - Parameter (Rule): # 22..29 "address" - TypeName (Rule): # 22..29 "address" - AddressType (Rule): # 22..29 "address" diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_multiple/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_multiple/generated/0.4.11-success.yml index 9df6123ff0..f954111db8 100644 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_multiple/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_multiple/generated/0.4.11-success.yml @@ -10,7 +10,7 @@ Tree: - ImportKeyword (Token): "import" # 0..6 - DeconstructionImport (Rule): # 6..44 ' { A1 as A2, B1, C1 as C2 } from "foo"' - OpenBrace (Token): "{" # 7..8 - - DeconstructionImportSymbolsList (Rule): # 8..32 " A1 as A2, B1, C1 as C2 " + - DeconstructionImportSymbolsList (Rule): # 8..31 " A1 as A2, B1, C1 as C2" - DeconstructionImportSymbol (Rule): # 8..17 " A1 as A2" - Identifier (Token): "A1" # 9..11 - AsKeyword (Token): "as" # 12..14 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_single/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_single/generated/0.4.11-success.yml index 41a372fc6c..d62862b618 100644 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_single/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_single/generated/0.4.11-success.yml @@ -10,7 +10,7 @@ Tree: - ImportKeyword (Token): "import" # 0..6 - DeconstructionImport (Rule): # 6..28 ' { x as y } from "foo"' - OpenBrace (Token): "{" # 7..8 - - DeconstructionImportSymbolsList (Rule): # 8..16 " x as y " + - DeconstructionImportSymbolsList (Rule): # 8..15 " x as y" - DeconstructionImportSymbol (Rule): # 8..15 " x as y" - Identifier (Token): "x" # 9..10 - AsKeyword (Token): "as" # 11..13 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.13-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.13-success.yml index 4fa974eb7c..c73ee5b8fd 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.13-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.13-success.yml @@ -50,8 +50,8 @@ Tree: - Semicolon (Token): ";" # 40..41 - UsingDirective (Rule): # 42..58 "\nusing A for B;\n" - UsingKeyword (Token): "using" # 43..48 - - UsingDirectivePath (Rule): # 48..51 " A " - - IdentifierPath (Rule): # 48..51 " A " + - UsingDirectivePath (Rule): # 48..50 " A" + - IdentifierPath (Rule): # 48..50 " A" - Identifier (Token): "A" # 49..50 - ForKeyword (Token): "for" # 51..54 - TypeName (Rule): # 54..56 " B" diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.13-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.13-success.yml index fa7fa1493d..29a05d2130 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.13-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.8.13-success.yml @@ -50,23 +50,23 @@ Tree: - Semicolon (Token): ";" # 54..55 - UsingDirective (Rule): # 56..98 "\nusing EnvelopeUtils for Envelope global;\n" - UsingKeyword (Token): "using" # 57..62 - - UsingDirectivePath (Rule): # 62..77 " EnvelopeUtils " - - IdentifierPath (Rule): # 62..77 " EnvelopeUtils " + - UsingDirectivePath (Rule): # 62..76 " EnvelopeUtils" + - IdentifierPath (Rule): # 62..76 " EnvelopeUtils" - Identifier (Token): "EnvelopeUtils" # 63..76 - ForKeyword (Token): "for" # 77..80 - - TypeName (Rule): # 80..90 " Envelope " - - IdentifierPath (Rule): # 80..90 " Envelope " + - TypeName (Rule): # 80..89 " Envelope" + - IdentifierPath (Rule): # 80..89 " Envelope" - Identifier (Token): "Envelope" # 81..89 - GlobalKeyword (Token): "global" # 90..96 - Semicolon (Token): ";" # 96..97 - UsingDirective (Rule): # 98..145 "using TransactionUtils for Transaction global;\n" - UsingKeyword (Token): "using" # 98..103 - - UsingDirectivePath (Rule): # 103..121 " TransactionUtils " - - IdentifierPath (Rule): # 103..121 " TransactionUtils " + - UsingDirectivePath (Rule): # 103..120 " TransactionUtils" + - IdentifierPath (Rule): # 103..120 " TransactionUtils" - Identifier (Token): "TransactionUtils" # 104..120 - ForKeyword (Token): "for" # 121..124 - - TypeName (Rule): # 124..137 " Transaction " - - IdentifierPath (Rule): # 124..137 " Transaction " + - TypeName (Rule): # 124..136 " Transaction" + - IdentifierPath (Rule): # 124..136 " Transaction" - Identifier (Token): "Transaction" # 125..136 - GlobalKeyword (Token): "global" # 137..143 - Semicolon (Token): ";" # 143..144 @@ -105,8 +105,8 @@ Tree: - Identifier (Token): "destinationChainId" # 754..772 - Semicolon (Token): ";" # 772..773 - StructMember (Rule): # 774..791 " bytes message;\n" - - TypeName (Rule): # 774..782 " bytes " - - IdentifierPath (Rule): # 774..782 " bytes " + - TypeName (Rule): # 774..781 " bytes" + - IdentifierPath (Rule): # 774..781 " bytes" - Identifier (Token): "bytes" # 776..781 - Identifier (Token): "message" # 782..789 - Semicolon (Token): ";" # 789..790 diff --git a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.11-failure.yml index d55a39459a..4d73618872 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statement/try_catch/generated/0.4.11-failure.yml @@ -17,8 +17,8 @@ Tree: - Statement (Rule): # 0..21 "try a.b() {} catch {}" - VariableDeclarationStatement (Rule): # 0..5 "try a" - VariableDeclaration (Rule): # 0..5 "try a" - - TypeName (Rule): # 0..4 "try " - - IdentifierPath (Rule): # 0..4 "try " + - TypeName (Rule): # 0..3 "try" + - IdentifierPath (Rule): # 0..3 "try" - Identifier (Token): "try" # 0..3 - Identifier (Token): "a" # 4..5 - SKIPPED (Token): ".b() {} catch {}" # 5..21 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleExpression/empty/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleExpression/empty/generated/0.4.11-success.yml index 07639b22da..a03a765449 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleExpression/empty/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleExpression/empty/generated/0.4.11-success.yml @@ -8,5 +8,5 @@ Errors: [] Tree: - TupleExpression (Rule): # 0..3 "( )" - OpenParen (Token): "(" # 0..1 - - TupleValuesList (Rule): " " # 1..2 + - TupleValuesList (Rule): [] # 1..1 - CloseParen (Token): ")" # 2..3 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.4.11-failure.yml index 9b718773c8..83b7c99b99 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.4.11-failure.yml @@ -26,15 +26,15 @@ Tree: - UsingKeyword (Token): "using" # 0..5 - UsingDirectiveDeconstruction (Rule): # 5..36 " {add as +, sub, mul, div as /}" - OpenBrace (Token): "{" # 6..7 - - UsingDirectiveSymbolsList (Rule): # 7..11 "add " - - UsingDirectiveSymbol (Rule): # 7..11 "add " - - IdentifierPath (Rule): # 7..11 "add " + - UsingDirectiveSymbolsList (Rule): # 7..10 "add" + - UsingDirectiveSymbol (Rule): # 7..10 "add" + - IdentifierPath (Rule): # 7..10 "add" - Identifier (Token): "add" # 7..10 - SKIPPED (Token): "as +, sub, mul, div as /" # 11..35 - CloseBrace (Token): "}" # 35..36 - ForKeyword (Token): "for" # 37..40 - - TypeName (Rule): # 40..45 " Int " - - IdentifierPath (Rule): # 40..45 " Int " + - TypeName (Rule): # 40..44 " Int" + - IdentifierPath (Rule): # 40..44 " Int" - Identifier (Token): "Int" # 41..44 - SKIPPED (Token): "global" # 45..51 - Semicolon (Token): ";" # 51..52 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.13-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.13-failure.yml index 3d9df08874..ce5ecd3db2 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.13-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.13-failure.yml @@ -18,15 +18,15 @@ Tree: - UsingKeyword (Token): "using" # 0..5 - UsingDirectiveDeconstruction (Rule): # 5..36 " {add as +, sub, mul, div as /}" - OpenBrace (Token): "{" # 6..7 - - UsingDirectiveSymbolsList (Rule): # 7..11 "add " - - UsingDirectiveSymbol (Rule): # 7..11 "add " - - IdentifierPath (Rule): # 7..11 "add " + - UsingDirectiveSymbolsList (Rule): # 7..10 "add" + - UsingDirectiveSymbol (Rule): # 7..10 "add" + - IdentifierPath (Rule): # 7..10 "add" - Identifier (Token): "add" # 7..10 - SKIPPED (Token): "as +, sub, mul, div as /" # 11..35 - CloseBrace (Token): "}" # 35..36 - ForKeyword (Token): "for" # 37..40 - - TypeName (Rule): # 40..45 " Int " - - IdentifierPath (Rule): # 40..45 " Int " + - TypeName (Rule): # 40..44 " Int" + - IdentifierPath (Rule): # 40..44 " Int" - Identifier (Token): "Int" # 41..44 - GlobalKeyword (Token): "global" # 45..51 - Semicolon (Token): ";" # 51..52 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.19-success.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.19-success.yml index 5521525136..d0a2f4dcdc 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.19-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_multiple/generated/0.8.19-success.yml @@ -12,7 +12,7 @@ Tree: - OpenBrace (Token): "{" # 6..7 - UsingDirectiveSymbolsList (Rule): # 7..35 "add as +, sub, mul, div as /" - UsingDirectiveSymbol (Rule): # 7..15 "add as +" - - IdentifierPath (Rule): # 7..11 "add " + - IdentifierPath (Rule): # 7..10 "add" - Identifier (Token): "add" # 7..10 - AsKeyword (Token): "as" # 11..13 - Plus (Token): "+" # 14..15 @@ -26,14 +26,14 @@ Tree: - Identifier (Token): "mul" # 22..25 - Comma (Token): "," # 25..26 - UsingDirectiveSymbol (Rule): # 26..35 " div as /" - - IdentifierPath (Rule): # 26..31 " div " + - IdentifierPath (Rule): # 26..30 " div" - Identifier (Token): "div" # 27..30 - AsKeyword (Token): "as" # 31..33 - Slash (Token): "/" # 34..35 - CloseBrace (Token): "}" # 35..36 - ForKeyword (Token): "for" # 37..40 - - TypeName (Rule): # 40..45 " Int " - - IdentifierPath (Rule): # 40..45 " Int " + - TypeName (Rule): # 40..44 " Int" + - IdentifierPath (Rule): # 40..44 " Int" - Identifier (Token): "Int" # 41..44 - GlobalKeyword (Token): "global" # 45..51 - Semicolon (Token): ";" # 51..52 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.4.11-failure.yml index abaf1c630b..125e8d1e4d 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.4.11-failure.yml @@ -24,8 +24,8 @@ Tree: - Identifier (Token): "add" # 7..10 - CloseBrace (Token): "}" # 10..11 - ForKeyword (Token): "for" # 12..15 - - TypeName (Rule): # 15..20 " Int " - - IdentifierPath (Rule): # 15..20 " Int " + - TypeName (Rule): # 15..19 " Int" + - IdentifierPath (Rule): # 15..19 " Int" - Identifier (Token): "Int" # 16..19 - SKIPPED (Token): "global" # 20..26 - Semicolon (Token): ";" # 26..27 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.8.13-success.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.8.13-success.yml index ba1e832caa..c56e4f7774 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.8.13-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.8.13-success.yml @@ -16,8 +16,8 @@ Tree: - Identifier (Token): "add" # 7..10 - CloseBrace (Token): "}" # 10..11 - ForKeyword (Token): "for" # 12..15 - - TypeName (Rule): # 15..20 " Int " - - IdentifierPath (Rule): # 15..20 " Int " + - TypeName (Rule): # 15..19 " Int" + - IdentifierPath (Rule): # 15..19 " Int" - Identifier (Token): "Int" # 16..19 - GlobalKeyword (Token): "global" # 20..26 - Semicolon (Token): ";" # 26..27 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.4.11-failure.yml index 3b169c591e..d4a79bcd2d 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.4.11-failure.yml @@ -16,12 +16,12 @@ Errors: # 1 total Tree: - UsingDirective (Rule): # 0..25 "using foo for bar global;" - UsingKeyword (Token): "using" # 0..5 - - UsingDirectivePath (Rule): # 5..10 " foo " - - IdentifierPath (Rule): # 5..10 " foo " + - UsingDirectivePath (Rule): # 5..9 " foo" + - IdentifierPath (Rule): # 5..9 " foo" - Identifier (Token): "foo" # 6..9 - ForKeyword (Token): "for" # 10..13 - - TypeName (Rule): # 13..18 " bar " - - IdentifierPath (Rule): # 13..18 " bar " + - TypeName (Rule): # 13..17 " bar" + - IdentifierPath (Rule): # 13..17 " bar" - Identifier (Token): "bar" # 14..17 - SKIPPED (Token): "global" # 18..24 - Semicolon (Token): ";" # 24..25 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.8.13-success.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.8.13-success.yml index c2f7c9f5f2..2bfac291a4 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.8.13-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_named/generated/0.8.13-success.yml @@ -8,12 +8,12 @@ Errors: [] Tree: - UsingDirective (Rule): # 0..25 "using foo for bar global;" - UsingKeyword (Token): "using" # 0..5 - - UsingDirectivePath (Rule): # 5..10 " foo " - - IdentifierPath (Rule): # 5..10 " foo " + - UsingDirectivePath (Rule): # 5..9 " foo" + - IdentifierPath (Rule): # 5..9 " foo" - Identifier (Token): "foo" # 6..9 - ForKeyword (Token): "for" # 10..13 - - TypeName (Rule): # 13..18 " bar " - - IdentifierPath (Rule): # 13..18 " bar " + - TypeName (Rule): # 13..17 " bar" + - IdentifierPath (Rule): # 13..17 " bar" - Identifier (Token): "bar" # 14..17 - GlobalKeyword (Token): "global" # 18..24 - Semicolon (Token): ";" # 24..25 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_unnamed/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_unnamed/generated/0.4.11-success.yml index 02f1886669..c94ba36a51 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_unnamed/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/path_unnamed/generated/0.4.11-success.yml @@ -8,8 +8,8 @@ Errors: [] Tree: - UsingDirective (Rule): # 0..16 "using foo for *;" - UsingKeyword (Token): "using" # 0..5 - - UsingDirectivePath (Rule): # 5..10 " foo " - - IdentifierPath (Rule): # 5..10 " foo " + - UsingDirectivePath (Rule): # 5..9 " foo" + - IdentifierPath (Rule): # 5..9 " foo" - Identifier (Token): "foo" # 6..9 - ForKeyword (Token): "for" # 10..13 - Asterisk (Token): "*" # 14..15 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.4.11-failure.yml index acfa11b001..9fb9e654a4 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.4.11-failure.yml @@ -26,15 +26,15 @@ Tree: - UsingKeyword (Token): "using" # 0..5 - UsingDirectiveDeconstruction (Rule): # 5..16 " {div as /}" - OpenBrace (Token): "{" # 6..7 - - UsingDirectiveSymbolsList (Rule): # 7..11 "div " - - UsingDirectiveSymbol (Rule): # 7..11 "div " - - IdentifierPath (Rule): # 7..11 "div " + - UsingDirectiveSymbolsList (Rule): # 7..10 "div" + - UsingDirectiveSymbol (Rule): # 7..10 "div" + - IdentifierPath (Rule): # 7..10 "div" - Identifier (Token): "div" # 7..10 - SKIPPED (Token): "as /" # 11..15 - CloseBrace (Token): "}" # 15..16 - ForKeyword (Token): "for" # 17..20 - - TypeName (Rule): # 20..25 " Int " - - IdentifierPath (Rule): # 20..25 " Int " + - TypeName (Rule): # 20..24 " Int" + - IdentifierPath (Rule): # 20..24 " Int" - Identifier (Token): "Int" # 21..24 - SKIPPED (Token): "global" # 25..31 - Semicolon (Token): ";" # 31..32 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.13-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.13-failure.yml index 424377d7e7..bc1b7ac2a0 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.13-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.13-failure.yml @@ -18,15 +18,15 @@ Tree: - UsingKeyword (Token): "using" # 0..5 - UsingDirectiveDeconstruction (Rule): # 5..16 " {div as /}" - OpenBrace (Token): "{" # 6..7 - - UsingDirectiveSymbolsList (Rule): # 7..11 "div " - - UsingDirectiveSymbol (Rule): # 7..11 "div " - - IdentifierPath (Rule): # 7..11 "div " + - UsingDirectiveSymbolsList (Rule): # 7..10 "div" + - UsingDirectiveSymbol (Rule): # 7..10 "div" + - IdentifierPath (Rule): # 7..10 "div" - Identifier (Token): "div" # 7..10 - SKIPPED (Token): "as /" # 11..15 - CloseBrace (Token): "}" # 15..16 - ForKeyword (Token): "for" # 17..20 - - TypeName (Rule): # 20..25 " Int " - - IdentifierPath (Rule): # 20..25 " Int " + - TypeName (Rule): # 20..24 " Int" + - IdentifierPath (Rule): # 20..24 " Int" - Identifier (Token): "Int" # 21..24 - GlobalKeyword (Token): "global" # 25..31 - Semicolon (Token): ";" # 31..32 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.19-success.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.19-success.yml index a8e55b3f92..3250979b5d 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.19-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/user_defined_operator/generated/0.8.19-success.yml @@ -12,14 +12,14 @@ Tree: - OpenBrace (Token): "{" # 6..7 - UsingDirectiveSymbolsList (Rule): # 7..15 "div as /" - UsingDirectiveSymbol (Rule): # 7..15 "div as /" - - IdentifierPath (Rule): # 7..11 "div " + - IdentifierPath (Rule): # 7..10 "div" - Identifier (Token): "div" # 7..10 - AsKeyword (Token): "as" # 11..13 - Slash (Token): "/" # 14..15 - CloseBrace (Token): "}" # 15..16 - ForKeyword (Token): "for" # 17..20 - - TypeName (Rule): # 20..25 " Int " - - IdentifierPath (Rule): # 20..25 " Int " + - TypeName (Rule): # 20..24 " Int" + - IdentifierPath (Rule): # 20..24 " Int" - Identifier (Token): "Int" # 21..24 - GlobalKeyword (Token): "global" # 25..31 - Semicolon (Token): ";" # 31..32 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/generated/0.4.11-failure.yml index 6ccf9b050c..acafdfb3ec 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/generated/0.4.11-failure.yml @@ -6,17 +6,17 @@ Source: > Errors: # 1 total - > Error: Expected Period. - ╭─[crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/input.sol:1:9] + ╭─[crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/input.sol:1:8] │ 1 │ foo.bar as / - │ ──┬─ - │ ╰─── Error occurred here. + │ ──┬── + │ ╰──── Error occurred here. ───╯ Tree: - UsingDirectiveSymbol (Rule): # 0..12 "foo.bar as /" - - IdentifierPath (Rule): # 0..8 "foo.bar " + - IdentifierPath (Rule): # 0..7 "foo.bar" - Identifier (Token): "foo" # 0..3 - Period (Token): "." # 3..4 - Identifier (Token): "bar" # 4..7 - - SKIPPED (Token): "as /" # 8..12 + - SKIPPED (Token): " as /" # 7..12 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/generated/0.8.19-success.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/generated/0.8.19-success.yml index b369790153..4b629a2288 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/generated/0.8.19-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/identifier_path_as_operator/generated/0.8.19-success.yml @@ -7,7 +7,7 @@ Errors: [] Tree: - UsingDirectiveSymbol (Rule): # 0..12 "foo.bar as /" - - IdentifierPath (Rule): # 0..8 "foo.bar " + - IdentifierPath (Rule): # 0..7 "foo.bar" - Identifier (Token): "foo" # 0..3 - Period (Token): "." # 3..4 - Identifier (Token): "bar" # 4..7 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/generated/0.4.11-failure.yml index 9531b78c15..8e056c58c5 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/generated/0.4.11-failure.yml @@ -6,15 +6,15 @@ Source: > Errors: # 1 total - > Error: Expected Period. - ╭─[crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/input.sol:1:5] + ╭─[crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/input.sol:1:4] │ 1 │ foo as / - │ ──┬─ - │ ╰─── Error occurred here. + │ ──┬── + │ ╰──── Error occurred here. ───╯ Tree: - UsingDirectiveSymbol (Rule): # 0..8 "foo as /" - - IdentifierPath (Rule): # 0..4 "foo " + - IdentifierPath (Rule): # 0..3 "foo" - Identifier (Token): "foo" # 0..3 - - SKIPPED (Token): "as /" # 4..8 + - SKIPPED (Token): " as /" # 3..8 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/generated/0.8.19-success.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/generated/0.8.19-success.yml index 8b97289e59..1a7220e058 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/generated/0.8.19-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirectiveSymbol/single_id_as_operator/generated/0.8.19-success.yml @@ -7,7 +7,7 @@ Errors: [] Tree: - UsingDirectiveSymbol (Rule): # 0..8 "foo as /" - - IdentifierPath (Rule): # 0..4 "foo " + - IdentifierPath (Rule): # 0..3 "foo" - Identifier (Token): "foo" # 0..3 - AsKeyword (Token): "as" # 4..6 - Slash (Token): "/" # 7..8 diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/alternatives/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/alternatives/generated/0.4.11-success.yml index 98a61d64e4..df9669607c 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/alternatives/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/alternatives/generated/0.4.11-success.yml @@ -11,18 +11,18 @@ Tree: - VersionPragmaExpressionsList (Rule): # 8..33 " 0.5.0 || 0.6.0 || ^0.7.0" - VersionPragmaExpression (Rule): # 8..33 " 0.5.0 || 0.6.0 || ^0.7.0" - VersionPragmaBinaryExpression (Rule): # 8..33 " 0.5.0 || 0.6.0 || ^0.7.0" - - VersionPragmaExpression (Rule): # 8..24 " 0.5.0 || 0.6.0 " - - VersionPragmaBinaryExpression (Rule): # 8..24 " 0.5.0 || 0.6.0 " - - VersionPragmaExpression (Rule): # 8..15 " 0.5.0 " - - VersionPragmaSpecifier (Rule): # 8..15 " 0.5.0 " + - VersionPragmaExpression (Rule): # 8..23 " 0.5.0 || 0.6.0" + - VersionPragmaBinaryExpression (Rule): # 8..23 " 0.5.0 || 0.6.0" + - VersionPragmaExpression (Rule): # 8..14 " 0.5.0" + - VersionPragmaSpecifier (Rule): # 8..14 " 0.5.0" - VersionPragmaValue (Token): "0" # 9..10 - Period (Token): "." # 10..11 - VersionPragmaValue (Token): "5" # 11..12 - Period (Token): "." # 12..13 - VersionPragmaValue (Token): "0" # 13..14 - BarBar (Token): "||" # 15..17 - - VersionPragmaExpression (Rule): # 17..24 " 0.6.0 " - - VersionPragmaSpecifier (Rule): # 17..24 " 0.6.0 " + - VersionPragmaExpression (Rule): # 17..23 " 0.6.0" + - VersionPragmaSpecifier (Rule): # 17..23 " 0.6.0" - VersionPragmaValue (Token): "0" # 18..19 - Period (Token): "." # 19..20 - VersionPragmaValue (Token): "6" # 20..21 diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/multiple_exact_versions/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/multiple_exact_versions/generated/0.4.11-success.yml index c1852c312e..942d923267 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/multiple_exact_versions/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/multiple_exact_versions/generated/0.4.11-success.yml @@ -9,15 +9,15 @@ Tree: - VersionPragma (Rule): # 0..20 "solidity 0.7.0 0.8.0" - SolidityKeyword (Token): "solidity" # 0..8 - VersionPragmaExpressionsList (Rule): # 8..20 " 0.7.0 0.8.0" - - VersionPragmaExpression (Rule): # 8..15 " 0.7.0 " - - VersionPragmaSpecifier (Rule): # 8..15 " 0.7.0 " + - VersionPragmaExpression (Rule): # 8..14 " 0.7.0" + - VersionPragmaSpecifier (Rule): # 8..14 " 0.7.0" - VersionPragmaValue (Token): "0" # 9..10 - Period (Token): "." # 10..11 - VersionPragmaValue (Token): "7" # 11..12 - Period (Token): "." # 12..13 - VersionPragmaValue (Token): "0" # 13..14 - - VersionPragmaExpression (Rule): # 15..20 "0.8.0" - - VersionPragmaSpecifier (Rule): # 15..20 "0.8.0" + - VersionPragmaExpression (Rule): # 14..20 " 0.8.0" + - VersionPragmaSpecifier (Rule): # 14..20 " 0.8.0" - VersionPragmaValue (Token): "0" # 15..16 - Period (Token): "." # 16..17 - VersionPragmaValue (Token): "8" # 17..18 diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/nested_expressions/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/nested_expressions/generated/0.4.11-success.yml index 84b2945f7a..22340701ee 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/nested_expressions/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/nested_expressions/generated/0.4.11-success.yml @@ -11,11 +11,11 @@ Tree: - VersionPragmaExpressionsList (Rule): # 8..30 " ^1.0.0 || 2.0.0-3.0.0" - VersionPragmaExpression (Rule): # 8..30 " ^1.0.0 || 2.0.0-3.0.0" - VersionPragmaBinaryExpression (Rule): # 8..30 " ^1.0.0 || 2.0.0-3.0.0" - - VersionPragmaExpression (Rule): # 8..16 " ^1.0.0 " - - VersionPragmaUnaryExpression (Rule): # 8..16 " ^1.0.0 " + - VersionPragmaExpression (Rule): # 8..15 " ^1.0.0" + - VersionPragmaUnaryExpression (Rule): # 8..15 " ^1.0.0" - Caret (Token): "^" # 9..10 - - VersionPragmaExpression (Rule): # 10..16 "1.0.0 " - - VersionPragmaSpecifier (Rule): # 10..16 "1.0.0 " + - VersionPragmaExpression (Rule): # 10..15 "1.0.0" + - VersionPragmaSpecifier (Rule): # 10..15 "1.0.0" - VersionPragmaValue (Token): "1" # 10..11 - Period (Token): "." # 11..12 - VersionPragmaValue (Token): "0" # 12..13 diff --git a/crates/solidity/testing/snapshots/cst_output/VersionPragma/ranges/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/VersionPragma/ranges/generated/0.4.11-success.yml index 9753e15bf0..41f1d30a10 100644 --- a/crates/solidity/testing/snapshots/cst_output/VersionPragma/ranges/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/VersionPragma/ranges/generated/0.4.11-success.yml @@ -11,8 +11,8 @@ Tree: - VersionPragmaExpressionsList (Rule): # 8..22 " 0.6.0 - 0.7.0" - VersionPragmaExpression (Rule): # 8..22 " 0.6.0 - 0.7.0" - VersionPragmaBinaryExpression (Rule): # 8..22 " 0.6.0 - 0.7.0" - - VersionPragmaExpression (Rule): # 8..15 " 0.6.0 " - - VersionPragmaSpecifier (Rule): # 8..15 " 0.6.0 " + - VersionPragmaExpression (Rule): # 8..14 " 0.6.0" + - VersionPragmaSpecifier (Rule): # 8..14 " 0.6.0" - VersionPragmaValue (Token): "0" # 9..10 - Period (Token): "." # 10..11 - VersionPragmaValue (Token): "6" # 11..12 diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/function_def/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/function_def/generated/0.4.11-success.yml index 57d2954c99..fe9a3141f3 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/function_def/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/function_def/generated/0.4.11-success.yml @@ -24,17 +24,17 @@ Tree: - Comma (Token): "," # 18..19 - YulIdentifier (Token): "b" # 20..21 - CloseParen (Token): ")" # 21..22 - - YulReturnsDeclaration (Rule): # 22..33 " -> result " + - YulReturnsDeclaration (Rule): # 22..32 " -> result" - MinusGreaterThan (Token): "->" # 23..25 - - YulIdentifiersList (Rule): # 25..33 " result " + - YulIdentifiersList (Rule): # 25..32 " result" - YulIdentifier (Token): "result" # 26..32 - - YulBlock (Rule): # 33..60 "{\n\t\tresult := mul(a, b)\n\t}\n" + - YulBlock (Rule): # 32..60 " {\n\t\tresult := mul(a, b)\n\t}\n" - OpenBrace (Token): "{" # 33..34 - YulStatementsList (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - YulStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - YulAssignmentStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - - YulIdentifierPathsList (Rule): # 35..44 "\t\tresult " - - YulIdentifierPath (Rule): # 35..44 "\t\tresult " + - YulIdentifierPathsList (Rule): # 35..43 "\t\tresult" + - YulIdentifierPath (Rule): # 35..43 "\t\tresult" - YulIdentifier (Token): "result" # 37..43 - ColonEqual (Token): ":=" # 44..46 - YulExpression (Rule): # 46..57 " mul(a, b)\n" diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.11-failure.yml index 3451b64cc1..c500e1419c 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.11-failure.yml @@ -34,17 +34,17 @@ Tree: - Comma (Token): "," # 18..19 - YulIdentifier (Token): "b" # 20..21 - CloseParen (Token): ")" # 21..22 - - YulReturnsDeclaration (Rule): # 22..33 " -> result " + - YulReturnsDeclaration (Rule): # 22..32 " -> result" - MinusGreaterThan (Token): "->" # 23..25 - - YulIdentifiersList (Rule): # 25..33 " result " + - YulIdentifiersList (Rule): # 25..32 " result" - YulIdentifier (Token): "result" # 26..32 - - YulBlock (Rule): # 33..83 "{\n\t\tresult := mul(a, b)\n\t\tresult := [mul(a, b)\n\t}\n" + - YulBlock (Rule): # 32..83 " {\n\t\tresult := mul(a, b)\n\t\tresult := [mul(a, b)\n\t}..." - OpenBrace (Token): "{" # 33..34 - - YulStatementsList (Rule): # 35..66 "\t\tresult := mul(a, b)\n\t\tresult " + - YulStatementsList (Rule): # 35..65 "\t\tresult := mul(a, b)\n\t\tresult" - YulStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - YulAssignmentStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - - YulIdentifierPathsList (Rule): # 35..44 "\t\tresult " - - YulIdentifierPath (Rule): # 35..44 "\t\tresult " + - YulIdentifierPathsList (Rule): # 35..43 "\t\tresult" + - YulIdentifierPath (Rule): # 35..43 "\t\tresult" - YulIdentifier (Token): "result" # 37..43 - ColonEqual (Token): ":=" # 44..46 - YulExpression (Rule): # 46..57 " mul(a, b)\n" @@ -62,9 +62,9 @@ Tree: - YulIdentifierPath (Rule): # 53..55 " b" - YulIdentifier (Token): "b" # 54..55 - CloseParen (Token): ")" # 55..56 - - YulStatement (Rule): # 57..66 "\t\tresult " - - YulExpression (Rule): # 57..66 "\t\tresult " - - YulIdentifierPath (Rule): # 57..66 "\t\tresult " + - YulStatement (Rule): # 57..65 "\t\tresult" + - YulExpression (Rule): # 57..65 "\t\tresult" + - YulIdentifierPath (Rule): # 57..65 "\t\tresult" - YulIdentifier (Token): "result" # 59..65 - SKIPPED (Token): ":= [mul(a, b)\n\t" # 66..81 - CloseBrace (Token): "}" # 81..82 diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.6.0-failure.yml index fa07fba9b7..39dab865c2 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.6.0-failure.yml @@ -34,17 +34,17 @@ Tree: - Comma (Token): "," # 18..19 - YulIdentifier (Token): "b" # 20..21 - CloseParen (Token): ")" # 21..22 - - YulReturnsDeclaration (Rule): # 22..33 " -> result " + - YulReturnsDeclaration (Rule): # 22..32 " -> result" - MinusGreaterThan (Token): "->" # 23..25 - - YulIdentifiersList (Rule): # 25..33 " result " + - YulIdentifiersList (Rule): # 25..32 " result" - YulIdentifier (Token): "result" # 26..32 - - YulBlock (Rule): # 33..83 "{\n\t\tresult := mul(a, b)\n\t\tresult := [mul(a, b)\n\t}\n" + - YulBlock (Rule): # 32..83 " {\n\t\tresult := mul(a, b)\n\t\tresult := [mul(a, b)\n\t}..." - OpenBrace (Token): "{" # 33..34 - - YulStatementsList (Rule): # 35..66 "\t\tresult := mul(a, b)\n\t\tresult " + - YulStatementsList (Rule): # 35..65 "\t\tresult := mul(a, b)\n\t\tresult" - YulStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - YulAssignmentStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - - YulIdentifierPathsList (Rule): # 35..44 "\t\tresult " - - YulIdentifierPath (Rule): # 35..44 "\t\tresult " + - YulIdentifierPathsList (Rule): # 35..43 "\t\tresult" + - YulIdentifierPath (Rule): # 35..43 "\t\tresult" - YulIdentifier (Token): "result" # 37..43 - ColonEqual (Token): ":=" # 44..46 - YulExpression (Rule): # 46..57 " mul(a, b)\n" @@ -62,9 +62,9 @@ Tree: - YulIdentifierPath (Rule): # 53..55 " b" - YulIdentifier (Token): "b" # 54..55 - CloseParen (Token): ")" # 55..56 - - YulStatement (Rule): # 57..66 "\t\tresult " - - YulExpression (Rule): # 57..66 "\t\tresult " - - YulIdentifierPath (Rule): # 57..66 "\t\tresult " + - YulStatement (Rule): # 57..65 "\t\tresult" + - YulExpression (Rule): # 57..65 "\t\tresult" + - YulIdentifierPath (Rule): # 57..65 "\t\tresult" - YulIdentifier (Token): "result" # 59..65 - SKIPPED (Token): ":= [mul(a, b)\n\t" # 66..81 - CloseBrace (Token): "}" # 81..82