From e0119467625025b81f4af9d4f25c3123ab10cafc Mon Sep 17 00:00:00 2001 From: OmarTawfik <15987992+OmarTawfik@users.noreply.github.com> Date: Thu, 23 Nov 2023 19:40:54 -0800 Subject: [PATCH] fix tuple members grammar Use the same names across all three grammars, and make sure `TupleMember` refers to the deconstructed (optional) symbol, not the potentially empty parent (that is now called `DeconstructionElement`). --- .../02-declaration-statements/productions.yml | 37 ++-- .../inputs/language/src/definition.rs | 8 +- crates/solidity/inputs/language/src/dsl.rs | 10 +- .../cargo/crate/src/generated/kinds.rs | 12 +- .../cargo/crate/src/generated/language.rs | 200 ++++++++++-------- .../outputs/npm/crate/src/generated/kinds.rs | 12 +- .../npm/crate/src/generated/language.rs | 200 ++++++++++-------- .../npm/package/src/generated/index.d.ts | 12 +- .../unversioned.md | 5 + .../unversioned.md | 5 + .../unversioned.md | 2 +- .../tuple-member/unversioned.md | 5 - .../typed-tuple-member/unversioned.md | 5 + .../unversioned.md | 4 +- .../generated/public/grammar/v0.4.11/index.md | 6 +- .../generated/public/grammar/v0.4.21/index.md | 6 +- .../generated/public/grammar/v0.4.22/index.md | 6 +- .../generated/public/grammar/v0.5.0/index.md | 6 +- .../generated/public/grammar/v0.5.3/index.md | 6 +- .../generated/public/grammar/v0.6.0/index.md | 6 +- .../generated/public/grammar/v0.6.11/index.md | 6 +- .../generated/public/grammar/v0.6.2/index.md | 6 +- .../generated/public/grammar/v0.6.5/index.md | 6 +- .../generated/public/grammar/v0.7.0/index.md | 6 +- .../generated/public/grammar/v0.7.1/index.md | 6 +- .../generated/public/grammar/v0.7.4/index.md | 6 +- .../generated/public/grammar/v0.8.0/index.md | 6 +- .../generated/public/grammar/v0.8.13/index.md | 6 +- .../generated/public/grammar/v0.8.18/index.md | 6 +- .../generated/public/grammar/v0.8.19/index.md | 6 +- .../generated/public/grammar/v0.8.22/index.md | 6 +- .../generated/public/grammar/v0.8.4/index.md | 6 +- .../generated/public/grammar/v0.8.8/index.md | 6 +- .../generated/0.4.11-failure.yml | 13 +- .../generated/0.6.2-success.yml | 13 +- .../generated/0.4.11-success.yml | 30 +-- .../generated/0.4.11-success.yml | 20 +- .../empty/generated/0.4.11-success.yml | 4 +- .../generated/0.4.11-success.yml | 16 +- .../generated/0.4.11-failure.yml | 12 +- .../generated/0.6.2-failure.yml | 12 +- .../generated/0.4.11-success.yml | 14 +- .../with_type/generated/0.4.11-success.yml | 16 +- .../generated/0.4.11-success.yml | 24 ++- 44 files changed, 464 insertions(+), 341 deletions(-) create mode 100644 crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md create mode 100644 crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md delete mode 100644 crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md create mode 100644 crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md rename crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/{tuple-members => untyped-tuple-member}/unversioned.md (52%) diff --git a/crates/solidity/inputs/language/definition/04-statements/02-declaration-statements/productions.yml b/crates/solidity/inputs/language/definition/04-statements/02-declaration-statements/productions.yml index b591762453..a9d2a0cf99 100644 --- a/crates/solidity/inputs/language/definition/04-statements/02-declaration-statements/productions.yml +++ b/crates/solidity/inputs/language/definition/04-statements/02-declaration-statements/productions.yml @@ -10,8 +10,7 @@ open: reference: "OpenParen" parser: - optional: - reference: "TupleMembers" + reference: "TupleDeconstructionElements" close: reference: "CloseParen" - reference: "Equal" @@ -19,29 +18,39 @@ terminator: reference: "Semicolon" -- name: "TupleMembers" +- name: "TupleDeconstructionElements" kind: "Parser" unversioned: separatedBy: separator: reference: "Comma" parser: - reference: "TupleMember" + reference: "TupleDeconstructionElement" -- name: "TupleMember" +- name: "TupleDeconstructionElement" kind: "Parser" unversioned: optional: choice: - - sequence: - - reference: "TypeName" - - optional: - reference: "DataLocation" - - reference: "Identifier" - - sequence: - - optional: - reference: "DataLocation" - - reference: "Identifier" + - reference: "TypedTupleMember" + - reference: "UntypedTupleMember" + +- name: "TypedTupleMember" + kind: "Parser" + unversioned: + sequence: + - reference: "TypeName" + - optional: + reference: "DataLocation" + - reference: "Identifier" + +- name: "UntypedTupleMember" + kind: "Parser" + unversioned: + sequence: + - optional: + reference: "DataLocation" + - reference: "Identifier" - name: "VariableDeclarationStatement" kind: "Parser" diff --git a/crates/solidity/inputs/language/src/definition.rs b/crates/solidity/inputs/language/src/definition.rs index c06e26e9a5..54f3b69cca 100644 --- a/crates/solidity/inputs/language/src/definition.rs +++ b/crates/solidity/inputs/language/src/definition.rs @@ -2898,7 +2898,7 @@ codegen_language_macros::compile!(Language( ), fields = ( open_paren = Required(Terminal([OpenParen])), - members = Required(NonTerminal(TupleMembersDeconstruction)), + elements = Required(NonTerminal(TupleDeconstructionElements)), close_paren = Required(Terminal([CloseParen])), equal = Required(Terminal([Equal])), expression = Required(NonTerminal(Expression)), @@ -2906,12 +2906,12 @@ codegen_language_macros::compile!(Language( ) ), Separated( - name = TupleMembersDeconstruction, - separated = TupleMemberDeconstruction, + name = TupleDeconstructionElements, + separated = TupleDeconstructionElement, separator = Comma ), Struct( - name = TupleMemberDeconstruction, + name = TupleDeconstructionElement, fields = (member = Optional(kind = NonTerminal(TupleMember))) ), Enum( diff --git a/crates/solidity/inputs/language/src/dsl.rs b/crates/solidity/inputs/language/src/dsl.rs index 85bee76798..3ef4cd48fb 100644 --- a/crates/solidity/inputs/language/src/dsl.rs +++ b/crates/solidity/inputs/language/src/dsl.rs @@ -513,18 +513,20 @@ slang_grammar! { parser TryStatement = { introduced in "0.6.0" (TryKeyword Expression (ReturnsDeclaration ?) Block CatchClauses) } ; - parser TupleDeconstructionStatement = ((((TupleMembers ?) delimited by OpenParen and CloseParen) Equal Expression) terminated by Semicolon) ; + parser TupleDeconstructionStatement = (((TupleDeconstructionElements delimited by OpenParen and CloseParen) Equal Expression) terminated by Semicolon) ; parser TupleExpression = (TupleValues delimited by OpenParen and CloseParen) ; - parser TupleMember = (((TypeName (DataLocation ?) Identifier) | ((DataLocation ?) Identifier)) ?) ; + parser TupleDeconstructionElement = ((TypedTupleMember | UntypedTupleMember) ?) ; - parser TupleMembers = (TupleMember separated by Comma) ; + parser TupleDeconstructionElements = (TupleDeconstructionElement separated by Comma) ; parser TupleValues = ((Expression ?) separated by Comma) ; parser TypeExpression = { introduced in "0.5.3" (TypeKeyword (TypeName delimited by OpenParen and CloseParen)) } ; + parser TypedTupleMember = (TypeName (DataLocation ?) Identifier) ; + precedence parser TypeName = ( [ postfix ArrayTypeNameOperator as ArrayTypeName @@ -548,6 +550,8 @@ slang_grammar! { parser UnnamedFunctionDefinition = { removed in "0.6.0" (FunctionKeyword ParametersDeclaration (UnnamedFunctionAttributes ?) (Semicolon | Block)) } ; + parser UntypedTupleMember = ((DataLocation ?) Identifier) ; + parser UserDefinedValueTypeDefinition = { introduced in "0.8.8" ((TypeKeyword Identifier IsKeyword ElementaryType) terminated by Semicolon) } ; parser UsingDirective = ((UsingKeyword (IdentifierPath | UsingDirectiveDeconstruction) ForKeyword (Asterisk | TypeName) ({ introduced in "0.8.13" GlobalKeyword } ?)) terminated by Semicolon) ; diff --git a/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs b/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs index 8d614ebf20..451b6df8ce 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs @@ -114,17 +114,19 @@ pub enum ProductionKind { ThrowStatement, TrailingTrivia, TryStatement, + TupleDeconstructionElement, + TupleDeconstructionElements, TupleDeconstructionStatement, TupleExpression, - TupleMember, - TupleMembers, TupleValues, TypeExpression, TypeName, + TypedTupleMember, UncheckedBlock, UnicodeStringLiterals, UnnamedFunctionAttributes, UnnamedFunctionDefinition, + UntypedTupleMember, UserDefinedValueTypeDefinition, UsingDirective, UsingDirectiveDeconstruction, @@ -276,19 +278,21 @@ pub enum RuleKind { ThrowStatement, TrailingTrivia, TryStatement, + TupleDeconstructionElement, + TupleDeconstructionElements, TupleDeconstructionStatement, TupleExpression, - TupleMember, - TupleMembers, TupleValues, TypeExpression, TypeName, + TypedTupleMember, UnaryPostfixExpression, UnaryPrefixExpression, UncheckedBlock, UnicodeStringLiterals, UnnamedFunctionAttributes, UnnamedFunctionDefinition, + UntypedTupleMember, UserDefinedValueTypeDefinition, UsingDirective, UsingDirectiveDeconstruction, diff --git a/crates/solidity/outputs/cargo/crate/src/generated/language.rs b/crates/solidity/outputs/cargo/crate/src/generated/language.rs index f0768200f3..d051c2250a 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/language.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/language.rs @@ -3833,6 +3833,29 @@ impl Language { .with_kind(RuleKind::TryStatement) } + #[allow(unused_assignments, unused_parens)] + fn tuple_deconstruction_element(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(ChoiceHelper::run(input, |mut choice, input| { + let result = self.typed_tuple_member(input); + choice.consider(input, result)?; + let result = self.untyped_tuple_member(input); + choice.consider(input, result)?; + choice.finish(input) + })) + .with_kind(RuleKind::TupleDeconstructionElement) + } + + #[allow(unused_assignments, unused_parens)] + fn tuple_deconstruction_elements(&self, input: &mut ParserContext) -> ParserResult { + SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.tuple_deconstruction_element(input), + TokenKind::Comma, + ) + .with_kind(RuleKind::TupleDeconstructionElements) + } + #[allow(unused_assignments, unused_parens)] fn tuple_deconstruction_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -3846,13 +3869,13 @@ impl Language { TokenKind::OpenParen, ))?; seq.elem( - OptionalHelper::transform(self.tuple_members(input)) + self.tuple_deconstruction_elements(input) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), )?; seq.elem(self.parse_token_with_trivia::( input, @@ -3910,90 +3933,6 @@ impl Language { .with_kind(RuleKind::TupleExpression) } - #[allow(unused_assignments, unused_parens)] - fn tuple_member(&self, input: &mut ParserContext) -> ParserResult { - OptionalHelper::transform(ChoiceHelper::run(input, |mut choice, input| { - let result = SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::MemoryKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::StorageKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::CalldataKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.finish() - }); - choice.consider(input, result)?; - let result = SequenceHelper::run(|mut seq| { - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::MemoryKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::StorageKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::CalldataKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.finish() - }); - choice.consider(input, result)?; - choice.finish(input) - })) - .with_kind(RuleKind::TupleMember) - } - - #[allow(unused_assignments, unused_parens)] - fn tuple_members(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.tuple_member(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::TupleMembers) - } - #[allow(unused_assignments, unused_parens)] fn tuple_values(&self, input: &mut ParserContext) -> ParserResult { SeparatedHelper::run::<_, LexicalContextType::Default>( @@ -4155,6 +4094,42 @@ impl Language { .with_kind(RuleKind::TypeName) } + #[allow(unused_assignments, unused_parens)] + fn typed_tuple_member(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.type_name(input))?; + seq.elem(OptionalHelper::transform(ChoiceHelper::run( + input, + |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::MemoryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::StorageKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_5_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::CalldataKeyword, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }, + )))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.finish() + }) + .with_kind(RuleKind::TypedTupleMember) + } + #[allow(unused_assignments, unused_parens)] fn unchecked_block(&self, input: &mut ParserContext) -> ParserResult { if self.version_is_at_least_0_8_0 { @@ -4259,6 +4234,41 @@ impl Language { .with_kind(RuleKind::UnnamedFunctionDefinition) } + #[allow(unused_assignments, unused_parens)] + fn untyped_tuple_member(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(OptionalHelper::transform(ChoiceHelper::run( + input, + |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::MemoryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::StorageKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_5_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::CalldataKeyword, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }, + )))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.finish() + }) + .with_kind(RuleKind::UntypedTupleMember) + } + #[allow(unused_assignments, unused_parens)] fn user_defined_value_type_definition(&self, input: &mut ParserContext) -> ParserResult { if self.version_is_at_least_0_8_8 { @@ -6070,15 +6080,20 @@ impl Language { ProductionKind::ThrowStatement => Self::throw_statement.parse(self, input), ProductionKind::TrailingTrivia => Self::trailing_trivia.parse(self, input), ProductionKind::TryStatement => Self::try_statement.parse(self, input), + ProductionKind::TupleDeconstructionElement => { + Self::tuple_deconstruction_element.parse(self, input) + } + ProductionKind::TupleDeconstructionElements => { + Self::tuple_deconstruction_elements.parse(self, input) + } ProductionKind::TupleDeconstructionStatement => { Self::tuple_deconstruction_statement.parse(self, input) } ProductionKind::TupleExpression => Self::tuple_expression.parse(self, input), - ProductionKind::TupleMember => Self::tuple_member.parse(self, input), - ProductionKind::TupleMembers => Self::tuple_members.parse(self, input), ProductionKind::TupleValues => Self::tuple_values.parse(self, input), ProductionKind::TypeExpression => Self::type_expression.parse(self, input), ProductionKind::TypeName => Self::type_name.parse(self, input), + ProductionKind::TypedTupleMember => Self::typed_tuple_member.parse(self, input), ProductionKind::UncheckedBlock => Self::unchecked_block.parse(self, input), ProductionKind::UnicodeStringLiterals => { Self::unicode_string_literals.parse(self, input) @@ -6089,6 +6104,7 @@ impl Language { ProductionKind::UnnamedFunctionDefinition => { Self::unnamed_function_definition.parse(self, input) } + ProductionKind::UntypedTupleMember => Self::untyped_tuple_member.parse(self, input), ProductionKind::UserDefinedValueTypeDefinition => { Self::user_defined_value_type_definition.parse(self, input) } diff --git a/crates/solidity/outputs/npm/crate/src/generated/kinds.rs b/crates/solidity/outputs/npm/crate/src/generated/kinds.rs index 8d614ebf20..451b6df8ce 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/kinds.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/kinds.rs @@ -114,17 +114,19 @@ pub enum ProductionKind { ThrowStatement, TrailingTrivia, TryStatement, + TupleDeconstructionElement, + TupleDeconstructionElements, TupleDeconstructionStatement, TupleExpression, - TupleMember, - TupleMembers, TupleValues, TypeExpression, TypeName, + TypedTupleMember, UncheckedBlock, UnicodeStringLiterals, UnnamedFunctionAttributes, UnnamedFunctionDefinition, + UntypedTupleMember, UserDefinedValueTypeDefinition, UsingDirective, UsingDirectiveDeconstruction, @@ -276,19 +278,21 @@ pub enum RuleKind { ThrowStatement, TrailingTrivia, TryStatement, + TupleDeconstructionElement, + TupleDeconstructionElements, TupleDeconstructionStatement, TupleExpression, - TupleMember, - TupleMembers, TupleValues, TypeExpression, TypeName, + TypedTupleMember, UnaryPostfixExpression, UnaryPrefixExpression, UncheckedBlock, UnicodeStringLiterals, UnnamedFunctionAttributes, UnnamedFunctionDefinition, + UntypedTupleMember, UserDefinedValueTypeDefinition, UsingDirective, UsingDirectiveDeconstruction, diff --git a/crates/solidity/outputs/npm/crate/src/generated/language.rs b/crates/solidity/outputs/npm/crate/src/generated/language.rs index f0768200f3..d051c2250a 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/language.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/language.rs @@ -3833,6 +3833,29 @@ impl Language { .with_kind(RuleKind::TryStatement) } + #[allow(unused_assignments, unused_parens)] + fn tuple_deconstruction_element(&self, input: &mut ParserContext) -> ParserResult { + OptionalHelper::transform(ChoiceHelper::run(input, |mut choice, input| { + let result = self.typed_tuple_member(input); + choice.consider(input, result)?; + let result = self.untyped_tuple_member(input); + choice.consider(input, result)?; + choice.finish(input) + })) + .with_kind(RuleKind::TupleDeconstructionElement) + } + + #[allow(unused_assignments, unused_parens)] + fn tuple_deconstruction_elements(&self, input: &mut ParserContext) -> ParserResult { + SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.tuple_deconstruction_element(input), + TokenKind::Comma, + ) + .with_kind(RuleKind::TupleDeconstructionElements) + } + #[allow(unused_assignments, unused_parens)] fn tuple_deconstruction_statement(&self, input: &mut ParserContext) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -3846,13 +3869,13 @@ impl Language { TokenKind::OpenParen, ))?; seq.elem( - OptionalHelper::transform(self.tuple_members(input)) + self.tuple_deconstruction_elements(input) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), )?; seq.elem(self.parse_token_with_trivia::( input, @@ -3910,90 +3933,6 @@ impl Language { .with_kind(RuleKind::TupleExpression) } - #[allow(unused_assignments, unused_parens)] - fn tuple_member(&self, input: &mut ParserContext) -> ParserResult { - OptionalHelper::transform(ChoiceHelper::run(input, |mut choice, input| { - let result = SequenceHelper::run(|mut seq| { - seq.elem(self.type_name(input))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::MemoryKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::StorageKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::CalldataKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.finish() - }); - choice.consider(input, result)?; - let result = SequenceHelper::run(|mut seq| { - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::MemoryKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::StorageKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::CalldataKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ))?; - seq.finish() - }); - choice.consider(input, result)?; - choice.finish(input) - })) - .with_kind(RuleKind::TupleMember) - } - - #[allow(unused_assignments, unused_parens)] - fn tuple_members(&self, input: &mut ParserContext) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.tuple_member(input), - TokenKind::Comma, - ) - .with_kind(RuleKind::TupleMembers) - } - #[allow(unused_assignments, unused_parens)] fn tuple_values(&self, input: &mut ParserContext) -> ParserResult { SeparatedHelper::run::<_, LexicalContextType::Default>( @@ -4155,6 +4094,42 @@ impl Language { .with_kind(RuleKind::TypeName) } + #[allow(unused_assignments, unused_parens)] + fn typed_tuple_member(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.type_name(input))?; + seq.elem(OptionalHelper::transform(ChoiceHelper::run( + input, + |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::MemoryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::StorageKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_5_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::CalldataKeyword, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }, + )))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.finish() + }) + .with_kind(RuleKind::TypedTupleMember) + } + #[allow(unused_assignments, unused_parens)] fn unchecked_block(&self, input: &mut ParserContext) -> ParserResult { if self.version_is_at_least_0_8_0 { @@ -4259,6 +4234,41 @@ impl Language { .with_kind(RuleKind::UnnamedFunctionDefinition) } + #[allow(unused_assignments, unused_parens)] + fn untyped_tuple_member(&self, input: &mut ParserContext) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(OptionalHelper::transform(ChoiceHelper::run( + input, + |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::MemoryKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::StorageKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_5_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::CalldataKeyword, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }, + )))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ))?; + seq.finish() + }) + .with_kind(RuleKind::UntypedTupleMember) + } + #[allow(unused_assignments, unused_parens)] fn user_defined_value_type_definition(&self, input: &mut ParserContext) -> ParserResult { if self.version_is_at_least_0_8_8 { @@ -6070,15 +6080,20 @@ impl Language { ProductionKind::ThrowStatement => Self::throw_statement.parse(self, input), ProductionKind::TrailingTrivia => Self::trailing_trivia.parse(self, input), ProductionKind::TryStatement => Self::try_statement.parse(self, input), + ProductionKind::TupleDeconstructionElement => { + Self::tuple_deconstruction_element.parse(self, input) + } + ProductionKind::TupleDeconstructionElements => { + Self::tuple_deconstruction_elements.parse(self, input) + } ProductionKind::TupleDeconstructionStatement => { Self::tuple_deconstruction_statement.parse(self, input) } ProductionKind::TupleExpression => Self::tuple_expression.parse(self, input), - ProductionKind::TupleMember => Self::tuple_member.parse(self, input), - ProductionKind::TupleMembers => Self::tuple_members.parse(self, input), ProductionKind::TupleValues => Self::tuple_values.parse(self, input), ProductionKind::TypeExpression => Self::type_expression.parse(self, input), ProductionKind::TypeName => Self::type_name.parse(self, input), + ProductionKind::TypedTupleMember => Self::typed_tuple_member.parse(self, input), ProductionKind::UncheckedBlock => Self::unchecked_block.parse(self, input), ProductionKind::UnicodeStringLiterals => { Self::unicode_string_literals.parse(self, input) @@ -6089,6 +6104,7 @@ impl Language { ProductionKind::UnnamedFunctionDefinition => { Self::unnamed_function_definition.parse(self, input) } + ProductionKind::UntypedTupleMember => Self::untyped_tuple_member.parse(self, input), ProductionKind::UserDefinedValueTypeDefinition => { Self::user_defined_value_type_definition.parse(self, input) } diff --git a/crates/solidity/outputs/npm/package/src/generated/index.d.ts b/crates/solidity/outputs/npm/package/src/generated/index.d.ts index f25b3ab4e8..a129305425 100644 --- a/crates/solidity/outputs/npm/package/src/generated/index.d.ts +++ b/crates/solidity/outputs/npm/package/src/generated/index.d.ts @@ -109,17 +109,19 @@ export namespace kinds { ThrowStatement = "ThrowStatement", TrailingTrivia = "TrailingTrivia", TryStatement = "TryStatement", + TupleDeconstructionElement = "TupleDeconstructionElement", + TupleDeconstructionElements = "TupleDeconstructionElements", TupleDeconstructionStatement = "TupleDeconstructionStatement", TupleExpression = "TupleExpression", - TupleMember = "TupleMember", - TupleMembers = "TupleMembers", TupleValues = "TupleValues", TypeExpression = "TypeExpression", TypeName = "TypeName", + TypedTupleMember = "TypedTupleMember", UncheckedBlock = "UncheckedBlock", UnicodeStringLiterals = "UnicodeStringLiterals", UnnamedFunctionAttributes = "UnnamedFunctionAttributes", UnnamedFunctionDefinition = "UnnamedFunctionDefinition", + UntypedTupleMember = "UntypedTupleMember", UserDefinedValueTypeDefinition = "UserDefinedValueTypeDefinition", UsingDirective = "UsingDirective", UsingDirectiveDeconstruction = "UsingDirectiveDeconstruction", @@ -257,19 +259,21 @@ export namespace kinds { ThrowStatement = "ThrowStatement", TrailingTrivia = "TrailingTrivia", TryStatement = "TryStatement", + TupleDeconstructionElement = "TupleDeconstructionElement", + TupleDeconstructionElements = "TupleDeconstructionElements", TupleDeconstructionStatement = "TupleDeconstructionStatement", TupleExpression = "TupleExpression", - TupleMember = "TupleMember", - TupleMembers = "TupleMembers", TupleValues = "TupleValues", TypeExpression = "TypeExpression", TypeName = "TypeName", + TypedTupleMember = "TypedTupleMember", UnaryPostfixExpression = "UnaryPostfixExpression", UnaryPrefixExpression = "UnaryPrefixExpression", UncheckedBlock = "UncheckedBlock", UnicodeStringLiterals = "UnicodeStringLiterals", UnnamedFunctionAttributes = "UnnamedFunctionAttributes", UnnamedFunctionDefinition = "UnnamedFunctionDefinition", + UntypedTupleMember = "UntypedTupleMember", UserDefinedValueTypeDefinition = "UserDefinedValueTypeDefinition", UsingDirective = "UsingDirective", UsingDirectiveDeconstruction = "UsingDirectiveDeconstruction", diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md new file mode 100644 index 0000000000..703a4f03b3 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #TupleDeconstructionElement } +TupleDeconstructionElement = (TypedTupleMember | UntypedTupleMember)?; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md new file mode 100644 index 0000000000..f28b133bcd --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #TupleDeconstructionElements } +TupleDeconstructionElements = TupleDeconstructionElement (COMMA TupleDeconstructionElement)*; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md index 17e817c22b..4630704093 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md @@ -1,5 +1,5 @@ ```{ .ebnf .slang-ebnf #TupleDeconstructionStatement } -TupleDeconstructionStatement = OPEN_PAREN TupleMembers? CLOSE_PAREN EQUAL Expression SEMICOLON; +TupleDeconstructionStatement = OPEN_PAREN TupleDeconstructionElements CLOSE_PAREN EQUAL Expression SEMICOLON; ``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md deleted file mode 100644 index 9a17e404eb..0000000000 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md +++ /dev/null @@ -1,5 +0,0 @@ - - -```{ .ebnf .slang-ebnf #TupleMember } -TupleMember = ((TypeName «DataLocation»? IDENTIFIER) | («DataLocation»? IDENTIFIER))?; -``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md new file mode 100644 index 0000000000..eb3a34f564 --- /dev/null +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md @@ -0,0 +1,5 @@ + + +```{ .ebnf .slang-ebnf #TypedTupleMember } +TypedTupleMember = TypeName «DataLocation»? IDENTIFIER; +``` diff --git a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md similarity index 52% rename from crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md rename to crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md index e2cfcd109d..ff6f8fcaaf 100644 --- a/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md +++ b/crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md @@ -1,5 +1,5 @@ -```{ .ebnf .slang-ebnf #TupleMembers } -TupleMembers = TupleMember (COMMA TupleMember)*; +```{ .ebnf .slang-ebnf #UntypedTupleMember } +UntypedTupleMember = «DataLocation»? IDENTIFIER; ``` diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.4.11/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.4.11/index.md index afb71ff7b8..851b4a255a 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.4.11/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.4.11/index.md @@ -274,8 +274,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.4.11.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.4.21/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.4.21/index.md index 584cfc5b99..9127449018 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.4.21/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.4.21/index.md @@ -275,8 +275,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.4.11.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.4.22/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.4.22/index.md index 8b697b035f..2b2ea991d5 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.4.22/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.4.22/index.md @@ -279,8 +279,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.4.11.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.4.11.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.5.0/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.5.0/index.md index 5dab914365..e50547ad15 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.5.0/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.5.0/index.md @@ -277,8 +277,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.5.3/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.5.3/index.md index 3f2fab81a6..2d21197955 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.5.3/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.5.3/index.md @@ -278,8 +278,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.0/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.0/index.md index 1ebb402e8e..64e7f735fb 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.0/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.0/index.md @@ -286,8 +286,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.11/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.11/index.md index 455e13d197..dbe9f6027b 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.11/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.11/index.md @@ -288,8 +288,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.2/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.2/index.md index 597c6ef16c..c6f65a98cc 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.2/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.2/index.md @@ -286,8 +286,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.5/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.5/index.md index 411eb1c0ca..c52f478d8f 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.6.5/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.6.5/index.md @@ -287,8 +287,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.7.0/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.7.0/index.md index fab3324cb2..172932181e 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.7.0/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.7.0/index.md @@ -286,8 +286,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.7.1/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.7.1/index.md index 5749db8b0a..8ed8f99724 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.7.1/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.7.1/index.md @@ -286,8 +286,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.7.4/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.7.4/index.md index 8442f49b23..04321e46bd 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.7.4/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.7.4/index.md @@ -290,8 +290,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.0/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.0/index.md index 28f951da2f..71e4f7798d 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.0/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.0/index.md @@ -291,8 +291,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.13/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.13/index.md index ff433d442f..8351ba4875 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.13/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.13/index.md @@ -308,8 +308,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.18/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.18/index.md index 1c8059c305..8434478b3a 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.18/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.18/index.md @@ -308,8 +308,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.19/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.19/index.md index 5cd8a9bcb4..76cbed3194 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.19/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.19/index.md @@ -309,8 +309,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.22/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.22/index.md index eb965427ed..ebb1bddfad 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.22/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.22/index.md @@ -309,8 +309,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.4/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.4/index.md index f9e0a0969c..b12163c6d8 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.4/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.4/index.md @@ -300,8 +300,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" diff --git a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.8/index.md b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.8/index.md index 63968acf6e..47e8e6ae05 100644 --- a/crates/solidity/outputs/spec/generated/public/grammar/v0.8.8/index.md +++ b/crates/solidity/outputs/spec/generated/public/grammar/v0.8.8/index.md @@ -304,8 +304,10 @@ ### 4.2. Declaration Statements --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-statement/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-members/unversioned.md" ---8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-elements/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/tuple-deconstruction-element/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/typed-tuple-member/unversioned.md" +--8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/untyped-tuple-member/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-statement/unversioned.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/variable-declaration-type/0.5.0.md" --8<-- "crates/solidity/outputs/spec/generated/ebnf/04-statements/02-declaration-statements/data-location/0.5.0.md" 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 fa0cbd630e..b29bea96aa 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 @@ -88,13 +88,14 @@ Tree: - Semicolon (Token): ";" # 199..200 - TupleDeconstructionStatement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." - OpenParen (Token): "(" # 206..207 - - TupleMembers (Rule): # 207..220 "bool success," - - TupleMember (Rule): # 207..219 "bool success" - - TypeName (Rule): # 207..211 "bool" - - BoolKeyword (Token): "bool" # 207..211 - - Identifier (Token): "success" # 212..219 + - TupleDeconstructionElements (Rule): # 207..220 "bool success," + - TupleDeconstructionElement (Rule): # 207..219 "bool success" + - TypedTupleMember (Rule): # 207..219 "bool success" + - TypeName (Rule): # 207..211 "bool" + - BoolKeyword (Token): "bool" # 207..211 + - Identifier (Token): "success" # 212..219 - Comma (Token): "," # 219..220 - - TupleMember (Rule): [] # 220..220 + - TupleDeconstructionElement (Rule): [] # 220..220 - CloseParen (Token): ")" # 221..222 - Equal (Token): "=" # 223..224 - Expression (Rule): # 224..239 " recipient.call" 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 a5e58759b6..c8994b26cb 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 @@ -80,13 +80,14 @@ Tree: - Semicolon (Token): ";" # 199..200 - TupleDeconstructionStatement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." - OpenParen (Token): "(" # 206..207 - - TupleMembers (Rule): # 207..220 "bool success," - - TupleMember (Rule): # 207..219 "bool success" - - TypeName (Rule): # 207..211 "bool" - - BoolKeyword (Token): "bool" # 207..211 - - Identifier (Token): "success" # 212..219 + - TupleDeconstructionElements (Rule): # 207..220 "bool success," + - TupleDeconstructionElement (Rule): # 207..219 "bool success" + - TypedTupleMember (Rule): # 207..219 "bool success" + - TypeName (Rule): # 207..211 "bool" + - BoolKeyword (Token): "bool" # 207..211 + - Identifier (Token): "success" # 212..219 - Comma (Token): "," # 219..220 - - TupleMember (Rule): [] # 220..220 + - TupleDeconstructionElement (Rule): [] # 220..220 - CloseParen (Token): ")" # 221..222 - Equal (Token): "=" # 223..224 - Expression (Rule): # 224..260 ' recipient.call{ value: amount }("")' diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_array_type/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_array_type/generated/0.4.11-success.yml index e8dffc5e14..717586bcca 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_array_type/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_array_type/generated/0.4.11-success.yml @@ -8,21 +8,23 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..69 "(uint32 a, uint32[] memory b) = abi.decode(data, (..." - OpenParen (Token): "(" # 0..1 - - TupleMembers (Rule): # 1..28 "uint32 a, uint32[] memory b" - - TupleMember (Rule): # 1..9 "uint32 a" - - TypeName (Rule): # 1..7 "uint32" - - UintKeyword (Token): "uint32" # 1..7 - - Identifier (Token): "a" # 8..9 + - TupleDeconstructionElements (Rule): # 1..28 "uint32 a, uint32[] memory b" + - TupleDeconstructionElement (Rule): # 1..9 "uint32 a" + - TypedTupleMember (Rule): # 1..9 "uint32 a" + - TypeName (Rule): # 1..7 "uint32" + - UintKeyword (Token): "uint32" # 1..7 + - Identifier (Token): "a" # 8..9 - Comma (Token): "," # 9..10 - - TupleMember (Rule): # 10..28 " uint32[] memory b" - - TypeName (Rule): # 10..19 " uint32[]" - - ArrayTypeName (Rule): # 10..19 " uint32[]" - - TypeName (Rule): # 10..17 " uint32" - - UintKeyword (Token): "uint32" # 11..17 - - OpenBracket (Token): "[" # 17..18 - - CloseBracket (Token): "]" # 18..19 - - MemoryKeyword (Token): "memory" # 20..26 - - Identifier (Token): "b" # 27..28 + - TupleDeconstructionElement (Rule): # 10..28 " uint32[] memory b" + - TypedTupleMember (Rule): # 10..28 " uint32[] memory b" + - TypeName (Rule): # 10..19 " uint32[]" + - ArrayTypeName (Rule): # 10..19 " uint32[]" + - TypeName (Rule): # 10..17 " uint32" + - UintKeyword (Token): "uint32" # 11..17 + - OpenBracket (Token): "[" # 17..18 + - CloseBracket (Token): "]" # 18..19 + - MemoryKeyword (Token): "memory" # 20..26 + - Identifier (Token): "b" # 27..28 - CloseParen (Token): ")" # 28..29 - Equal (Token): "=" # 30..31 - Expression (Rule): # 31..68 " abi.decode(data, (uint32, uint32[]))" diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_singleton_type/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_singleton_type/generated/0.4.11-success.yml index c174666681..08291c675a 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_singleton_type/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/abi_decode_singleton_type/generated/0.4.11-success.yml @@ -8,16 +8,18 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..58 "(uint32 a, uint32 b) = abi.decode(data, (uint32, u..." - OpenParen (Token): "(" # 0..1 - - TupleMembers (Rule): # 1..19 "uint32 a, uint32 b" - - TupleMember (Rule): # 1..9 "uint32 a" - - TypeName (Rule): # 1..7 "uint32" - - UintKeyword (Token): "uint32" # 1..7 - - Identifier (Token): "a" # 8..9 + - TupleDeconstructionElements (Rule): # 1..19 "uint32 a, uint32 b" + - TupleDeconstructionElement (Rule): # 1..9 "uint32 a" + - TypedTupleMember (Rule): # 1..9 "uint32 a" + - TypeName (Rule): # 1..7 "uint32" + - UintKeyword (Token): "uint32" # 1..7 + - Identifier (Token): "a" # 8..9 - Comma (Token): "," # 9..10 - - TupleMember (Rule): # 10..19 " uint32 b" - - TypeName (Rule): # 10..17 " uint32" - - UintKeyword (Token): "uint32" # 11..17 - - Identifier (Token): "b" # 18..19 + - TupleDeconstructionElement (Rule): # 10..19 " uint32 b" + - TypedTupleMember (Rule): # 10..19 " uint32 b" + - TypeName (Rule): # 10..17 " uint32" + - UintKeyword (Token): "uint32" # 11..17 + - Identifier (Token): "b" # 18..19 - CloseParen (Token): ")" # 19..20 - Equal (Token): "=" # 21..22 - Expression (Rule): # 22..57 " abi.decode(data, (uint32, uint32))" diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/empty/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/empty/generated/0.4.11-success.yml index c0a51fad70..4835b5b02e 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/empty/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/empty/generated/0.4.11-success.yml @@ -11,8 +11,8 @@ Tree: - LeadingTrivia (Rule): # 0..48 "// TODO(#671): Tuple expressions can't be empty\n" - SingleLineComment (Trivia): "// TODO(#671): Tuple expressions can't be empty" # 0..47 - OpenParen (Token): "(" # 48..49 - - TupleMembers (Rule): # 49..49 - - TupleMember (Rule): [] # 49..49 + - TupleDeconstructionElements (Rule): # 49..49 + - TupleDeconstructionElement (Rule): [] # 49..49 - CloseParen (Token): ")" # 49..50 - Equal (Token): "=" # 51..52 - Expression (Rule): # 52..55 " ()" diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/ignored_members/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/ignored_members/generated/0.4.11-success.yml index f575abfed9..536bbf8352 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/ignored_members/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/ignored_members/generated/0.4.11-success.yml @@ -8,16 +8,18 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..27 "(, second, , fourth) = rhs;" - OpenParen (Token): "(" # 0..1 - - TupleMembers (Rule): # 1..19 ", second, , fourth" - - TupleMember (Rule): [] # 1..1 + - TupleDeconstructionElements (Rule): # 1..19 ", second, , fourth" + - TupleDeconstructionElement (Rule): [] # 1..1 - Comma (Token): "," # 1..2 - - TupleMember (Rule): # 2..9 " second" - - Identifier (Token): "second" # 3..9 + - TupleDeconstructionElement (Rule): # 2..9 " second" + - UntypedTupleMember (Rule): # 2..9 " second" + - Identifier (Token): "second" # 3..9 - Comma (Token): "," # 9..10 - - TupleMember (Rule): [] # 10..10 + - TupleDeconstructionElement (Rule): [] # 10..10 - Comma (Token): "," # 11..12 - - TupleMember (Rule): # 12..19 " fourth" - - Identifier (Token): "fourth" # 13..19 + - TupleDeconstructionElement (Rule): # 12..19 " fourth" + - UntypedTupleMember (Rule): # 12..19 " fourth" + - Identifier (Token): "fourth" # 13..19 - CloseParen (Token): ")" # 19..20 - Equal (Token): "=" # 21..22 - Expression (Rule): # 22..26 " rhs" diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.4.11-failure.yml index ee97698235..fa9246fa74 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.4.11-failure.yml @@ -19,12 +19,14 @@ Errors: # 1 total Tree: - TupleDeconstructionStatement (Rule): # 0..35 "(a, b) = (123, 135)\n/**/\n{ throw; \n" - OpenParen (Token): "(" # 0..1 - - TupleMembers (Rule): # 1..5 "a, b" - - TupleMember (Rule): # 1..2 "a" - - Identifier (Token): "a" # 1..2 + - TupleDeconstructionElements (Rule): # 1..5 "a, b" + - TupleDeconstructionElement (Rule): # 1..2 "a" + - UntypedTupleMember (Rule): # 1..2 "a" + - Identifier (Token): "a" # 1..2 - Comma (Token): "," # 2..3 - - TupleMember (Rule): # 3..5 " b" - - Identifier (Token): "b" # 4..5 + - TupleDeconstructionElement (Rule): # 3..5 " b" + - UntypedTupleMember (Rule): # 3..5 " b" + - Identifier (Token): "b" # 4..5 - CloseParen (Token): ")" # 5..6 - Equal (Token): "=" # 7..8 - Expression (Rule): # 8..20 " (123, 135)\n" diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.6.2-failure.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.6.2-failure.yml index 4fbdae024d..f66f8099c9 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.6.2-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.6.2-failure.yml @@ -18,12 +18,14 @@ Errors: # 1 total Tree: - TupleDeconstructionStatement (Rule): # 0..35 "(a, b) = (123, 135)\n/**/\n{ throw; \n" - OpenParen (Token): "(" # 0..1 - - TupleMembers (Rule): # 1..5 "a, b" - - TupleMember (Rule): # 1..2 "a" - - Identifier (Token): "a" # 1..2 + - TupleDeconstructionElements (Rule): # 1..5 "a, b" + - TupleDeconstructionElement (Rule): # 1..2 "a" + - UntypedTupleMember (Rule): # 1..2 "a" + - Identifier (Token): "a" # 1..2 - Comma (Token): "," # 2..3 - - TupleMember (Rule): # 3..5 " b" - - Identifier (Token): "b" # 4..5 + - TupleDeconstructionElement (Rule): # 3..5 " b" + - UntypedTupleMember (Rule): # 3..5 " b" + - Identifier (Token): "b" # 4..5 - CloseParen (Token): ")" # 5..6 - Equal (Token): "=" # 7..8 - Expression (Rule): # 8..26 " (123, 135)\n/**/\n{" diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_location/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_location/generated/0.4.11-success.yml index 5db0e5c0ed..3b9178e9ff 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_location/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_location/generated/0.4.11-success.yml @@ -8,13 +8,15 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..47 "(memory with_location, without_location) = rhs;" - OpenParen (Token): "(" # 0..1 - - TupleMembers (Rule): # 1..39 "memory with_location, without_location" - - TupleMember (Rule): # 1..21 "memory with_location" - - MemoryKeyword (Token): "memory" # 1..7 - - Identifier (Token): "with_location" # 8..21 + - TupleDeconstructionElements (Rule): # 1..39 "memory with_location, without_location" + - TupleDeconstructionElement (Rule): # 1..21 "memory with_location" + - UntypedTupleMember (Rule): # 1..21 "memory with_location" + - MemoryKeyword (Token): "memory" # 1..7 + - Identifier (Token): "with_location" # 8..21 - Comma (Token): "," # 21..22 - - TupleMember (Rule): # 22..39 " without_location" - - Identifier (Token): "without_location" # 23..39 + - TupleDeconstructionElement (Rule): # 22..39 " without_location" + - UntypedTupleMember (Rule): # 22..39 " without_location" + - Identifier (Token): "without_location" # 23..39 - CloseParen (Token): ")" # 39..40 - Equal (Token): "=" # 41..42 - Expression (Rule): # 42..46 " rhs" diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type/generated/0.4.11-success.yml index 902d7609e6..f195ebfec9 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type/generated/0.4.11-success.yml @@ -8,14 +8,16 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..37 "(bool with_type, without_type) = rhs;" - OpenParen (Token): "(" # 0..1 - - TupleMembers (Rule): # 1..29 "bool with_type, without_type" - - TupleMember (Rule): # 1..15 "bool with_type" - - TypeName (Rule): # 1..5 "bool" - - BoolKeyword (Token): "bool" # 1..5 - - Identifier (Token): "with_type" # 6..15 + - TupleDeconstructionElements (Rule): # 1..29 "bool with_type, without_type" + - TupleDeconstructionElement (Rule): # 1..15 "bool with_type" + - TypedTupleMember (Rule): # 1..15 "bool with_type" + - TypeName (Rule): # 1..5 "bool" + - BoolKeyword (Token): "bool" # 1..5 + - Identifier (Token): "with_type" # 6..15 - Comma (Token): "," # 15..16 - - TupleMember (Rule): # 16..29 " without_type" - - Identifier (Token): "without_type" # 17..29 + - TupleDeconstructionElement (Rule): # 16..29 " without_type" + - UntypedTupleMember (Rule): # 16..29 " without_type" + - Identifier (Token): "without_type" # 17..29 - CloseParen (Token): ")" # 29..30 - Equal (Token): "=" # 31..32 - Expression (Rule): # 32..36 " rhs" diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type_and_location/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type_and_location/generated/0.4.11-success.yml index f9b8493279..c57efe3e09 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type_and_location/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/with_type_and_location/generated/0.4.11-success.yml @@ -8,18 +8,20 @@ Errors: [] Tree: - TupleDeconstructionStatement (Rule): # 0..38 "(bool memory x, bool storage y) = rhs;" - OpenParen (Token): "(" # 0..1 - - TupleMembers (Rule): # 1..30 "bool memory x, bool storage y" - - TupleMember (Rule): # 1..14 "bool memory x" - - TypeName (Rule): # 1..5 "bool" - - BoolKeyword (Token): "bool" # 1..5 - - MemoryKeyword (Token): "memory" # 6..12 - - Identifier (Token): "x" # 13..14 + - TupleDeconstructionElements (Rule): # 1..30 "bool memory x, bool storage y" + - TupleDeconstructionElement (Rule): # 1..14 "bool memory x" + - TypedTupleMember (Rule): # 1..14 "bool memory x" + - TypeName (Rule): # 1..5 "bool" + - BoolKeyword (Token): "bool" # 1..5 + - MemoryKeyword (Token): "memory" # 6..12 + - Identifier (Token): "x" # 13..14 - Comma (Token): "," # 14..15 - - TupleMember (Rule): # 15..30 " bool storage y" - - TypeName (Rule): # 15..20 " bool" - - BoolKeyword (Token): "bool" # 16..20 - - StorageKeyword (Token): "storage" # 21..28 - - Identifier (Token): "y" # 29..30 + - TupleDeconstructionElement (Rule): # 15..30 " bool storage y" + - TypedTupleMember (Rule): # 15..30 " bool storage y" + - TypeName (Rule): # 15..20 " bool" + - BoolKeyword (Token): "bool" # 16..20 + - StorageKeyword (Token): "storage" # 21..28 + - Identifier (Token): "y" # 29..30 - CloseParen (Token): ")" # 30..31 - Equal (Token): "=" # 32..33 - Expression (Rule): # 33..37 " rhs"