diff --git a/crates/solidity/inputs/language/src/grammar.rs b/crates/solidity/inputs/language/src/grammar.rs index e7323d42f8..2c8208206c 100644 --- a/crates/solidity/inputs/language/src/grammar.rs +++ b/crates/solidity/inputs/language/src/grammar.rs @@ -327,8 +327,7 @@ fn resolve_grammar_element(ident: &Identifier, ctx: &mut ResolveCtx<'_>) -> Gram let thunk = Rc::new(NamedParserThunk { name: ident.to_string().leak(), context: lex_ctx, - // Enums have a single reference per variant, so they should be inlined. - is_inline: matches!(elem.as_ref(), Item::Enum { .. }), + is_inline: false, def: OnceCell::new(), }); ctx.resolved.insert( diff --git a/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs b/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs index 052c0bc81a..f87c025206 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/kinds.rs @@ -19,6 +19,7 @@ use {napi::bindgen_prelude::*, napi_derive::napi}; pub enum ProductionKind { ABICoderPragma, AddressType, + ArgumentsDeclaration, ArrayExpression, ArrayValues, AsciiStringLiterals, @@ -31,14 +32,17 @@ pub enum ProductionKind { CatchClauseError, CatchClauses, ConstantDefinition, + ConstructorAttribute, ConstructorAttributes, ConstructorDefinition, ContinueStatement, ContractDefinition, + ContractMember, ContractMembers, DecimalNumberExpression, DeleteStatement, DoWhileStatement, + ElementaryType, ElseBranch, EmitStatement, EndOfFileTrivia, @@ -52,21 +56,31 @@ pub enum ProductionKind { EventParameter, EventParameters, EventParametersDeclaration, + ExperimentalFeature, ExperimentalPragma, Expression, ExpressionStatement, + FallbackFunctionAttribute, FallbackFunctionAttributes, FallbackFunctionDefinition, ForStatement, + ForStatementCondition, + ForStatementInitialization, + FunctionAttribute, FunctionAttributes, + FunctionBody, + FunctionCallOptions, FunctionDefinition, + FunctionName, FunctionType, + FunctionTypeAttribute, FunctionTypeAttributes, HexNumberExpression, HexStringLiterals, IdentifierPath, IfStatement, ImportAlias, + ImportClause, ImportDeconstruction, ImportDeconstructionSymbol, ImportDeconstructionSymbols, @@ -81,8 +95,11 @@ pub enum ProductionKind { LibraryDefinition, LibraryMembers, MappingKey, + MappingKeyType, MappingType, MappingValue, + MemberAccess, + ModifierAttribute, ModifierAttributes, ModifierDefinition, ModifierInvocation, @@ -93,6 +110,7 @@ pub enum ProductionKind { NamedArgumentsDeclaration, NamedImport, NewExpression, + NumberUnit, OverridePaths, OverridePathsDeclaration, OverrideSpecifier, @@ -102,18 +120,25 @@ pub enum ProductionKind { PathImport, PositionalArguments, PositionalArgumentsDeclaration, + Pragma, PragmaDirective, + ReceiveFunctionAttribute, ReceiveFunctionAttributes, ReceiveFunctionDefinition, ReturnStatement, ReturnsDeclaration, RevertStatement, SourceUnit, + SourceUnitMember, SourceUnitMembers, + StateVariableAttribute, StateVariableAttributes, StateVariableDefinition, StateVariableDefinitionValue, + Statement, Statements, + StorageLocation, + StringExpression, StructDefinition, StructMember, StructMembers, @@ -124,6 +149,7 @@ pub enum ProductionKind { TupleDeconstructionElements, TupleDeconstructionStatement, TupleExpression, + TupleMember, TupleValue, TupleValues, TypeExpression, @@ -131,16 +157,21 @@ pub enum ProductionKind { TypedTupleMember, UncheckedBlock, UnicodeStringLiterals, + UnnamedFunctionAttribute, UnnamedFunctionAttributes, UnnamedFunctionDefinition, UntypedTupleMember, UserDefinedValueTypeDefinition, UsingAlias, + UsingClause, UsingDeconstruction, UsingDeconstructionSymbol, UsingDeconstructionSymbols, UsingDirective, + UsingOperator, + UsingTarget, VariableDeclarationStatement, + VariableDeclarationType, VariableDeclarationValue, VersionPragma, VersionPragmaExpression, @@ -160,11 +191,14 @@ pub enum ProductionKind { YulIdentifierPaths, YulIfStatement, YulLeaveStatement, + YulLiteral, YulParameters, YulParametersDeclaration, YulReturnVariables, YulReturnsDeclaration, + YulStatement, YulStatements, + YulSwitchCase, YulSwitchCases, YulSwitchStatement, YulValueCase, @@ -188,6 +222,7 @@ pub enum ProductionKind { pub enum RuleKind { ABICoderPragma, AddressType, + ArgumentsDeclaration, ArrayExpression, ArrayTypeName, ArrayValues, @@ -203,14 +238,17 @@ pub enum RuleKind { CatchClauses, ConditionalExpression, ConstantDefinition, + ConstructorAttribute, ConstructorAttributes, ConstructorDefinition, ContinueStatement, ContractDefinition, + ContractMember, ContractMembers, DecimalNumberExpression, DeleteStatement, DoWhileStatement, + ElementaryType, ElseBranch, EmitStatement, EndOfFileTrivia, @@ -224,22 +262,32 @@ pub enum RuleKind { EventParameter, EventParameters, EventParametersDeclaration, + ExperimentalFeature, ExperimentalPragma, Expression, ExpressionStatement, + FallbackFunctionAttribute, FallbackFunctionAttributes, FallbackFunctionDefinition, ForStatement, + ForStatementCondition, + ForStatementInitialization, + FunctionAttribute, FunctionAttributes, + FunctionBody, FunctionCallExpression, + FunctionCallOptions, FunctionDefinition, + FunctionName, FunctionType, + FunctionTypeAttribute, FunctionTypeAttributes, HexNumberExpression, HexStringLiterals, IdentifierPath, IfStatement, ImportAlias, + ImportClause, ImportDeconstruction, ImportDeconstructionSymbol, ImportDeconstructionSymbols, @@ -255,9 +303,12 @@ pub enum RuleKind { LibraryDefinition, LibraryMembers, MappingKey, + MappingKeyType, MappingType, MappingValue, + MemberAccess, MemberAccessExpression, + ModifierAttribute, ModifierAttributes, ModifierDefinition, ModifierInvocation, @@ -268,6 +319,7 @@ pub enum RuleKind { NamedArgumentsDeclaration, NamedImport, NewExpression, + NumberUnit, OverridePaths, OverridePathsDeclaration, OverrideSpecifier, @@ -277,18 +329,25 @@ pub enum RuleKind { PathImport, PositionalArguments, PositionalArgumentsDeclaration, + Pragma, PragmaDirective, + ReceiveFunctionAttribute, ReceiveFunctionAttributes, ReceiveFunctionDefinition, ReturnStatement, ReturnsDeclaration, RevertStatement, SourceUnit, + SourceUnitMember, SourceUnitMembers, + StateVariableAttribute, StateVariableAttributes, StateVariableDefinition, StateVariableDefinitionValue, + Statement, Statements, + StorageLocation, + StringExpression, StructDefinition, StructMember, StructMembers, @@ -299,6 +358,7 @@ pub enum RuleKind { TupleDeconstructionElements, TupleDeconstructionStatement, TupleExpression, + TupleMember, TupleValue, TupleValues, TypeExpression, @@ -308,16 +368,21 @@ pub enum RuleKind { UnaryPrefixExpression, UncheckedBlock, UnicodeStringLiterals, + UnnamedFunctionAttribute, UnnamedFunctionAttributes, UnnamedFunctionDefinition, UntypedTupleMember, UserDefinedValueTypeDefinition, UsingAlias, + UsingClause, UsingDeconstruction, UsingDeconstructionSymbol, UsingDeconstructionSymbols, UsingDirective, + UsingOperator, + UsingTarget, VariableDeclarationStatement, + VariableDeclarationType, VariableDeclarationValue, VersionPragma, VersionPragmaBinaryExpression, @@ -340,11 +405,14 @@ pub enum RuleKind { YulIdentifierPaths, YulIfStatement, YulLeaveStatement, + YulLiteral, YulParameters, YulParametersDeclaration, YulReturnVariables, YulReturnsDeclaration, + YulStatement, YulStatements, + YulSwitchCase, YulSwitchCases, YulSwitchStatement, YulValueCase, diff --git a/crates/solidity/outputs/cargo/crate/src/generated/language.rs b/crates/solidity/outputs/cargo/crate/src/generated/language.rs index 183df95f28..4c862493a2 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/language.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/language.rs @@ -227,6 +227,18 @@ impl Language { .with_kind(RuleKind::AddressType) } + #[allow(unused_assignments, unused_parens)] + fn arguments_declaration(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.positional_arguments_declaration(input); + choice.consider(input, result)?; + let result = self.named_arguments_declaration(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ArgumentsDeclaration) + } + #[allow(unused_assignments, unused_parens)] fn array_expression(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -481,37 +493,41 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn constructor_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + fn constructor_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { if self.version_is_at_least_0_4_22 { - OneOrMoreHelper::run(input, |input| { - if self.version_is_at_least_0_4_22 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PublicKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) }) } else { ParserResult::disabled() } + .with_kind(RuleKind::ConstructorAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn constructor_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + if self.version_is_at_least_0_4_22 { + OneOrMoreHelper::run(input, |input| self.constructor_attribute(input)) + } else { + ParserResult::disabled() + } .with_kind(RuleKind::ConstructorAttributes) } @@ -608,51 +624,55 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn contract_members(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.using_directive(input); - choice.consider(input, result)?; - let result = self.function_definition(input); + fn contract_member(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.using_directive(input); + choice.consider(input, result)?; + let result = self.function_definition(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_4_22 { + let result = self.constructor_definition(input); choice.consider(input, result)?; - if self.version_is_at_least_0_4_22 { - let result = self.constructor_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.receive_function_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.fallback_function_definition(input); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_6_0 { - let result = self.unnamed_function_definition(input); - choice.consider(input, result)?; - } - let result = self.modifier_definition(input); + } + if self.version_is_at_least_0_6_0 { + let result = self.receive_function_definition(input); choice.consider(input, result)?; - let result = self.struct_definition(input); + } + if self.version_is_at_least_0_6_0 { + let result = self.fallback_function_definition(input); choice.consider(input, result)?; - let result = self.enum_definition(input); + } + if !self.version_is_at_least_0_6_0 { + let result = self.unnamed_function_definition(input); choice.consider(input, result)?; - let result = self.event_definition(input); + } + let result = self.modifier_definition(input); + choice.consider(input, result)?; + let result = self.struct_definition(input); + choice.consider(input, result)?; + let result = self.enum_definition(input); + choice.consider(input, result)?; + let result = self.event_definition(input); + choice.consider(input, result)?; + let result = self.state_variable_definition(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_8_4 { + let result = self.error_definition(input); choice.consider(input, result)?; - let result = self.state_variable_definition(input); + } + if self.version_is_at_least_0_8_8 { + let result = self.user_defined_value_type_definition(input); choice.consider(input, result)?; - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) + } + choice.finish(input) }) - .with_kind(RuleKind::ContractMembers) + .with_kind(RuleKind::ContractMember) + } + + #[allow(unused_assignments, unused_parens)] + fn contract_members(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.contract_member(input)) + .with_kind(RuleKind::ContractMembers) } #[allow(unused_assignments, unused_parens)] @@ -662,75 +682,7 @@ impl Language { input, TokenKind::DecimalLiteral, ))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::WeiKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_6_11 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::GweiKeyword, - ); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_7_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::SzaboKeyword, - ); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_7_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::FinneyKeyword, - ); - choice.consider(input, result)?; - } - let result = self.parse_token_with_trivia::( - input, - TokenKind::EtherKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::SecondsKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::MinutesKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::HoursKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::DaysKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::WeeksKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::YearsKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; + seq.elem(OptionalHelper::transform(self.number_unit(input)))?; seq.finish() }) .with_kind(RuleKind::DecimalNumberExpression) @@ -773,55 +725,7 @@ impl Language { input, TokenKind::DoKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - let result = self.if_statement(input); - choice.consider(input, result)?; - let result = self.for_statement(input); - choice.consider(input, result)?; - let result = self.while_statement(input); - choice.consider(input, result)?; - let result = self.do_while_statement(input); - choice.consider(input, result)?; - let result = self.continue_statement(input); - choice.consider(input, result)?; - let result = self.break_statement(input); - choice.consider(input, result)?; - let result = self.delete_statement(input); - choice.consider(input, result)?; - let result = self.return_statement(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.throw_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_4_21 { - let result = self.emit_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.try_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.revert_statement(input); - choice.consider(input, result)?; - } - let result = self.assembly_statement(input); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_0 { - let result = self.unchecked_block(input); - choice.consider(input, result)?; - } - choice.finish(input) - }))?; + seq.elem(self.statement(input))?; seq.elem(self.parse_token_with_trivia::( input, TokenKind::WhileKeyword, @@ -866,6 +770,63 @@ impl Language { .with_kind(RuleKind::DoWhileStatement) } + #[allow(unused_assignments, unused_parens)] + fn elementary_type(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::BoolKeyword, + ); + choice.consider(input, result)?; + if !self.version_is_at_least_0_8_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::ByteKeyword, + ); + choice.consider(input, result)?; + } + let result = self.parse_token_with_trivia::( + input, + TokenKind::StringKeyword, + ); + choice.consider(input, result)?; + let result = self.address_type(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BytesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::IntKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UintKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FixedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UfixedKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ElementaryType) + } + #[allow(unused_assignments, unused_parens)] fn else_branch(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -873,55 +834,7 @@ impl Language { input, TokenKind::ElseKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - let result = self.if_statement(input); - choice.consider(input, result)?; - let result = self.for_statement(input); - choice.consider(input, result)?; - let result = self.while_statement(input); - choice.consider(input, result)?; - let result = self.do_while_statement(input); - choice.consider(input, result)?; - let result = self.continue_statement(input); - choice.consider(input, result)?; - let result = self.break_statement(input); - choice.consider(input, result)?; - let result = self.delete_statement(input); - choice.consider(input, result)?; - let result = self.return_statement(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.throw_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_4_21 { - let result = self.emit_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.try_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.revert_statement(input); - choice.consider(input, result)?; - } - let result = self.assembly_statement(input); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_0 { - let result = self.unchecked_block(input); - choice.consider(input, result)?; - } - choice.finish(input) - }))?; + seq.elem(self.statement(input))?; seq.finish() }) .with_kind(RuleKind::ElseBranch) @@ -938,13 +851,7 @@ impl Language { TokenKind::EmitKeyword, ))?; seq.elem(self.identifier_path(input))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.positional_arguments_declaration(input); - choice.consider(input, result)?; - let result = self.named_arguments_declaration(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.arguments_declaration(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -1242,6 +1149,24 @@ impl Language { .with_kind(RuleKind::EventParametersDeclaration) } + #[allow(unused_assignments, unused_parens)] + fn experimental_feature(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ExperimentalFeature) + } + #[allow(unused_assignments, unused_parens)] fn experimental_pragma(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -1249,19 +1174,7 @@ impl Language { input, TokenKind::ExperimentalKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.experimental_feature(input))?; seq.finish() }) .with_kind(RuleKind::ExperimentalPragma) @@ -2913,33 +2826,9 @@ impl Language { 85u8, SequenceHelper::run(|mut seq| { if self.version_is_at_least_0_6_2 { - seq.elem(OptionalHelper::transform( - if self.version_is_at_least_0_6_2 { - ChoiceHelper::run(input, |mut choice, input| { - if self.version_is_at_least_0_6_2 - && !self.version_is_at_least_0_8_0 - { - let result = self.named_argument_groups(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_0 { - let result = self.named_argument_group(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) - } else { - ParserResult::disabled() - }, - ))?; + seq.elem(OptionalHelper::transform(self.function_call_options(input)))?; } - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.positional_arguments_declaration(input); - choice.consider(input, result)?; - let result = self.named_arguments_declaration(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.arguments_declaration(input))?; seq.finish() }), ) @@ -2954,19 +2843,7 @@ impl Language { input, TokenKind::Period, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AddressKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.member_access(input))?; seq.finish() }), ) @@ -3041,70 +2918,9 @@ impl Language { choice.consider(input, result)?; let result = self.decimal_number_expression(input); choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.hex_string_literals(input); - choice.consider(input, result)?; - let result = self.ascii_string_literals(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_7_0 { - let result = self.unicode_string_literals(input); - choice.consider(input, result)?; - } - choice.finish(input) - }); + let result = self.string_expression(input); choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::BoolKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } - let result = self.parse_token_with_trivia::( - input, - TokenKind::StringKeyword, - ); - choice.consider(input, result)?; - let result = self.address_type(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::BytesKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::IntKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UintKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FixedKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UfixedKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }); + let result = self.elementary_type(input); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, @@ -3274,49 +3090,53 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn fallback_function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + fn fallback_function_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { if self.version_is_at_least_0_6_0 { - OneOrMoreHelper::run(input, |input| { - if self.version_is_at_least_0_6_0 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PureKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ViewKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.override_specifier(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::VirtualKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) }) } else { ParserResult::disabled() } + .with_kind(RuleKind::FallbackFunctionAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn fallback_function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + if self.version_is_at_least_0_6_0 { + OneOrMoreHelper::run(input, |input| self.fallback_function_attribute(input)) + } else { + ParserResult::disabled() + } .with_kind(RuleKind::FallbackFunctionAttributes) } @@ -3333,16 +3153,7 @@ impl Language { self.fallback_function_attributes(input), ))?; seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.block(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.function_body(input))?; seq.finish() }) } else { @@ -3367,32 +3178,8 @@ impl Language { ))?; seq.elem( SequenceHelper::run(|mut seq| { - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.for_statement_initialization(input))?; + seq.elem(self.for_statement_condition(input))?; seq.elem(OptionalHelper::transform(self.expression(input)))?; seq.finish() }) @@ -3409,121 +3196,146 @@ impl Language { ))?; seq.finish() }))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - let result = self.if_statement(input); - choice.consider(input, result)?; - let result = self.for_statement(input); - choice.consider(input, result)?; - let result = self.while_statement(input); - choice.consider(input, result)?; - let result = self.do_while_statement(input); - choice.consider(input, result)?; - let result = self.continue_statement(input); - choice.consider(input, result)?; - let result = self.break_statement(input); - choice.consider(input, result)?; - let result = self.delete_statement(input); - choice.consider(input, result)?; - let result = self.return_statement(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.throw_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_4_21 { - let result = self.emit_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.try_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.revert_statement(input); - choice.consider(input, result)?; - } - let result = self.assembly_statement(input); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_0 { - let result = self.unchecked_block(input); - choice.consider(input, result)?; - } - choice.finish(input) - }))?; + seq.elem(self.statement(input))?; seq.finish() }) .with_kind(RuleKind::ForStatement) } #[allow(unused_assignments, unused_parens)] - fn function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ConstantKeyword, - ); - choice.consider(input, result)?; - } - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PrivateKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PublicKeyword, - ); - choice.consider(input, result)?; + fn for_statement_condition(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.expression_statement(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ForStatementCondition) + } + + #[allow(unused_assignments, unused_parens)] + fn for_statement_initialization(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.expression_statement(input); + choice.consider(input, result)?; + let result = self.variable_declaration_statement(input); + choice.consider(input, result)?; + let result = self.tuple_deconstruction_statement(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ForStatementInitialization) + } + + #[allow(unused_assignments, unused_parens)] + fn function_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.override_specifier(input); + choice.consider(input, result)?; + if !self.version_is_at_least_0_5_0 { let result = self.parse_token_with_trivia::( input, - TokenKind::PureKeyword, + TokenKind::ConstantKeyword, ); choice.consider(input, result)?; + } + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { let result = self.parse_token_with_trivia::( input, - TokenKind::ViewKeyword, + TokenKind::VirtualKeyword, ); choice.consider(input, result)?; - if self.version_is_at_least_0_6_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); + } + choice.finish(input) + }) + .with_kind(RuleKind::FunctionAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.function_attribute(input)) + .with_kind(RuleKind::FunctionAttributes) + } + + #[allow(unused_assignments, unused_parens)] + fn function_body(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.block(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::FunctionBody) + } + + #[allow(unused_assignments, unused_parens)] + fn function_call_options(&self, input: &mut ParserContext<'_>) -> ParserResult { + if self.version_is_at_least_0_6_2 { + ChoiceHelper::run(input, |mut choice, input| { + if self.version_is_at_least_0_6_2 && !self.version_is_at_least_0_8_0 { + let result = self.named_argument_groups(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_0 { + let result = self.named_argument_group(input); choice.consider(input, result)?; } choice.finish(input) }) - }) - .with_kind(RuleKind::FunctionAttributes) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::FunctionCallOptions) } #[allow(unused_assignments, unused_parens)] @@ -3533,42 +3345,39 @@ impl Language { input, TokenKind::FunctionKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FallbackKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ReceiveKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.function_name(input))?; seq.elem(self.parameters_declaration(input))?; seq.elem(OptionalHelper::transform(self.function_attributes(input)))?; seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.block(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.function_body(input))?; seq.finish() }) .with_kind(RuleKind::FunctionDefinition) } + #[allow(unused_assignments, unused_parens)] + fn function_name(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FallbackKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ReceiveKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::FunctionName) + } + #[allow(unused_assignments, unused_parens)] fn function_type(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -3587,48 +3396,52 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn function_type_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PrivateKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PublicKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PureKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ViewKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) + fn function_type_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::FunctionTypeAttributes) + .with_kind(RuleKind::FunctionTypeAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn function_type_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.function_type_attribute(input)) + .with_kind(RuleKind::FunctionTypeAttributes) } #[allow(unused_assignments, unused_parens)] @@ -3639,79 +3452,7 @@ impl Language { TokenKind::HexLiteral, ))?; if !self.version_is_at_least_0_5_0 { - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::WeiKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_6_11 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::GweiKeyword, - ); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_7_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::SzaboKeyword, - ); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_7_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::FinneyKeyword, - ); - choice.consider(input, result)?; - } - let result = self.parse_token_with_trivia::( - input, - TokenKind::EtherKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::SecondsKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::MinutesKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::HoursKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::DaysKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::WeeksKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::YearsKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; + seq.elem(OptionalHelper::transform(self.number_unit(input)))?; } seq.finish() }) @@ -3746,83 +3487,35 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn if_statement(&self, input: &mut ParserContext<'_>) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::IfKeyword, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - self.expression(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - let result = self.if_statement(input); - choice.consider(input, result)?; - let result = self.for_statement(input); - choice.consider(input, result)?; - let result = self.while_statement(input); - choice.consider(input, result)?; - let result = self.do_while_statement(input); - choice.consider(input, result)?; - let result = self.continue_statement(input); - choice.consider(input, result)?; - let result = self.break_statement(input); - choice.consider(input, result)?; - let result = self.delete_statement(input); - choice.consider(input, result)?; - let result = self.return_statement(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.throw_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_4_21 { - let result = self.emit_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.try_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.revert_statement(input); - choice.consider(input, result)?; - } - let result = self.assembly_statement(input); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_0 { - let result = self.unchecked_block(input); - choice.consider(input, result)?; - } - choice.finish(input) + fn if_statement(&self, input: &mut ParserContext<'_>) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::IfKeyword, + ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + self.expression(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() }))?; + seq.elem(self.statement(input))?; seq.elem(OptionalHelper::transform(self.else_branch(input)))?; seq.finish() }) @@ -3845,6 +3538,20 @@ impl Language { .with_kind(RuleKind::ImportAlias) } + #[allow(unused_assignments, unused_parens)] + fn import_clause(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.path_import(input); + choice.consider(input, result)?; + let result = self.named_import(input); + choice.consider(input, result)?; + let result = self.import_deconstruction(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ImportClause) + } + #[allow(unused_assignments, unused_parens)] fn import_deconstruction(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -3916,15 +3623,7 @@ impl Language { input, TokenKind::ImportKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.path_import(input); - choice.consider(input, result)?; - let result = self.named_import(input); - choice.consider(input, result)?; - let result = self.import_deconstruction(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.import_clause(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -3975,16 +3674,7 @@ impl Language { fn inheritance_type(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.identifier_path(input))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.positional_arguments_declaration(input); - choice.consider(input, result)?; - let result = self.named_arguments_declaration(input); - choice.consider(input, result)?; - choice.finish(input) - }, - )))?; + seq.elem(OptionalHelper::transform(self.arguments_declaration(input)))?; seq.finish() }) .with_kind(RuleKind::InheritanceType) @@ -4042,50 +3732,8 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn interface_members(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.using_directive(input); - choice.consider(input, result)?; - let result = self.function_definition(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_4_22 { - let result = self.constructor_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.receive_function_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.fallback_function_definition(input); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_6_0 { - let result = self.unnamed_function_definition(input); - choice.consider(input, result)?; - } - let result = self.modifier_definition(input); - choice.consider(input, result)?; - let result = self.struct_definition(input); - choice.consider(input, result)?; - let result = self.enum_definition(input); - choice.consider(input, result)?; - let result = self.event_definition(input); - choice.consider(input, result)?; - let result = self.state_variable_definition(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) - }) - .with_kind(RuleKind::InterfaceMembers) + OneOrMoreHelper::run(input, |input| self.contract_member(input)) + .with_kind(RuleKind::InterfaceMembers) } #[allow(unused_assignments, unused_parens)] @@ -4152,113 +3800,14 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn library_members(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.using_directive(input); - choice.consider(input, result)?; - let result = self.function_definition(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_4_22 { - let result = self.constructor_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.receive_function_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.fallback_function_definition(input); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_6_0 { - let result = self.unnamed_function_definition(input); - choice.consider(input, result)?; - } - let result = self.modifier_definition(input); - choice.consider(input, result)?; - let result = self.struct_definition(input); - choice.consider(input, result)?; - let result = self.enum_definition(input); - choice.consider(input, result)?; - let result = self.event_definition(input); - choice.consider(input, result)?; - let result = self.state_variable_definition(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) - }) - .with_kind(RuleKind::LibraryMembers) + OneOrMoreHelper::run(input, |input| self.contract_member(input)) + .with_kind(RuleKind::LibraryMembers) } #[allow(unused_assignments, unused_parens)] fn mapping_key(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::BoolKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } - let result = self.parse_token_with_trivia::( - input, - TokenKind::StringKeyword, - ); - choice.consider(input, result)?; - let result = self.address_type(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::BytesKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::IntKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UintKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FixedKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UfixedKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - let result = self.identifier_path(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.mapping_key_type(input))?; if self.version_is_at_least_0_8_18 { seq.elem(OptionalHelper::transform( self.parse_token_with_trivia::( @@ -4272,6 +3821,18 @@ impl Language { .with_kind(RuleKind::MappingKey) } + #[allow(unused_assignments, unused_parens)] + fn mapping_key_type(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.elementary_type(input); + choice.consider(input, result)?; + let result = self.identifier_path(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::MappingKeyType) + } + #[allow(unused_assignments, unused_parens)] fn mapping_type(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -4332,22 +3893,44 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn modifier_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.override_specifier(input); + fn member_access(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AddressKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::MemberAccess) + } + + #[allow(unused_assignments, unused_parens)] + fn modifier_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.override_specifier(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::VirtualKeyword, + ); choice.consider(input, result)?; - if self.version_is_at_least_0_6_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }) + } + choice.finish(input) }) - .with_kind(RuleKind::ModifierAttributes) + .with_kind(RuleKind::ModifierAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn modifier_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.modifier_attribute(input)) + .with_kind(RuleKind::ModifierAttributes) } #[allow(unused_assignments, unused_parens)] @@ -4365,16 +3948,7 @@ impl Language { self.parameters_declaration(input), ))?; seq.elem(OptionalHelper::transform(self.modifier_attributes(input)))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.block(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.function_body(input))?; seq.finish() }) .with_kind(RuleKind::ModifierDefinition) @@ -4384,16 +3958,7 @@ impl Language { fn modifier_invocation(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.identifier_path(input))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.positional_arguments_declaration(input); - choice.consider(input, result)?; - let result = self.named_arguments_declaration(input); - choice.consider(input, result)?; - choice.finish(input) - }, - )))?; + seq.elem(OptionalHelper::transform(self.arguments_declaration(input)))?; seq.finish() }) .with_kind(RuleKind::ModifierInvocation) @@ -4498,33 +4063,104 @@ impl Language { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Asterisk, - ))?; - seq.elem(self.import_alias(input))?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::Asterisk, + ))?; + seq.elem(self.import_alias(input))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::FromKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, + ))?; + seq.finish() + }) + .with_kind(RuleKind::NamedImport) + } + + #[allow(unused_assignments, unused_parens)] + fn new_expression(&self, input: &mut ParserContext<'_>) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::NewKeyword, + ))?; + seq.elem(self.type_name(input))?; + seq.finish() + }) + .with_kind(RuleKind::NewExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn number_unit(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::WeiKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_11 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::GweiKeyword, + ); + choice.consider(input, result)?; + } + if !self.version_is_at_least_0_7_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::SzaboKeyword, + ); + choice.consider(input, result)?; + } + if !self.version_is_at_least_0_7_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::FinneyKeyword, + ); + choice.consider(input, result)?; + } + let result = self.parse_token_with_trivia::( + input, + TokenKind::EtherKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SecondsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinutesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::FromKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::HoursKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::AsciiStringLiteral, - ))?; - seq.finish() - }) - .with_kind(RuleKind::NamedImport) - } - - #[allow(unused_assignments, unused_parens)] - fn new_expression(&self, input: &mut ParserContext<'_>) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + TokenKind::DaysKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::NewKeyword, - ))?; - seq.elem(self.type_name(input))?; - seq.finish() + TokenKind::WeeksKeyword, + ); + choice.consider(input, result)?; + if !self.version_is_at_least_0_5_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::YearsKeyword, + ); + choice.consider(input, result)?; + } + choice.finish(input) }) - .with_kind(RuleKind::NewExpression) + .with_kind(RuleKind::NumberUnit) } #[allow(unused_assignments, unused_parens)] @@ -4584,29 +4220,7 @@ impl Language { fn parameter(&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(OptionalHelper::transform(self.storage_location(input)))?; seq.elem(OptionalHelper::transform( self.parse_token_with_trivia::( input, @@ -4707,6 +4321,20 @@ impl Language { .with_kind(RuleKind::PositionalArgumentsDeclaration) } + #[allow(unused_assignments, unused_parens)] + fn pragma(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.abi_coder_pragma(input); + choice.consider(input, result)?; + let result = self.experimental_pragma(input); + choice.consider(input, result)?; + let result = self.version_pragma(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::Pragma) + } + #[allow(unused_assignments, unused_parens)] fn pragma_directive(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -4716,15 +4344,7 @@ impl Language { input, TokenKind::PragmaKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.abi_coder_pragma(input); - choice.consider(input, result)?; - let result = self.experimental_pragma(input); - choice.consider(input, result)?; - let result = self.version_pragma(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.pragma(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Pragma>( @@ -4744,39 +4364,43 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn receive_function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + fn receive_function_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { if self.version_is_at_least_0_6_0 { - OneOrMoreHelper::run(input, |input| { - if self.version_is_at_least_0_6_0 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.override_specifier(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::VirtualKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) }) } else { ParserResult::disabled() } + .with_kind(RuleKind::ReceiveFunctionAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn receive_function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + if self.version_is_at_least_0_6_0 { + OneOrMoreHelper::run(input, |input| self.receive_function_attribute(input)) + } else { + ParserResult::disabled() + } .with_kind(RuleKind::ReceiveFunctionAttributes) } @@ -4792,16 +4416,7 @@ impl Language { seq.elem(OptionalHelper::transform( self.receive_function_attributes(input), ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.block(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.function_body(input))?; seq.finish() }) } else { @@ -4862,13 +4477,7 @@ impl Language { TokenKind::RevertKeyword, ))?; seq.elem(OptionalHelper::transform(self.identifier_path(input)))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.positional_arguments_declaration(input); - choice.consider(input, result)?; - let result = self.named_arguments_declaration(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.arguments_declaration(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -4901,94 +4510,102 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn source_unit_members(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.pragma_directive(input); + fn source_unit_member(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.pragma_directive(input); + choice.consider(input, result)?; + let result = self.import_directive(input); + choice.consider(input, result)?; + let result = self.contract_definition(input); + choice.consider(input, result)?; + let result = self.interface_definition(input); + choice.consider(input, result)?; + let result = self.library_definition(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { + let result = self.struct_definition(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_6_0 { + let result = self.enum_definition(input); choice.consider(input, result)?; - let result = self.import_directive(input); + } + if self.version_is_at_least_0_7_1 { + let result = self.function_definition(input); choice.consider(input, result)?; - let result = self.contract_definition(input); + } + if self.version_is_at_least_0_7_4 { + let result = self.constant_definition(input); choice.consider(input, result)?; - let result = self.interface_definition(input); + } + if self.version_is_at_least_0_8_4 { + let result = self.error_definition(input); choice.consider(input, result)?; - let result = self.library_definition(input); + } + if self.version_is_at_least_0_8_8 { + let result = self.user_defined_value_type_definition(input); choice.consider(input, result)?; - if self.version_is_at_least_0_6_0 { - let result = self.struct_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.enum_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_7_1 { - let result = self.function_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_7_4 { - let result = self.constant_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_13 { - let result = self.using_directive(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_22 { - let result = self.event_definition(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) + } + if self.version_is_at_least_0_8_13 { + let result = self.using_directive(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_22 { + let result = self.event_definition(input); + choice.consider(input, result)?; + } + choice.finish(input) }) - .with_kind(RuleKind::SourceUnitMembers) + .with_kind(RuleKind::SourceUnitMember) } #[allow(unused_assignments, unused_parens)] - fn state_variable_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ConstantKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PrivateKeyword, - ); - choice.consider(input, result)?; + fn source_unit_members(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.source_unit_member(input)) + .with_kind(RuleKind::SourceUnitMembers) + } + + #[allow(unused_assignments, unused_parens)] + fn state_variable_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.override_specifier(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ConstantKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_5 { let result = self.parse_token_with_trivia::( input, - TokenKind::PublicKeyword, + TokenKind::ImmutableKeyword, ); choice.consider(input, result)?; - if self.version_is_at_least_0_6_5 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ImmutableKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }) + } + choice.finish(input) }) - .with_kind(RuleKind::StateVariableAttributes) + .with_kind(RuleKind::StateVariableAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn state_variable_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.state_variable_attribute(input)) + .with_kind(RuleKind::StateVariableAttributes) } #[allow(unused_assignments, unused_parens)] @@ -5037,63 +4654,107 @@ impl Language { seq.elem(self.expression(input))?; seq.finish() }) - .with_kind(RuleKind::StateVariableDefinitionValue) + .with_kind(RuleKind::StateVariableDefinitionValue) + } + + #[allow(unused_assignments, unused_parens)] + fn statement(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.expression_statement(input); + choice.consider(input, result)?; + let result = self.variable_declaration_statement(input); + choice.consider(input, result)?; + let result = self.tuple_deconstruction_statement(input); + choice.consider(input, result)?; + let result = self.if_statement(input); + choice.consider(input, result)?; + let result = self.for_statement(input); + choice.consider(input, result)?; + let result = self.while_statement(input); + choice.consider(input, result)?; + let result = self.do_while_statement(input); + choice.consider(input, result)?; + let result = self.continue_statement(input); + choice.consider(input, result)?; + let result = self.break_statement(input); + choice.consider(input, result)?; + let result = self.delete_statement(input); + choice.consider(input, result)?; + let result = self.return_statement(input); + choice.consider(input, result)?; + if !self.version_is_at_least_0_5_0 { + let result = self.throw_statement(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_4_21 { + let result = self.emit_statement(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_6_0 { + let result = self.try_statement(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_4 { + let result = self.revert_statement(input); + choice.consider(input, result)?; + } + let result = self.assembly_statement(input); + choice.consider(input, result)?; + let result = self.block(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_8_0 { + let result = self.unchecked_block(input); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::Statement) + } + + #[allow(unused_assignments, unused_parens)] + fn statements(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.statement(input)).with_kind(RuleKind::Statements) + } + + #[allow(unused_assignments, unused_parens)] + fn storage_location(&self, input: &mut ParserContext<'_>) -> ParserResult { + 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) + }) + .with_kind(RuleKind::StorageLocation) } #[allow(unused_assignments, unused_parens)] - fn statements(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - let result = self.if_statement(input); - choice.consider(input, result)?; - let result = self.for_statement(input); - choice.consider(input, result)?; - let result = self.while_statement(input); - choice.consider(input, result)?; - let result = self.do_while_statement(input); - choice.consider(input, result)?; - let result = self.continue_statement(input); - choice.consider(input, result)?; - let result = self.break_statement(input); - choice.consider(input, result)?; - let result = self.delete_statement(input); - choice.consider(input, result)?; - let result = self.return_statement(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.throw_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_4_21 { - let result = self.emit_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.try_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.revert_statement(input); - choice.consider(input, result)?; - } - let result = self.assembly_statement(input); - choice.consider(input, result)?; - let result = self.block(input); + fn string_expression(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.hex_string_literals(input); + choice.consider(input, result)?; + let result = self.ascii_string_literals(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_7_0 { + let result = self.unicode_string_literals(input); choice.consider(input, result)?; - if self.version_is_at_least_0_8_0 { - let result = self.unchecked_block(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) + } + choice.finish(input) }) - .with_kind(RuleKind::Statements) + .with_kind(RuleKind::StringExpression) } #[allow(unused_assignments, unused_parens)] @@ -5236,14 +4897,8 @@ impl Language { #[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) + OptionalHelper::transform(self.tuple_member(input)) + .with_kind(RuleKind::TupleDeconstructionElement) } #[allow(unused_assignments, unused_parens)] @@ -5334,6 +4989,18 @@ impl Language { .with_kind(RuleKind::TupleExpression) } + #[allow(unused_assignments, unused_parens)] + fn tuple_member(&self, input: &mut ParserContext<'_>) -> ParserResult { + 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::TupleMember) + } + #[allow(unused_assignments, unused_parens)] fn tuple_value(&self, input: &mut ParserContext<'_>) -> ParserResult { OptionalHelper::transform(self.expression(input)).with_kind(RuleKind::TupleValue) @@ -5426,58 +5093,7 @@ impl Language { choice.consider(input, result)?; let result = self.mapping_type(input); choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::BoolKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } - let result = self.parse_token_with_trivia::( - input, - TokenKind::StringKeyword, - ); - choice.consider(input, result)?; - let result = self.address_type(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::BytesKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::IntKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UintKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FixedKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UfixedKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }); + let result = self.elementary_type(input); choice.consider(input, result)?; let result = self.identifier_path(input); choice.consider(input, result)?; @@ -5513,29 +5129,7 @@ impl Language { 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(OptionalHelper::transform(self.storage_location(input)))?; seq.elem(self.parse_token_with_trivia::( input, TokenKind::Identifier, @@ -5578,44 +5172,48 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn unnamed_function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + fn unnamed_function_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { if !self.version_is_at_least_0_6_0 { - OneOrMoreHelper::run(input, |input| { - if !self.version_is_at_least_0_6_0 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PureKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ViewKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.override_specifier(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) }) } else { ParserResult::disabled() } + .with_kind(RuleKind::UnnamedFunctionAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn unnamed_function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + if !self.version_is_at_least_0_6_0 { + OneOrMoreHelper::run(input, |input| self.unnamed_function_attribute(input)) + } else { + ParserResult::disabled() + } .with_kind(RuleKind::UnnamedFunctionAttributes) } @@ -5631,16 +5229,7 @@ impl Language { seq.elem(OptionalHelper::transform( self.unnamed_function_attributes(input), ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.block(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.function_body(input))?; seq.finish() }) } else { @@ -5652,29 +5241,7 @@ impl Language { #[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(OptionalHelper::transform(self.storage_location(input)))?; seq.elem(self.parse_token_with_trivia::( input, TokenKind::Identifier, @@ -5702,67 +5269,7 @@ impl Language { input, TokenKind::IsKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::BoolKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } - let result = self - .parse_token_with_trivia::( - input, - TokenKind::StringKeyword, - ); - choice.consider(input, result)?; - let result = self.address_type(input); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::BytesKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::IntKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::UintKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::FixedKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::UfixedKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.elementary_type(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -5792,88 +5299,7 @@ impl Language { input, TokenKind::AsKeyword, ))?; - seq.elem(if self.version_is_at_least_0_8_19 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Ampersand, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Asterisk, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::BangEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Bar, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Caret, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::EqualEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThanEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::LessThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::LessThanEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Minus, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Percent, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Plus, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Slash, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Tilde, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - })?; + seq.elem(self.using_operator(input))?; seq.finish() }) } else { @@ -5882,6 +5308,20 @@ impl Language { .with_kind(RuleKind::UsingAlias) } + #[allow(unused_assignments, unused_parens)] + fn using_clause(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.identifier_path(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_8_13 { + let result = self.using_deconstruction(input); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::UsingClause) + } + #[allow(unused_assignments, unused_parens)] fn using_deconstruction(&self, input: &mut ParserContext<'_>) -> ParserResult { if self.version_is_at_least_0_8_13 { @@ -5953,29 +5393,12 @@ impl Language { input, TokenKind::UsingKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.identifier_path(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_13 { - let result = self.using_deconstruction(input); - choice.consider(input, result)?; - } - choice.finish(input) - }))?; + seq.elem(self.using_clause(input))?; seq.elem(self.parse_token_with_trivia::( input, TokenKind::ForKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.type_name(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Asterisk, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.using_target(input))?; if self.version_is_at_least_0_8_13 { seq.elem(OptionalHelper::transform( self.parse_token_with_trivia::( @@ -6002,50 +5425,109 @@ impl Language { .with_kind(RuleKind::UsingDirective) } + #[allow(unused_assignments, unused_parens)] + fn using_operator(&self, input: &mut ParserContext<'_>) -> ParserResult { + if self.version_is_at_least_0_8_19 { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Ampersand, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Asterisk, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BangEqual, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::Bar); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Caret, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::EqualEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Minus, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Percent, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::Plus); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Slash, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Tilde, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UsingOperator) + } + + #[allow(unused_assignments, unused_parens)] + fn using_target(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.type_name(input); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::Asterisk); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::UsingTarget) + } + #[allow(unused_assignments, unused_parens)] fn variable_declaration_statement(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem( SequenceHelper::run(|mut seq| { - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.type_name(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::VarKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(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.variable_declaration_type(input))?; + seq.elem(OptionalHelper::transform(self.storage_location(input)))?; seq.elem(self.parse_token_with_trivia::( input, TokenKind::Identifier, @@ -6071,6 +5553,23 @@ impl Language { .with_kind(RuleKind::VariableDeclarationStatement) } + #[allow(unused_assignments, unused_parens)] + fn variable_declaration_type(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.type_name(input); + choice.consider(input, result)?; + if !self.version_is_at_least_0_5_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::VarKeyword, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::VariableDeclarationType) + } + #[allow(unused_assignments, unused_parens)] fn variable_declaration_value(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -6552,55 +6051,7 @@ impl Language { ))?; seq.finish() }))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - let result = self.if_statement(input); - choice.consider(input, result)?; - let result = self.for_statement(input); - choice.consider(input, result)?; - let result = self.while_statement(input); - choice.consider(input, result)?; - let result = self.do_while_statement(input); - choice.consider(input, result)?; - let result = self.continue_statement(input); - choice.consider(input, result)?; - let result = self.break_statement(input); - choice.consider(input, result)?; - let result = self.delete_statement(input); - choice.consider(input, result)?; - let result = self.return_statement(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.throw_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_4_21 { - let result = self.emit_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.try_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.revert_statement(input); - choice.consider(input, result)?; - } - let result = self.assembly_statement(input); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_0 { - let result = self.unchecked_block(input); - choice.consider(input, result)?; - } - choice.finish(input) - }))?; + seq.elem(self.statement(input))?; seq.finish() }) .with_kind(RuleKind::WhileStatement) @@ -6726,39 +6177,7 @@ impl Language { #[allow(unused_variables)] let primary_expression_parser = |input: &mut ParserContext<'_>| { ChoiceHelper::run(input, |mut choice, input| { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulTrueKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulFalseKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulDecimalLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulHexLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::HexStringLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, - ); - choice.consider(input, result)?; - choice.finish(input) - }); + let result = self.yul_literal(input); choice.consider(input, result)?; let result = self.yul_identifier_path(input); choice.consider(input, result)?; @@ -6881,6 +6300,44 @@ impl Language { .with_kind(RuleKind::YulLeaveStatement) } + #[allow(unused_assignments, unused_parens)] + fn yul_literal(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulTrueKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFalseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulDecimalLiteral, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulHexLiteral, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::HexStringLiteral, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::YulLiteral) + } + #[allow(unused_assignments, unused_parens)] fn yul_parameters(&self, input: &mut ParserContext<'_>) -> ParserResult { SeparatedHelper::run::<_, LexicalContextType::Yul>( @@ -6958,51 +6415,59 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn yul_statements(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.yul_block(input); - choice.consider(input, result)?; - let result = self.yul_function_definition(input); - choice.consider(input, result)?; - let result = self.yul_variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.yul_assignment_statement(input); - choice.consider(input, result)?; - let result = self.yul_if_statement(input); - choice.consider(input, result)?; - let result = self.yul_for_statement(input); - choice.consider(input, result)?; - let result = self.yul_switch_statement(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_6_0 { - let result = self.yul_leave_statement(input); - choice.consider(input, result)?; - } - let result = self.yul_break_statement(input); - choice.consider(input, result)?; - let result = self.yul_continue_statement(input); - choice.consider(input, result)?; - let result = self.yul_expression(input); + fn yul_statement(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.yul_block(input); + choice.consider(input, result)?; + let result = self.yul_function_definition(input); + choice.consider(input, result)?; + let result = self.yul_variable_declaration_statement(input); + choice.consider(input, result)?; + let result = self.yul_assignment_statement(input); + choice.consider(input, result)?; + let result = self.yul_if_statement(input); + choice.consider(input, result)?; + let result = self.yul_for_statement(input); + choice.consider(input, result)?; + let result = self.yul_switch_statement(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { + let result = self.yul_leave_statement(input); choice.consider(input, result)?; - choice.finish(input) - }) + } + let result = self.yul_break_statement(input); + choice.consider(input, result)?; + let result = self.yul_continue_statement(input); + choice.consider(input, result)?; + let result = self.yul_expression(input); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::YulStatements) + .with_kind(RuleKind::YulStatement) } #[allow(unused_assignments, unused_parens)] - fn yul_switch_cases(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.yul_default_case(input); - choice.consider(input, result)?; - let result = self.yul_value_case(input); - choice.consider(input, result)?; - choice.finish(input) - }) + fn yul_statements(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.yul_statement(input)) + .with_kind(RuleKind::YulStatements) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_switch_case(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.yul_default_case(input); + choice.consider(input, result)?; + let result = self.yul_value_case(input); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::YulSwitchCases) + .with_kind(RuleKind::YulSwitchCase) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_switch_cases(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.yul_switch_case(input)) + .with_kind(RuleKind::YulSwitchCases) } #[allow(unused_assignments, unused_parens)] @@ -7026,39 +6491,7 @@ impl Language { input, TokenKind::YulCaseKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulTrueKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulFalseKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulDecimalLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulHexLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::HexStringLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.yul_literal(input))?; seq.elem(self.yul_block(input))?; seq.finish() }) @@ -8998,6 +8431,7 @@ impl Language { match production_kind { ProductionKind::ABICoderPragma => Self::abi_coder_pragma.parse(self, input), ProductionKind::AddressType => Self::address_type.parse(self, input), + ProductionKind::ArgumentsDeclaration => Self::arguments_declaration.parse(self, input), ProductionKind::ArrayExpression => Self::array_expression.parse(self, input), ProductionKind::ArrayValues => Self::array_values.parse(self, input), ProductionKind::AsciiStringLiterals => Self::ascii_string_literals.parse(self, input), @@ -9012,6 +8446,7 @@ impl Language { ProductionKind::CatchClauseError => Self::catch_clause_error.parse(self, input), ProductionKind::CatchClauses => Self::catch_clauses.parse(self, input), ProductionKind::ConstantDefinition => Self::constant_definition.parse(self, input), + ProductionKind::ConstructorAttribute => Self::constructor_attribute.parse(self, input), ProductionKind::ConstructorAttributes => { Self::constructor_attributes.parse(self, input) } @@ -9020,12 +8455,14 @@ impl Language { } ProductionKind::ContinueStatement => Self::continue_statement.parse(self, input), ProductionKind::ContractDefinition => Self::contract_definition.parse(self, input), + ProductionKind::ContractMember => Self::contract_member.parse(self, input), ProductionKind::ContractMembers => Self::contract_members.parse(self, input), ProductionKind::DecimalNumberExpression => { Self::decimal_number_expression.parse(self, input) } ProductionKind::DeleteStatement => Self::delete_statement.parse(self, input), ProductionKind::DoWhileStatement => Self::do_while_statement.parse(self, input), + ProductionKind::ElementaryType => Self::elementary_type.parse(self, input), ProductionKind::ElseBranch => Self::else_branch.parse(self, input), ProductionKind::EmitStatement => Self::emit_statement.parse(self, input), ProductionKind::EndOfFileTrivia => Self::end_of_file_trivia.parse(self, input), @@ -9043,9 +8480,13 @@ impl Language { ProductionKind::EventParametersDeclaration => { Self::event_parameters_declaration.parse(self, input) } + ProductionKind::ExperimentalFeature => Self::experimental_feature.parse(self, input), ProductionKind::ExperimentalPragma => Self::experimental_pragma.parse(self, input), ProductionKind::Expression => Self::expression.parse(self, input), ProductionKind::ExpressionStatement => Self::expression_statement.parse(self, input), + ProductionKind::FallbackFunctionAttribute => { + Self::fallback_function_attribute.parse(self, input) + } ProductionKind::FallbackFunctionAttributes => { Self::fallback_function_attributes.parse(self, input) } @@ -9053,9 +8494,22 @@ impl Language { Self::fallback_function_definition.parse(self, input) } ProductionKind::ForStatement => Self::for_statement.parse(self, input), + ProductionKind::ForStatementCondition => { + Self::for_statement_condition.parse(self, input) + } + ProductionKind::ForStatementInitialization => { + Self::for_statement_initialization.parse(self, input) + } + ProductionKind::FunctionAttribute => Self::function_attribute.parse(self, input), ProductionKind::FunctionAttributes => Self::function_attributes.parse(self, input), + ProductionKind::FunctionBody => Self::function_body.parse(self, input), + ProductionKind::FunctionCallOptions => Self::function_call_options.parse(self, input), ProductionKind::FunctionDefinition => Self::function_definition.parse(self, input), + ProductionKind::FunctionName => Self::function_name.parse(self, input), ProductionKind::FunctionType => Self::function_type.parse(self, input), + ProductionKind::FunctionTypeAttribute => { + Self::function_type_attribute.parse(self, input) + } ProductionKind::FunctionTypeAttributes => { Self::function_type_attributes.parse(self, input) } @@ -9064,6 +8518,7 @@ impl Language { ProductionKind::IdentifierPath => Self::identifier_path.parse(self, input), ProductionKind::IfStatement => Self::if_statement.parse(self, input), ProductionKind::ImportAlias => Self::import_alias.parse(self, input), + ProductionKind::ImportClause => Self::import_clause.parse(self, input), ProductionKind::ImportDeconstruction => Self::import_deconstruction.parse(self, input), ProductionKind::ImportDeconstructionSymbol => { Self::import_deconstruction_symbol.parse(self, input) @@ -9082,8 +8537,11 @@ impl Language { ProductionKind::LibraryDefinition => Self::library_definition.parse(self, input), ProductionKind::LibraryMembers => Self::library_members.parse(self, input), ProductionKind::MappingKey => Self::mapping_key.parse(self, input), + ProductionKind::MappingKeyType => Self::mapping_key_type.parse(self, input), ProductionKind::MappingType => Self::mapping_type.parse(self, input), ProductionKind::MappingValue => Self::mapping_value.parse(self, input), + ProductionKind::MemberAccess => Self::member_access.parse(self, input), + ProductionKind::ModifierAttribute => Self::modifier_attribute.parse(self, input), ProductionKind::ModifierAttributes => Self::modifier_attributes.parse(self, input), ProductionKind::ModifierDefinition => Self::modifier_definition.parse(self, input), ProductionKind::ModifierInvocation => Self::modifier_invocation.parse(self, input), @@ -9096,6 +8554,7 @@ impl Language { } ProductionKind::NamedImport => Self::named_import.parse(self, input), ProductionKind::NewExpression => Self::new_expression.parse(self, input), + ProductionKind::NumberUnit => Self::number_unit.parse(self, input), ProductionKind::OverridePaths => Self::override_paths.parse(self, input), ProductionKind::OverridePathsDeclaration => { Self::override_paths_declaration.parse(self, input) @@ -9111,7 +8570,11 @@ impl Language { ProductionKind::PositionalArgumentsDeclaration => { Self::positional_arguments_declaration.parse(self, input) } + ProductionKind::Pragma => Self::pragma.parse(self, input), ProductionKind::PragmaDirective => Self::pragma_directive.parse(self, input), + ProductionKind::ReceiveFunctionAttribute => { + Self::receive_function_attribute.parse(self, input) + } ProductionKind::ReceiveFunctionAttributes => { Self::receive_function_attributes.parse(self, input) } @@ -9122,7 +8585,11 @@ impl Language { ProductionKind::ReturnsDeclaration => Self::returns_declaration.parse(self, input), ProductionKind::RevertStatement => Self::revert_statement.parse(self, input), ProductionKind::SourceUnit => Self::source_unit.parse(self, input), + ProductionKind::SourceUnitMember => Self::source_unit_member.parse(self, input), ProductionKind::SourceUnitMembers => Self::source_unit_members.parse(self, input), + ProductionKind::StateVariableAttribute => { + Self::state_variable_attribute.parse(self, input) + } ProductionKind::StateVariableAttributes => { Self::state_variable_attributes.parse(self, input) } @@ -9132,7 +8599,10 @@ impl Language { ProductionKind::StateVariableDefinitionValue => { Self::state_variable_definition_value.parse(self, input) } + ProductionKind::Statement => Self::statement.parse(self, input), ProductionKind::Statements => Self::statements.parse(self, input), + ProductionKind::StorageLocation => Self::storage_location.parse(self, input), + ProductionKind::StringExpression => Self::string_expression.parse(self, input), ProductionKind::StructDefinition => Self::struct_definition.parse(self, input), ProductionKind::StructMember => Self::struct_member.parse(self, input), ProductionKind::StructMembers => Self::struct_members.parse(self, input), @@ -9149,6 +8619,7 @@ impl Language { Self::tuple_deconstruction_statement.parse(self, input) } ProductionKind::TupleExpression => Self::tuple_expression.parse(self, input), + ProductionKind::TupleMember => Self::tuple_member.parse(self, input), ProductionKind::TupleValue => Self::tuple_value.parse(self, input), ProductionKind::TupleValues => Self::tuple_values.parse(self, input), ProductionKind::TypeExpression => Self::type_expression.parse(self, input), @@ -9158,6 +8629,9 @@ impl Language { ProductionKind::UnicodeStringLiterals => { Self::unicode_string_literals.parse(self, input) } + ProductionKind::UnnamedFunctionAttribute => { + Self::unnamed_function_attribute.parse(self, input) + } ProductionKind::UnnamedFunctionAttributes => { Self::unnamed_function_attributes.parse(self, input) } @@ -9169,6 +8643,7 @@ impl Language { Self::user_defined_value_type_definition.parse(self, input) } ProductionKind::UsingAlias => Self::using_alias.parse(self, input), + ProductionKind::UsingClause => Self::using_clause.parse(self, input), ProductionKind::UsingDeconstruction => Self::using_deconstruction.parse(self, input), ProductionKind::UsingDeconstructionSymbol => { Self::using_deconstruction_symbol.parse(self, input) @@ -9177,9 +8652,14 @@ impl Language { Self::using_deconstruction_symbols.parse(self, input) } ProductionKind::UsingDirective => Self::using_directive.parse(self, input), + ProductionKind::UsingOperator => Self::using_operator.parse(self, input), + ProductionKind::UsingTarget => Self::using_target.parse(self, input), ProductionKind::VariableDeclarationStatement => { Self::variable_declaration_statement.parse(self, input) } + ProductionKind::VariableDeclarationType => { + Self::variable_declaration_type.parse(self, input) + } ProductionKind::VariableDeclarationValue => { Self::variable_declaration_value.parse(self, input) } @@ -9211,6 +8691,7 @@ impl Language { ProductionKind::YulIdentifierPaths => Self::yul_identifier_paths.parse(self, input), ProductionKind::YulIfStatement => Self::yul_if_statement.parse(self, input), ProductionKind::YulLeaveStatement => Self::yul_leave_statement.parse(self, input), + ProductionKind::YulLiteral => Self::yul_literal.parse(self, input), ProductionKind::YulParameters => Self::yul_parameters.parse(self, input), ProductionKind::YulParametersDeclaration => { Self::yul_parameters_declaration.parse(self, input) @@ -9219,7 +8700,9 @@ impl Language { ProductionKind::YulReturnsDeclaration => { Self::yul_returns_declaration.parse(self, input) } + ProductionKind::YulStatement => Self::yul_statement.parse(self, input), ProductionKind::YulStatements => Self::yul_statements.parse(self, input), + ProductionKind::YulSwitchCase => Self::yul_switch_case.parse(self, input), ProductionKind::YulSwitchCases => Self::yul_switch_cases.parse(self, input), ProductionKind::YulSwitchStatement => Self::yul_switch_statement.parse(self, input), ProductionKind::YulValueCase => Self::yul_value_case.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 052c0bc81a..f87c025206 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/kinds.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/kinds.rs @@ -19,6 +19,7 @@ use {napi::bindgen_prelude::*, napi_derive::napi}; pub enum ProductionKind { ABICoderPragma, AddressType, + ArgumentsDeclaration, ArrayExpression, ArrayValues, AsciiStringLiterals, @@ -31,14 +32,17 @@ pub enum ProductionKind { CatchClauseError, CatchClauses, ConstantDefinition, + ConstructorAttribute, ConstructorAttributes, ConstructorDefinition, ContinueStatement, ContractDefinition, + ContractMember, ContractMembers, DecimalNumberExpression, DeleteStatement, DoWhileStatement, + ElementaryType, ElseBranch, EmitStatement, EndOfFileTrivia, @@ -52,21 +56,31 @@ pub enum ProductionKind { EventParameter, EventParameters, EventParametersDeclaration, + ExperimentalFeature, ExperimentalPragma, Expression, ExpressionStatement, + FallbackFunctionAttribute, FallbackFunctionAttributes, FallbackFunctionDefinition, ForStatement, + ForStatementCondition, + ForStatementInitialization, + FunctionAttribute, FunctionAttributes, + FunctionBody, + FunctionCallOptions, FunctionDefinition, + FunctionName, FunctionType, + FunctionTypeAttribute, FunctionTypeAttributes, HexNumberExpression, HexStringLiterals, IdentifierPath, IfStatement, ImportAlias, + ImportClause, ImportDeconstruction, ImportDeconstructionSymbol, ImportDeconstructionSymbols, @@ -81,8 +95,11 @@ pub enum ProductionKind { LibraryDefinition, LibraryMembers, MappingKey, + MappingKeyType, MappingType, MappingValue, + MemberAccess, + ModifierAttribute, ModifierAttributes, ModifierDefinition, ModifierInvocation, @@ -93,6 +110,7 @@ pub enum ProductionKind { NamedArgumentsDeclaration, NamedImport, NewExpression, + NumberUnit, OverridePaths, OverridePathsDeclaration, OverrideSpecifier, @@ -102,18 +120,25 @@ pub enum ProductionKind { PathImport, PositionalArguments, PositionalArgumentsDeclaration, + Pragma, PragmaDirective, + ReceiveFunctionAttribute, ReceiveFunctionAttributes, ReceiveFunctionDefinition, ReturnStatement, ReturnsDeclaration, RevertStatement, SourceUnit, + SourceUnitMember, SourceUnitMembers, + StateVariableAttribute, StateVariableAttributes, StateVariableDefinition, StateVariableDefinitionValue, + Statement, Statements, + StorageLocation, + StringExpression, StructDefinition, StructMember, StructMembers, @@ -124,6 +149,7 @@ pub enum ProductionKind { TupleDeconstructionElements, TupleDeconstructionStatement, TupleExpression, + TupleMember, TupleValue, TupleValues, TypeExpression, @@ -131,16 +157,21 @@ pub enum ProductionKind { TypedTupleMember, UncheckedBlock, UnicodeStringLiterals, + UnnamedFunctionAttribute, UnnamedFunctionAttributes, UnnamedFunctionDefinition, UntypedTupleMember, UserDefinedValueTypeDefinition, UsingAlias, + UsingClause, UsingDeconstruction, UsingDeconstructionSymbol, UsingDeconstructionSymbols, UsingDirective, + UsingOperator, + UsingTarget, VariableDeclarationStatement, + VariableDeclarationType, VariableDeclarationValue, VersionPragma, VersionPragmaExpression, @@ -160,11 +191,14 @@ pub enum ProductionKind { YulIdentifierPaths, YulIfStatement, YulLeaveStatement, + YulLiteral, YulParameters, YulParametersDeclaration, YulReturnVariables, YulReturnsDeclaration, + YulStatement, YulStatements, + YulSwitchCase, YulSwitchCases, YulSwitchStatement, YulValueCase, @@ -188,6 +222,7 @@ pub enum ProductionKind { pub enum RuleKind { ABICoderPragma, AddressType, + ArgumentsDeclaration, ArrayExpression, ArrayTypeName, ArrayValues, @@ -203,14 +238,17 @@ pub enum RuleKind { CatchClauses, ConditionalExpression, ConstantDefinition, + ConstructorAttribute, ConstructorAttributes, ConstructorDefinition, ContinueStatement, ContractDefinition, + ContractMember, ContractMembers, DecimalNumberExpression, DeleteStatement, DoWhileStatement, + ElementaryType, ElseBranch, EmitStatement, EndOfFileTrivia, @@ -224,22 +262,32 @@ pub enum RuleKind { EventParameter, EventParameters, EventParametersDeclaration, + ExperimentalFeature, ExperimentalPragma, Expression, ExpressionStatement, + FallbackFunctionAttribute, FallbackFunctionAttributes, FallbackFunctionDefinition, ForStatement, + ForStatementCondition, + ForStatementInitialization, + FunctionAttribute, FunctionAttributes, + FunctionBody, FunctionCallExpression, + FunctionCallOptions, FunctionDefinition, + FunctionName, FunctionType, + FunctionTypeAttribute, FunctionTypeAttributes, HexNumberExpression, HexStringLiterals, IdentifierPath, IfStatement, ImportAlias, + ImportClause, ImportDeconstruction, ImportDeconstructionSymbol, ImportDeconstructionSymbols, @@ -255,9 +303,12 @@ pub enum RuleKind { LibraryDefinition, LibraryMembers, MappingKey, + MappingKeyType, MappingType, MappingValue, + MemberAccess, MemberAccessExpression, + ModifierAttribute, ModifierAttributes, ModifierDefinition, ModifierInvocation, @@ -268,6 +319,7 @@ pub enum RuleKind { NamedArgumentsDeclaration, NamedImport, NewExpression, + NumberUnit, OverridePaths, OverridePathsDeclaration, OverrideSpecifier, @@ -277,18 +329,25 @@ pub enum RuleKind { PathImport, PositionalArguments, PositionalArgumentsDeclaration, + Pragma, PragmaDirective, + ReceiveFunctionAttribute, ReceiveFunctionAttributes, ReceiveFunctionDefinition, ReturnStatement, ReturnsDeclaration, RevertStatement, SourceUnit, + SourceUnitMember, SourceUnitMembers, + StateVariableAttribute, StateVariableAttributes, StateVariableDefinition, StateVariableDefinitionValue, + Statement, Statements, + StorageLocation, + StringExpression, StructDefinition, StructMember, StructMembers, @@ -299,6 +358,7 @@ pub enum RuleKind { TupleDeconstructionElements, TupleDeconstructionStatement, TupleExpression, + TupleMember, TupleValue, TupleValues, TypeExpression, @@ -308,16 +368,21 @@ pub enum RuleKind { UnaryPrefixExpression, UncheckedBlock, UnicodeStringLiterals, + UnnamedFunctionAttribute, UnnamedFunctionAttributes, UnnamedFunctionDefinition, UntypedTupleMember, UserDefinedValueTypeDefinition, UsingAlias, + UsingClause, UsingDeconstruction, UsingDeconstructionSymbol, UsingDeconstructionSymbols, UsingDirective, + UsingOperator, + UsingTarget, VariableDeclarationStatement, + VariableDeclarationType, VariableDeclarationValue, VersionPragma, VersionPragmaBinaryExpression, @@ -340,11 +405,14 @@ pub enum RuleKind { YulIdentifierPaths, YulIfStatement, YulLeaveStatement, + YulLiteral, YulParameters, YulParametersDeclaration, YulReturnVariables, YulReturnsDeclaration, + YulStatement, YulStatements, + YulSwitchCase, YulSwitchCases, YulSwitchStatement, YulValueCase, diff --git a/crates/solidity/outputs/npm/crate/src/generated/language.rs b/crates/solidity/outputs/npm/crate/src/generated/language.rs index 183df95f28..4c862493a2 100644 --- a/crates/solidity/outputs/npm/crate/src/generated/language.rs +++ b/crates/solidity/outputs/npm/crate/src/generated/language.rs @@ -227,6 +227,18 @@ impl Language { .with_kind(RuleKind::AddressType) } + #[allow(unused_assignments, unused_parens)] + fn arguments_declaration(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.positional_arguments_declaration(input); + choice.consider(input, result)?; + let result = self.named_arguments_declaration(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ArgumentsDeclaration) + } + #[allow(unused_assignments, unused_parens)] fn array_expression(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -481,37 +493,41 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn constructor_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + fn constructor_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { if self.version_is_at_least_0_4_22 { - OneOrMoreHelper::run(input, |input| { - if self.version_is_at_least_0_4_22 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PublicKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) }) } else { ParserResult::disabled() } + .with_kind(RuleKind::ConstructorAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn constructor_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + if self.version_is_at_least_0_4_22 { + OneOrMoreHelper::run(input, |input| self.constructor_attribute(input)) + } else { + ParserResult::disabled() + } .with_kind(RuleKind::ConstructorAttributes) } @@ -608,51 +624,55 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn contract_members(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.using_directive(input); - choice.consider(input, result)?; - let result = self.function_definition(input); + fn contract_member(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.using_directive(input); + choice.consider(input, result)?; + let result = self.function_definition(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_4_22 { + let result = self.constructor_definition(input); choice.consider(input, result)?; - if self.version_is_at_least_0_4_22 { - let result = self.constructor_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.receive_function_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.fallback_function_definition(input); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_6_0 { - let result = self.unnamed_function_definition(input); - choice.consider(input, result)?; - } - let result = self.modifier_definition(input); + } + if self.version_is_at_least_0_6_0 { + let result = self.receive_function_definition(input); choice.consider(input, result)?; - let result = self.struct_definition(input); + } + if self.version_is_at_least_0_6_0 { + let result = self.fallback_function_definition(input); choice.consider(input, result)?; - let result = self.enum_definition(input); + } + if !self.version_is_at_least_0_6_0 { + let result = self.unnamed_function_definition(input); choice.consider(input, result)?; - let result = self.event_definition(input); + } + let result = self.modifier_definition(input); + choice.consider(input, result)?; + let result = self.struct_definition(input); + choice.consider(input, result)?; + let result = self.enum_definition(input); + choice.consider(input, result)?; + let result = self.event_definition(input); + choice.consider(input, result)?; + let result = self.state_variable_definition(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_8_4 { + let result = self.error_definition(input); choice.consider(input, result)?; - let result = self.state_variable_definition(input); + } + if self.version_is_at_least_0_8_8 { + let result = self.user_defined_value_type_definition(input); choice.consider(input, result)?; - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) + } + choice.finish(input) }) - .with_kind(RuleKind::ContractMembers) + .with_kind(RuleKind::ContractMember) + } + + #[allow(unused_assignments, unused_parens)] + fn contract_members(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.contract_member(input)) + .with_kind(RuleKind::ContractMembers) } #[allow(unused_assignments, unused_parens)] @@ -662,75 +682,7 @@ impl Language { input, TokenKind::DecimalLiteral, ))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::WeiKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_6_11 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::GweiKeyword, - ); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_7_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::SzaboKeyword, - ); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_7_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::FinneyKeyword, - ); - choice.consider(input, result)?; - } - let result = self.parse_token_with_trivia::( - input, - TokenKind::EtherKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::SecondsKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::MinutesKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::HoursKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::DaysKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::WeeksKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::YearsKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; + seq.elem(OptionalHelper::transform(self.number_unit(input)))?; seq.finish() }) .with_kind(RuleKind::DecimalNumberExpression) @@ -773,55 +725,7 @@ impl Language { input, TokenKind::DoKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - let result = self.if_statement(input); - choice.consider(input, result)?; - let result = self.for_statement(input); - choice.consider(input, result)?; - let result = self.while_statement(input); - choice.consider(input, result)?; - let result = self.do_while_statement(input); - choice.consider(input, result)?; - let result = self.continue_statement(input); - choice.consider(input, result)?; - let result = self.break_statement(input); - choice.consider(input, result)?; - let result = self.delete_statement(input); - choice.consider(input, result)?; - let result = self.return_statement(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.throw_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_4_21 { - let result = self.emit_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.try_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.revert_statement(input); - choice.consider(input, result)?; - } - let result = self.assembly_statement(input); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_0 { - let result = self.unchecked_block(input); - choice.consider(input, result)?; - } - choice.finish(input) - }))?; + seq.elem(self.statement(input))?; seq.elem(self.parse_token_with_trivia::( input, TokenKind::WhileKeyword, @@ -866,6 +770,63 @@ impl Language { .with_kind(RuleKind::DoWhileStatement) } + #[allow(unused_assignments, unused_parens)] + fn elementary_type(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::BoolKeyword, + ); + choice.consider(input, result)?; + if !self.version_is_at_least_0_8_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::ByteKeyword, + ); + choice.consider(input, result)?; + } + let result = self.parse_token_with_trivia::( + input, + TokenKind::StringKeyword, + ); + choice.consider(input, result)?; + let result = self.address_type(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BytesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::IntKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UintKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FixedKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::UfixedKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ElementaryType) + } + #[allow(unused_assignments, unused_parens)] fn else_branch(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -873,55 +834,7 @@ impl Language { input, TokenKind::ElseKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - let result = self.if_statement(input); - choice.consider(input, result)?; - let result = self.for_statement(input); - choice.consider(input, result)?; - let result = self.while_statement(input); - choice.consider(input, result)?; - let result = self.do_while_statement(input); - choice.consider(input, result)?; - let result = self.continue_statement(input); - choice.consider(input, result)?; - let result = self.break_statement(input); - choice.consider(input, result)?; - let result = self.delete_statement(input); - choice.consider(input, result)?; - let result = self.return_statement(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.throw_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_4_21 { - let result = self.emit_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.try_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.revert_statement(input); - choice.consider(input, result)?; - } - let result = self.assembly_statement(input); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_0 { - let result = self.unchecked_block(input); - choice.consider(input, result)?; - } - choice.finish(input) - }))?; + seq.elem(self.statement(input))?; seq.finish() }) .with_kind(RuleKind::ElseBranch) @@ -938,13 +851,7 @@ impl Language { TokenKind::EmitKeyword, ))?; seq.elem(self.identifier_path(input))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.positional_arguments_declaration(input); - choice.consider(input, result)?; - let result = self.named_arguments_declaration(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.arguments_declaration(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -1242,6 +1149,24 @@ impl Language { .with_kind(RuleKind::EventParametersDeclaration) } + #[allow(unused_assignments, unused_parens)] + fn experimental_feature(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ExperimentalFeature) + } + #[allow(unused_assignments, unused_parens)] fn experimental_pragma(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -1249,19 +1174,7 @@ impl Language { input, TokenKind::ExperimentalKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.experimental_feature(input))?; seq.finish() }) .with_kind(RuleKind::ExperimentalPragma) @@ -2913,33 +2826,9 @@ impl Language { 85u8, SequenceHelper::run(|mut seq| { if self.version_is_at_least_0_6_2 { - seq.elem(OptionalHelper::transform( - if self.version_is_at_least_0_6_2 { - ChoiceHelper::run(input, |mut choice, input| { - if self.version_is_at_least_0_6_2 - && !self.version_is_at_least_0_8_0 - { - let result = self.named_argument_groups(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_0 { - let result = self.named_argument_group(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) - } else { - ParserResult::disabled() - }, - ))?; + seq.elem(OptionalHelper::transform(self.function_call_options(input)))?; } - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.positional_arguments_declaration(input); - choice.consider(input, result)?; - let result = self.named_arguments_declaration(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.arguments_declaration(input))?; seq.finish() }), ) @@ -2954,19 +2843,7 @@ impl Language { input, TokenKind::Period, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AddressKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.member_access(input))?; seq.finish() }), ) @@ -3041,70 +2918,9 @@ impl Language { choice.consider(input, result)?; let result = self.decimal_number_expression(input); choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.hex_string_literals(input); - choice.consider(input, result)?; - let result = self.ascii_string_literals(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_7_0 { - let result = self.unicode_string_literals(input); - choice.consider(input, result)?; - } - choice.finish(input) - }); + let result = self.string_expression(input); choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::BoolKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } - let result = self.parse_token_with_trivia::( - input, - TokenKind::StringKeyword, - ); - choice.consider(input, result)?; - let result = self.address_type(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::BytesKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::IntKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UintKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FixedKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UfixedKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }); + let result = self.elementary_type(input); choice.consider(input, result)?; let result = self.parse_token_with_trivia::( input, @@ -3274,49 +3090,53 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn fallback_function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + fn fallback_function_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { if self.version_is_at_least_0_6_0 { - OneOrMoreHelper::run(input, |input| { - if self.version_is_at_least_0_6_0 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PureKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ViewKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.override_specifier(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::VirtualKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) }) } else { ParserResult::disabled() } + .with_kind(RuleKind::FallbackFunctionAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn fallback_function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + if self.version_is_at_least_0_6_0 { + OneOrMoreHelper::run(input, |input| self.fallback_function_attribute(input)) + } else { + ParserResult::disabled() + } .with_kind(RuleKind::FallbackFunctionAttributes) } @@ -3333,16 +3153,7 @@ impl Language { self.fallback_function_attributes(input), ))?; seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.block(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.function_body(input))?; seq.finish() }) } else { @@ -3367,32 +3178,8 @@ impl Language { ))?; seq.elem( SequenceHelper::run(|mut seq| { - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.for_statement_initialization(input))?; + seq.elem(self.for_statement_condition(input))?; seq.elem(OptionalHelper::transform(self.expression(input)))?; seq.finish() }) @@ -3409,121 +3196,146 @@ impl Language { ))?; seq.finish() }))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - let result = self.if_statement(input); - choice.consider(input, result)?; - let result = self.for_statement(input); - choice.consider(input, result)?; - let result = self.while_statement(input); - choice.consider(input, result)?; - let result = self.do_while_statement(input); - choice.consider(input, result)?; - let result = self.continue_statement(input); - choice.consider(input, result)?; - let result = self.break_statement(input); - choice.consider(input, result)?; - let result = self.delete_statement(input); - choice.consider(input, result)?; - let result = self.return_statement(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.throw_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_4_21 { - let result = self.emit_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.try_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.revert_statement(input); - choice.consider(input, result)?; - } - let result = self.assembly_statement(input); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_0 { - let result = self.unchecked_block(input); - choice.consider(input, result)?; - } - choice.finish(input) - }))?; + seq.elem(self.statement(input))?; seq.finish() }) .with_kind(RuleKind::ForStatement) } #[allow(unused_assignments, unused_parens)] - fn function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ConstantKeyword, - ); - choice.consider(input, result)?; - } - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PrivateKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PublicKeyword, - ); - choice.consider(input, result)?; + fn for_statement_condition(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.expression_statement(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ForStatementCondition) + } + + #[allow(unused_assignments, unused_parens)] + fn for_statement_initialization(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.expression_statement(input); + choice.consider(input, result)?; + let result = self.variable_declaration_statement(input); + choice.consider(input, result)?; + let result = self.tuple_deconstruction_statement(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ForStatementInitialization) + } + + #[allow(unused_assignments, unused_parens)] + fn function_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.override_specifier(input); + choice.consider(input, result)?; + if !self.version_is_at_least_0_5_0 { let result = self.parse_token_with_trivia::( input, - TokenKind::PureKeyword, + TokenKind::ConstantKeyword, ); choice.consider(input, result)?; + } + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { let result = self.parse_token_with_trivia::( input, - TokenKind::ViewKeyword, + TokenKind::VirtualKeyword, ); choice.consider(input, result)?; - if self.version_is_at_least_0_6_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); + } + choice.finish(input) + }) + .with_kind(RuleKind::FunctionAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.function_attribute(input)) + .with_kind(RuleKind::FunctionAttributes) + } + + #[allow(unused_assignments, unused_parens)] + fn function_body(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.block(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Semicolon, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::FunctionBody) + } + + #[allow(unused_assignments, unused_parens)] + fn function_call_options(&self, input: &mut ParserContext<'_>) -> ParserResult { + if self.version_is_at_least_0_6_2 { + ChoiceHelper::run(input, |mut choice, input| { + if self.version_is_at_least_0_6_2 && !self.version_is_at_least_0_8_0 { + let result = self.named_argument_groups(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_0 { + let result = self.named_argument_group(input); choice.consider(input, result)?; } choice.finish(input) }) - }) - .with_kind(RuleKind::FunctionAttributes) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::FunctionCallOptions) } #[allow(unused_assignments, unused_parens)] @@ -3533,42 +3345,39 @@ impl Language { input, TokenKind::FunctionKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Identifier, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FallbackKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ReceiveKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.function_name(input))?; seq.elem(self.parameters_declaration(input))?; seq.elem(OptionalHelper::transform(self.function_attributes(input)))?; seq.elem(OptionalHelper::transform(self.returns_declaration(input)))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.block(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.function_body(input))?; seq.finish() }) .with_kind(RuleKind::FunctionDefinition) } + #[allow(unused_assignments, unused_parens)] + fn function_name(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::FallbackKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ReceiveKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::FunctionName) + } + #[allow(unused_assignments, unused_parens)] fn function_type(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -3587,48 +3396,52 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn function_type_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PrivateKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PublicKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PureKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ViewKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) + fn function_type_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::FunctionTypeAttributes) + .with_kind(RuleKind::FunctionTypeAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn function_type_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.function_type_attribute(input)) + .with_kind(RuleKind::FunctionTypeAttributes) } #[allow(unused_assignments, unused_parens)] @@ -3639,79 +3452,7 @@ impl Language { TokenKind::HexLiteral, ))?; if !self.version_is_at_least_0_5_0 { - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::WeiKeyword, - ); - choice.consider(input, result)?; - if self.version_is_at_least_0_6_11 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::GweiKeyword, - ); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_7_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::SzaboKeyword, - ); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_7_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::FinneyKeyword, - ); - choice.consider(input, result)?; - } - let result = self.parse_token_with_trivia::( - input, - TokenKind::EtherKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::SecondsKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::MinutesKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::HoursKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::DaysKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::WeeksKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::YearsKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }, - )))?; + seq.elem(OptionalHelper::transform(self.number_unit(input)))?; } seq.finish() }) @@ -3746,83 +3487,35 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn if_statement(&self, input: &mut ParserContext<'_>) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::IfKeyword, - ))?; - seq.elem(SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ))?; - seq.elem( - self.expression(input) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( - input, - self, - TokenKind::CloseParen, - RecoverFromNoMatch::Yes, - ), - )?; - seq.elem(self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ))?; - seq.finish() - }))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - let result = self.if_statement(input); - choice.consider(input, result)?; - let result = self.for_statement(input); - choice.consider(input, result)?; - let result = self.while_statement(input); - choice.consider(input, result)?; - let result = self.do_while_statement(input); - choice.consider(input, result)?; - let result = self.continue_statement(input); - choice.consider(input, result)?; - let result = self.break_statement(input); - choice.consider(input, result)?; - let result = self.delete_statement(input); - choice.consider(input, result)?; - let result = self.return_statement(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.throw_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_4_21 { - let result = self.emit_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.try_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.revert_statement(input); - choice.consider(input, result)?; - } - let result = self.assembly_statement(input); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_0 { - let result = self.unchecked_block(input); - choice.consider(input, result)?; - } - choice.finish(input) + fn if_statement(&self, input: &mut ParserContext<'_>) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::IfKeyword, + ))?; + seq.elem(SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ))?; + seq.elem( + self.expression(input) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + input, + self, + TokenKind::CloseParen, + RecoverFromNoMatch::Yes, + ), + )?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ))?; + seq.finish() }))?; + seq.elem(self.statement(input))?; seq.elem(OptionalHelper::transform(self.else_branch(input)))?; seq.finish() }) @@ -3845,6 +3538,20 @@ impl Language { .with_kind(RuleKind::ImportAlias) } + #[allow(unused_assignments, unused_parens)] + fn import_clause(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.path_import(input); + choice.consider(input, result)?; + let result = self.named_import(input); + choice.consider(input, result)?; + let result = self.import_deconstruction(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::ImportClause) + } + #[allow(unused_assignments, unused_parens)] fn import_deconstruction(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -3916,15 +3623,7 @@ impl Language { input, TokenKind::ImportKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.path_import(input); - choice.consider(input, result)?; - let result = self.named_import(input); - choice.consider(input, result)?; - let result = self.import_deconstruction(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.import_clause(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -3975,16 +3674,7 @@ impl Language { fn inheritance_type(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.identifier_path(input))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.positional_arguments_declaration(input); - choice.consider(input, result)?; - let result = self.named_arguments_declaration(input); - choice.consider(input, result)?; - choice.finish(input) - }, - )))?; + seq.elem(OptionalHelper::transform(self.arguments_declaration(input)))?; seq.finish() }) .with_kind(RuleKind::InheritanceType) @@ -4042,50 +3732,8 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn interface_members(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.using_directive(input); - choice.consider(input, result)?; - let result = self.function_definition(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_4_22 { - let result = self.constructor_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.receive_function_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.fallback_function_definition(input); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_6_0 { - let result = self.unnamed_function_definition(input); - choice.consider(input, result)?; - } - let result = self.modifier_definition(input); - choice.consider(input, result)?; - let result = self.struct_definition(input); - choice.consider(input, result)?; - let result = self.enum_definition(input); - choice.consider(input, result)?; - let result = self.event_definition(input); - choice.consider(input, result)?; - let result = self.state_variable_definition(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) - }) - .with_kind(RuleKind::InterfaceMembers) + OneOrMoreHelper::run(input, |input| self.contract_member(input)) + .with_kind(RuleKind::InterfaceMembers) } #[allow(unused_assignments, unused_parens)] @@ -4152,113 +3800,14 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn library_members(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.using_directive(input); - choice.consider(input, result)?; - let result = self.function_definition(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_4_22 { - let result = self.constructor_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.receive_function_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.fallback_function_definition(input); - choice.consider(input, result)?; - } - if !self.version_is_at_least_0_6_0 { - let result = self.unnamed_function_definition(input); - choice.consider(input, result)?; - } - let result = self.modifier_definition(input); - choice.consider(input, result)?; - let result = self.struct_definition(input); - choice.consider(input, result)?; - let result = self.enum_definition(input); - choice.consider(input, result)?; - let result = self.event_definition(input); - choice.consider(input, result)?; - let result = self.state_variable_definition(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) - }) - .with_kind(RuleKind::LibraryMembers) + OneOrMoreHelper::run(input, |input| self.contract_member(input)) + .with_kind(RuleKind::LibraryMembers) } #[allow(unused_assignments, unused_parens)] fn mapping_key(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::BoolKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } - let result = self.parse_token_with_trivia::( - input, - TokenKind::StringKeyword, - ); - choice.consider(input, result)?; - let result = self.address_type(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::BytesKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::IntKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UintKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FixedKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UfixedKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }); - choice.consider(input, result)?; - let result = self.identifier_path(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.mapping_key_type(input))?; if self.version_is_at_least_0_8_18 { seq.elem(OptionalHelper::transform( self.parse_token_with_trivia::( @@ -4272,6 +3821,18 @@ impl Language { .with_kind(RuleKind::MappingKey) } + #[allow(unused_assignments, unused_parens)] + fn mapping_key_type(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.elementary_type(input); + choice.consider(input, result)?; + let result = self.identifier_path(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::MappingKeyType) + } + #[allow(unused_assignments, unused_parens)] fn mapping_type(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -4332,22 +3893,44 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn modifier_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.override_specifier(input); + fn member_access(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Identifier, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AddressKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::MemberAccess) + } + + #[allow(unused_assignments, unused_parens)] + fn modifier_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.override_specifier(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::VirtualKeyword, + ); choice.consider(input, result)?; - if self.version_is_at_least_0_6_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }) + } + choice.finish(input) }) - .with_kind(RuleKind::ModifierAttributes) + .with_kind(RuleKind::ModifierAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn modifier_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.modifier_attribute(input)) + .with_kind(RuleKind::ModifierAttributes) } #[allow(unused_assignments, unused_parens)] @@ -4365,16 +3948,7 @@ impl Language { self.parameters_declaration(input), ))?; seq.elem(OptionalHelper::transform(self.modifier_attributes(input)))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.block(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.function_body(input))?; seq.finish() }) .with_kind(RuleKind::ModifierDefinition) @@ -4384,16 +3958,7 @@ impl Language { fn modifier_invocation(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem(self.identifier_path(input))?; - seq.elem(OptionalHelper::transform(ChoiceHelper::run( - input, - |mut choice, input| { - let result = self.positional_arguments_declaration(input); - choice.consider(input, result)?; - let result = self.named_arguments_declaration(input); - choice.consider(input, result)?; - choice.finish(input) - }, - )))?; + seq.elem(OptionalHelper::transform(self.arguments_declaration(input)))?; seq.finish() }) .with_kind(RuleKind::ModifierInvocation) @@ -4498,33 +4063,104 @@ impl Language { SequenceHelper::run(|mut seq| { seq.elem(self.parse_token_with_trivia::( input, - TokenKind::Asterisk, - ))?; - seq.elem(self.import_alias(input))?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::Asterisk, + ))?; + seq.elem(self.import_alias(input))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::FromKeyword, + ))?; + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, + ))?; + seq.finish() + }) + .with_kind(RuleKind::NamedImport) + } + + #[allow(unused_assignments, unused_parens)] + fn new_expression(&self, input: &mut ParserContext<'_>) -> ParserResult { + SequenceHelper::run(|mut seq| { + seq.elem(self.parse_token_with_trivia::( + input, + TokenKind::NewKeyword, + ))?; + seq.elem(self.type_name(input))?; + seq.finish() + }) + .with_kind(RuleKind::NewExpression) + } + + #[allow(unused_assignments, unused_parens)] + fn number_unit(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::WeiKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_11 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::GweiKeyword, + ); + choice.consider(input, result)?; + } + if !self.version_is_at_least_0_7_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::SzaboKeyword, + ); + choice.consider(input, result)?; + } + if !self.version_is_at_least_0_7_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::FinneyKeyword, + ); + choice.consider(input, result)?; + } + let result = self.parse_token_with_trivia::( + input, + TokenKind::EtherKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::SecondsKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::MinutesKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::FromKeyword, - ))?; - seq.elem(self.parse_token_with_trivia::( + TokenKind::HoursKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::AsciiStringLiteral, - ))?; - seq.finish() - }) - .with_kind(RuleKind::NamedImport) - } - - #[allow(unused_assignments, unused_parens)] - fn new_expression(&self, input: &mut ParserContext<'_>) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem(self.parse_token_with_trivia::( + TokenKind::DaysKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( input, - TokenKind::NewKeyword, - ))?; - seq.elem(self.type_name(input))?; - seq.finish() + TokenKind::WeeksKeyword, + ); + choice.consider(input, result)?; + if !self.version_is_at_least_0_5_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::YearsKeyword, + ); + choice.consider(input, result)?; + } + choice.finish(input) }) - .with_kind(RuleKind::NewExpression) + .with_kind(RuleKind::NumberUnit) } #[allow(unused_assignments, unused_parens)] @@ -4584,29 +4220,7 @@ impl Language { fn parameter(&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(OptionalHelper::transform(self.storage_location(input)))?; seq.elem(OptionalHelper::transform( self.parse_token_with_trivia::( input, @@ -4707,6 +4321,20 @@ impl Language { .with_kind(RuleKind::PositionalArgumentsDeclaration) } + #[allow(unused_assignments, unused_parens)] + fn pragma(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.abi_coder_pragma(input); + choice.consider(input, result)?; + let result = self.experimental_pragma(input); + choice.consider(input, result)?; + let result = self.version_pragma(input); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::Pragma) + } + #[allow(unused_assignments, unused_parens)] fn pragma_directive(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -4716,15 +4344,7 @@ impl Language { input, TokenKind::PragmaKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.abi_coder_pragma(input); - choice.consider(input, result)?; - let result = self.experimental_pragma(input); - choice.consider(input, result)?; - let result = self.version_pragma(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.pragma(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Pragma>( @@ -4744,39 +4364,43 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn receive_function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + fn receive_function_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { if self.version_is_at_least_0_6_0 { - OneOrMoreHelper::run(input, |input| { - if self.version_is_at_least_0_6_0 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::VirtualKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.override_specifier(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::VirtualKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) }) } else { ParserResult::disabled() } + .with_kind(RuleKind::ReceiveFunctionAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn receive_function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + if self.version_is_at_least_0_6_0 { + OneOrMoreHelper::run(input, |input| self.receive_function_attribute(input)) + } else { + ParserResult::disabled() + } .with_kind(RuleKind::ReceiveFunctionAttributes) } @@ -4792,16 +4416,7 @@ impl Language { seq.elem(OptionalHelper::transform( self.receive_function_attributes(input), ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.block(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.function_body(input))?; seq.finish() }) } else { @@ -4862,13 +4477,7 @@ impl Language { TokenKind::RevertKeyword, ))?; seq.elem(OptionalHelper::transform(self.identifier_path(input)))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.positional_arguments_declaration(input); - choice.consider(input, result)?; - let result = self.named_arguments_declaration(input); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.arguments_declaration(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -4901,94 +4510,102 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn source_unit_members(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.pragma_directive(input); + fn source_unit_member(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.pragma_directive(input); + choice.consider(input, result)?; + let result = self.import_directive(input); + choice.consider(input, result)?; + let result = self.contract_definition(input); + choice.consider(input, result)?; + let result = self.interface_definition(input); + choice.consider(input, result)?; + let result = self.library_definition(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { + let result = self.struct_definition(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_6_0 { + let result = self.enum_definition(input); choice.consider(input, result)?; - let result = self.import_directive(input); + } + if self.version_is_at_least_0_7_1 { + let result = self.function_definition(input); choice.consider(input, result)?; - let result = self.contract_definition(input); + } + if self.version_is_at_least_0_7_4 { + let result = self.constant_definition(input); choice.consider(input, result)?; - let result = self.interface_definition(input); + } + if self.version_is_at_least_0_8_4 { + let result = self.error_definition(input); choice.consider(input, result)?; - let result = self.library_definition(input); + } + if self.version_is_at_least_0_8_8 { + let result = self.user_defined_value_type_definition(input); choice.consider(input, result)?; - if self.version_is_at_least_0_6_0 { - let result = self.struct_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.enum_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_7_1 { - let result = self.function_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_7_4 { - let result = self.constant_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.error_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_8 { - let result = self.user_defined_value_type_definition(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_13 { - let result = self.using_directive(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_22 { - let result = self.event_definition(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) + } + if self.version_is_at_least_0_8_13 { + let result = self.using_directive(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_22 { + let result = self.event_definition(input); + choice.consider(input, result)?; + } + choice.finish(input) }) - .with_kind(RuleKind::SourceUnitMembers) + .with_kind(RuleKind::SourceUnitMember) } #[allow(unused_assignments, unused_parens)] - fn state_variable_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ConstantKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::InternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PrivateKeyword, - ); - choice.consider(input, result)?; + fn source_unit_members(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.source_unit_member(input)) + .with_kind(RuleKind::SourceUnitMembers) + } + + #[allow(unused_assignments, unused_parens)] + fn state_variable_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.override_specifier(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ConstantKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::InternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PrivateKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PublicKeyword, + ); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_5 { let result = self.parse_token_with_trivia::( input, - TokenKind::PublicKeyword, + TokenKind::ImmutableKeyword, ); choice.consider(input, result)?; - if self.version_is_at_least_0_6_5 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ImmutableKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(input) - }) + } + choice.finish(input) }) - .with_kind(RuleKind::StateVariableAttributes) + .with_kind(RuleKind::StateVariableAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn state_variable_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.state_variable_attribute(input)) + .with_kind(RuleKind::StateVariableAttributes) } #[allow(unused_assignments, unused_parens)] @@ -5037,63 +4654,107 @@ impl Language { seq.elem(self.expression(input))?; seq.finish() }) - .with_kind(RuleKind::StateVariableDefinitionValue) + .with_kind(RuleKind::StateVariableDefinitionValue) + } + + #[allow(unused_assignments, unused_parens)] + fn statement(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.expression_statement(input); + choice.consider(input, result)?; + let result = self.variable_declaration_statement(input); + choice.consider(input, result)?; + let result = self.tuple_deconstruction_statement(input); + choice.consider(input, result)?; + let result = self.if_statement(input); + choice.consider(input, result)?; + let result = self.for_statement(input); + choice.consider(input, result)?; + let result = self.while_statement(input); + choice.consider(input, result)?; + let result = self.do_while_statement(input); + choice.consider(input, result)?; + let result = self.continue_statement(input); + choice.consider(input, result)?; + let result = self.break_statement(input); + choice.consider(input, result)?; + let result = self.delete_statement(input); + choice.consider(input, result)?; + let result = self.return_statement(input); + choice.consider(input, result)?; + if !self.version_is_at_least_0_5_0 { + let result = self.throw_statement(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_4_21 { + let result = self.emit_statement(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_6_0 { + let result = self.try_statement(input); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_8_4 { + let result = self.revert_statement(input); + choice.consider(input, result)?; + } + let result = self.assembly_statement(input); + choice.consider(input, result)?; + let result = self.block(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_8_0 { + let result = self.unchecked_block(input); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::Statement) + } + + #[allow(unused_assignments, unused_parens)] + fn statements(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.statement(input)).with_kind(RuleKind::Statements) + } + + #[allow(unused_assignments, unused_parens)] + fn storage_location(&self, input: &mut ParserContext<'_>) -> ParserResult { + 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) + }) + .with_kind(RuleKind::StorageLocation) } #[allow(unused_assignments, unused_parens)] - fn statements(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - let result = self.if_statement(input); - choice.consider(input, result)?; - let result = self.for_statement(input); - choice.consider(input, result)?; - let result = self.while_statement(input); - choice.consider(input, result)?; - let result = self.do_while_statement(input); - choice.consider(input, result)?; - let result = self.continue_statement(input); - choice.consider(input, result)?; - let result = self.break_statement(input); - choice.consider(input, result)?; - let result = self.delete_statement(input); - choice.consider(input, result)?; - let result = self.return_statement(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.throw_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_4_21 { - let result = self.emit_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.try_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.revert_statement(input); - choice.consider(input, result)?; - } - let result = self.assembly_statement(input); - choice.consider(input, result)?; - let result = self.block(input); + fn string_expression(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.hex_string_literals(input); + choice.consider(input, result)?; + let result = self.ascii_string_literals(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_7_0 { + let result = self.unicode_string_literals(input); choice.consider(input, result)?; - if self.version_is_at_least_0_8_0 { - let result = self.unchecked_block(input); - choice.consider(input, result)?; - } - choice.finish(input) - }) + } + choice.finish(input) }) - .with_kind(RuleKind::Statements) + .with_kind(RuleKind::StringExpression) } #[allow(unused_assignments, unused_parens)] @@ -5236,14 +4897,8 @@ impl Language { #[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) + OptionalHelper::transform(self.tuple_member(input)) + .with_kind(RuleKind::TupleDeconstructionElement) } #[allow(unused_assignments, unused_parens)] @@ -5334,6 +4989,18 @@ impl Language { .with_kind(RuleKind::TupleExpression) } + #[allow(unused_assignments, unused_parens)] + fn tuple_member(&self, input: &mut ParserContext<'_>) -> ParserResult { + 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::TupleMember) + } + #[allow(unused_assignments, unused_parens)] fn tuple_value(&self, input: &mut ParserContext<'_>) -> ParserResult { OptionalHelper::transform(self.expression(input)).with_kind(RuleKind::TupleValue) @@ -5426,58 +5093,7 @@ impl Language { choice.consider(input, result)?; let result = self.mapping_type(input); choice.consider(input, result)?; - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::BoolKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self.parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } - let result = self.parse_token_with_trivia::( - input, - TokenKind::StringKeyword, - ); - choice.consider(input, result)?; - let result = self.address_type(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::BytesKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::IntKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UintKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::FixedKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::UfixedKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }); + let result = self.elementary_type(input); choice.consider(input, result)?; let result = self.identifier_path(input); choice.consider(input, result)?; @@ -5513,29 +5129,7 @@ impl Language { 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(OptionalHelper::transform(self.storage_location(input)))?; seq.elem(self.parse_token_with_trivia::( input, TokenKind::Identifier, @@ -5578,44 +5172,48 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn unnamed_function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + fn unnamed_function_attribute(&self, input: &mut ParserContext<'_>) -> ParserResult { if !self.version_is_at_least_0_6_0 { - OneOrMoreHelper::run(input, |input| { - if !self.version_is_at_least_0_6_0 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.modifier_invocation(input); - choice.consider(input, result)?; - let result = self.override_specifier(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ExternalKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::PureKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::ViewKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - } + ChoiceHelper::run(input, |mut choice, input| { + let result = self.modifier_invocation(input); + choice.consider(input, result)?; + let result = self.override_specifier(input); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ExternalKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PayableKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::PureKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::ViewKeyword, + ); + choice.consider(input, result)?; + choice.finish(input) }) } else { ParserResult::disabled() } + .with_kind(RuleKind::UnnamedFunctionAttribute) + } + + #[allow(unused_assignments, unused_parens)] + fn unnamed_function_attributes(&self, input: &mut ParserContext<'_>) -> ParserResult { + if !self.version_is_at_least_0_6_0 { + OneOrMoreHelper::run(input, |input| self.unnamed_function_attribute(input)) + } else { + ParserResult::disabled() + } .with_kind(RuleKind::UnnamedFunctionAttributes) } @@ -5631,16 +5229,7 @@ impl Language { seq.elem(OptionalHelper::transform( self.unnamed_function_attributes(input), ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.block(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Semicolon, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.function_body(input))?; seq.finish() }) } else { @@ -5652,29 +5241,7 @@ impl Language { #[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(OptionalHelper::transform(self.storage_location(input)))?; seq.elem(self.parse_token_with_trivia::( input, TokenKind::Identifier, @@ -5702,67 +5269,7 @@ impl Language { input, TokenKind::IsKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::BoolKeyword, - ); - choice.consider(input, result)?; - if !self.version_is_at_least_0_8_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::ByteKeyword, - ); - choice.consider(input, result)?; - } - let result = self - .parse_token_with_trivia::( - input, - TokenKind::StringKeyword, - ); - choice.consider(input, result)?; - let result = self.address_type(input); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::PayableKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::BytesKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::IntKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::UintKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::FixedKeyword, - ); - choice.consider(input, result)?; - let result = self - .parse_token_with_trivia::( - input, - TokenKind::UfixedKeyword, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.elementary_type(input))?; seq.finish() }) .recover_until_with_nested_delims::<_, LexicalContextType::Default>( @@ -5792,88 +5299,7 @@ impl Language { input, TokenKind::AsKeyword, ))?; - seq.elem(if self.version_is_at_least_0_8_19 { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::Ampersand, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Asterisk, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::BangEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Bar, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Caret, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::EqualEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::GreaterThanEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::LessThan, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::LessThanEqual, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Minus, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Percent, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Plus, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Slash, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Tilde, - ); - choice.consider(input, result)?; - choice.finish(input) - }) - } else { - ParserResult::disabled() - })?; + seq.elem(self.using_operator(input))?; seq.finish() }) } else { @@ -5882,6 +5308,20 @@ impl Language { .with_kind(RuleKind::UsingAlias) } + #[allow(unused_assignments, unused_parens)] + fn using_clause(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.identifier_path(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_8_13 { + let result = self.using_deconstruction(input); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::UsingClause) + } + #[allow(unused_assignments, unused_parens)] fn using_deconstruction(&self, input: &mut ParserContext<'_>) -> ParserResult { if self.version_is_at_least_0_8_13 { @@ -5953,29 +5393,12 @@ impl Language { input, TokenKind::UsingKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.identifier_path(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_13 { - let result = self.using_deconstruction(input); - choice.consider(input, result)?; - } - choice.finish(input) - }))?; + seq.elem(self.using_clause(input))?; seq.elem(self.parse_token_with_trivia::( input, TokenKind::ForKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.type_name(input); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::Asterisk, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.using_target(input))?; if self.version_is_at_least_0_8_13 { seq.elem(OptionalHelper::transform( self.parse_token_with_trivia::( @@ -6002,50 +5425,109 @@ impl Language { .with_kind(RuleKind::UsingDirective) } + #[allow(unused_assignments, unused_parens)] + fn using_operator(&self, input: &mut ParserContext<'_>) -> ParserResult { + if self.version_is_at_least_0_8_19 { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::Ampersand, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Asterisk, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::BangEqual, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::Bar); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Caret, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::EqualEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::GreaterThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThan, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::LessThanEqual, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Minus, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Percent, + ); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::Plus); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Slash, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::Tilde, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::UsingOperator) + } + + #[allow(unused_assignments, unused_parens)] + fn using_target(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.type_name(input); + choice.consider(input, result)?; + let result = self + .parse_token_with_trivia::(input, TokenKind::Asterisk); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::UsingTarget) + } + #[allow(unused_assignments, unused_parens)] fn variable_declaration_statement(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem( SequenceHelper::run(|mut seq| { - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.type_name(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self - .parse_token_with_trivia::( - input, - TokenKind::VarKeyword, - ); - choice.consider(input, result)?; - } - choice.finish(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.variable_declaration_type(input))?; + seq.elem(OptionalHelper::transform(self.storage_location(input)))?; seq.elem(self.parse_token_with_trivia::( input, TokenKind::Identifier, @@ -6071,6 +5553,23 @@ impl Language { .with_kind(RuleKind::VariableDeclarationStatement) } + #[allow(unused_assignments, unused_parens)] + fn variable_declaration_type(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.type_name(input); + choice.consider(input, result)?; + if !self.version_is_at_least_0_5_0 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::VarKeyword, + ); + choice.consider(input, result)?; + } + choice.finish(input) + }) + .with_kind(RuleKind::VariableDeclarationType) + } + #[allow(unused_assignments, unused_parens)] fn variable_declaration_value(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { @@ -6552,55 +6051,7 @@ impl Language { ))?; seq.finish() }))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.expression_statement(input); - choice.consider(input, result)?; - let result = self.variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.tuple_deconstruction_statement(input); - choice.consider(input, result)?; - let result = self.if_statement(input); - choice.consider(input, result)?; - let result = self.for_statement(input); - choice.consider(input, result)?; - let result = self.while_statement(input); - choice.consider(input, result)?; - let result = self.do_while_statement(input); - choice.consider(input, result)?; - let result = self.continue_statement(input); - choice.consider(input, result)?; - let result = self.break_statement(input); - choice.consider(input, result)?; - let result = self.delete_statement(input); - choice.consider(input, result)?; - let result = self.return_statement(input); - choice.consider(input, result)?; - if !self.version_is_at_least_0_5_0 { - let result = self.throw_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_4_21 { - let result = self.emit_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_6_0 { - let result = self.try_statement(input); - choice.consider(input, result)?; - } - if self.version_is_at_least_0_8_4 { - let result = self.revert_statement(input); - choice.consider(input, result)?; - } - let result = self.assembly_statement(input); - choice.consider(input, result)?; - let result = self.block(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_8_0 { - let result = self.unchecked_block(input); - choice.consider(input, result)?; - } - choice.finish(input) - }))?; + seq.elem(self.statement(input))?; seq.finish() }) .with_kind(RuleKind::WhileStatement) @@ -6726,39 +6177,7 @@ impl Language { #[allow(unused_variables)] let primary_expression_parser = |input: &mut ParserContext<'_>| { ChoiceHelper::run(input, |mut choice, input| { - let result = ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulTrueKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulFalseKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulDecimalLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulHexLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::HexStringLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, - ); - choice.consider(input, result)?; - choice.finish(input) - }); + let result = self.yul_literal(input); choice.consider(input, result)?; let result = self.yul_identifier_path(input); choice.consider(input, result)?; @@ -6881,6 +6300,44 @@ impl Language { .with_kind(RuleKind::YulLeaveStatement) } + #[allow(unused_assignments, unused_parens)] + fn yul_literal(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulTrueKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulFalseKeyword, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulDecimalLiteral, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::YulHexLiteral, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::HexStringLiteral, + ); + choice.consider(input, result)?; + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_kind(RuleKind::YulLiteral) + } + #[allow(unused_assignments, unused_parens)] fn yul_parameters(&self, input: &mut ParserContext<'_>) -> ParserResult { SeparatedHelper::run::<_, LexicalContextType::Yul>( @@ -6958,51 +6415,59 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn yul_statements(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.yul_block(input); - choice.consider(input, result)?; - let result = self.yul_function_definition(input); - choice.consider(input, result)?; - let result = self.yul_variable_declaration_statement(input); - choice.consider(input, result)?; - let result = self.yul_assignment_statement(input); - choice.consider(input, result)?; - let result = self.yul_if_statement(input); - choice.consider(input, result)?; - let result = self.yul_for_statement(input); - choice.consider(input, result)?; - let result = self.yul_switch_statement(input); - choice.consider(input, result)?; - if self.version_is_at_least_0_6_0 { - let result = self.yul_leave_statement(input); - choice.consider(input, result)?; - } - let result = self.yul_break_statement(input); - choice.consider(input, result)?; - let result = self.yul_continue_statement(input); - choice.consider(input, result)?; - let result = self.yul_expression(input); + fn yul_statement(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.yul_block(input); + choice.consider(input, result)?; + let result = self.yul_function_definition(input); + choice.consider(input, result)?; + let result = self.yul_variable_declaration_statement(input); + choice.consider(input, result)?; + let result = self.yul_assignment_statement(input); + choice.consider(input, result)?; + let result = self.yul_if_statement(input); + choice.consider(input, result)?; + let result = self.yul_for_statement(input); + choice.consider(input, result)?; + let result = self.yul_switch_statement(input); + choice.consider(input, result)?; + if self.version_is_at_least_0_6_0 { + let result = self.yul_leave_statement(input); choice.consider(input, result)?; - choice.finish(input) - }) + } + let result = self.yul_break_statement(input); + choice.consider(input, result)?; + let result = self.yul_continue_statement(input); + choice.consider(input, result)?; + let result = self.yul_expression(input); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::YulStatements) + .with_kind(RuleKind::YulStatement) } #[allow(unused_assignments, unused_parens)] - fn yul_switch_cases(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - ChoiceHelper::run(input, |mut choice, input| { - let result = self.yul_default_case(input); - choice.consider(input, result)?; - let result = self.yul_value_case(input); - choice.consider(input, result)?; - choice.finish(input) - }) + fn yul_statements(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.yul_statement(input)) + .with_kind(RuleKind::YulStatements) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_switch_case(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.yul_default_case(input); + choice.consider(input, result)?; + let result = self.yul_value_case(input); + choice.consider(input, result)?; + choice.finish(input) }) - .with_kind(RuleKind::YulSwitchCases) + .with_kind(RuleKind::YulSwitchCase) + } + + #[allow(unused_assignments, unused_parens)] + fn yul_switch_cases(&self, input: &mut ParserContext<'_>) -> ParserResult { + OneOrMoreHelper::run(input, |input| self.yul_switch_case(input)) + .with_kind(RuleKind::YulSwitchCases) } #[allow(unused_assignments, unused_parens)] @@ -7026,39 +6491,7 @@ impl Language { input, TokenKind::YulCaseKeyword, ))?; - seq.elem(ChoiceHelper::run(input, |mut choice, input| { - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulTrueKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulFalseKeyword, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulDecimalLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::YulHexLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::HexStringLiteral, - ); - choice.consider(input, result)?; - let result = self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, - ); - choice.consider(input, result)?; - choice.finish(input) - }))?; + seq.elem(self.yul_literal(input))?; seq.elem(self.yul_block(input))?; seq.finish() }) @@ -8998,6 +8431,7 @@ impl Language { match production_kind { ProductionKind::ABICoderPragma => Self::abi_coder_pragma.parse(self, input), ProductionKind::AddressType => Self::address_type.parse(self, input), + ProductionKind::ArgumentsDeclaration => Self::arguments_declaration.parse(self, input), ProductionKind::ArrayExpression => Self::array_expression.parse(self, input), ProductionKind::ArrayValues => Self::array_values.parse(self, input), ProductionKind::AsciiStringLiterals => Self::ascii_string_literals.parse(self, input), @@ -9012,6 +8446,7 @@ impl Language { ProductionKind::CatchClauseError => Self::catch_clause_error.parse(self, input), ProductionKind::CatchClauses => Self::catch_clauses.parse(self, input), ProductionKind::ConstantDefinition => Self::constant_definition.parse(self, input), + ProductionKind::ConstructorAttribute => Self::constructor_attribute.parse(self, input), ProductionKind::ConstructorAttributes => { Self::constructor_attributes.parse(self, input) } @@ -9020,12 +8455,14 @@ impl Language { } ProductionKind::ContinueStatement => Self::continue_statement.parse(self, input), ProductionKind::ContractDefinition => Self::contract_definition.parse(self, input), + ProductionKind::ContractMember => Self::contract_member.parse(self, input), ProductionKind::ContractMembers => Self::contract_members.parse(self, input), ProductionKind::DecimalNumberExpression => { Self::decimal_number_expression.parse(self, input) } ProductionKind::DeleteStatement => Self::delete_statement.parse(self, input), ProductionKind::DoWhileStatement => Self::do_while_statement.parse(self, input), + ProductionKind::ElementaryType => Self::elementary_type.parse(self, input), ProductionKind::ElseBranch => Self::else_branch.parse(self, input), ProductionKind::EmitStatement => Self::emit_statement.parse(self, input), ProductionKind::EndOfFileTrivia => Self::end_of_file_trivia.parse(self, input), @@ -9043,9 +8480,13 @@ impl Language { ProductionKind::EventParametersDeclaration => { Self::event_parameters_declaration.parse(self, input) } + ProductionKind::ExperimentalFeature => Self::experimental_feature.parse(self, input), ProductionKind::ExperimentalPragma => Self::experimental_pragma.parse(self, input), ProductionKind::Expression => Self::expression.parse(self, input), ProductionKind::ExpressionStatement => Self::expression_statement.parse(self, input), + ProductionKind::FallbackFunctionAttribute => { + Self::fallback_function_attribute.parse(self, input) + } ProductionKind::FallbackFunctionAttributes => { Self::fallback_function_attributes.parse(self, input) } @@ -9053,9 +8494,22 @@ impl Language { Self::fallback_function_definition.parse(self, input) } ProductionKind::ForStatement => Self::for_statement.parse(self, input), + ProductionKind::ForStatementCondition => { + Self::for_statement_condition.parse(self, input) + } + ProductionKind::ForStatementInitialization => { + Self::for_statement_initialization.parse(self, input) + } + ProductionKind::FunctionAttribute => Self::function_attribute.parse(self, input), ProductionKind::FunctionAttributes => Self::function_attributes.parse(self, input), + ProductionKind::FunctionBody => Self::function_body.parse(self, input), + ProductionKind::FunctionCallOptions => Self::function_call_options.parse(self, input), ProductionKind::FunctionDefinition => Self::function_definition.parse(self, input), + ProductionKind::FunctionName => Self::function_name.parse(self, input), ProductionKind::FunctionType => Self::function_type.parse(self, input), + ProductionKind::FunctionTypeAttribute => { + Self::function_type_attribute.parse(self, input) + } ProductionKind::FunctionTypeAttributes => { Self::function_type_attributes.parse(self, input) } @@ -9064,6 +8518,7 @@ impl Language { ProductionKind::IdentifierPath => Self::identifier_path.parse(self, input), ProductionKind::IfStatement => Self::if_statement.parse(self, input), ProductionKind::ImportAlias => Self::import_alias.parse(self, input), + ProductionKind::ImportClause => Self::import_clause.parse(self, input), ProductionKind::ImportDeconstruction => Self::import_deconstruction.parse(self, input), ProductionKind::ImportDeconstructionSymbol => { Self::import_deconstruction_symbol.parse(self, input) @@ -9082,8 +8537,11 @@ impl Language { ProductionKind::LibraryDefinition => Self::library_definition.parse(self, input), ProductionKind::LibraryMembers => Self::library_members.parse(self, input), ProductionKind::MappingKey => Self::mapping_key.parse(self, input), + ProductionKind::MappingKeyType => Self::mapping_key_type.parse(self, input), ProductionKind::MappingType => Self::mapping_type.parse(self, input), ProductionKind::MappingValue => Self::mapping_value.parse(self, input), + ProductionKind::MemberAccess => Self::member_access.parse(self, input), + ProductionKind::ModifierAttribute => Self::modifier_attribute.parse(self, input), ProductionKind::ModifierAttributes => Self::modifier_attributes.parse(self, input), ProductionKind::ModifierDefinition => Self::modifier_definition.parse(self, input), ProductionKind::ModifierInvocation => Self::modifier_invocation.parse(self, input), @@ -9096,6 +8554,7 @@ impl Language { } ProductionKind::NamedImport => Self::named_import.parse(self, input), ProductionKind::NewExpression => Self::new_expression.parse(self, input), + ProductionKind::NumberUnit => Self::number_unit.parse(self, input), ProductionKind::OverridePaths => Self::override_paths.parse(self, input), ProductionKind::OverridePathsDeclaration => { Self::override_paths_declaration.parse(self, input) @@ -9111,7 +8570,11 @@ impl Language { ProductionKind::PositionalArgumentsDeclaration => { Self::positional_arguments_declaration.parse(self, input) } + ProductionKind::Pragma => Self::pragma.parse(self, input), ProductionKind::PragmaDirective => Self::pragma_directive.parse(self, input), + ProductionKind::ReceiveFunctionAttribute => { + Self::receive_function_attribute.parse(self, input) + } ProductionKind::ReceiveFunctionAttributes => { Self::receive_function_attributes.parse(self, input) } @@ -9122,7 +8585,11 @@ impl Language { ProductionKind::ReturnsDeclaration => Self::returns_declaration.parse(self, input), ProductionKind::RevertStatement => Self::revert_statement.parse(self, input), ProductionKind::SourceUnit => Self::source_unit.parse(self, input), + ProductionKind::SourceUnitMember => Self::source_unit_member.parse(self, input), ProductionKind::SourceUnitMembers => Self::source_unit_members.parse(self, input), + ProductionKind::StateVariableAttribute => { + Self::state_variable_attribute.parse(self, input) + } ProductionKind::StateVariableAttributes => { Self::state_variable_attributes.parse(self, input) } @@ -9132,7 +8599,10 @@ impl Language { ProductionKind::StateVariableDefinitionValue => { Self::state_variable_definition_value.parse(self, input) } + ProductionKind::Statement => Self::statement.parse(self, input), ProductionKind::Statements => Self::statements.parse(self, input), + ProductionKind::StorageLocation => Self::storage_location.parse(self, input), + ProductionKind::StringExpression => Self::string_expression.parse(self, input), ProductionKind::StructDefinition => Self::struct_definition.parse(self, input), ProductionKind::StructMember => Self::struct_member.parse(self, input), ProductionKind::StructMembers => Self::struct_members.parse(self, input), @@ -9149,6 +8619,7 @@ impl Language { Self::tuple_deconstruction_statement.parse(self, input) } ProductionKind::TupleExpression => Self::tuple_expression.parse(self, input), + ProductionKind::TupleMember => Self::tuple_member.parse(self, input), ProductionKind::TupleValue => Self::tuple_value.parse(self, input), ProductionKind::TupleValues => Self::tuple_values.parse(self, input), ProductionKind::TypeExpression => Self::type_expression.parse(self, input), @@ -9158,6 +8629,9 @@ impl Language { ProductionKind::UnicodeStringLiterals => { Self::unicode_string_literals.parse(self, input) } + ProductionKind::UnnamedFunctionAttribute => { + Self::unnamed_function_attribute.parse(self, input) + } ProductionKind::UnnamedFunctionAttributes => { Self::unnamed_function_attributes.parse(self, input) } @@ -9169,6 +8643,7 @@ impl Language { Self::user_defined_value_type_definition.parse(self, input) } ProductionKind::UsingAlias => Self::using_alias.parse(self, input), + ProductionKind::UsingClause => Self::using_clause.parse(self, input), ProductionKind::UsingDeconstruction => Self::using_deconstruction.parse(self, input), ProductionKind::UsingDeconstructionSymbol => { Self::using_deconstruction_symbol.parse(self, input) @@ -9177,9 +8652,14 @@ impl Language { Self::using_deconstruction_symbols.parse(self, input) } ProductionKind::UsingDirective => Self::using_directive.parse(self, input), + ProductionKind::UsingOperator => Self::using_operator.parse(self, input), + ProductionKind::UsingTarget => Self::using_target.parse(self, input), ProductionKind::VariableDeclarationStatement => { Self::variable_declaration_statement.parse(self, input) } + ProductionKind::VariableDeclarationType => { + Self::variable_declaration_type.parse(self, input) + } ProductionKind::VariableDeclarationValue => { Self::variable_declaration_value.parse(self, input) } @@ -9211,6 +8691,7 @@ impl Language { ProductionKind::YulIdentifierPaths => Self::yul_identifier_paths.parse(self, input), ProductionKind::YulIfStatement => Self::yul_if_statement.parse(self, input), ProductionKind::YulLeaveStatement => Self::yul_leave_statement.parse(self, input), + ProductionKind::YulLiteral => Self::yul_literal.parse(self, input), ProductionKind::YulParameters => Self::yul_parameters.parse(self, input), ProductionKind::YulParametersDeclaration => { Self::yul_parameters_declaration.parse(self, input) @@ -9219,7 +8700,9 @@ impl Language { ProductionKind::YulReturnsDeclaration => { Self::yul_returns_declaration.parse(self, input) } + ProductionKind::YulStatement => Self::yul_statement.parse(self, input), ProductionKind::YulStatements => Self::yul_statements.parse(self, input), + ProductionKind::YulSwitchCase => Self::yul_switch_case.parse(self, input), ProductionKind::YulSwitchCases => Self::yul_switch_cases.parse(self, input), ProductionKind::YulSwitchStatement => Self::yul_switch_statement.parse(self, input), ProductionKind::YulValueCase => Self::yul_value_case.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 5a084093b4..563bc2caa8 100644 --- a/crates/solidity/outputs/npm/package/src/generated/index.d.ts +++ b/crates/solidity/outputs/npm/package/src/generated/index.d.ts @@ -12,6 +12,7 @@ export namespace kinds { export enum ProductionKind { ABICoderPragma = "ABICoderPragma", AddressType = "AddressType", + ArgumentsDeclaration = "ArgumentsDeclaration", ArrayExpression = "ArrayExpression", ArrayValues = "ArrayValues", AsciiStringLiterals = "AsciiStringLiterals", @@ -24,14 +25,17 @@ export namespace kinds { CatchClauseError = "CatchClauseError", CatchClauses = "CatchClauses", ConstantDefinition = "ConstantDefinition", + ConstructorAttribute = "ConstructorAttribute", ConstructorAttributes = "ConstructorAttributes", ConstructorDefinition = "ConstructorDefinition", ContinueStatement = "ContinueStatement", ContractDefinition = "ContractDefinition", + ContractMember = "ContractMember", ContractMembers = "ContractMembers", DecimalNumberExpression = "DecimalNumberExpression", DeleteStatement = "DeleteStatement", DoWhileStatement = "DoWhileStatement", + ElementaryType = "ElementaryType", ElseBranch = "ElseBranch", EmitStatement = "EmitStatement", EndOfFileTrivia = "EndOfFileTrivia", @@ -45,21 +49,31 @@ export namespace kinds { EventParameter = "EventParameter", EventParameters = "EventParameters", EventParametersDeclaration = "EventParametersDeclaration", + ExperimentalFeature = "ExperimentalFeature", ExperimentalPragma = "ExperimentalPragma", Expression = "Expression", ExpressionStatement = "ExpressionStatement", + FallbackFunctionAttribute = "FallbackFunctionAttribute", FallbackFunctionAttributes = "FallbackFunctionAttributes", FallbackFunctionDefinition = "FallbackFunctionDefinition", ForStatement = "ForStatement", + ForStatementCondition = "ForStatementCondition", + ForStatementInitialization = "ForStatementInitialization", + FunctionAttribute = "FunctionAttribute", FunctionAttributes = "FunctionAttributes", + FunctionBody = "FunctionBody", + FunctionCallOptions = "FunctionCallOptions", FunctionDefinition = "FunctionDefinition", + FunctionName = "FunctionName", FunctionType = "FunctionType", + FunctionTypeAttribute = "FunctionTypeAttribute", FunctionTypeAttributes = "FunctionTypeAttributes", HexNumberExpression = "HexNumberExpression", HexStringLiterals = "HexStringLiterals", IdentifierPath = "IdentifierPath", IfStatement = "IfStatement", ImportAlias = "ImportAlias", + ImportClause = "ImportClause", ImportDeconstruction = "ImportDeconstruction", ImportDeconstructionSymbol = "ImportDeconstructionSymbol", ImportDeconstructionSymbols = "ImportDeconstructionSymbols", @@ -74,8 +88,11 @@ export namespace kinds { LibraryDefinition = "LibraryDefinition", LibraryMembers = "LibraryMembers", MappingKey = "MappingKey", + MappingKeyType = "MappingKeyType", MappingType = "MappingType", MappingValue = "MappingValue", + MemberAccess = "MemberAccess", + ModifierAttribute = "ModifierAttribute", ModifierAttributes = "ModifierAttributes", ModifierDefinition = "ModifierDefinition", ModifierInvocation = "ModifierInvocation", @@ -86,6 +103,7 @@ export namespace kinds { NamedArgumentsDeclaration = "NamedArgumentsDeclaration", NamedImport = "NamedImport", NewExpression = "NewExpression", + NumberUnit = "NumberUnit", OverridePaths = "OverridePaths", OverridePathsDeclaration = "OverridePathsDeclaration", OverrideSpecifier = "OverrideSpecifier", @@ -95,18 +113,25 @@ export namespace kinds { PathImport = "PathImport", PositionalArguments = "PositionalArguments", PositionalArgumentsDeclaration = "PositionalArgumentsDeclaration", + Pragma = "Pragma", PragmaDirective = "PragmaDirective", + ReceiveFunctionAttribute = "ReceiveFunctionAttribute", ReceiveFunctionAttributes = "ReceiveFunctionAttributes", ReceiveFunctionDefinition = "ReceiveFunctionDefinition", ReturnStatement = "ReturnStatement", ReturnsDeclaration = "ReturnsDeclaration", RevertStatement = "RevertStatement", SourceUnit = "SourceUnit", + SourceUnitMember = "SourceUnitMember", SourceUnitMembers = "SourceUnitMembers", + StateVariableAttribute = "StateVariableAttribute", StateVariableAttributes = "StateVariableAttributes", StateVariableDefinition = "StateVariableDefinition", StateVariableDefinitionValue = "StateVariableDefinitionValue", + Statement = "Statement", Statements = "Statements", + StorageLocation = "StorageLocation", + StringExpression = "StringExpression", StructDefinition = "StructDefinition", StructMember = "StructMember", StructMembers = "StructMembers", @@ -117,6 +142,7 @@ export namespace kinds { TupleDeconstructionElements = "TupleDeconstructionElements", TupleDeconstructionStatement = "TupleDeconstructionStatement", TupleExpression = "TupleExpression", + TupleMember = "TupleMember", TupleValue = "TupleValue", TupleValues = "TupleValues", TypeExpression = "TypeExpression", @@ -124,16 +150,21 @@ export namespace kinds { TypedTupleMember = "TypedTupleMember", UncheckedBlock = "UncheckedBlock", UnicodeStringLiterals = "UnicodeStringLiterals", + UnnamedFunctionAttribute = "UnnamedFunctionAttribute", UnnamedFunctionAttributes = "UnnamedFunctionAttributes", UnnamedFunctionDefinition = "UnnamedFunctionDefinition", UntypedTupleMember = "UntypedTupleMember", UserDefinedValueTypeDefinition = "UserDefinedValueTypeDefinition", UsingAlias = "UsingAlias", + UsingClause = "UsingClause", UsingDeconstruction = "UsingDeconstruction", UsingDeconstructionSymbol = "UsingDeconstructionSymbol", UsingDeconstructionSymbols = "UsingDeconstructionSymbols", UsingDirective = "UsingDirective", + UsingOperator = "UsingOperator", + UsingTarget = "UsingTarget", VariableDeclarationStatement = "VariableDeclarationStatement", + VariableDeclarationType = "VariableDeclarationType", VariableDeclarationValue = "VariableDeclarationValue", VersionPragma = "VersionPragma", VersionPragmaExpression = "VersionPragmaExpression", @@ -153,11 +184,14 @@ export namespace kinds { YulIdentifierPaths = "YulIdentifierPaths", YulIfStatement = "YulIfStatement", YulLeaveStatement = "YulLeaveStatement", + YulLiteral = "YulLiteral", YulParameters = "YulParameters", YulParametersDeclaration = "YulParametersDeclaration", YulReturnVariables = "YulReturnVariables", YulReturnsDeclaration = "YulReturnsDeclaration", + YulStatement = "YulStatement", YulStatements = "YulStatements", + YulSwitchCase = "YulSwitchCase", YulSwitchCases = "YulSwitchCases", YulSwitchStatement = "YulSwitchStatement", YulValueCase = "YulValueCase", @@ -167,6 +201,7 @@ export namespace kinds { export enum RuleKind { ABICoderPragma = "ABICoderPragma", AddressType = "AddressType", + ArgumentsDeclaration = "ArgumentsDeclaration", ArrayExpression = "ArrayExpression", ArrayTypeName = "ArrayTypeName", ArrayValues = "ArrayValues", @@ -182,14 +217,17 @@ export namespace kinds { CatchClauses = "CatchClauses", ConditionalExpression = "ConditionalExpression", ConstantDefinition = "ConstantDefinition", + ConstructorAttribute = "ConstructorAttribute", ConstructorAttributes = "ConstructorAttributes", ConstructorDefinition = "ConstructorDefinition", ContinueStatement = "ContinueStatement", ContractDefinition = "ContractDefinition", + ContractMember = "ContractMember", ContractMembers = "ContractMembers", DecimalNumberExpression = "DecimalNumberExpression", DeleteStatement = "DeleteStatement", DoWhileStatement = "DoWhileStatement", + ElementaryType = "ElementaryType", ElseBranch = "ElseBranch", EmitStatement = "EmitStatement", EndOfFileTrivia = "EndOfFileTrivia", @@ -203,22 +241,32 @@ export namespace kinds { EventParameter = "EventParameter", EventParameters = "EventParameters", EventParametersDeclaration = "EventParametersDeclaration", + ExperimentalFeature = "ExperimentalFeature", ExperimentalPragma = "ExperimentalPragma", Expression = "Expression", ExpressionStatement = "ExpressionStatement", + FallbackFunctionAttribute = "FallbackFunctionAttribute", FallbackFunctionAttributes = "FallbackFunctionAttributes", FallbackFunctionDefinition = "FallbackFunctionDefinition", ForStatement = "ForStatement", + ForStatementCondition = "ForStatementCondition", + ForStatementInitialization = "ForStatementInitialization", + FunctionAttribute = "FunctionAttribute", FunctionAttributes = "FunctionAttributes", + FunctionBody = "FunctionBody", FunctionCallExpression = "FunctionCallExpression", + FunctionCallOptions = "FunctionCallOptions", FunctionDefinition = "FunctionDefinition", + FunctionName = "FunctionName", FunctionType = "FunctionType", + FunctionTypeAttribute = "FunctionTypeAttribute", FunctionTypeAttributes = "FunctionTypeAttributes", HexNumberExpression = "HexNumberExpression", HexStringLiterals = "HexStringLiterals", IdentifierPath = "IdentifierPath", IfStatement = "IfStatement", ImportAlias = "ImportAlias", + ImportClause = "ImportClause", ImportDeconstruction = "ImportDeconstruction", ImportDeconstructionSymbol = "ImportDeconstructionSymbol", ImportDeconstructionSymbols = "ImportDeconstructionSymbols", @@ -234,9 +282,12 @@ export namespace kinds { LibraryDefinition = "LibraryDefinition", LibraryMembers = "LibraryMembers", MappingKey = "MappingKey", + MappingKeyType = "MappingKeyType", MappingType = "MappingType", MappingValue = "MappingValue", + MemberAccess = "MemberAccess", MemberAccessExpression = "MemberAccessExpression", + ModifierAttribute = "ModifierAttribute", ModifierAttributes = "ModifierAttributes", ModifierDefinition = "ModifierDefinition", ModifierInvocation = "ModifierInvocation", @@ -247,6 +298,7 @@ export namespace kinds { NamedArgumentsDeclaration = "NamedArgumentsDeclaration", NamedImport = "NamedImport", NewExpression = "NewExpression", + NumberUnit = "NumberUnit", OverridePaths = "OverridePaths", OverridePathsDeclaration = "OverridePathsDeclaration", OverrideSpecifier = "OverrideSpecifier", @@ -256,18 +308,25 @@ export namespace kinds { PathImport = "PathImport", PositionalArguments = "PositionalArguments", PositionalArgumentsDeclaration = "PositionalArgumentsDeclaration", + Pragma = "Pragma", PragmaDirective = "PragmaDirective", + ReceiveFunctionAttribute = "ReceiveFunctionAttribute", ReceiveFunctionAttributes = "ReceiveFunctionAttributes", ReceiveFunctionDefinition = "ReceiveFunctionDefinition", ReturnStatement = "ReturnStatement", ReturnsDeclaration = "ReturnsDeclaration", RevertStatement = "RevertStatement", SourceUnit = "SourceUnit", + SourceUnitMember = "SourceUnitMember", SourceUnitMembers = "SourceUnitMembers", + StateVariableAttribute = "StateVariableAttribute", StateVariableAttributes = "StateVariableAttributes", StateVariableDefinition = "StateVariableDefinition", StateVariableDefinitionValue = "StateVariableDefinitionValue", + Statement = "Statement", Statements = "Statements", + StorageLocation = "StorageLocation", + StringExpression = "StringExpression", StructDefinition = "StructDefinition", StructMember = "StructMember", StructMembers = "StructMembers", @@ -278,6 +337,7 @@ export namespace kinds { TupleDeconstructionElements = "TupleDeconstructionElements", TupleDeconstructionStatement = "TupleDeconstructionStatement", TupleExpression = "TupleExpression", + TupleMember = "TupleMember", TupleValue = "TupleValue", TupleValues = "TupleValues", TypeExpression = "TypeExpression", @@ -287,16 +347,21 @@ export namespace kinds { UnaryPrefixExpression = "UnaryPrefixExpression", UncheckedBlock = "UncheckedBlock", UnicodeStringLiterals = "UnicodeStringLiterals", + UnnamedFunctionAttribute = "UnnamedFunctionAttribute", UnnamedFunctionAttributes = "UnnamedFunctionAttributes", UnnamedFunctionDefinition = "UnnamedFunctionDefinition", UntypedTupleMember = "UntypedTupleMember", UserDefinedValueTypeDefinition = "UserDefinedValueTypeDefinition", UsingAlias = "UsingAlias", + UsingClause = "UsingClause", UsingDeconstruction = "UsingDeconstruction", UsingDeconstructionSymbol = "UsingDeconstructionSymbol", UsingDeconstructionSymbols = "UsingDeconstructionSymbols", UsingDirective = "UsingDirective", + UsingOperator = "UsingOperator", + UsingTarget = "UsingTarget", VariableDeclarationStatement = "VariableDeclarationStatement", + VariableDeclarationType = "VariableDeclarationType", VariableDeclarationValue = "VariableDeclarationValue", VersionPragma = "VersionPragma", VersionPragmaBinaryExpression = "VersionPragmaBinaryExpression", @@ -319,11 +384,14 @@ export namespace kinds { YulIdentifierPaths = "YulIdentifierPaths", YulIfStatement = "YulIfStatement", YulLeaveStatement = "YulLeaveStatement", + YulLiteral = "YulLiteral", YulParameters = "YulParameters", YulParametersDeclaration = "YulParametersDeclaration", YulReturnVariables = "YulReturnVariables", YulReturnsDeclaration = "YulReturnsDeclaration", + YulStatement = "YulStatement", YulStatements = "YulStatements", + YulSwitchCase = "YulSwitchCase", YulSwitchCases = "YulSwitchCases", YulSwitchStatement = "YulSwitchStatement", YulValueCase = "YulValueCase", diff --git a/crates/solidity/outputs/npm/tests/src/tests/cst-cursor.ts b/crates/solidity/outputs/npm/tests/src/tests/cst-cursor.ts index 99124f8fb8..f4795d81e5 100644 --- a/crates/solidity/outputs/npm/tests/src/tests/cst-cursor.ts +++ b/crates/solidity/outputs/npm/tests/src/tests/cst-cursor.ts @@ -16,12 +16,18 @@ test("use cursor", () => { expectRule(cursor.node(), RuleKind.SourceUnitMembers); expect(cursor.goToNext()).toBe(true); + expectRule(cursor.node(), RuleKind.SourceUnitMember); + expect(cursor.goToNext()).toBe(true); + expectRule(cursor.node(), RuleKind.ConstantDefinition); expect(cursor.goToNext()).toBe(true); expectRule(cursor.node(), RuleKind.TypeName); expect(cursor.goToNext()).toBe(true); + expectRule(cursor.node(), RuleKind.ElementaryType); + expect(cursor.goToNext()).toBe(true); + expectToken(cursor.node(), TokenKind.IntKeyword, "int256"); expect(cursor.goToNext()).toBe(true); diff --git a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.4.11-failure.yml index 3f9813e22b..a620253611 100644 --- a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.4.11-failure.yml @@ -17,8 +17,9 @@ Tree: - Block (Rule): # 0..24 "{ unchecked { x = 1; } }" - OpenBrace (Token): "{" # 0..1 - Statements (Rule): # 1..12 " unchecked " - - ExpressionStatement (Rule): # 1..12 " unchecked " - - Expression (Rule): # 1..11 " unchecked" - - Identifier (Token): "unchecked" # 2..11 + - Statement (Rule): # 1..12 " unchecked " + - ExpressionStatement (Rule): # 1..12 " unchecked " + - Expression (Rule): # 1..11 " unchecked" + - Identifier (Token): "unchecked" # 2..11 - SKIPPED (Token): "{ x = 1; } " # 12..23 - CloseBrace (Token): "}" # 23..24 diff --git a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.8.0-success.yml b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.8.0-success.yml index e820e50894..e54c525bb5 100644 --- a/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.8.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Block/unchecked/generated/0.8.0-success.yml @@ -9,20 +9,22 @@ Tree: - Block (Rule): # 0..24 "{ unchecked { x = 1; } }" - OpenBrace (Token): "{" # 0..1 - Statements (Rule): # 1..22 " unchecked { x = 1; }" - - UncheckedBlock (Rule): # 1..22 " unchecked { x = 1; }" - - UncheckedKeyword (Token): "unchecked" # 2..11 - - Block (Rule): # 11..22 " { x = 1; }" - - OpenBrace (Token): "{" # 12..13 - - Statements (Rule): # 13..20 " x = 1;" - - ExpressionStatement (Rule): # 13..20 " x = 1;" - - Expression (Rule): # 13..19 " x = 1" - - BinaryExpression (Rule): # 13..19 " x = 1" - - Expression (Rule): # 13..15 " x" - - Identifier (Token): "x" # 14..15 - - Equal (Token): "=" # 16..17 - - Expression (Rule): # 17..19 " 1" - - DecimalNumberExpression (Rule): # 17..19 " 1" - - DecimalLiteral (Token): "1" # 18..19 - - Semicolon (Token): ";" # 19..20 - - CloseBrace (Token): "}" # 21..22 + - Statement (Rule): # 1..22 " unchecked { x = 1; }" + - UncheckedBlock (Rule): # 1..22 " unchecked { x = 1; }" + - UncheckedKeyword (Token): "unchecked" # 2..11 + - Block (Rule): # 11..22 " { x = 1; }" + - OpenBrace (Token): "{" # 12..13 + - Statements (Rule): # 13..20 " x = 1;" + - Statement (Rule): # 13..20 " x = 1;" + - ExpressionStatement (Rule): # 13..20 " x = 1;" + - Expression (Rule): # 13..19 " x = 1" + - BinaryExpression (Rule): # 13..19 " x = 1" + - Expression (Rule): # 13..15 " x" + - Identifier (Token): "x" # 14..15 + - Equal (Token): "=" # 16..17 + - Expression (Rule): # 17..19 " 1" + - DecimalNumberExpression (Rule): # 17..19 " 1" + - DecimalLiteral (Token): "1" # 18..19 + - Semicolon (Token): ";" # 19..20 + - CloseBrace (Token): "}" # 21..22 - CloseBrace (Token): "}" # 23..24 diff --git a/crates/solidity/testing/snapshots/cst_output/ConstantDefinition/int/generated/0.7.4-success.yml b/crates/solidity/testing/snapshots/cst_output/ConstantDefinition/int/generated/0.7.4-success.yml index 5960b2fe93..47bfd2ebce 100644 --- a/crates/solidity/testing/snapshots/cst_output/ConstantDefinition/int/generated/0.7.4-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ConstantDefinition/int/generated/0.7.4-success.yml @@ -8,7 +8,8 @@ Errors: [] Tree: - ConstantDefinition (Rule): # 0..21 "int constant foo = 0;" - TypeName (Rule): # 0..3 "int" - - IntKeyword (Token): "int" # 0..3 + - ElementaryType (Rule): # 0..3 "int" + - IntKeyword (Token): "int" # 0..3 - ConstantKeyword (Token): "constant" # 4..12 - Identifier (Token): "foo" # 13..16 - Equal (Token): "=" # 17..18 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 43ff2859b9..97082d571d 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 @@ -29,98 +29,117 @@ Tree: - Identifier (Token): "ABC" # 41..44 - OpenBrace (Token): "{" # 45..46 - ContractMembers (Rule): # 47..350 " function sendValue(address payable recipient, ui..." - - FunctionDefinition (Rule): # 47..350 " function sendValue(address payable recipient, ui..." - - FunctionKeyword (Token): "function" # 49..57 - - Identifier (Token): "sendValue" # 58..67 - - ParametersDeclaration (Rule): # 67..110 "(address payable recipient, uint256 amount)" - - OpenParen (Token): "(" # 67..68 - - Parameters (Rule): # 68..109 "address payable recipient, uint256 amount" - - Parameter (Rule): # 68..93 "address payable recipient" - - TypeName (Rule): # 68..83 "address payable" - - AddressType (Rule): # 68..83 "address payable" - - AddressKeyword (Token): "address" # 68..75 - - PayableKeyword (Token): "payable" # 76..83 - - Identifier (Token): "recipient" # 84..93 - - Comma (Token): "," # 93..94 - - Parameter (Rule): # 94..109 " uint256 amount" - - TypeName (Rule): # 94..102 " uint256" - - UintKeyword (Token): "uint256" # 95..102 - - Identifier (Token): "amount" # 103..109 - - CloseParen (Token): ")" # 109..110 - - FunctionAttributes (Rule): # 110..119 " internal" - - InternalKeyword (Token): "internal" # 111..119 - - Block (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' - - OpenBrace (Token): "{" # 120..121 - - Statements (Rule): # 122..346 ' require(address(this).balance >= amount, "Addr...' - - ExpressionStatement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' - - Expression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' - - FunctionCallExpression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' - - Expression (Rule): # 122..133 " require" - - Identifier (Token): "require" # 126..133 - - PositionalArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' - - OpenParen (Token): "(" # 133..134 - - PositionalArguments (Rule): # 134..198 'address(this).balance >= amount, "Address: insuffi...' - - Expression (Rule): # 134..165 "address(this).balance >= amount" - - BinaryExpression (Rule): # 134..165 "address(this).balance >= amount" - - Expression (Rule): # 134..155 "address(this).balance" - - MemberAccessExpression (Rule): # 134..155 "address(this).balance" - - Expression (Rule): # 134..147 "address(this)" - - FunctionCallExpression (Rule): # 134..147 "address(this)" - - Expression (Rule): # 134..141 "address" - - AddressType (Rule): # 134..141 "address" - - AddressKeyword (Token): "address" # 134..141 - - PositionalArgumentsDeclaration (Rule): # 141..147 "(this)" - - OpenParen (Token): "(" # 141..142 - - PositionalArguments (Rule): # 142..146 "this" - - Expression (Rule): # 142..146 "this" - - Identifier (Token): "this" # 142..146 - - CloseParen (Token): ")" # 146..147 - - Period (Token): "." # 147..148 - - Identifier (Token): "balance" # 148..155 - - GreaterThanEqual (Token): ">=" # 156..158 - - Expression (Rule): # 158..165 " amount" - - Identifier (Token): "amount" # 159..165 - - Comma (Token): "," # 165..166 - - Expression (Rule): # 166..198 ' "Address: insufficient balance"' - - AsciiStringLiterals (Rule): # 166..198 ' "Address: insufficient balance"' - - AsciiStringLiteral (Token): '"Address: insufficient balance"' # 167..198 - - CloseParen (Token): ")" # 198..199 - - Semicolon (Token): ";" # 199..200 - - TupleDeconstructionStatement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." - - OpenParen (Token): "(" # 206..207 - - 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 - - TupleDeconstructionElement (Rule): [] # 220..220 - - CloseParen (Token): ")" # 221..222 - - Equal (Token): "=" # 223..224 - - Expression (Rule): # 224..239 " recipient.call" - - MemberAccessExpression (Rule): # 224..239 " recipient.call" - - Expression (Rule): # 224..234 " recipient" - - Identifier (Token): "recipient" # 225..234 - - Period (Token): "." # 234..235 - - Identifier (Token): "call" # 235..239 - - SKIPPED (Token): '{ value: amount }("")' # 239..260 - - Semicolon (Token): ";" # 260..261 - - ExpressionStatement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' - - Expression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' - - FunctionCallExpression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' - - Expression (Rule): # 262..273 " require" - - Identifier (Token): "require" # 266..273 - - PositionalArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' - - OpenParen (Token): "(" # 273..274 - - PositionalArguments (Rule): # 274..343 'success, "Address: unable to send value, recipient...' - - Expression (Rule): # 274..281 "success" - - Identifier (Token): "success" # 274..281 - - Comma (Token): "," # 281..282 - - Expression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' - - AsciiStringLiterals (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' - - AsciiStringLiteral (Token): '"Address: unable to send value, recipient may have...' # 283..343 - - CloseParen (Token): ")" # 343..344 - - Semicolon (Token): ";" # 344..345 - - CloseBrace (Token): "}" # 348..349 + - ContractMember (Rule): # 47..350 " function sendValue(address payable recipient, ui..." + - FunctionDefinition (Rule): # 47..350 " function sendValue(address payable recipient, ui..." + - FunctionKeyword (Token): "function" # 49..57 + - FunctionName (Rule): # 57..67 " sendValue" + - Identifier (Token): "sendValue" # 58..67 + - ParametersDeclaration (Rule): # 67..110 "(address payable recipient, uint256 amount)" + - OpenParen (Token): "(" # 67..68 + - Parameters (Rule): # 68..109 "address payable recipient, uint256 amount" + - Parameter (Rule): # 68..93 "address payable recipient" + - TypeName (Rule): # 68..83 "address payable" + - ElementaryType (Rule): # 68..83 "address payable" + - AddressType (Rule): # 68..83 "address payable" + - AddressKeyword (Token): "address" # 68..75 + - PayableKeyword (Token): "payable" # 76..83 + - Identifier (Token): "recipient" # 84..93 + - Comma (Token): "," # 93..94 + - Parameter (Rule): # 94..109 " uint256 amount" + - TypeName (Rule): # 94..102 " uint256" + - ElementaryType (Rule): # 94..102 " uint256" + - UintKeyword (Token): "uint256" # 95..102 + - Identifier (Token): "amount" # 103..109 + - CloseParen (Token): ")" # 109..110 + - FunctionAttributes (Rule): # 110..119 " internal" + - FunctionAttribute (Rule): # 110..119 " internal" + - InternalKeyword (Token): "internal" # 111..119 + - FunctionBody (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' + - Block (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' + - OpenBrace (Token): "{" # 120..121 + - Statements (Rule): # 122..346 ' require(address(this).balance >= amount, "Addr...' + - Statement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' + - ExpressionStatement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' + - Expression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' + - FunctionCallExpression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' + - Expression (Rule): # 122..133 " require" + - Identifier (Token): "require" # 126..133 + - ArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' + - PositionalArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' + - OpenParen (Token): "(" # 133..134 + - PositionalArguments (Rule): # 134..198 'address(this).balance >= amount, "Address: insuffi...' + - Expression (Rule): # 134..165 "address(this).balance >= amount" + - BinaryExpression (Rule): # 134..165 "address(this).balance >= amount" + - Expression (Rule): # 134..155 "address(this).balance" + - MemberAccessExpression (Rule): # 134..155 "address(this).balance" + - Expression (Rule): # 134..147 "address(this)" + - FunctionCallExpression (Rule): # 134..147 "address(this)" + - Expression (Rule): # 134..141 "address" + - ElementaryType (Rule): # 134..141 "address" + - AddressType (Rule): # 134..141 "address" + - AddressKeyword (Token): "address" # 134..141 + - ArgumentsDeclaration (Rule): # 141..147 "(this)" + - PositionalArgumentsDeclaration (Rule): # 141..147 "(this)" + - OpenParen (Token): "(" # 141..142 + - PositionalArguments (Rule): # 142..146 "this" + - Expression (Rule): # 142..146 "this" + - Identifier (Token): "this" # 142..146 + - CloseParen (Token): ")" # 146..147 + - Period (Token): "." # 147..148 + - MemberAccess (Rule): # 148..155 "balance" + - Identifier (Token): "balance" # 148..155 + - GreaterThanEqual (Token): ">=" # 156..158 + - Expression (Rule): # 158..165 " amount" + - Identifier (Token): "amount" # 159..165 + - Comma (Token): "," # 165..166 + - Expression (Rule): # 166..198 ' "Address: insufficient balance"' + - StringExpression (Rule): # 166..198 ' "Address: insufficient balance"' + - AsciiStringLiterals (Rule): # 166..198 ' "Address: insufficient balance"' + - AsciiStringLiteral (Token): '"Address: insufficient balance"' # 167..198 + - CloseParen (Token): ")" # 198..199 + - Semicolon (Token): ";" # 199..200 + - 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 + - TupleDeconstructionElements (Rule): # 207..220 "bool success," + - TupleDeconstructionElement (Rule): # 207..219 "bool success" + - TupleMember (Rule): # 207..219 "bool success" + - TypedTupleMember (Rule): # 207..219 "bool success" + - TypeName (Rule): # 207..211 "bool" + - ElementaryType (Rule): # 207..211 "bool" + - BoolKeyword (Token): "bool" # 207..211 + - Identifier (Token): "success" # 212..219 + - Comma (Token): "," # 219..220 + - TupleDeconstructionElement (Rule): [] # 220..220 + - CloseParen (Token): ")" # 221..222 + - Equal (Token): "=" # 223..224 + - Expression (Rule): # 224..239 " recipient.call" + - MemberAccessExpression (Rule): # 224..239 " recipient.call" + - Expression (Rule): # 224..234 " recipient" + - Identifier (Token): "recipient" # 225..234 + - Period (Token): "." # 234..235 + - MemberAccess (Rule): # 235..239 "call" + - Identifier (Token): "call" # 235..239 + - SKIPPED (Token): '{ value: amount }("")' # 239..260 + - Semicolon (Token): ";" # 260..261 + - Statement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' + - ExpressionStatement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' + - Expression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' + - FunctionCallExpression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' + - Expression (Rule): # 262..273 " require" + - Identifier (Token): "require" # 266..273 + - ArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' + - PositionalArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' + - OpenParen (Token): "(" # 273..274 + - PositionalArguments (Rule): # 274..343 'success, "Address: unable to send value, recipient...' + - Expression (Rule): # 274..281 "success" + - Identifier (Token): "success" # 274..281 + - Comma (Token): "," # 281..282 + - Expression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - StringExpression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - AsciiStringLiterals (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - AsciiStringLiteral (Token): '"Address: unable to send value, recipient may have...' # 283..343 + - CloseParen (Token): ")" # 343..344 + - Semicolon (Token): ";" # 344..345 + - CloseBrace (Token): "}" # 348..349 - CloseBrace (Token): "}" # 350..351 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 02381078c5..1bba7d9ec3 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 @@ -21,116 +21,138 @@ Tree: - Identifier (Token): "ABC" # 41..44 - OpenBrace (Token): "{" # 45..46 - ContractMembers (Rule): # 47..350 " function sendValue(address payable recipient, ui..." - - FunctionDefinition (Rule): # 47..350 " function sendValue(address payable recipient, ui..." - - FunctionKeyword (Token): "function" # 49..57 - - Identifier (Token): "sendValue" # 58..67 - - ParametersDeclaration (Rule): # 67..110 "(address payable recipient, uint256 amount)" - - OpenParen (Token): "(" # 67..68 - - Parameters (Rule): # 68..109 "address payable recipient, uint256 amount" - - Parameter (Rule): # 68..93 "address payable recipient" - - TypeName (Rule): # 68..83 "address payable" - - AddressType (Rule): # 68..83 "address payable" - - AddressKeyword (Token): "address" # 68..75 - - PayableKeyword (Token): "payable" # 76..83 - - Identifier (Token): "recipient" # 84..93 - - Comma (Token): "," # 93..94 - - Parameter (Rule): # 94..109 " uint256 amount" - - TypeName (Rule): # 94..102 " uint256" - - UintKeyword (Token): "uint256" # 95..102 - - Identifier (Token): "amount" # 103..109 - - CloseParen (Token): ")" # 109..110 - - FunctionAttributes (Rule): # 110..119 " internal" - - InternalKeyword (Token): "internal" # 111..119 - - Block (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' - - OpenBrace (Token): "{" # 120..121 - - Statements (Rule): # 122..346 ' require(address(this).balance >= amount, "Addr...' - - ExpressionStatement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' - - Expression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' - - FunctionCallExpression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' - - Expression (Rule): # 122..133 " require" - - Identifier (Token): "require" # 126..133 - - PositionalArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' - - OpenParen (Token): "(" # 133..134 - - PositionalArguments (Rule): # 134..198 'address(this).balance >= amount, "Address: insuffi...' - - Expression (Rule): # 134..165 "address(this).balance >= amount" - - BinaryExpression (Rule): # 134..165 "address(this).balance >= amount" - - Expression (Rule): # 134..155 "address(this).balance" - - MemberAccessExpression (Rule): # 134..155 "address(this).balance" - - Expression (Rule): # 134..147 "address(this)" - - FunctionCallExpression (Rule): # 134..147 "address(this)" - - Expression (Rule): # 134..141 "address" - - AddressType (Rule): # 134..141 "address" - - AddressKeyword (Token): "address" # 134..141 - - PositionalArgumentsDeclaration (Rule): # 141..147 "(this)" - - OpenParen (Token): "(" # 141..142 - - PositionalArguments (Rule): # 142..146 "this" - - Expression (Rule): # 142..146 "this" - - Identifier (Token): "this" # 142..146 - - CloseParen (Token): ")" # 146..147 - - Period (Token): "." # 147..148 - - Identifier (Token): "balance" # 148..155 - - GreaterThanEqual (Token): ">=" # 156..158 - - Expression (Rule): # 158..165 " amount" - - Identifier (Token): "amount" # 159..165 - - Comma (Token): "," # 165..166 - - Expression (Rule): # 166..198 ' "Address: insufficient balance"' - - AsciiStringLiterals (Rule): # 166..198 ' "Address: insufficient balance"' - - AsciiStringLiteral (Token): '"Address: insufficient balance"' # 167..198 - - CloseParen (Token): ")" # 198..199 - - Semicolon (Token): ";" # 199..200 - - TupleDeconstructionStatement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." - - OpenParen (Token): "(" # 206..207 - - 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 - - TupleDeconstructionElement (Rule): [] # 220..220 - - CloseParen (Token): ")" # 221..222 - - Equal (Token): "=" # 223..224 - - Expression (Rule): # 224..260 ' recipient.call{ value: amount }("")' - - FunctionCallExpression (Rule): # 224..260 ' recipient.call{ value: amount }("")' - - Expression (Rule): # 224..239 " recipient.call" - - MemberAccessExpression (Rule): # 224..239 " recipient.call" - - Expression (Rule): # 224..234 " recipient" - - Identifier (Token): "recipient" # 225..234 - - Period (Token): "." # 234..235 - - Identifier (Token): "call" # 235..239 - - NamedArgumentGroups (Rule): # 239..256 "{ value: amount }" - - NamedArgumentGroup (Rule): # 239..256 "{ value: amount }" - - OpenBrace (Token): "{" # 239..240 - - NamedArguments (Rule): # 240..254 " value: amount" - - NamedArgument (Rule): # 240..254 " value: amount" - - Identifier (Token): "value" # 241..246 - - Colon (Token): ":" # 246..247 - - Expression (Rule): # 247..254 " amount" - - Identifier (Token): "amount" # 248..254 - - CloseBrace (Token): "}" # 255..256 - - PositionalArgumentsDeclaration (Rule): # 256..260 '("")' - - OpenParen (Token): "(" # 256..257 - - PositionalArguments (Rule): # 257..259 '""' - - Expression (Rule): # 257..259 '""' - - AsciiStringLiterals (Rule): # 257..259 '""' - - AsciiStringLiteral (Token): '""' # 257..259 - - CloseParen (Token): ")" # 259..260 - - Semicolon (Token): ";" # 260..261 - - ExpressionStatement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' - - Expression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' - - FunctionCallExpression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' - - Expression (Rule): # 262..273 " require" - - Identifier (Token): "require" # 266..273 - - PositionalArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' - - OpenParen (Token): "(" # 273..274 - - PositionalArguments (Rule): # 274..343 'success, "Address: unable to send value, recipient...' - - Expression (Rule): # 274..281 "success" - - Identifier (Token): "success" # 274..281 - - Comma (Token): "," # 281..282 - - Expression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' - - AsciiStringLiterals (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' - - AsciiStringLiteral (Token): '"Address: unable to send value, recipient may have...' # 283..343 - - CloseParen (Token): ")" # 343..344 - - Semicolon (Token): ";" # 344..345 - - CloseBrace (Token): "}" # 348..349 + - ContractMember (Rule): # 47..350 " function sendValue(address payable recipient, ui..." + - FunctionDefinition (Rule): # 47..350 " function sendValue(address payable recipient, ui..." + - FunctionKeyword (Token): "function" # 49..57 + - FunctionName (Rule): # 57..67 " sendValue" + - Identifier (Token): "sendValue" # 58..67 + - ParametersDeclaration (Rule): # 67..110 "(address payable recipient, uint256 amount)" + - OpenParen (Token): "(" # 67..68 + - Parameters (Rule): # 68..109 "address payable recipient, uint256 amount" + - Parameter (Rule): # 68..93 "address payable recipient" + - TypeName (Rule): # 68..83 "address payable" + - ElementaryType (Rule): # 68..83 "address payable" + - AddressType (Rule): # 68..83 "address payable" + - AddressKeyword (Token): "address" # 68..75 + - PayableKeyword (Token): "payable" # 76..83 + - Identifier (Token): "recipient" # 84..93 + - Comma (Token): "," # 93..94 + - Parameter (Rule): # 94..109 " uint256 amount" + - TypeName (Rule): # 94..102 " uint256" + - ElementaryType (Rule): # 94..102 " uint256" + - UintKeyword (Token): "uint256" # 95..102 + - Identifier (Token): "amount" # 103..109 + - CloseParen (Token): ")" # 109..110 + - FunctionAttributes (Rule): # 110..119 " internal" + - FunctionAttribute (Rule): # 110..119 " internal" + - InternalKeyword (Token): "internal" # 111..119 + - FunctionBody (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' + - Block (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' + - OpenBrace (Token): "{" # 120..121 + - Statements (Rule): # 122..346 ' require(address(this).balance >= amount, "Addr...' + - Statement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' + - ExpressionStatement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' + - Expression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' + - FunctionCallExpression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' + - Expression (Rule): # 122..133 " require" + - Identifier (Token): "require" # 126..133 + - ArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' + - PositionalArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' + - OpenParen (Token): "(" # 133..134 + - PositionalArguments (Rule): # 134..198 'address(this).balance >= amount, "Address: insuffi...' + - Expression (Rule): # 134..165 "address(this).balance >= amount" + - BinaryExpression (Rule): # 134..165 "address(this).balance >= amount" + - Expression (Rule): # 134..155 "address(this).balance" + - MemberAccessExpression (Rule): # 134..155 "address(this).balance" + - Expression (Rule): # 134..147 "address(this)" + - FunctionCallExpression (Rule): # 134..147 "address(this)" + - Expression (Rule): # 134..141 "address" + - ElementaryType (Rule): # 134..141 "address" + - AddressType (Rule): # 134..141 "address" + - AddressKeyword (Token): "address" # 134..141 + - ArgumentsDeclaration (Rule): # 141..147 "(this)" + - PositionalArgumentsDeclaration (Rule): # 141..147 "(this)" + - OpenParen (Token): "(" # 141..142 + - PositionalArguments (Rule): # 142..146 "this" + - Expression (Rule): # 142..146 "this" + - Identifier (Token): "this" # 142..146 + - CloseParen (Token): ")" # 146..147 + - Period (Token): "." # 147..148 + - MemberAccess (Rule): # 148..155 "balance" + - Identifier (Token): "balance" # 148..155 + - GreaterThanEqual (Token): ">=" # 156..158 + - Expression (Rule): # 158..165 " amount" + - Identifier (Token): "amount" # 159..165 + - Comma (Token): "," # 165..166 + - Expression (Rule): # 166..198 ' "Address: insufficient balance"' + - StringExpression (Rule): # 166..198 ' "Address: insufficient balance"' + - AsciiStringLiterals (Rule): # 166..198 ' "Address: insufficient balance"' + - AsciiStringLiteral (Token): '"Address: insufficient balance"' # 167..198 + - CloseParen (Token): ")" # 198..199 + - Semicolon (Token): ";" # 199..200 + - 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 + - TupleDeconstructionElements (Rule): # 207..220 "bool success," + - TupleDeconstructionElement (Rule): # 207..219 "bool success" + - TupleMember (Rule): # 207..219 "bool success" + - TypedTupleMember (Rule): # 207..219 "bool success" + - TypeName (Rule): # 207..211 "bool" + - ElementaryType (Rule): # 207..211 "bool" + - BoolKeyword (Token): "bool" # 207..211 + - Identifier (Token): "success" # 212..219 + - Comma (Token): "," # 219..220 + - TupleDeconstructionElement (Rule): [] # 220..220 + - CloseParen (Token): ")" # 221..222 + - Equal (Token): "=" # 223..224 + - Expression (Rule): # 224..260 ' recipient.call{ value: amount }("")' + - FunctionCallExpression (Rule): # 224..260 ' recipient.call{ value: amount }("")' + - Expression (Rule): # 224..239 " recipient.call" + - MemberAccessExpression (Rule): # 224..239 " recipient.call" + - Expression (Rule): # 224..234 " recipient" + - Identifier (Token): "recipient" # 225..234 + - Period (Token): "." # 234..235 + - MemberAccess (Rule): # 235..239 "call" + - Identifier (Token): "call" # 235..239 + - FunctionCallOptions (Rule): # 239..256 "{ value: amount }" + - NamedArgumentGroups (Rule): # 239..256 "{ value: amount }" + - NamedArgumentGroup (Rule): # 239..256 "{ value: amount }" + - OpenBrace (Token): "{" # 239..240 + - NamedArguments (Rule): # 240..254 " value: amount" + - NamedArgument (Rule): # 240..254 " value: amount" + - Identifier (Token): "value" # 241..246 + - Colon (Token): ":" # 246..247 + - Expression (Rule): # 247..254 " amount" + - Identifier (Token): "amount" # 248..254 + - CloseBrace (Token): "}" # 255..256 + - ArgumentsDeclaration (Rule): # 256..260 '("")' + - PositionalArgumentsDeclaration (Rule): # 256..260 '("")' + - OpenParen (Token): "(" # 256..257 + - PositionalArguments (Rule): # 257..259 '""' + - Expression (Rule): # 257..259 '""' + - StringExpression (Rule): # 257..259 '""' + - AsciiStringLiterals (Rule): # 257..259 '""' + - AsciiStringLiteral (Token): '""' # 257..259 + - CloseParen (Token): ")" # 259..260 + - Semicolon (Token): ";" # 260..261 + - Statement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' + - ExpressionStatement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' + - Expression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' + - FunctionCallExpression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' + - Expression (Rule): # 262..273 " require" + - Identifier (Token): "require" # 266..273 + - ArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' + - PositionalArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' + - OpenParen (Token): "(" # 273..274 + - PositionalArguments (Rule): # 274..343 'success, "Address: unable to send value, recipient...' + - Expression (Rule): # 274..281 "success" + - Identifier (Token): "success" # 274..281 + - Comma (Token): "," # 281..282 + - Expression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - StringExpression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - AsciiStringLiterals (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - AsciiStringLiteral (Token): '"Address: unable to send value, recipient may have...' # 283..343 + - CloseParen (Token): ")" # 343..344 + - Semicolon (Token): ";" # 344..345 + - CloseBrace (Token): "}" # 348..349 - CloseBrace (Token): "}" # 350..351 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.8.0-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.8.0-success.yml index d7db1f4772..f51fff9e96 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.8.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.8.0-success.yml @@ -21,115 +21,137 @@ Tree: - Identifier (Token): "ABC" # 41..44 - OpenBrace (Token): "{" # 45..46 - ContractMembers (Rule): # 47..350 " function sendValue(address payable recipient, ui..." - - FunctionDefinition (Rule): # 47..350 " function sendValue(address payable recipient, ui..." - - FunctionKeyword (Token): "function" # 49..57 - - Identifier (Token): "sendValue" # 58..67 - - ParametersDeclaration (Rule): # 67..110 "(address payable recipient, uint256 amount)" - - OpenParen (Token): "(" # 67..68 - - Parameters (Rule): # 68..109 "address payable recipient, uint256 amount" - - Parameter (Rule): # 68..93 "address payable recipient" - - TypeName (Rule): # 68..83 "address payable" - - AddressType (Rule): # 68..83 "address payable" - - AddressKeyword (Token): "address" # 68..75 - - PayableKeyword (Token): "payable" # 76..83 - - Identifier (Token): "recipient" # 84..93 - - Comma (Token): "," # 93..94 - - Parameter (Rule): # 94..109 " uint256 amount" - - TypeName (Rule): # 94..102 " uint256" - - UintKeyword (Token): "uint256" # 95..102 - - Identifier (Token): "amount" # 103..109 - - CloseParen (Token): ")" # 109..110 - - FunctionAttributes (Rule): # 110..119 " internal" - - InternalKeyword (Token): "internal" # 111..119 - - Block (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' - - OpenBrace (Token): "{" # 120..121 - - Statements (Rule): # 122..346 ' require(address(this).balance >= amount, "Addr...' - - ExpressionStatement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' - - Expression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' - - FunctionCallExpression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' - - Expression (Rule): # 122..133 " require" - - Identifier (Token): "require" # 126..133 - - PositionalArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' - - OpenParen (Token): "(" # 133..134 - - PositionalArguments (Rule): # 134..198 'address(this).balance >= amount, "Address: insuffi...' - - Expression (Rule): # 134..165 "address(this).balance >= amount" - - BinaryExpression (Rule): # 134..165 "address(this).balance >= amount" - - Expression (Rule): # 134..155 "address(this).balance" - - MemberAccessExpression (Rule): # 134..155 "address(this).balance" - - Expression (Rule): # 134..147 "address(this)" - - FunctionCallExpression (Rule): # 134..147 "address(this)" - - Expression (Rule): # 134..141 "address" - - AddressType (Rule): # 134..141 "address" - - AddressKeyword (Token): "address" # 134..141 - - PositionalArgumentsDeclaration (Rule): # 141..147 "(this)" - - OpenParen (Token): "(" # 141..142 - - PositionalArguments (Rule): # 142..146 "this" - - Expression (Rule): # 142..146 "this" - - Identifier (Token): "this" # 142..146 - - CloseParen (Token): ")" # 146..147 - - Period (Token): "." # 147..148 - - Identifier (Token): "balance" # 148..155 - - GreaterThanEqual (Token): ">=" # 156..158 - - Expression (Rule): # 158..165 " amount" - - Identifier (Token): "amount" # 159..165 - - Comma (Token): "," # 165..166 - - Expression (Rule): # 166..198 ' "Address: insufficient balance"' - - AsciiStringLiterals (Rule): # 166..198 ' "Address: insufficient balance"' - - AsciiStringLiteral (Token): '"Address: insufficient balance"' # 167..198 - - CloseParen (Token): ")" # 198..199 - - Semicolon (Token): ";" # 199..200 - - TupleDeconstructionStatement (Rule): # 201..262 "\n (bool success, ) = recipient.call{ value: amo..." - - OpenParen (Token): "(" # 206..207 - - 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 - - TupleDeconstructionElement (Rule): [] # 220..220 - - CloseParen (Token): ")" # 221..222 - - Equal (Token): "=" # 223..224 - - Expression (Rule): # 224..260 ' recipient.call{ value: amount }("")' - - FunctionCallExpression (Rule): # 224..260 ' recipient.call{ value: amount }("")' - - Expression (Rule): # 224..239 " recipient.call" - - MemberAccessExpression (Rule): # 224..239 " recipient.call" - - Expression (Rule): # 224..234 " recipient" - - Identifier (Token): "recipient" # 225..234 - - Period (Token): "." # 234..235 - - Identifier (Token): "call" # 235..239 - - NamedArgumentGroup (Rule): # 239..256 "{ value: amount }" - - OpenBrace (Token): "{" # 239..240 - - NamedArguments (Rule): # 240..254 " value: amount" - - NamedArgument (Rule): # 240..254 " value: amount" - - Identifier (Token): "value" # 241..246 - - Colon (Token): ":" # 246..247 - - Expression (Rule): # 247..254 " amount" - - Identifier (Token): "amount" # 248..254 - - CloseBrace (Token): "}" # 255..256 - - PositionalArgumentsDeclaration (Rule): # 256..260 '("")' - - OpenParen (Token): "(" # 256..257 - - PositionalArguments (Rule): # 257..259 '""' - - Expression (Rule): # 257..259 '""' - - AsciiStringLiterals (Rule): # 257..259 '""' - - AsciiStringLiteral (Token): '""' # 257..259 - - CloseParen (Token): ")" # 259..260 - - Semicolon (Token): ";" # 260..261 - - ExpressionStatement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' - - Expression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' - - FunctionCallExpression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' - - Expression (Rule): # 262..273 " require" - - Identifier (Token): "require" # 266..273 - - PositionalArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' - - OpenParen (Token): "(" # 273..274 - - PositionalArguments (Rule): # 274..343 'success, "Address: unable to send value, recipient...' - - Expression (Rule): # 274..281 "success" - - Identifier (Token): "success" # 274..281 - - Comma (Token): "," # 281..282 - - Expression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' - - AsciiStringLiterals (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' - - AsciiStringLiteral (Token): '"Address: unable to send value, recipient may have...' # 283..343 - - CloseParen (Token): ")" # 343..344 - - Semicolon (Token): ";" # 344..345 - - CloseBrace (Token): "}" # 348..349 + - ContractMember (Rule): # 47..350 " function sendValue(address payable recipient, ui..." + - FunctionDefinition (Rule): # 47..350 " function sendValue(address payable recipient, ui..." + - FunctionKeyword (Token): "function" # 49..57 + - FunctionName (Rule): # 57..67 " sendValue" + - Identifier (Token): "sendValue" # 58..67 + - ParametersDeclaration (Rule): # 67..110 "(address payable recipient, uint256 amount)" + - OpenParen (Token): "(" # 67..68 + - Parameters (Rule): # 68..109 "address payable recipient, uint256 amount" + - Parameter (Rule): # 68..93 "address payable recipient" + - TypeName (Rule): # 68..83 "address payable" + - ElementaryType (Rule): # 68..83 "address payable" + - AddressType (Rule): # 68..83 "address payable" + - AddressKeyword (Token): "address" # 68..75 + - PayableKeyword (Token): "payable" # 76..83 + - Identifier (Token): "recipient" # 84..93 + - Comma (Token): "," # 93..94 + - Parameter (Rule): # 94..109 " uint256 amount" + - TypeName (Rule): # 94..102 " uint256" + - ElementaryType (Rule): # 94..102 " uint256" + - UintKeyword (Token): "uint256" # 95..102 + - Identifier (Token): "amount" # 103..109 + - CloseParen (Token): ")" # 109..110 + - FunctionAttributes (Rule): # 110..119 " internal" + - FunctionAttribute (Rule): # 110..119 " internal" + - InternalKeyword (Token): "internal" # 111..119 + - FunctionBody (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' + - Block (Rule): # 119..350 ' {\n require(address(this).balance >= amount, "A...' + - OpenBrace (Token): "{" # 120..121 + - Statements (Rule): # 122..346 ' require(address(this).balance >= amount, "Addr...' + - Statement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' + - ExpressionStatement (Rule): # 122..201 ' require(address(this).balance >= amount, "Addr...' + - Expression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' + - FunctionCallExpression (Rule): # 122..199 ' require(address(this).balance >= amount, "Addr...' + - Expression (Rule): # 122..133 " require" + - Identifier (Token): "require" # 126..133 + - ArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' + - PositionalArgumentsDeclaration (Rule): # 133..199 '(address(this).balance >= amount, "Address: insuff...' + - OpenParen (Token): "(" # 133..134 + - PositionalArguments (Rule): # 134..198 'address(this).balance >= amount, "Address: insuffi...' + - Expression (Rule): # 134..165 "address(this).balance >= amount" + - BinaryExpression (Rule): # 134..165 "address(this).balance >= amount" + - Expression (Rule): # 134..155 "address(this).balance" + - MemberAccessExpression (Rule): # 134..155 "address(this).balance" + - Expression (Rule): # 134..147 "address(this)" + - FunctionCallExpression (Rule): # 134..147 "address(this)" + - Expression (Rule): # 134..141 "address" + - ElementaryType (Rule): # 134..141 "address" + - AddressType (Rule): # 134..141 "address" + - AddressKeyword (Token): "address" # 134..141 + - ArgumentsDeclaration (Rule): # 141..147 "(this)" + - PositionalArgumentsDeclaration (Rule): # 141..147 "(this)" + - OpenParen (Token): "(" # 141..142 + - PositionalArguments (Rule): # 142..146 "this" + - Expression (Rule): # 142..146 "this" + - Identifier (Token): "this" # 142..146 + - CloseParen (Token): ")" # 146..147 + - Period (Token): "." # 147..148 + - MemberAccess (Rule): # 148..155 "balance" + - Identifier (Token): "balance" # 148..155 + - GreaterThanEqual (Token): ">=" # 156..158 + - Expression (Rule): # 158..165 " amount" + - Identifier (Token): "amount" # 159..165 + - Comma (Token): "," # 165..166 + - Expression (Rule): # 166..198 ' "Address: insufficient balance"' + - StringExpression (Rule): # 166..198 ' "Address: insufficient balance"' + - AsciiStringLiterals (Rule): # 166..198 ' "Address: insufficient balance"' + - AsciiStringLiteral (Token): '"Address: insufficient balance"' # 167..198 + - CloseParen (Token): ")" # 198..199 + - Semicolon (Token): ";" # 199..200 + - 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 + - TupleDeconstructionElements (Rule): # 207..220 "bool success," + - TupleDeconstructionElement (Rule): # 207..219 "bool success" + - TupleMember (Rule): # 207..219 "bool success" + - TypedTupleMember (Rule): # 207..219 "bool success" + - TypeName (Rule): # 207..211 "bool" + - ElementaryType (Rule): # 207..211 "bool" + - BoolKeyword (Token): "bool" # 207..211 + - Identifier (Token): "success" # 212..219 + - Comma (Token): "," # 219..220 + - TupleDeconstructionElement (Rule): [] # 220..220 + - CloseParen (Token): ")" # 221..222 + - Equal (Token): "=" # 223..224 + - Expression (Rule): # 224..260 ' recipient.call{ value: amount }("")' + - FunctionCallExpression (Rule): # 224..260 ' recipient.call{ value: amount }("")' + - Expression (Rule): # 224..239 " recipient.call" + - MemberAccessExpression (Rule): # 224..239 " recipient.call" + - Expression (Rule): # 224..234 " recipient" + - Identifier (Token): "recipient" # 225..234 + - Period (Token): "." # 234..235 + - MemberAccess (Rule): # 235..239 "call" + - Identifier (Token): "call" # 235..239 + - FunctionCallOptions (Rule): # 239..256 "{ value: amount }" + - NamedArgumentGroup (Rule): # 239..256 "{ value: amount }" + - OpenBrace (Token): "{" # 239..240 + - NamedArguments (Rule): # 240..254 " value: amount" + - NamedArgument (Rule): # 240..254 " value: amount" + - Identifier (Token): "value" # 241..246 + - Colon (Token): ":" # 246..247 + - Expression (Rule): # 247..254 " amount" + - Identifier (Token): "amount" # 248..254 + - CloseBrace (Token): "}" # 255..256 + - ArgumentsDeclaration (Rule): # 256..260 '("")' + - PositionalArgumentsDeclaration (Rule): # 256..260 '("")' + - OpenParen (Token): "(" # 256..257 + - PositionalArguments (Rule): # 257..259 '""' + - Expression (Rule): # 257..259 '""' + - StringExpression (Rule): # 257..259 '""' + - AsciiStringLiterals (Rule): # 257..259 '""' + - AsciiStringLiteral (Token): '""' # 257..259 + - CloseParen (Token): ")" # 259..260 + - Semicolon (Token): ";" # 260..261 + - Statement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' + - ExpressionStatement (Rule): # 262..346 ' require(success, "Address: unable to send valu...' + - Expression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' + - FunctionCallExpression (Rule): # 262..344 ' require(success, "Address: unable to send valu...' + - Expression (Rule): # 262..273 " require" + - Identifier (Token): "require" # 266..273 + - ArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' + - PositionalArgumentsDeclaration (Rule): # 273..344 '(success, "Address: unable to send value, recipien...' + - OpenParen (Token): "(" # 273..274 + - PositionalArguments (Rule): # 274..343 'success, "Address: unable to send value, recipient...' + - Expression (Rule): # 274..281 "success" + - Identifier (Token): "success" # 274..281 + - Comma (Token): "," # 281..282 + - Expression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - StringExpression (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - AsciiStringLiterals (Rule): # 282..343 ' "Address: unable to send value, recipient may hav...' + - AsciiStringLiteral (Token): '"Address: unable to send value, recipient may have...' # 283..343 + - CloseParen (Token): ")" # 343..344 + - Semicolon (Token): ";" # 344..345 + - CloseBrace (Token): "}" # 348..349 - CloseBrace (Token): "}" # 350..351 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 ea11102f51..5f449d56c6 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 @@ -19,17 +19,18 @@ Tree: - InheritanceType (Rule): # 23..33 " Bar(1, 2)" - IdentifierPath (Rule): # 23..27 " Bar" - Identifier (Token): "Bar" # 24..27 - - PositionalArgumentsDeclaration (Rule): # 27..33 "(1, 2)" - - OpenParen (Token): "(" # 27..28 - - PositionalArguments (Rule): # 28..32 "1, 2" - - Expression (Rule): # 28..29 "1" - - DecimalNumberExpression (Rule): # 28..29 "1" - - DecimalLiteral (Token): "1" # 28..29 - - Comma (Token): "," # 29..30 - - Expression (Rule): # 30..32 " 2" - - DecimalNumberExpression (Rule): # 30..32 " 2" - - DecimalLiteral (Token): "2" # 31..32 - - CloseParen (Token): ")" # 32..33 + - ArgumentsDeclaration (Rule): # 27..33 "(1, 2)" + - PositionalArgumentsDeclaration (Rule): # 27..33 "(1, 2)" + - OpenParen (Token): "(" # 27..28 + - PositionalArguments (Rule): # 28..32 "1, 2" + - Expression (Rule): # 28..29 "1" + - DecimalNumberExpression (Rule): # 28..29 "1" + - DecimalLiteral (Token): "1" # 28..29 + - Comma (Token): "," # 29..30 + - Expression (Rule): # 30..32 " 2" + - DecimalNumberExpression (Rule): # 30..32 " 2" + - DecimalLiteral (Token): "2" # 31..32 + - CloseParen (Token): ")" # 32..33 - Comma (Token): "," # 33..34 - InheritanceType (Rule): # 34..38 " Baz" - IdentifierPath (Rule): # 34..38 " Baz" diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.11-failure.yml index 0251fe4ce2..f714e67e0e 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.11-failure.yml @@ -23,9 +23,10 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..31 " constructor" - - StateVariableDefinition (Rule): # 18..31 " constructor" - - TypeName (Rule): # 18..31 " constructor" - - IdentifierPath (Rule): # 18..31 " constructor" - - Identifier (Token): "constructor" # 20..31 + - ContractMember (Rule): # 18..31 " constructor" + - StateVariableDefinition (Rule): # 18..31 " constructor" + - TypeName (Rule): # 18..31 " constructor" + - IdentifierPath (Rule): # 18..31 " constructor" + - Identifier (Token): "constructor" # 20..31 - SKIPPED (Token): "() public {\n }\n" # 31..47 - CloseBrace (Token): "}" # 47..48 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.22-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.22-success.yml index e715e08127..ab95ab6fed 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.22-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/generated/0.4.22-success.yml @@ -14,14 +14,16 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..47 " constructor() public {\n }\n" - - ConstructorDefinition (Rule): # 18..47 " constructor() public {\n }\n" - - ConstructorKeyword (Token): "constructor" # 20..31 - - ParametersDeclaration (Rule): # 31..33 "()" - - OpenParen (Token): "(" # 31..32 - - CloseParen (Token): ")" # 32..33 - - ConstructorAttributes (Rule): # 33..40 " public" - - PublicKeyword (Token): "public" # 34..40 - - Block (Rule): # 40..47 " {\n }\n" - - OpenBrace (Token): "{" # 41..42 - - CloseBrace (Token): "}" # 45..46 + - ContractMember (Rule): # 18..47 " constructor() public {\n }\n" + - ConstructorDefinition (Rule): # 18..47 " constructor() public {\n }\n" + - ConstructorKeyword (Token): "constructor" # 20..31 + - ParametersDeclaration (Rule): # 31..33 "()" + - OpenParen (Token): "(" # 31..32 + - CloseParen (Token): ")" # 32..33 + - ConstructorAttributes (Rule): # 33..40 " public" + - ConstructorAttribute (Rule): # 33..40 " public" + - PublicKeyword (Token): "public" # 34..40 + - Block (Rule): # 40..47 " {\n }\n" + - OpenBrace (Token): "{" # 41..42 + - CloseBrace (Token): "}" # 45..46 - CloseBrace (Token): "}" # 47..48 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 1166acbc75..3525acd12b 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 @@ -17,15 +17,16 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..57 " enum State {\n A,\n B,\n C\n }\n" - - EnumDefinition (Rule): # 18..57 " enum State {\n A,\n B,\n C\n }\n" - - EnumKeyword (Token): "enum" # 20..24 - - Identifier (Token): "State" # 25..30 - - OpenBrace (Token): "{" # 31..32 - - EnumMembers (Rule): # 33..53 " A,\n B,\n C\n" - - Identifier (Token): "A" # 37..38 - - Comma (Token): "," # 38..39 - - Identifier (Token): "B" # 44..45 - - Comma (Token): "," # 45..46 - - Identifier (Token): "C" # 51..52 - - CloseBrace (Token): "}" # 55..56 + - ContractMember (Rule): # 18..57 " enum State {\n A,\n B,\n C\n }\n" + - EnumDefinition (Rule): # 18..57 " enum State {\n A,\n B,\n C\n }\n" + - EnumKeyword (Token): "enum" # 20..24 + - Identifier (Token): "State" # 25..30 + - OpenBrace (Token): "{" # 31..32 + - EnumMembers (Rule): # 33..53 " A,\n B,\n C\n" + - Identifier (Token): "A" # 37..38 + - Comma (Token): "," # 38..39 + - Identifier (Token): "B" # 44..45 + - Comma (Token): "," # 45..46 + - Identifier (Token): "C" # 51..52 + - CloseBrace (Token): "}" # 55..56 - CloseBrace (Token): "}" # 57..58 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 4555d1efe3..97ac2e8f4b 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 @@ -21,11 +21,12 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..36 " error Error1();\n" - - StateVariableDefinition (Rule): # 18..36 " error Error1();\n" - - TypeName (Rule): # 18..25 " error" - - IdentifierPath (Rule): # 18..25 " error" - - Identifier (Token): "error" # 20..25 - - Identifier (Token): "Error1" # 26..32 - - SKIPPED (Token): "()" # 32..34 - - Semicolon (Token): ";" # 34..35 + - ContractMember (Rule): # 18..36 " error Error1();\n" + - StateVariableDefinition (Rule): # 18..36 " error Error1();\n" + - TypeName (Rule): # 18..25 " error" + - IdentifierPath (Rule): # 18..25 " error" + - Identifier (Token): "error" # 20..25 + - Identifier (Token): "Error1" # 26..32 + - SKIPPED (Token): "()" # 32..34 + - Semicolon (Token): ";" # 34..35 - CloseBrace (Token): "}" # 36..37 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.8.4-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.8.4-success.yml index 9305723f44..be624b9213 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.8.4-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_error_definition/generated/0.8.4-success.yml @@ -13,11 +13,12 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..36 " error Error1();\n" - - ErrorDefinition (Rule): # 18..36 " error Error1();\n" - - ErrorKeyword (Token): "error" # 20..25 - - Identifier (Token): "Error1" # 26..32 - - ErrorParametersDeclaration (Rule): # 32..34 "()" - - OpenParen (Token): "(" # 32..33 - - CloseParen (Token): ")" # 33..34 - - Semicolon (Token): ";" # 34..35 + - ContractMember (Rule): # 18..36 " error Error1();\n" + - ErrorDefinition (Rule): # 18..36 " error Error1();\n" + - ErrorKeyword (Token): "error" # 20..25 + - Identifier (Token): "Error1" # 26..32 + - ErrorParametersDeclaration (Rule): # 32..34 "()" + - OpenParen (Token): "(" # 32..33 + - CloseParen (Token): ")" # 33..34 + - Semicolon (Token): ";" # 34..35 - CloseBrace (Token): "}" # 36..37 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_event_definition/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_event_definition/generated/0.4.11-success.yml index 009001d83d..80ae96e494 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_event_definition/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_event_definition/generated/0.4.11-success.yml @@ -13,23 +13,26 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..69 " event Log(uint256 indexed a, uint256 indexed b);..." - - EventDefinition (Rule): # 18..69 " event Log(uint256 indexed a, uint256 indexed b);..." - - EventKeyword (Token): "event" # 20..25 - - Identifier (Token): "Log" # 26..29 - - EventParametersDeclaration (Rule): # 29..67 "(uint256 indexed a, uint256 indexed b)" - - OpenParen (Token): "(" # 29..30 - - EventParameters (Rule): # 30..66 "uint256 indexed a, uint256 indexed b" - - EventParameter (Rule): # 30..47 "uint256 indexed a" - - TypeName (Rule): # 30..37 "uint256" - - UintKeyword (Token): "uint256" # 30..37 - - IndexedKeyword (Token): "indexed" # 38..45 - - Identifier (Token): "a" # 46..47 - - Comma (Token): "," # 47..48 - - EventParameter (Rule): # 48..66 " uint256 indexed b" - - TypeName (Rule): # 48..56 " uint256" - - UintKeyword (Token): "uint256" # 49..56 - - IndexedKeyword (Token): "indexed" # 57..64 - - Identifier (Token): "b" # 65..66 - - CloseParen (Token): ")" # 66..67 - - Semicolon (Token): ";" # 67..68 + - ContractMember (Rule): # 18..69 " event Log(uint256 indexed a, uint256 indexed b);..." + - EventDefinition (Rule): # 18..69 " event Log(uint256 indexed a, uint256 indexed b);..." + - EventKeyword (Token): "event" # 20..25 + - Identifier (Token): "Log" # 26..29 + - EventParametersDeclaration (Rule): # 29..67 "(uint256 indexed a, uint256 indexed b)" + - OpenParen (Token): "(" # 29..30 + - EventParameters (Rule): # 30..66 "uint256 indexed a, uint256 indexed b" + - EventParameter (Rule): # 30..47 "uint256 indexed a" + - TypeName (Rule): # 30..37 "uint256" + - ElementaryType (Rule): # 30..37 "uint256" + - UintKeyword (Token): "uint256" # 30..37 + - IndexedKeyword (Token): "indexed" # 38..45 + - Identifier (Token): "a" # 46..47 + - Comma (Token): "," # 47..48 + - EventParameter (Rule): # 48..66 " uint256 indexed b" + - TypeName (Rule): # 48..56 " uint256" + - ElementaryType (Rule): # 48..56 " uint256" + - UintKeyword (Token): "uint256" # 49..56 + - IndexedKeyword (Token): "indexed" # 57..64 + - Identifier (Token): "b" # 65..66 + - CloseParen (Token): ")" # 66..67 + - Semicolon (Token): ";" # 67..68 - CloseBrace (Token): "}" # 69..70 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.4.11-failure.yml index 71068f5c7b..4fdc9f1513 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.4.11-failure.yml @@ -23,9 +23,10 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..28 " fallback" - - StateVariableDefinition (Rule): # 18..28 " fallback" - - TypeName (Rule): # 18..28 " fallback" - - IdentifierPath (Rule): # 18..28 " fallback" - - Identifier (Token): "fallback" # 20..28 + - ContractMember (Rule): # 18..28 " fallback" + - StateVariableDefinition (Rule): # 18..28 " fallback" + - TypeName (Rule): # 18..28 " fallback" + - IdentifierPath (Rule): # 18..28 " fallback" + - Identifier (Token): "fallback" # 20..28 - SKIPPED (Token): "() {\n }\n" # 28..37 - CloseBrace (Token): "}" # 37..38 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.6.0-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.6.0-success.yml index d367d070a8..f2eaa5c921 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.6.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/generated/0.6.0-success.yml @@ -14,12 +14,14 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..37 " fallback() {\n }\n" - - FallbackFunctionDefinition (Rule): # 18..37 " fallback() {\n }\n" - - FallbackKeyword (Token): "fallback" # 20..28 - - ParametersDeclaration (Rule): # 28..30 "()" - - OpenParen (Token): "(" # 28..29 - - CloseParen (Token): ")" # 29..30 - - Block (Rule): # 30..37 " {\n }\n" - - OpenBrace (Token): "{" # 31..32 - - CloseBrace (Token): "}" # 35..36 + - ContractMember (Rule): # 18..37 " fallback() {\n }\n" + - FallbackFunctionDefinition (Rule): # 18..37 " fallback() {\n }\n" + - FallbackKeyword (Token): "fallback" # 20..28 + - ParametersDeclaration (Rule): # 28..30 "()" + - OpenParen (Token): "(" # 28..29 + - CloseParen (Token): ")" # 29..30 + - FunctionBody (Rule): # 30..37 " {\n }\n" + - Block (Rule): # 30..37 " {\n }\n" + - OpenBrace (Token): "{" # 31..32 + - CloseBrace (Token): "}" # 35..36 - CloseBrace (Token): "}" # 37..38 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_function_definition/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_function_definition/generated/0.4.11-success.yml index bb3659a013..61c55c7199 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_function_definition/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_function_definition/generated/0.4.11-success.yml @@ -15,29 +15,34 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..70 " function foo() returns (uint) {\n return 1;\n ..." - - FunctionDefinition (Rule): # 18..70 " function foo() returns (uint) {\n return 1;\n ..." - - FunctionKeyword (Token): "function" # 20..28 - - Identifier (Token): "foo" # 29..32 - - ParametersDeclaration (Rule): # 32..34 "()" - - OpenParen (Token): "(" # 32..33 - - CloseParen (Token): ")" # 33..34 - - ReturnsDeclaration (Rule): # 34..49 " returns (uint)" - - ReturnsKeyword (Token): "returns" # 35..42 - - ParametersDeclaration (Rule): # 42..49 " (uint)" - - OpenParen (Token): "(" # 43..44 - - Parameters (Rule): # 44..48 "uint" - - Parameter (Rule): # 44..48 "uint" - - TypeName (Rule): # 44..48 "uint" - - UintKeyword (Token): "uint" # 44..48 - - CloseParen (Token): ")" # 48..49 - - Block (Rule): # 49..70 " {\n return 1;\n }\n" - - OpenBrace (Token): "{" # 50..51 - - Statements (Rule): # 52..66 " return 1;\n" - - ReturnStatement (Rule): # 52..66 " return 1;\n" - - ReturnKeyword (Token): "return" # 56..62 - - Expression (Rule): # 62..64 " 1" - - DecimalNumberExpression (Rule): # 62..64 " 1" - - DecimalLiteral (Token): "1" # 63..64 - - Semicolon (Token): ";" # 64..65 - - CloseBrace (Token): "}" # 68..69 + - ContractMember (Rule): # 18..70 " function foo() returns (uint) {\n return 1;\n ..." + - FunctionDefinition (Rule): # 18..70 " function foo() returns (uint) {\n return 1;\n ..." + - FunctionKeyword (Token): "function" # 20..28 + - FunctionName (Rule): # 28..32 " foo" + - Identifier (Token): "foo" # 29..32 + - ParametersDeclaration (Rule): # 32..34 "()" + - OpenParen (Token): "(" # 32..33 + - CloseParen (Token): ")" # 33..34 + - ReturnsDeclaration (Rule): # 34..49 " returns (uint)" + - ReturnsKeyword (Token): "returns" # 35..42 + - ParametersDeclaration (Rule): # 42..49 " (uint)" + - OpenParen (Token): "(" # 43..44 + - Parameters (Rule): # 44..48 "uint" + - Parameter (Rule): # 44..48 "uint" + - TypeName (Rule): # 44..48 "uint" + - ElementaryType (Rule): # 44..48 "uint" + - UintKeyword (Token): "uint" # 44..48 + - CloseParen (Token): ")" # 48..49 + - FunctionBody (Rule): # 49..70 " {\n return 1;\n }\n" + - Block (Rule): # 49..70 " {\n return 1;\n }\n" + - OpenBrace (Token): "{" # 50..51 + - Statements (Rule): # 52..66 " return 1;\n" + - Statement (Rule): # 52..66 " return 1;\n" + - ReturnStatement (Rule): # 52..66 " return 1;\n" + - ReturnKeyword (Token): "return" # 56..62 + - Expression (Rule): # 62..64 " 1" + - DecimalNumberExpression (Rule): # 62..64 " 1" + - DecimalLiteral (Token): "1" # 63..64 + - Semicolon (Token): ";" # 64..65 + - CloseBrace (Token): "}" # 68..69 - CloseBrace (Token): "}" # 70..71 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_modifier_definition/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_modifier_definition/generated/0.4.11-success.yml index f69127c647..9f0b7aa243 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_modifier_definition/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_modifier_definition/generated/0.4.11-success.yml @@ -15,18 +15,21 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..48 " modifier foo() {\n _;\n }\n" - - ModifierDefinition (Rule): # 18..48 " modifier foo() {\n _;\n }\n" - - ModifierKeyword (Token): "modifier" # 20..28 - - Identifier (Token): "foo" # 29..32 - - ParametersDeclaration (Rule): # 32..34 "()" - - OpenParen (Token): "(" # 32..33 - - CloseParen (Token): ")" # 33..34 - - Block (Rule): # 34..48 " {\n _;\n }\n" - - OpenBrace (Token): "{" # 35..36 - - Statements (Rule): # 37..44 " _;\n" - - ExpressionStatement (Rule): # 37..44 " _;\n" - - Expression (Rule): # 37..42 " _" - - Identifier (Token): "_" # 41..42 - - Semicolon (Token): ";" # 42..43 - - CloseBrace (Token): "}" # 46..47 + - ContractMember (Rule): # 18..48 " modifier foo() {\n _;\n }\n" + - ModifierDefinition (Rule): # 18..48 " modifier foo() {\n _;\n }\n" + - ModifierKeyword (Token): "modifier" # 20..28 + - Identifier (Token): "foo" # 29..32 + - ParametersDeclaration (Rule): # 32..34 "()" + - OpenParen (Token): "(" # 32..33 + - CloseParen (Token): ")" # 33..34 + - FunctionBody (Rule): # 34..48 " {\n _;\n }\n" + - Block (Rule): # 34..48 " {\n _;\n }\n" + - OpenBrace (Token): "{" # 35..36 + - Statements (Rule): # 37..44 " _;\n" + - Statement (Rule): # 37..44 " _;\n" + - ExpressionStatement (Rule): # 37..44 " _;\n" + - Expression (Rule): # 37..42 " _" + - Identifier (Token): "_" # 41..42 + - Semicolon (Token): ";" # 42..43 + - CloseBrace (Token): "}" # 46..47 - CloseBrace (Token): "}" # 48..49 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.4.11-failure.yml index aabb2a868b..532de0c3e1 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.4.11-failure.yml @@ -23,9 +23,10 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..27 " receive" - - StateVariableDefinition (Rule): # 18..27 " receive" - - TypeName (Rule): # 18..27 " receive" - - IdentifierPath (Rule): # 18..27 " receive" - - Identifier (Token): "receive" # 20..27 + - ContractMember (Rule): # 18..27 " receive" + - StateVariableDefinition (Rule): # 18..27 " receive" + - TypeName (Rule): # 18..27 " receive" + - IdentifierPath (Rule): # 18..27 " receive" + - Identifier (Token): "receive" # 20..27 - SKIPPED (Token): "() {\n }\n" # 27..36 - CloseBrace (Token): "}" # 36..37 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.6.0-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.6.0-success.yml index 87c3af8bdd..6c9c936f47 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.6.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/generated/0.6.0-success.yml @@ -14,12 +14,14 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..36 " receive() {\n }\n" - - ReceiveFunctionDefinition (Rule): # 18..36 " receive() {\n }\n" - - ReceiveKeyword (Token): "receive" # 20..27 - - ParametersDeclaration (Rule): # 27..29 "()" - - OpenParen (Token): "(" # 27..28 - - CloseParen (Token): ")" # 28..29 - - Block (Rule): # 29..36 " {\n }\n" - - OpenBrace (Token): "{" # 30..31 - - CloseBrace (Token): "}" # 34..35 + - ContractMember (Rule): # 18..36 " receive() {\n }\n" + - ReceiveFunctionDefinition (Rule): # 18..36 " receive() {\n }\n" + - ReceiveKeyword (Token): "receive" # 20..27 + - ParametersDeclaration (Rule): # 27..29 "()" + - OpenParen (Token): "(" # 27..28 + - CloseParen (Token): ")" # 28..29 + - FunctionBody (Rule): # 29..36 " {\n }\n" + - Block (Rule): # 29..36 " {\n }\n" + - OpenBrace (Token): "{" # 30..31 + - CloseBrace (Token): "}" # 34..35 - CloseBrace (Token): "}" # 36..37 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_state_variable_declaration/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_state_variable_declaration/generated/0.4.11-success.yml index ee9dcd89da..a4378b1106 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_state_variable_declaration/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_state_variable_declaration/generated/0.4.11-success.yml @@ -13,11 +13,14 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..35 " uint public a;\n" - - StateVariableDefinition (Rule): # 18..35 " uint public a;\n" - - TypeName (Rule): # 18..24 " uint" - - UintKeyword (Token): "uint" # 20..24 - - StateVariableAttributes (Rule): # 24..31 " public" - - PublicKeyword (Token): "public" # 25..31 - - Identifier (Token): "a" # 32..33 - - Semicolon (Token): ";" # 33..34 + - ContractMember (Rule): # 18..35 " uint public a;\n" + - StateVariableDefinition (Rule): # 18..35 " uint public a;\n" + - TypeName (Rule): # 18..24 " uint" + - ElementaryType (Rule): # 18..24 " uint" + - UintKeyword (Token): "uint" # 20..24 + - StateVariableAttributes (Rule): # 24..31 " public" + - StateVariableAttribute (Rule): # 24..31 " public" + - PublicKeyword (Token): "public" # 25..31 + - Identifier (Token): "a" # 32..33 + - Semicolon (Token): ";" # 33..34 - CloseBrace (Token): "}" # 35..36 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_struct_definition/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_struct_definition/generated/0.4.11-success.yml index 27a0a2afa5..682507a89c 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_struct_definition/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_struct_definition/generated/0.4.11-success.yml @@ -16,20 +16,23 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..59 " struct S {\n uint a;\n uint b;\n }\n" - - StructDefinition (Rule): # 18..59 " struct S {\n uint a;\n uint b;\n }\n" - - StructKeyword (Token): "struct" # 20..26 - - Identifier (Token): "S" # 27..28 - - OpenBrace (Token): "{" # 29..30 - - StructMembers (Rule): # 31..55 " uint a;\n uint b;\n" - - StructMember (Rule): # 31..43 " uint a;\n" - - TypeName (Rule): # 31..39 " uint" - - UintKeyword (Token): "uint" # 35..39 - - Identifier (Token): "a" # 40..41 - - Semicolon (Token): ";" # 41..42 - - StructMember (Rule): # 43..55 " uint b;\n" - - TypeName (Rule): # 43..51 " uint" - - UintKeyword (Token): "uint" # 47..51 - - Identifier (Token): "b" # 52..53 - - Semicolon (Token): ";" # 53..54 - - CloseBrace (Token): "}" # 57..58 + - ContractMember (Rule): # 18..59 " struct S {\n uint a;\n uint b;\n }\n" + - StructDefinition (Rule): # 18..59 " struct S {\n uint a;\n uint b;\n }\n" + - StructKeyword (Token): "struct" # 20..26 + - Identifier (Token): "S" # 27..28 + - OpenBrace (Token): "{" # 29..30 + - StructMembers (Rule): # 31..55 " uint a;\n uint b;\n" + - StructMember (Rule): # 31..43 " uint a;\n" + - TypeName (Rule): # 31..39 " uint" + - ElementaryType (Rule): # 31..39 " uint" + - UintKeyword (Token): "uint" # 35..39 + - Identifier (Token): "a" # 40..41 + - Semicolon (Token): ";" # 41..42 + - StructMember (Rule): # 43..55 " uint b;\n" + - TypeName (Rule): # 43..51 " uint" + - ElementaryType (Rule): # 43..51 " uint" + - UintKeyword (Token): "uint" # 47..51 + - Identifier (Token): "b" # 52..53 + - Semicolon (Token): ";" # 53..54 + - CloseBrace (Token): "}" # 57..58 - CloseBrace (Token): "}" # 59..60 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.4.11-success.yml index 48120bf2a9..b5c9837f28 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.4.11-success.yml @@ -14,12 +14,14 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..38 " function () {\n }\n" - - UnnamedFunctionDefinition (Rule): # 18..38 " function () {\n }\n" - - FunctionKeyword (Token): "function" # 20..28 - - ParametersDeclaration (Rule): # 28..31 " ()" - - OpenParen (Token): "(" # 29..30 - - CloseParen (Token): ")" # 30..31 - - Block (Rule): # 31..38 " {\n }\n" - - OpenBrace (Token): "{" # 32..33 - - CloseBrace (Token): "}" # 36..37 + - ContractMember (Rule): # 18..38 " function () {\n }\n" + - UnnamedFunctionDefinition (Rule): # 18..38 " function () {\n }\n" + - FunctionKeyword (Token): "function" # 20..28 + - ParametersDeclaration (Rule): # 28..31 " ()" + - OpenParen (Token): "(" # 29..30 + - CloseParen (Token): ")" # 30..31 + - FunctionBody (Rule): # 31..38 " {\n }\n" + - Block (Rule): # 31..38 " {\n }\n" + - OpenBrace (Token): "{" # 32..33 + - CloseBrace (Token): "}" # 36..37 - CloseBrace (Token): "}" # 38..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.0-failure.yml index 93e25e1492..5696554d4b 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.0-failure.yml @@ -23,12 +23,13 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..32 " function () " - - StateVariableDefinition (Rule): # 18..32 " function () " - - TypeName (Rule): # 18..31 " function ()" - - FunctionType (Rule): # 18..31 " function ()" - - FunctionKeyword (Token): "function" # 20..28 - - ParametersDeclaration (Rule): # 28..31 " ()" - - OpenParen (Token): "(" # 29..30 - - CloseParen (Token): ")" # 30..31 + - ContractMember (Rule): # 18..32 " function () " + - StateVariableDefinition (Rule): # 18..32 " function () " + - TypeName (Rule): # 18..31 " function ()" + - FunctionType (Rule): # 18..31 " function ()" + - FunctionKeyword (Token): "function" # 20..28 + - ParametersDeclaration (Rule): # 28..31 " ()" + - OpenParen (Token): "(" # 29..30 + - CloseParen (Token): ")" # 30..31 - SKIPPED (Token): "{\n }\n" # 32..38 - CloseBrace (Token): "}" # 38..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.5-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.5-failure.yml index 72390bb00b..78ab089f3e 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.5-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_definition/generated/0.6.5-failure.yml @@ -23,12 +23,13 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..32 " function () " - - StateVariableDefinition (Rule): # 18..32 " function () " - - TypeName (Rule): # 18..31 " function ()" - - FunctionType (Rule): # 18..31 " function ()" - - FunctionKeyword (Token): "function" # 20..28 - - ParametersDeclaration (Rule): # 28..31 " ()" - - OpenParen (Token): "(" # 29..30 - - CloseParen (Token): ")" # 30..31 + - ContractMember (Rule): # 18..32 " function () " + - StateVariableDefinition (Rule): # 18..32 " function () " + - TypeName (Rule): # 18..31 " function ()" + - FunctionType (Rule): # 18..31 " function ()" + - FunctionKeyword (Token): "function" # 20..28 + - ParametersDeclaration (Rule): # 28..31 " ()" + - OpenParen (Token): "(" # 29..30 + - CloseParen (Token): ")" # 30..31 - SKIPPED (Token): "{\n }\n" # 32..38 - CloseBrace (Token): "}" # 38..39 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.4.11-success.yml index 42edcc5d37..57d19ae0cd 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.4.11-success.yml @@ -13,15 +13,19 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..51 " function() external payable {}\n" - - UnnamedFunctionDefinition (Rule): # 18..51 " function() external payable {}\n" - - FunctionKeyword (Token): "function" # 20..28 - - ParametersDeclaration (Rule): # 28..30 "()" - - OpenParen (Token): "(" # 28..29 - - CloseParen (Token): ")" # 29..30 - - UnnamedFunctionAttributes (Rule): # 30..47 " external payable" - - ExternalKeyword (Token): "external" # 31..39 - - PayableKeyword (Token): "payable" # 40..47 - - Block (Rule): # 47..51 " {}\n" - - OpenBrace (Token): "{" # 48..49 - - CloseBrace (Token): "}" # 49..50 + - ContractMember (Rule): # 18..51 " function() external payable {}\n" + - UnnamedFunctionDefinition (Rule): # 18..51 " function() external payable {}\n" + - FunctionKeyword (Token): "function" # 20..28 + - ParametersDeclaration (Rule): # 28..30 "()" + - OpenParen (Token): "(" # 28..29 + - CloseParen (Token): ")" # 29..30 + - UnnamedFunctionAttributes (Rule): # 30..47 " external payable" + - UnnamedFunctionAttribute (Rule): # 30..39 " external" + - ExternalKeyword (Token): "external" # 31..39 + - UnnamedFunctionAttribute (Rule): # 39..47 " payable" + - PayableKeyword (Token): "payable" # 40..47 + - FunctionBody (Rule): # 47..51 " {}\n" + - Block (Rule): # 47..51 " {}\n" + - OpenBrace (Token): "{" # 48..49 + - CloseBrace (Token): "}" # 49..50 - CloseBrace (Token): "}" # 51..52 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.0-failure.yml index c8ad17d053..55b82275dd 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.0-failure.yml @@ -21,15 +21,18 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..48 " function() external payable " - - StateVariableDefinition (Rule): # 18..48 " function() external payable " - - TypeName (Rule): # 18..47 " function() external payable" - - FunctionType (Rule): # 18..47 " function() external payable" - - FunctionKeyword (Token): "function" # 20..28 - - ParametersDeclaration (Rule): # 28..30 "()" - - OpenParen (Token): "(" # 28..29 - - CloseParen (Token): ")" # 29..30 - - FunctionTypeAttributes (Rule): # 30..47 " external payable" - - ExternalKeyword (Token): "external" # 31..39 - - PayableKeyword (Token): "payable" # 40..47 + - ContractMember (Rule): # 18..48 " function() external payable " + - StateVariableDefinition (Rule): # 18..48 " function() external payable " + - TypeName (Rule): # 18..47 " function() external payable" + - FunctionType (Rule): # 18..47 " function() external payable" + - FunctionKeyword (Token): "function" # 20..28 + - ParametersDeclaration (Rule): # 28..30 "()" + - OpenParen (Token): "(" # 28..29 + - CloseParen (Token): ")" # 29..30 + - FunctionTypeAttributes (Rule): # 30..47 " external payable" + - FunctionTypeAttribute (Rule): # 30..39 " external" + - ExternalKeyword (Token): "external" # 31..39 + - FunctionTypeAttribute (Rule): # 39..47 " payable" + - PayableKeyword (Token): "payable" # 40..47 - SKIPPED (Token): "{}\n" # 48..51 - CloseBrace (Token): "}" # 51..52 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.5-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.5-failure.yml index 01028ffa79..fc9236a304 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.5-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_unnamed_function_with_attrs_definition/generated/0.6.5-failure.yml @@ -21,15 +21,18 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..48 " function() external payable " - - StateVariableDefinition (Rule): # 18..48 " function() external payable " - - TypeName (Rule): # 18..47 " function() external payable" - - FunctionType (Rule): # 18..47 " function() external payable" - - FunctionKeyword (Token): "function" # 20..28 - - ParametersDeclaration (Rule): # 28..30 "()" - - OpenParen (Token): "(" # 28..29 - - CloseParen (Token): ")" # 29..30 - - FunctionTypeAttributes (Rule): # 30..47 " external payable" - - ExternalKeyword (Token): "external" # 31..39 - - PayableKeyword (Token): "payable" # 40..47 + - ContractMember (Rule): # 18..48 " function() external payable " + - StateVariableDefinition (Rule): # 18..48 " function() external payable " + - TypeName (Rule): # 18..47 " function() external payable" + - FunctionType (Rule): # 18..47 " function() external payable" + - FunctionKeyword (Token): "function" # 20..28 + - ParametersDeclaration (Rule): # 28..30 "()" + - OpenParen (Token): "(" # 28..29 + - CloseParen (Token): ")" # 29..30 + - FunctionTypeAttributes (Rule): # 30..47 " external payable" + - FunctionTypeAttribute (Rule): # 30..39 " external" + - ExternalKeyword (Token): "external" # 31..39 + - FunctionTypeAttribute (Rule): # 39..47 " payable" + - PayableKeyword (Token): "payable" # 40..47 - SKIPPED (Token): "{}\n" # 48..51 - CloseBrace (Token): "}" # 51..52 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.8-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.8-success.yml index e68c1cfdbe..336b0f7dc6 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.8-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_user_defined_value_type_definition/generated/0.8.8-success.yml @@ -13,10 +13,12 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..38 " type Foo is bool;\n" - - UserDefinedValueTypeDefinition (Rule): # 18..38 " type Foo is bool;\n" - - TypeKeyword (Token): "type" # 20..24 - - Identifier (Token): "Foo" # 25..28 - - IsKeyword (Token): "is" # 29..31 - - BoolKeyword (Token): "bool" # 32..36 - - Semicolon (Token): ";" # 36..37 + - ContractMember (Rule): # 18..38 " type Foo is bool;\n" + - UserDefinedValueTypeDefinition (Rule): # 18..38 " type Foo is bool;\n" + - TypeKeyword (Token): "type" # 20..24 + - Identifier (Token): "Foo" # 25..28 + - IsKeyword (Token): "is" # 29..31 + - ElementaryType (Rule): # 31..36 " bool" + - BoolKeyword (Token): "bool" # 32..36 + - Semicolon (Token): ";" # 36..37 - CloseBrace (Token): "}" # 38..39 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 5249d303e6..ddf2780163 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 @@ -13,11 +13,14 @@ Tree: - Identifier (Token): "Sample" # 9..15 - OpenBrace (Token): "{" # 16..17 - ContractMembers (Rule): # 18..35 " using x for *;\n" - - UsingDirective (Rule): # 18..35 " using x for *;\n" - - UsingKeyword (Token): "using" # 20..25 - - IdentifierPath (Rule): # 25..27 " x" - - Identifier (Token): "x" # 26..27 - - ForKeyword (Token): "for" # 28..31 - - Asterisk (Token): "*" # 32..33 - - Semicolon (Token): ";" # 33..34 + - ContractMember (Rule): # 18..35 " using x for *;\n" + - UsingDirective (Rule): # 18..35 " using x for *;\n" + - UsingKeyword (Token): "using" # 20..25 + - UsingClause (Rule): # 25..27 " x" + - IdentifierPath (Rule): # 25..27 " x" + - Identifier (Token): "x" # 26..27 + - ForKeyword (Token): "for" # 28..31 + - UsingTarget (Rule): # 31..33 " *" + - Asterisk (Token): "*" # 32..33 + - Semicolon (Token): ";" # 33..34 - CloseBrace (Token): "}" # 35..36 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.4.11-failure.yml index 3e2bc6893f..2d787095b3 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.4.11-failure.yml @@ -21,10 +21,11 @@ Tree: - Identifier (Token): "Test" # 9..13 - OpenBrace (Token): "{" # 14..15 - ContractMembers (Rule): # 16..25 " field;\n" - - StateVariableDefinition (Rule): # 16..25 " field;\n" - - TypeName (Rule): # 16..23 " field" - - IdentifierPath (Rule): # 16..23 " field" - - Identifier (Token): "field" # 18..23 - - SKIPPED (Token): "" # 23..23 - - Semicolon (Token): ";" # 23..24 + - ContractMember (Rule): # 16..25 " field;\n" + - StateVariableDefinition (Rule): # 16..25 " field;\n" + - TypeName (Rule): # 16..23 " field" + - IdentifierPath (Rule): # 16..23 " field" + - Identifier (Token): "field" # 18..23 + - SKIPPED (Token): "" # 23..23 + - Semicolon (Token): ";" # 23..24 - CloseBrace (Token): "}" # 25..26 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.6.5-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.6.5-failure.yml index 2c3ee58344..a76cc045df 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.6.5-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.6.5-failure.yml @@ -21,10 +21,11 @@ Tree: - Identifier (Token): "Test" # 9..13 - OpenBrace (Token): "{" # 14..15 - ContractMembers (Rule): # 16..25 " field;\n" - - StateVariableDefinition (Rule): # 16..25 " field;\n" - - TypeName (Rule): # 16..23 " field" - - IdentifierPath (Rule): # 16..23 " field" - - Identifier (Token): "field" # 18..23 - - SKIPPED (Token): "" # 23..23 - - Semicolon (Token): ";" # 23..24 + - ContractMember (Rule): # 16..25 " field;\n" + - StateVariableDefinition (Rule): # 16..25 " field;\n" + - TypeName (Rule): # 16..23 " field" + - IdentifierPath (Rule): # 16..23 " field" + - Identifier (Token): "field" # 18..23 + - SKIPPED (Token): "" # 23..23 + - Semicolon (Token): ";" # 23..24 - CloseBrace (Token): "}" # 25..26 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 9ddbf6f70e..380b33d364 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 @@ -47,65 +47,82 @@ Tree: - Identifier (Token): "Contract" # 9..17 - OpenBrace (Token): "{" # 18..19 - ContractMembers (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "_transfer" # 30..39 - - ParametersDeclaration (Rule): # 39..54 "(address while)" - - OpenParen (Token): "(" # 39..40 - - Parameters (Rule): # 40..47 "address" - - Parameter (Rule): # 40..47 "address" - - TypeName (Rule): # 40..47 "address" - - AddressType (Rule): # 40..47 "address" - - AddressKeyword (Token): "address" # 40..47 - - SKIPPED (Token): "while" # 48..53 - - CloseParen (Token): ")" # 53..54 - - FunctionAttributes (Rule): # 54..62 " private" - - PrivateKeyword (Token): "private" # 55..62 - - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." - - OpenBrace (Token): "{" # 63..64 - - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfKeyword (Token): "if" # 67..69 - - OpenParen (Token): "(" # 69..70 - - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 - - CloseParen (Token): ")" # 110..111 - - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - OpenBrace (Token): "{" # 111..112 - - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - TypeName (Rule): # 113..123 "\t\t\tuint256" - - UintKeyword (Token): "uint256" # 116..123 - - Identifier (Token): "a" # 124..125 - - VariableDeclarationValue (Rule): # 125..129 " = 1" - - Equal (Token): "=" # 126..127 - - Expression (Rule): # 127..129 " 1" - - DecimalNumberExpression (Rule): # 127..129 " 1" - - DecimalLiteral (Token): "1" # 128..129 - - Semicolon (Token): ";" # 129..130 - - CloseBrace (Token): "}" # 133..134 - - CloseBrace (Token): "}" # 136..137 - - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." - - FunctionKeyword (Token): "function" # 140..148 - - Identifier (Token): "abc" # 149..152 - - ParametersDeclaration (Rule): # 152..154 "()" - - OpenParen (Token): "(" # 152..153 - - CloseParen (Token): ")" # 153..154 - - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." - - OpenBrace (Token): "{" # 155..156 - - Statements (Rule): # 157..186 "\t\tuint256 x = 0;\n\t\tunchecked " - - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - TypeName (Rule): # 157..166 "\t\tuint256" - - UintKeyword (Token): "uint256" # 159..166 - - Identifier (Token): "x" # 167..168 - - VariableDeclarationValue (Rule): # 168..172 " = 0" - - Equal (Token): "=" # 169..170 - - Expression (Rule): # 170..172 " 0" - - DecimalNumberExpression (Rule): # 170..172 " 0" - - DecimalLiteral (Token): "0" # 171..172 - - Semicolon (Token): ";" # 172..173 - - ExpressionStatement (Rule): # 174..186 "\t\tunchecked " - - Expression (Rule): # 174..185 "\t\tunchecked" - - Identifier (Token): "unchecked" # 176..185 - - SKIPPED (Token): "{ invalid sequence }\n\t" # 186..208 - - CloseBrace (Token): "}" # 208..209 + - ContractMember (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionKeyword (Token): "function" # 21..29 + - FunctionName (Rule): # 29..39 " _transfer" + - Identifier (Token): "_transfer" # 30..39 + - ParametersDeclaration (Rule): # 39..54 "(address while)" + - OpenParen (Token): "(" # 39..40 + - Parameters (Rule): # 40..47 "address" + - Parameter (Rule): # 40..47 "address" + - TypeName (Rule): # 40..47 "address" + - ElementaryType (Rule): # 40..47 "address" + - AddressType (Rule): # 40..47 "address" + - AddressKeyword (Token): "address" # 40..47 + - SKIPPED (Token): "while" # 48..53 + - CloseParen (Token): ")" # 53..54 + - FunctionAttributes (Rule): # 54..62 " private" + - FunctionAttribute (Rule): # 54..62 " private" + - PrivateKeyword (Token): "private" # 55..62 + - FunctionBody (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - OpenBrace (Token): "{" # 63..64 + - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfKeyword (Token): "if" # 67..69 + - OpenParen (Token): "(" # 69..70 + - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 + - CloseParen (Token): ")" # 110..111 + - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - OpenBrace (Token): "{" # 111..112 + - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationType (Rule): # 113..123 "\t\t\tuint256" + - TypeName (Rule): # 113..123 "\t\t\tuint256" + - ElementaryType (Rule): # 113..123 "\t\t\tuint256" + - UintKeyword (Token): "uint256" # 116..123 + - Identifier (Token): "a" # 124..125 + - VariableDeclarationValue (Rule): # 125..129 " = 1" + - Equal (Token): "=" # 126..127 + - Expression (Rule): # 127..129 " 1" + - DecimalNumberExpression (Rule): # 127..129 " 1" + - DecimalLiteral (Token): "1" # 128..129 + - Semicolon (Token): ";" # 129..130 + - CloseBrace (Token): "}" # 133..134 + - CloseBrace (Token): "}" # 136..137 + - ContractMember (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionKeyword (Token): "function" # 140..148 + - FunctionName (Rule): # 148..152 " abc" + - Identifier (Token): "abc" # 149..152 + - ParametersDeclaration (Rule): # 152..154 "()" + - OpenParen (Token): "(" # 152..153 + - CloseParen (Token): ")" # 153..154 + - FunctionBody (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - OpenBrace (Token): "{" # 155..156 + - Statements (Rule): # 157..186 "\t\tuint256 x = 0;\n\t\tunchecked " + - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationType (Rule): # 157..166 "\t\tuint256" + - TypeName (Rule): # 157..166 "\t\tuint256" + - ElementaryType (Rule): # 157..166 "\t\tuint256" + - UintKeyword (Token): "uint256" # 159..166 + - Identifier (Token): "x" # 167..168 + - VariableDeclarationValue (Rule): # 168..172 " = 0" + - Equal (Token): "=" # 169..170 + - Expression (Rule): # 170..172 " 0" + - DecimalNumberExpression (Rule): # 170..172 " 0" + - DecimalLiteral (Token): "0" # 171..172 + - Semicolon (Token): ";" # 172..173 + - Statement (Rule): # 174..186 "\t\tunchecked " + - ExpressionStatement (Rule): # 174..186 "\t\tunchecked " + - Expression (Rule): # 174..185 "\t\tunchecked" + - Identifier (Token): "unchecked" # 176..185 + - SKIPPED (Token): "{ invalid sequence }\n\t" # 186..208 + - CloseBrace (Token): "}" # 208..209 - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.0-failure.yml index b5f0c518ac..4f6d831972 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.5.0-failure.yml @@ -47,62 +47,78 @@ Tree: - Identifier (Token): "Contract" # 9..17 - OpenBrace (Token): "{" # 18..19 - ContractMembers (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "_transfer" # 30..39 - - ParametersDeclaration (Rule): # 39..54 "(address while)" - - OpenParen (Token): "(" # 39..40 - - Parameters (Rule): # 40..47 "address" - - Parameter (Rule): # 40..47 "address" - - TypeName (Rule): # 40..47 "address" - - AddressType (Rule): # 40..47 "address" - - AddressKeyword (Token): "address" # 40..47 - - SKIPPED (Token): "while" # 48..53 - - CloseParen (Token): ")" # 53..54 - - FunctionAttributes (Rule): # 54..62 " private" - - PrivateKeyword (Token): "private" # 55..62 - - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." - - OpenBrace (Token): "{" # 63..64 - - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfKeyword (Token): "if" # 67..69 - - OpenParen (Token): "(" # 69..70 - - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 - - CloseParen (Token): ")" # 110..111 - - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - OpenBrace (Token): "{" # 111..112 - - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - TypeName (Rule): # 113..123 "\t\t\tuint256" - - UintKeyword (Token): "uint256" # 116..123 - - Identifier (Token): "a" # 124..125 - - VariableDeclarationValue (Rule): # 125..129 " = 1" - - Equal (Token): "=" # 126..127 - - Expression (Rule): # 127..129 " 1" - - DecimalNumberExpression (Rule): # 127..129 " 1" - - DecimalLiteral (Token): "1" # 128..129 - - Semicolon (Token): ";" # 129..130 - - CloseBrace (Token): "}" # 133..134 - - CloseBrace (Token): "}" # 136..137 - - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." - - FunctionKeyword (Token): "function" # 140..148 - - Identifier (Token): "abc" # 149..152 - - ParametersDeclaration (Rule): # 152..154 "()" - - OpenParen (Token): "(" # 152..153 - - CloseParen (Token): ")" # 153..154 - - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." - - OpenBrace (Token): "{" # 155..156 - - Statements (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - TypeName (Rule): # 157..166 "\t\tuint256" - - UintKeyword (Token): "uint256" # 159..166 - - Identifier (Token): "x" # 167..168 - - VariableDeclarationValue (Rule): # 168..172 " = 0" - - Equal (Token): "=" # 169..170 - - Expression (Rule): # 170..172 " 0" - - DecimalNumberExpression (Rule): # 170..172 " 0" - - DecimalLiteral (Token): "0" # 171..172 - - Semicolon (Token): ";" # 172..173 - - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 - - CloseBrace (Token): "}" # 208..209 + - ContractMember (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionKeyword (Token): "function" # 21..29 + - FunctionName (Rule): # 29..39 " _transfer" + - Identifier (Token): "_transfer" # 30..39 + - ParametersDeclaration (Rule): # 39..54 "(address while)" + - OpenParen (Token): "(" # 39..40 + - Parameters (Rule): # 40..47 "address" + - Parameter (Rule): # 40..47 "address" + - TypeName (Rule): # 40..47 "address" + - ElementaryType (Rule): # 40..47 "address" + - AddressType (Rule): # 40..47 "address" + - AddressKeyword (Token): "address" # 40..47 + - SKIPPED (Token): "while" # 48..53 + - CloseParen (Token): ")" # 53..54 + - FunctionAttributes (Rule): # 54..62 " private" + - FunctionAttribute (Rule): # 54..62 " private" + - PrivateKeyword (Token): "private" # 55..62 + - FunctionBody (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - OpenBrace (Token): "{" # 63..64 + - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfKeyword (Token): "if" # 67..69 + - OpenParen (Token): "(" # 69..70 + - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 + - CloseParen (Token): ")" # 110..111 + - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - OpenBrace (Token): "{" # 111..112 + - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationType (Rule): # 113..123 "\t\t\tuint256" + - TypeName (Rule): # 113..123 "\t\t\tuint256" + - ElementaryType (Rule): # 113..123 "\t\t\tuint256" + - UintKeyword (Token): "uint256" # 116..123 + - Identifier (Token): "a" # 124..125 + - VariableDeclarationValue (Rule): # 125..129 " = 1" + - Equal (Token): "=" # 126..127 + - Expression (Rule): # 127..129 " 1" + - DecimalNumberExpression (Rule): # 127..129 " 1" + - DecimalLiteral (Token): "1" # 128..129 + - Semicolon (Token): ";" # 129..130 + - CloseBrace (Token): "}" # 133..134 + - CloseBrace (Token): "}" # 136..137 + - ContractMember (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionKeyword (Token): "function" # 140..148 + - FunctionName (Rule): # 148..152 " abc" + - Identifier (Token): "abc" # 149..152 + - ParametersDeclaration (Rule): # 152..154 "()" + - OpenParen (Token): "(" # 152..153 + - CloseParen (Token): ")" # 153..154 + - FunctionBody (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - OpenBrace (Token): "{" # 155..156 + - Statements (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationType (Rule): # 157..166 "\t\tuint256" + - TypeName (Rule): # 157..166 "\t\tuint256" + - ElementaryType (Rule): # 157..166 "\t\tuint256" + - UintKeyword (Token): "uint256" # 159..166 + - Identifier (Token): "x" # 167..168 + - VariableDeclarationValue (Rule): # 168..172 " = 0" + - Equal (Token): "=" # 169..170 + - Expression (Rule): # 170..172 " 0" + - DecimalNumberExpression (Rule): # 170..172 " 0" + - DecimalLiteral (Token): "0" # 171..172 + - Semicolon (Token): ";" # 172..173 + - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 + - CloseBrace (Token): "}" # 208..209 - CloseBrace (Token): "}" # 210..211 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 09aa26f1c9..6bbb43429c 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 @@ -47,62 +47,78 @@ Tree: - Identifier (Token): "Contract" # 9..17 - OpenBrace (Token): "{" # 18..19 - ContractMembers (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "_transfer" # 30..39 - - ParametersDeclaration (Rule): # 39..54 "(address while)" - - OpenParen (Token): "(" # 39..40 - - Parameters (Rule): # 40..47 "address" - - Parameter (Rule): # 40..47 "address" - - TypeName (Rule): # 40..47 "address" - - AddressType (Rule): # 40..47 "address" - - AddressKeyword (Token): "address" # 40..47 - - SKIPPED (Token): "while" # 48..53 - - CloseParen (Token): ")" # 53..54 - - FunctionAttributes (Rule): # 54..62 " private" - - PrivateKeyword (Token): "private" # 55..62 - - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." - - OpenBrace (Token): "{" # 63..64 - - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfKeyword (Token): "if" # 67..69 - - OpenParen (Token): "(" # 69..70 - - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 - - CloseParen (Token): ")" # 110..111 - - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - OpenBrace (Token): "{" # 111..112 - - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - TypeName (Rule): # 113..123 "\t\t\tuint256" - - UintKeyword (Token): "uint256" # 116..123 - - Identifier (Token): "a" # 124..125 - - VariableDeclarationValue (Rule): # 125..129 " = 1" - - Equal (Token): "=" # 126..127 - - Expression (Rule): # 127..129 " 1" - - DecimalNumberExpression (Rule): # 127..129 " 1" - - DecimalLiteral (Token): "1" # 128..129 - - Semicolon (Token): ";" # 129..130 - - CloseBrace (Token): "}" # 133..134 - - CloseBrace (Token): "}" # 136..137 - - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." - - FunctionKeyword (Token): "function" # 140..148 - - Identifier (Token): "abc" # 149..152 - - ParametersDeclaration (Rule): # 152..154 "()" - - OpenParen (Token): "(" # 152..153 - - CloseParen (Token): ")" # 153..154 - - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." - - OpenBrace (Token): "{" # 155..156 - - Statements (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - TypeName (Rule): # 157..166 "\t\tuint256" - - UintKeyword (Token): "uint256" # 159..166 - - Identifier (Token): "x" # 167..168 - - VariableDeclarationValue (Rule): # 168..172 " = 0" - - Equal (Token): "=" # 169..170 - - Expression (Rule): # 170..172 " 0" - - DecimalNumberExpression (Rule): # 170..172 " 0" - - DecimalLiteral (Token): "0" # 171..172 - - Semicolon (Token): ";" # 172..173 - - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 - - CloseBrace (Token): "}" # 208..209 + - ContractMember (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionKeyword (Token): "function" # 21..29 + - FunctionName (Rule): # 29..39 " _transfer" + - Identifier (Token): "_transfer" # 30..39 + - ParametersDeclaration (Rule): # 39..54 "(address while)" + - OpenParen (Token): "(" # 39..40 + - Parameters (Rule): # 40..47 "address" + - Parameter (Rule): # 40..47 "address" + - TypeName (Rule): # 40..47 "address" + - ElementaryType (Rule): # 40..47 "address" + - AddressType (Rule): # 40..47 "address" + - AddressKeyword (Token): "address" # 40..47 + - SKIPPED (Token): "while" # 48..53 + - CloseParen (Token): ")" # 53..54 + - FunctionAttributes (Rule): # 54..62 " private" + - FunctionAttribute (Rule): # 54..62 " private" + - PrivateKeyword (Token): "private" # 55..62 + - FunctionBody (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - OpenBrace (Token): "{" # 63..64 + - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfKeyword (Token): "if" # 67..69 + - OpenParen (Token): "(" # 69..70 + - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 + - CloseParen (Token): ")" # 110..111 + - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - OpenBrace (Token): "{" # 111..112 + - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationType (Rule): # 113..123 "\t\t\tuint256" + - TypeName (Rule): # 113..123 "\t\t\tuint256" + - ElementaryType (Rule): # 113..123 "\t\t\tuint256" + - UintKeyword (Token): "uint256" # 116..123 + - Identifier (Token): "a" # 124..125 + - VariableDeclarationValue (Rule): # 125..129 " = 1" + - Equal (Token): "=" # 126..127 + - Expression (Rule): # 127..129 " 1" + - DecimalNumberExpression (Rule): # 127..129 " 1" + - DecimalLiteral (Token): "1" # 128..129 + - Semicolon (Token): ";" # 129..130 + - CloseBrace (Token): "}" # 133..134 + - CloseBrace (Token): "}" # 136..137 + - ContractMember (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionKeyword (Token): "function" # 140..148 + - FunctionName (Rule): # 148..152 " abc" + - Identifier (Token): "abc" # 149..152 + - ParametersDeclaration (Rule): # 152..154 "()" + - OpenParen (Token): "(" # 152..153 + - CloseParen (Token): ")" # 153..154 + - FunctionBody (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - OpenBrace (Token): "{" # 155..156 + - Statements (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationType (Rule): # 157..166 "\t\tuint256" + - TypeName (Rule): # 157..166 "\t\tuint256" + - ElementaryType (Rule): # 157..166 "\t\tuint256" + - UintKeyword (Token): "uint256" # 159..166 + - Identifier (Token): "x" # 167..168 + - VariableDeclarationValue (Rule): # 168..172 " = 0" + - Equal (Token): "=" # 169..170 + - Expression (Rule): # 170..172 " 0" + - DecimalNumberExpression (Rule): # 170..172 " 0" + - DecimalLiteral (Token): "0" # 171..172 + - Semicolon (Token): ";" # 172..173 + - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 + - CloseBrace (Token): "}" # 208..209 - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.6.0-failure.yml index 96f0abf624..ce9eb6e7a9 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated/0.6.0-failure.yml @@ -47,62 +47,78 @@ Tree: - Identifier (Token): "Contract" # 9..17 - OpenBrace (Token): "{" # 18..19 - ContractMembers (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "_transfer" # 30..39 - - ParametersDeclaration (Rule): # 39..54 "(address while)" - - OpenParen (Token): "(" # 39..40 - - Parameters (Rule): # 40..47 "address" - - Parameter (Rule): # 40..47 "address" - - TypeName (Rule): # 40..47 "address" - - AddressType (Rule): # 40..47 "address" - - AddressKeyword (Token): "address" # 40..47 - - SKIPPED (Token): "while" # 48..53 - - CloseParen (Token): ")" # 53..54 - - FunctionAttributes (Rule): # 54..62 " private" - - PrivateKeyword (Token): "private" # 55..62 - - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." - - OpenBrace (Token): "{" # 63..64 - - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfKeyword (Token): "if" # 67..69 - - OpenParen (Token): "(" # 69..70 - - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 - - CloseParen (Token): ")" # 110..111 - - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - OpenBrace (Token): "{" # 111..112 - - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - TypeName (Rule): # 113..123 "\t\t\tuint256" - - UintKeyword (Token): "uint256" # 116..123 - - Identifier (Token): "a" # 124..125 - - VariableDeclarationValue (Rule): # 125..129 " = 1" - - Equal (Token): "=" # 126..127 - - Expression (Rule): # 127..129 " 1" - - DecimalNumberExpression (Rule): # 127..129 " 1" - - DecimalLiteral (Token): "1" # 128..129 - - Semicolon (Token): ";" # 129..130 - - CloseBrace (Token): "}" # 133..134 - - CloseBrace (Token): "}" # 136..137 - - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." - - FunctionKeyword (Token): "function" # 140..148 - - Identifier (Token): "abc" # 149..152 - - ParametersDeclaration (Rule): # 152..154 "()" - - OpenParen (Token): "(" # 152..153 - - CloseParen (Token): ")" # 153..154 - - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." - - OpenBrace (Token): "{" # 155..156 - - Statements (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - TypeName (Rule): # 157..166 "\t\tuint256" - - UintKeyword (Token): "uint256" # 159..166 - - Identifier (Token): "x" # 167..168 - - VariableDeclarationValue (Rule): # 168..172 " = 0" - - Equal (Token): "=" # 169..170 - - Expression (Rule): # 170..172 " 0" - - DecimalNumberExpression (Rule): # 170..172 " 0" - - DecimalLiteral (Token): "0" # 171..172 - - Semicolon (Token): ";" # 172..173 - - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 - - CloseBrace (Token): "}" # 208..209 + - ContractMember (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionKeyword (Token): "function" # 21..29 + - FunctionName (Rule): # 29..39 " _transfer" + - Identifier (Token): "_transfer" # 30..39 + - ParametersDeclaration (Rule): # 39..54 "(address while)" + - OpenParen (Token): "(" # 39..40 + - Parameters (Rule): # 40..47 "address" + - Parameter (Rule): # 40..47 "address" + - TypeName (Rule): # 40..47 "address" + - ElementaryType (Rule): # 40..47 "address" + - AddressType (Rule): # 40..47 "address" + - AddressKeyword (Token): "address" # 40..47 + - SKIPPED (Token): "while" # 48..53 + - CloseParen (Token): ")" # 53..54 + - FunctionAttributes (Rule): # 54..62 " private" + - FunctionAttribute (Rule): # 54..62 " private" + - PrivateKeyword (Token): "private" # 55..62 + - FunctionBody (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - OpenBrace (Token): "{" # 63..64 + - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfKeyword (Token): "if" # 67..69 + - OpenParen (Token): "(" # 69..70 + - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 + - CloseParen (Token): ")" # 110..111 + - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - OpenBrace (Token): "{" # 111..112 + - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationType (Rule): # 113..123 "\t\t\tuint256" + - TypeName (Rule): # 113..123 "\t\t\tuint256" + - ElementaryType (Rule): # 113..123 "\t\t\tuint256" + - UintKeyword (Token): "uint256" # 116..123 + - Identifier (Token): "a" # 124..125 + - VariableDeclarationValue (Rule): # 125..129 " = 1" + - Equal (Token): "=" # 126..127 + - Expression (Rule): # 127..129 " 1" + - DecimalNumberExpression (Rule): # 127..129 " 1" + - DecimalLiteral (Token): "1" # 128..129 + - Semicolon (Token): ";" # 129..130 + - CloseBrace (Token): "}" # 133..134 + - CloseBrace (Token): "}" # 136..137 + - ContractMember (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionKeyword (Token): "function" # 140..148 + - FunctionName (Rule): # 148..152 " abc" + - Identifier (Token): "abc" # 149..152 + - ParametersDeclaration (Rule): # 152..154 "()" + - OpenParen (Token): "(" # 152..153 + - CloseParen (Token): ")" # 153..154 + - FunctionBody (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - OpenBrace (Token): "{" # 155..156 + - Statements (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationType (Rule): # 157..166 "\t\tuint256" + - TypeName (Rule): # 157..166 "\t\tuint256" + - ElementaryType (Rule): # 157..166 "\t\tuint256" + - UintKeyword (Token): "uint256" # 159..166 + - Identifier (Token): "x" # 167..168 + - VariableDeclarationValue (Rule): # 168..172 " = 0" + - Equal (Token): "=" # 169..170 + - Expression (Rule): # 170..172 " 0" + - DecimalNumberExpression (Rule): # 170..172 " 0" + - DecimalLiteral (Token): "0" # 171..172 + - Semicolon (Token): ";" # 172..173 + - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 + - CloseBrace (Token): "}" # 208..209 - CloseBrace (Token): "}" # 210..211 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 b1bc0f22e6..884a2699af 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 @@ -47,62 +47,78 @@ Tree: - Identifier (Token): "Contract" # 9..17 - OpenBrace (Token): "{" # 18..19 - ContractMembers (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "_transfer" # 30..39 - - ParametersDeclaration (Rule): # 39..54 "(address while)" - - OpenParen (Token): "(" # 39..40 - - Parameters (Rule): # 40..47 "address" - - Parameter (Rule): # 40..47 "address" - - TypeName (Rule): # 40..47 "address" - - AddressType (Rule): # 40..47 "address" - - AddressKeyword (Token): "address" # 40..47 - - SKIPPED (Token): "while" # 48..53 - - CloseParen (Token): ")" # 53..54 - - FunctionAttributes (Rule): # 54..62 " private" - - PrivateKeyword (Token): "private" # 55..62 - - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." - - OpenBrace (Token): "{" # 63..64 - - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfKeyword (Token): "if" # 67..69 - - OpenParen (Token): "(" # 69..70 - - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 - - CloseParen (Token): ")" # 110..111 - - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - OpenBrace (Token): "{" # 111..112 - - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - TypeName (Rule): # 113..123 "\t\t\tuint256" - - UintKeyword (Token): "uint256" # 116..123 - - Identifier (Token): "a" # 124..125 - - VariableDeclarationValue (Rule): # 125..129 " = 1" - - Equal (Token): "=" # 126..127 - - Expression (Rule): # 127..129 " 1" - - DecimalNumberExpression (Rule): # 127..129 " 1" - - DecimalLiteral (Token): "1" # 128..129 - - Semicolon (Token): ";" # 129..130 - - CloseBrace (Token): "}" # 133..134 - - CloseBrace (Token): "}" # 136..137 - - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." - - FunctionKeyword (Token): "function" # 140..148 - - Identifier (Token): "abc" # 149..152 - - ParametersDeclaration (Rule): # 152..154 "()" - - OpenParen (Token): "(" # 152..153 - - CloseParen (Token): ")" # 153..154 - - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." - - OpenBrace (Token): "{" # 155..156 - - Statements (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - TypeName (Rule): # 157..166 "\t\tuint256" - - UintKeyword (Token): "uint256" # 159..166 - - Identifier (Token): "x" # 167..168 - - VariableDeclarationValue (Rule): # 168..172 " = 0" - - Equal (Token): "=" # 169..170 - - Expression (Rule): # 170..172 " 0" - - DecimalNumberExpression (Rule): # 170..172 " 0" - - DecimalLiteral (Token): "0" # 171..172 - - Semicolon (Token): ";" # 172..173 - - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 - - CloseBrace (Token): "}" # 208..209 + - ContractMember (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionKeyword (Token): "function" # 21..29 + - FunctionName (Rule): # 29..39 " _transfer" + - Identifier (Token): "_transfer" # 30..39 + - ParametersDeclaration (Rule): # 39..54 "(address while)" + - OpenParen (Token): "(" # 39..40 + - Parameters (Rule): # 40..47 "address" + - Parameter (Rule): # 40..47 "address" + - TypeName (Rule): # 40..47 "address" + - ElementaryType (Rule): # 40..47 "address" + - AddressType (Rule): # 40..47 "address" + - AddressKeyword (Token): "address" # 40..47 + - SKIPPED (Token): "while" # 48..53 + - CloseParen (Token): ")" # 53..54 + - FunctionAttributes (Rule): # 54..62 " private" + - FunctionAttribute (Rule): # 54..62 " private" + - PrivateKeyword (Token): "private" # 55..62 + - FunctionBody (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - OpenBrace (Token): "{" # 63..64 + - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfKeyword (Token): "if" # 67..69 + - OpenParen (Token): "(" # 69..70 + - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 + - CloseParen (Token): ")" # 110..111 + - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - OpenBrace (Token): "{" # 111..112 + - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationType (Rule): # 113..123 "\t\t\tuint256" + - TypeName (Rule): # 113..123 "\t\t\tuint256" + - ElementaryType (Rule): # 113..123 "\t\t\tuint256" + - UintKeyword (Token): "uint256" # 116..123 + - Identifier (Token): "a" # 124..125 + - VariableDeclarationValue (Rule): # 125..129 " = 1" + - Equal (Token): "=" # 126..127 + - Expression (Rule): # 127..129 " 1" + - DecimalNumberExpression (Rule): # 127..129 " 1" + - DecimalLiteral (Token): "1" # 128..129 + - Semicolon (Token): ";" # 129..130 + - CloseBrace (Token): "}" # 133..134 + - CloseBrace (Token): "}" # 136..137 + - ContractMember (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionKeyword (Token): "function" # 140..148 + - FunctionName (Rule): # 148..152 " abc" + - Identifier (Token): "abc" # 149..152 + - ParametersDeclaration (Rule): # 152..154 "()" + - OpenParen (Token): "(" # 152..153 + - CloseParen (Token): ")" # 153..154 + - FunctionBody (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - OpenBrace (Token): "{" # 155..156 + - Statements (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationType (Rule): # 157..166 "\t\tuint256" + - TypeName (Rule): # 157..166 "\t\tuint256" + - ElementaryType (Rule): # 157..166 "\t\tuint256" + - UintKeyword (Token): "uint256" # 159..166 + - Identifier (Token): "x" # 167..168 + - VariableDeclarationValue (Rule): # 168..172 " = 0" + - Equal (Token): "=" # 169..170 + - Expression (Rule): # 170..172 " 0" + - DecimalNumberExpression (Rule): # 170..172 " 0" + - DecimalLiteral (Token): "0" # 171..172 + - Semicolon (Token): ";" # 172..173 + - SKIPPED (Token): "unchecked { invalid sequence }\n\t" # 176..208 + - CloseBrace (Token): "}" # 208..209 - CloseBrace (Token): "}" # 210..211 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 81f4618530..314b925e1d 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 @@ -46,73 +46,92 @@ Tree: - Identifier (Token): "Contract" # 9..17 - OpenBrace (Token): "{" # 18..19 - ContractMembers (Rule): # 20..210 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "_transfer" # 30..39 - - ParametersDeclaration (Rule): # 39..54 "(address while)" - - OpenParen (Token): "(" # 39..40 - - Parameters (Rule): # 40..47 "address" - - Parameter (Rule): # 40..47 "address" - - TypeName (Rule): # 40..47 "address" - - AddressType (Rule): # 40..47 "address" - - AddressKeyword (Token): "address" # 40..47 - - SKIPPED (Token): "while" # 48..53 - - CloseParen (Token): ")" # 53..54 - - FunctionAttributes (Rule): # 54..62 " private" - - PrivateKeyword (Token): "private" # 55..62 - - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." - - OpenBrace (Token): "{" # 63..64 - - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." - - IfKeyword (Token): "if" # 67..69 - - OpenParen (Token): "(" # 69..70 - - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 - - CloseParen (Token): ")" # 110..111 - - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" - - OpenBrace (Token): "{" # 111..112 - - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" - - TypeName (Rule): # 113..123 "\t\t\tuint256" - - UintKeyword (Token): "uint256" # 116..123 - - Identifier (Token): "a" # 124..125 - - VariableDeclarationValue (Rule): # 125..129 " = 1" - - Equal (Token): "=" # 126..127 - - Expression (Rule): # 127..129 " 1" - - DecimalNumberExpression (Rule): # 127..129 " 1" - - DecimalLiteral (Token): "1" # 128..129 - - Semicolon (Token): ";" # 129..130 - - CloseBrace (Token): "}" # 133..134 - - CloseBrace (Token): "}" # 136..137 - - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." - - FunctionKeyword (Token): "function" # 140..148 - - Identifier (Token): "abc" # 149..152 - - ParametersDeclaration (Rule): # 152..154 "()" - - OpenParen (Token): "(" # 152..153 - - CloseParen (Token): ")" # 153..154 - - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." - - OpenBrace (Token): "{" # 155..156 - - Statements (Rule): # 157..207 "\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence }\n" - - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" - - TypeName (Rule): # 157..166 "\t\tuint256" - - UintKeyword (Token): "uint256" # 159..166 - - Identifier (Token): "x" # 167..168 - - VariableDeclarationValue (Rule): # 168..172 " = 0" - - Equal (Token): "=" # 169..170 - - Expression (Rule): # 170..172 " 0" - - DecimalNumberExpression (Rule): # 170..172 " 0" - - DecimalLiteral (Token): "0" # 171..172 - - Semicolon (Token): ";" # 172..173 - - UncheckedBlock (Rule): # 174..207 "\t\tunchecked { invalid sequence }\n" - - UncheckedKeyword (Token): "unchecked" # 176..185 - - Block (Rule): # 185..207 " { invalid sequence }\n" - - OpenBrace (Token): "{" # 186..187 - - Statements (Rule): # 187..205 " invalid sequence " - - VariableDeclarationStatement (Rule): # 187..205 " invalid sequence " - - TypeName (Rule): # 187..195 " invalid" - - IdentifierPath (Rule): # 187..195 " invalid" - - Identifier (Token): "invalid" # 188..195 - - Identifier (Token): "sequence" # 196..204 - - SKIPPED (Token): "" # 205..205 - - CloseBrace (Token): "}" # 205..206 - - CloseBrace (Token): "}" # 208..209 + - ContractMember (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionDefinition (Rule): # 20..138 "\tfunction _transfer(address while) private {\n\t\tif(..." + - FunctionKeyword (Token): "function" # 21..29 + - FunctionName (Rule): # 29..39 " _transfer" + - Identifier (Token): "_transfer" # 30..39 + - ParametersDeclaration (Rule): # 39..54 "(address while)" + - OpenParen (Token): "(" # 39..40 + - Parameters (Rule): # 40..47 "address" + - Parameter (Rule): # 40..47 "address" + - TypeName (Rule): # 40..47 "address" + - ElementaryType (Rule): # 40..47 "address" + - AddressType (Rule): # 40..47 "address" + - AddressKeyword (Token): "address" # 40..47 + - SKIPPED (Token): "while" # 48..53 + - CloseParen (Token): ")" # 53..54 + - FunctionAttributes (Rule): # 54..62 " private" + - FunctionAttribute (Rule): # 54..62 " private" + - PrivateKeyword (Token): "private" # 55..62 + - FunctionBody (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - Block (Rule): # 62..138 " {\n\t\tif(while == pair && !_isExcludedFromFee[to]){..." + - OpenBrace (Token): "{" # 63..64 + - Statements (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - Statement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfStatement (Rule): # 65..135 "\t\tif(while == pair && !_isExcludedFromFee[to]){\n\t\t..." + - IfKeyword (Token): "if" # 67..69 + - OpenParen (Token): "(" # 69..70 + - SKIPPED (Token): "while == pair && !_isExcludedFromFee[to]" # 70..110 + - CloseParen (Token): ")" # 110..111 + - Statement (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - Block (Rule): # 111..135 "{\n\t\t\tuint256 a = 1;\n\t\t}\n" + - OpenBrace (Token): "{" # 111..112 + - Statements (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - Statement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationStatement (Rule): # 113..131 "\t\t\tuint256 a = 1;\n" + - VariableDeclarationType (Rule): # 113..123 "\t\t\tuint256" + - TypeName (Rule): # 113..123 "\t\t\tuint256" + - ElementaryType (Rule): # 113..123 "\t\t\tuint256" + - UintKeyword (Token): "uint256" # 116..123 + - Identifier (Token): "a" # 124..125 + - VariableDeclarationValue (Rule): # 125..129 " = 1" + - Equal (Token): "=" # 126..127 + - Expression (Rule): # 127..129 " 1" + - DecimalNumberExpression (Rule): # 127..129 " 1" + - DecimalLiteral (Token): "1" # 128..129 + - Semicolon (Token): ";" # 129..130 + - CloseBrace (Token): "}" # 133..134 + - CloseBrace (Token): "}" # 136..137 + - ContractMember (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionDefinition (Rule): # 138..210 "\n\tfunction abc() {\n\t\tuint256 x = 0;\n\t\tunchecked { ..." + - FunctionKeyword (Token): "function" # 140..148 + - FunctionName (Rule): # 148..152 " abc" + - Identifier (Token): "abc" # 149..152 + - ParametersDeclaration (Rule): # 152..154 "()" + - OpenParen (Token): "(" # 152..153 + - CloseParen (Token): ")" # 153..154 + - FunctionBody (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - Block (Rule): # 154..210 " {\n\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence..." + - OpenBrace (Token): "{" # 155..156 + - Statements (Rule): # 157..207 "\t\tuint256 x = 0;\n\t\tunchecked { invalid sequence }\n" + - Statement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationStatement (Rule): # 157..174 "\t\tuint256 x = 0;\n" + - VariableDeclarationType (Rule): # 157..166 "\t\tuint256" + - TypeName (Rule): # 157..166 "\t\tuint256" + - ElementaryType (Rule): # 157..166 "\t\tuint256" + - UintKeyword (Token): "uint256" # 159..166 + - Identifier (Token): "x" # 167..168 + - VariableDeclarationValue (Rule): # 168..172 " = 0" + - Equal (Token): "=" # 169..170 + - Expression (Rule): # 170..172 " 0" + - DecimalNumberExpression (Rule): # 170..172 " 0" + - DecimalLiteral (Token): "0" # 171..172 + - Semicolon (Token): ";" # 172..173 + - Statement (Rule): # 174..207 "\t\tunchecked { invalid sequence }\n" + - UncheckedBlock (Rule): # 174..207 "\t\tunchecked { invalid sequence }\n" + - UncheckedKeyword (Token): "unchecked" # 176..185 + - Block (Rule): # 185..207 " { invalid sequence }\n" + - OpenBrace (Token): "{" # 186..187 + - Statements (Rule): # 187..205 " invalid sequence " + - Statement (Rule): # 187..205 " invalid sequence " + - VariableDeclarationStatement (Rule): # 187..205 " invalid sequence " + - VariableDeclarationType (Rule): # 187..195 " 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 + - CloseBrace (Token): "}" # 205..206 + - CloseBrace (Token): "}" # 208..209 - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/constructor/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/constructor/generated/0.4.11-failure.yml index 142a85db71..8b03a67310 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/constructor/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/constructor/generated/0.4.11-failure.yml @@ -15,8 +15,9 @@ Errors: # 1 total Tree: - ContractMembers (Rule): # 0..24 "constructor() public {}\n" - - StateVariableDefinition (Rule): # 0..11 "constructor" - - TypeName (Rule): # 0..11 "constructor" - - IdentifierPath (Rule): # 0..11 "constructor" - - Identifier (Token): "constructor" # 0..11 + - ContractMember (Rule): # 0..11 "constructor" + - StateVariableDefinition (Rule): # 0..11 "constructor" + - TypeName (Rule): # 0..11 "constructor" + - IdentifierPath (Rule): # 0..11 "constructor" + - Identifier (Token): "constructor" # 0..11 - SKIPPED (Token): "() public {}\n" # 11..24 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/constructor/generated/0.4.22-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/constructor/generated/0.4.22-success.yml index 997f15149a..857a392c80 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/constructor/generated/0.4.22-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/constructor/generated/0.4.22-success.yml @@ -7,13 +7,15 @@ Errors: [] Tree: - ContractMembers (Rule): # 0..24 "constructor() public {}\n" - - ConstructorDefinition (Rule): # 0..24 "constructor() public {}\n" - - ConstructorKeyword (Token): "constructor" # 0..11 - - ParametersDeclaration (Rule): # 11..13 "()" - - OpenParen (Token): "(" # 11..12 - - CloseParen (Token): ")" # 12..13 - - ConstructorAttributes (Rule): # 13..20 " public" - - PublicKeyword (Token): "public" # 14..20 - - Block (Rule): # 20..24 " {}\n" - - OpenBrace (Token): "{" # 21..22 - - CloseBrace (Token): "}" # 22..23 + - ContractMember (Rule): # 0..24 "constructor() public {}\n" + - ConstructorDefinition (Rule): # 0..24 "constructor() public {}\n" + - ConstructorKeyword (Token): "constructor" # 0..11 + - ParametersDeclaration (Rule): # 11..13 "()" + - OpenParen (Token): "(" # 11..12 + - CloseParen (Token): ")" # 12..13 + - ConstructorAttributes (Rule): # 13..20 " public" + - ConstructorAttribute (Rule): # 13..20 " public" + - PublicKeyword (Token): "public" # 14..20 + - Block (Rule): # 20..24 " {}\n" + - OpenBrace (Token): "{" # 21..22 + - CloseBrace (Token): "}" # 22..23 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/local_expression/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/local_expression/generated/0.4.11-success.yml index 53671e0c8e..f3dd2450ae 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/local_expression/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/local_expression/generated/0.4.11-success.yml @@ -9,35 +9,41 @@ Errors: [] Tree: - ContractMembers (Rule): # 0..42 "function func() {\n uint a = 1 + 2 * 3;\n}\n" - - FunctionDefinition (Rule): # 0..42 "function func() {\n uint a = 1 + 2 * 3;\n}\n" - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "func" # 9..13 - - ParametersDeclaration (Rule): # 13..15 "()" - - OpenParen (Token): "(" # 13..14 - - CloseParen (Token): ")" # 14..15 - - Block (Rule): # 15..42 " {\n uint a = 1 + 2 * 3;\n}\n" - - OpenBrace (Token): "{" # 16..17 - - Statements (Rule): # 18..40 " uint a = 1 + 2 * 3;\n" - - VariableDeclarationStatement (Rule): # 18..40 " uint a = 1 + 2 * 3;\n" - - TypeName (Rule): # 18..24 " uint" - - UintKeyword (Token): "uint" # 20..24 - - Identifier (Token): "a" # 25..26 - - VariableDeclarationValue (Rule): # 26..38 " = 1 + 2 * 3" - - Equal (Token): "=" # 27..28 - - Expression (Rule): # 28..38 " 1 + 2 * 3" - - BinaryExpression (Rule): # 28..38 " 1 + 2 * 3" - - Expression (Rule): # 28..30 " 1" - - DecimalNumberExpression (Rule): # 28..30 " 1" - - DecimalLiteral (Token): "1" # 29..30 - - Plus (Token): "+" # 31..32 - - Expression (Rule): # 32..38 " 2 * 3" - - BinaryExpression (Rule): # 32..38 " 2 * 3" - - Expression (Rule): # 32..34 " 2" - - DecimalNumberExpression (Rule): # 32..34 " 2" - - DecimalLiteral (Token): "2" # 33..34 - - Asterisk (Token): "*" # 35..36 - - Expression (Rule): # 36..38 " 3" - - DecimalNumberExpression (Rule): # 36..38 " 3" - - DecimalLiteral (Token): "3" # 37..38 - - Semicolon (Token): ";" # 38..39 - - CloseBrace (Token): "}" # 40..41 + - ContractMember (Rule): # 0..42 "function func() {\n uint a = 1 + 2 * 3;\n}\n" + - FunctionDefinition (Rule): # 0..42 "function func() {\n uint a = 1 + 2 * 3;\n}\n" + - FunctionKeyword (Token): "function" # 0..8 + - FunctionName (Rule): # 8..13 " func" + - Identifier (Token): "func" # 9..13 + - ParametersDeclaration (Rule): # 13..15 "()" + - OpenParen (Token): "(" # 13..14 + - CloseParen (Token): ")" # 14..15 + - FunctionBody (Rule): # 15..42 " {\n uint a = 1 + 2 * 3;\n}\n" + - Block (Rule): # 15..42 " {\n uint a = 1 + 2 * 3;\n}\n" + - OpenBrace (Token): "{" # 16..17 + - Statements (Rule): # 18..40 " uint a = 1 + 2 * 3;\n" + - Statement (Rule): # 18..40 " uint a = 1 + 2 * 3;\n" + - VariableDeclarationStatement (Rule): # 18..40 " uint a = 1 + 2 * 3;\n" + - VariableDeclarationType (Rule): # 18..24 " uint" + - TypeName (Rule): # 18..24 " uint" + - ElementaryType (Rule): # 18..24 " uint" + - UintKeyword (Token): "uint" # 20..24 + - Identifier (Token): "a" # 25..26 + - VariableDeclarationValue (Rule): # 26..38 " = 1 + 2 * 3" + - Equal (Token): "=" # 27..28 + - Expression (Rule): # 28..38 " 1 + 2 * 3" + - BinaryExpression (Rule): # 28..38 " 1 + 2 * 3" + - Expression (Rule): # 28..30 " 1" + - DecimalNumberExpression (Rule): # 28..30 " 1" + - DecimalLiteral (Token): "1" # 29..30 + - Plus (Token): "+" # 31..32 + - Expression (Rule): # 32..38 " 2 * 3" + - BinaryExpression (Rule): # 32..38 " 2 * 3" + - Expression (Rule): # 32..34 " 2" + - DecimalNumberExpression (Rule): # 32..34 " 2" + - DecimalLiteral (Token): "2" # 33..34 + - Asterisk (Token): "*" # 35..36 + - Expression (Rule): # 36..38 " 3" + - DecimalNumberExpression (Rule): # 36..38 " 3" + - DecimalLiteral (Token): "3" # 37..38 + - Semicolon (Token): ";" # 38..39 + - CloseBrace (Token): "}" # 40..41 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.4.11-failure.yml index 813d1de643..cd3cf512d1 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.4.11-failure.yml @@ -28,41 +28,49 @@ Errors: # 2 total Tree: - ContractMembers (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "someFunc" # 9..17 - - ParametersDeclaration (Rule): # 17..19 "()" - - OpenParen (Token): "(" # 17..18 - - CloseParen (Token): ")" # 18..19 - - FunctionAttributes (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - TypeName (Rule): # 35..50 " uint256" - - UintKeyword (Token): "uint256" # 43..50 - - Identifier (Token): "arg" # 51..54 - - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValues (Rule): # 58..63 "1 + 2" - - TupleValue (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - DecimalNumberExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - DecimalNumberExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - ContractMember (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionKeyword (Token): "function" # 0..8 + - FunctionName (Rule): # 8..17 " someFunc" + - Identifier (Token): "someFunc" # 9..17 + - ParametersDeclaration (Rule): # 17..19 "()" + - OpenParen (Token): "(" # 17..18 + - CloseParen (Token): ")" # 18..19 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 + - Identifier (Token): "arg" # 51..54 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.4.21-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.4.21-failure.yml index 8caf42d81b..afd17fa0ed 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.4.21-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.4.21-failure.yml @@ -28,41 +28,49 @@ Errors: # 2 total Tree: - ContractMembers (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "someFunc" # 9..17 - - ParametersDeclaration (Rule): # 17..19 "()" - - OpenParen (Token): "(" # 17..18 - - CloseParen (Token): ")" # 18..19 - - FunctionAttributes (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - TypeName (Rule): # 35..50 " uint256" - - UintKeyword (Token): "uint256" # 43..50 - - Identifier (Token): "arg" # 51..54 - - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValues (Rule): # 58..63 "1 + 2" - - TupleValue (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - DecimalNumberExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - DecimalNumberExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - ContractMember (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionKeyword (Token): "function" # 0..8 + - FunctionName (Rule): # 8..17 " someFunc" + - Identifier (Token): "someFunc" # 9..17 + - ParametersDeclaration (Rule): # 17..19 "()" + - OpenParen (Token): "(" # 17..18 + - CloseParen (Token): ")" # 18..19 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 + - Identifier (Token): "arg" # 51..54 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.5.0-failure.yml index d2d6f3a43b..bd1f4c2e2d 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.5.0-failure.yml @@ -28,41 +28,49 @@ Errors: # 2 total Tree: - ContractMembers (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "someFunc" # 9..17 - - ParametersDeclaration (Rule): # 17..19 "()" - - OpenParen (Token): "(" # 17..18 - - CloseParen (Token): ")" # 18..19 - - FunctionAttributes (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - TypeName (Rule): # 35..50 " uint256" - - UintKeyword (Token): "uint256" # 43..50 - - Identifier (Token): "arg" # 51..54 - - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValues (Rule): # 58..63 "1 + 2" - - TupleValue (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - DecimalNumberExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - DecimalNumberExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - ContractMember (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionKeyword (Token): "function" # 0..8 + - FunctionName (Rule): # 8..17 " someFunc" + - Identifier (Token): "someFunc" # 9..17 + - ParametersDeclaration (Rule): # 17..19 "()" + - OpenParen (Token): "(" # 17..18 + - CloseParen (Token): ")" # 18..19 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 + - Identifier (Token): "arg" # 51..54 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.5.3-failure.yml index 69b8095919..c492dce64f 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.5.3-failure.yml @@ -28,41 +28,49 @@ Errors: # 2 total Tree: - ContractMembers (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "someFunc" # 9..17 - - ParametersDeclaration (Rule): # 17..19 "()" - - OpenParen (Token): "(" # 17..18 - - CloseParen (Token): ")" # 18..19 - - FunctionAttributes (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - TypeName (Rule): # 35..50 " uint256" - - UintKeyword (Token): "uint256" # 43..50 - - Identifier (Token): "arg" # 51..54 - - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValues (Rule): # 58..63 "1 + 2" - - TupleValue (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - DecimalNumberExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - DecimalNumberExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - ContractMember (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionKeyword (Token): "function" # 0..8 + - FunctionName (Rule): # 8..17 " someFunc" + - Identifier (Token): "someFunc" # 9..17 + - ParametersDeclaration (Rule): # 17..19 "()" + - OpenParen (Token): "(" # 17..18 + - CloseParen (Token): ")" # 18..19 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 + - Identifier (Token): "arg" # 51..54 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.6.0-failure.yml index 274b5368dc..143d3fcf3b 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.6.0-failure.yml @@ -28,41 +28,49 @@ Errors: # 2 total Tree: - ContractMembers (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "someFunc" # 9..17 - - ParametersDeclaration (Rule): # 17..19 "()" - - OpenParen (Token): "(" # 17..18 - - CloseParen (Token): ")" # 18..19 - - FunctionAttributes (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - TypeName (Rule): # 35..50 " uint256" - - UintKeyword (Token): "uint256" # 43..50 - - Identifier (Token): "arg" # 51..54 - - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValues (Rule): # 58..63 "1 + 2" - - TupleValue (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - DecimalNumberExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - DecimalNumberExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - ContractMember (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionKeyword (Token): "function" # 0..8 + - FunctionName (Rule): # 8..17 " someFunc" + - Identifier (Token): "someFunc" # 9..17 + - ParametersDeclaration (Rule): # 17..19 "()" + - OpenParen (Token): "(" # 17..18 + - CloseParen (Token): ")" # 18..19 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 + - Identifier (Token): "arg" # 51..54 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.7.0-failure.yml index 4c3d6b8f2d..07aa14ec80 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.7.0-failure.yml @@ -28,41 +28,49 @@ Errors: # 2 total Tree: - ContractMembers (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "someFunc" # 9..17 - - ParametersDeclaration (Rule): # 17..19 "()" - - OpenParen (Token): "(" # 17..18 - - CloseParen (Token): ")" # 18..19 - - FunctionAttributes (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - TypeName (Rule): # 35..50 " uint256" - - UintKeyword (Token): "uint256" # 43..50 - - Identifier (Token): "arg" # 51..54 - - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValues (Rule): # 58..63 "1 + 2" - - TupleValue (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - DecimalNumberExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - DecimalNumberExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - ContractMember (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionKeyword (Token): "function" # 0..8 + - FunctionName (Rule): # 8..17 " someFunc" + - Identifier (Token): "someFunc" # 9..17 + - ParametersDeclaration (Rule): # 17..19 "()" + - OpenParen (Token): "(" # 17..18 + - CloseParen (Token): ")" # 18..19 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 + - Identifier (Token): "arg" # 51..54 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.8.0-failure.yml index f370c2181c..56729fe767 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.8.0-failure.yml @@ -28,41 +28,49 @@ Errors: # 2 total Tree: - ContractMembers (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "someFunc" # 9..17 - - ParametersDeclaration (Rule): # 17..19 "()" - - OpenParen (Token): "(" # 17..18 - - CloseParen (Token): ")" # 18..19 - - FunctionAttributes (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - TypeName (Rule): # 35..50 " uint256" - - UintKeyword (Token): "uint256" # 43..50 - - Identifier (Token): "arg" # 51..54 - - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValues (Rule): # 58..63 "1 + 2" - - TupleValue (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - DecimalNumberExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - DecimalNumberExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - ContractMember (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionKeyword (Token): "function" # 0..8 + - FunctionName (Rule): # 8..17 " someFunc" + - Identifier (Token): "someFunc" # 9..17 + - ParametersDeclaration (Rule): # 17..19 "()" + - OpenParen (Token): "(" # 17..18 + - CloseParen (Token): ")" # 18..19 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 + - Identifier (Token): "arg" # 51..54 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.8.4-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.8.4-failure.yml index dad44c7d54..922c4458f3 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.8.4-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/mismatched_delimiter/generated/0.8.4-failure.yml @@ -28,41 +28,49 @@ Errors: # 2 total Tree: - ContractMembers (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "someFunc" # 9..17 - - ParametersDeclaration (Rule): # 17..19 "()" - - OpenParen (Token): "(" # 17..18 - - CloseParen (Token): ")" # 18..19 - - FunctionAttributes (Rule): # 19..26 " public" - - PublicKeyword (Token): "public" # 20..26 - - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" - - OpenBrace (Token): "{" # 27..28 - - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" - - OpenBrace (Token): "{" # 33..34 - - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" - - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" - - TypeName (Rule): # 35..50 " uint256" - - UintKeyword (Token): "uint256" # 43..50 - - Identifier (Token): "arg" # 51..54 - - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" - - Equal (Token): "=" # 55..56 - - Expression (Rule): # 56..63 " (1 + 2" - - TupleExpression (Rule): # 56..63 " (1 + 2" - - OpenParen (Token): "(" # 57..58 - - TupleValues (Rule): # 58..63 "1 + 2" - - TupleValue (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..63 "1 + 2" - - BinaryExpression (Rule): # 58..63 "1 + 2" - - Expression (Rule): # 58..59 "1" - - DecimalNumberExpression (Rule): # 58..59 "1" - - DecimalLiteral (Token): "1" # 58..59 - - Plus (Token): "+" # 60..61 - - Expression (Rule): # 61..63 " 2" - - DecimalNumberExpression (Rule): # 61..63 " 2" - - DecimalLiteral (Token): "2" # 62..63 - - SKIPPED (Token): ";\n " # 63..69 - - CloseBrace (Token): "}" # 69..70 - - SKIPPED (Token): ")\n" # 70..72 - - CloseBrace (Token): "}" # 72..73 + - ContractMember (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..." + - FunctionKeyword (Token): "function" # 0..8 + - FunctionName (Rule): # 8..17 " someFunc" + - Identifier (Token): "someFunc" # 9..17 + - ParametersDeclaration (Rule): # 17..19 "()" + - OpenParen (Token): "(" # 17..18 + - CloseParen (Token): ")" # 18..19 + - FunctionAttributes (Rule): # 19..26 " public" + - FunctionAttribute (Rule): # 19..26 " public" + - PublicKeyword (Token): "public" # 20..26 + - FunctionBody (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n" + - OpenBrace (Token): "{" # 27..28 + - Statements (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }" + - OpenBrace (Token): "{" # 33..34 + - Statements (Rule): # 35..63 " uint256 arg = (1 + 2" + - Statement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2" + - VariableDeclarationType (Rule): # 35..50 " uint256" + - TypeName (Rule): # 35..50 " uint256" + - ElementaryType (Rule): # 35..50 " uint256" + - UintKeyword (Token): "uint256" # 43..50 + - Identifier (Token): "arg" # 51..54 + - VariableDeclarationValue (Rule): # 54..63 " = (1 + 2" + - Equal (Token): "=" # 55..56 + - Expression (Rule): # 56..63 " (1 + 2" + - TupleExpression (Rule): # 56..63 " (1 + 2" + - OpenParen (Token): "(" # 57..58 + - TupleValues (Rule): # 58..63 "1 + 2" + - TupleValue (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..63 "1 + 2" + - BinaryExpression (Rule): # 58..63 "1 + 2" + - Expression (Rule): # 58..59 "1" + - DecimalNumberExpression (Rule): # 58..59 "1" + - DecimalLiteral (Token): "1" # 58..59 + - Plus (Token): "+" # 60..61 + - Expression (Rule): # 61..63 " 2" + - DecimalNumberExpression (Rule): # 61..63 " 2" + - DecimalLiteral (Token): "2" # 62..63 + - SKIPPED (Token): ";\n " # 63..69 + - CloseBrace (Token): "}" # 69..70 + - SKIPPED (Token): ")\n" # 70..72 + - CloseBrace (Token): "}" # 72..73 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.4.11-failure.yml index 0dd29f73c9..bdce9781fb 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.4.11-failure.yml @@ -98,182 +98,221 @@ Errors: # 10 total Tree: - ContractMembers (Rule): # 0..560 "function all() override(some.ident unexpected toke..." - - FunctionDefinition (Rule): # 0..309 "function all() override(some.ident unexpected toke..." - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "all" # 9..12 - - ParametersDeclaration (Rule): # 12..14 "()" - - OpenParen (Token): "(" # 12..13 - - CloseParen (Token): ")" # 13..14 - - FunctionAttributes (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." - - ModifierInvocation (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." - - IdentifierPath (Rule): # 14..23 " override" - - Identifier (Token): "override" # 15..23 - - PositionalArgumentsDeclaration (Rule): # 23..76 "(some.ident unexpected tokens, ISomeInterface, Oth..." - - OpenParen (Token): "(" # 23..24 - - PositionalArguments (Rule): # 24..34 "some.ident" - - Expression (Rule): # 24..34 "some.ident" - - MemberAccessExpression (Rule): # 24..34 "some.ident" - - Expression (Rule): # 24..28 "some" - - Identifier (Token): "some" # 24..28 - - Period (Token): "." # 28..29 - - Identifier (Token): "ident" # 29..34 - - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 - - CloseParen (Token): ")" # 75..76 - - PublicKeyword (Token): "public" # 77..83 - - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." - - OpenBrace (Token): "{" # 84..85 - - Statements (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." - - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" - - Expression (Rule): # 86..103 " msg.sender.call" - - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" - - Expression (Rule): # 86..98 " msg.sender" - - MemberAccessExpression (Rule): # 86..98 " msg.sender" - - Expression (Rule): # 86..91 " msg" - - Identifier (Token): "msg" # 88..91 - - Period (Token): "." # 91..92 - - Identifier (Token): "sender" # 92..98 - - Period (Token): "." # 98..99 - - Identifier (Token): "call" # 99..103 - - SKIPPED (Token): "{do: 1, arg: 1 }()" # 103..121 - - Semicolon (Token): ";" # 121..122 - - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" - - Expression (Rule): # 123..140 " msg.sender.call" - - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" - - Expression (Rule): # 123..135 " msg.sender" - - MemberAccessExpression (Rule): # 123..135 " msg.sender" - - Expression (Rule): # 123..128 " msg" - - Identifier (Token): "msg" # 125..128 - - Period (Token): "." # 128..129 - - Identifier (Token): "sender" # 129..135 - - Period (Token): "." # 135..136 - - Identifier (Token): "call" # 136..140 - - SKIPPED (Token): "{, empty: 1, parse: 2 }()" # 140..165 - - Semicolon (Token): ";" # 165..166 - - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..184 " msg.sender.call" - - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" - - Expression (Rule): # 167..179 " msg.sender" - - MemberAccessExpression (Rule): # 167..179 " msg.sender" - - Expression (Rule): # 167..172 " msg" - - Identifier (Token): "msg" # 169..172 - - Period (Token): "." # 172..173 - - Identifier (Token): "sender" # 173..179 - - Period (Token): "." # 179..180 - - Identifier (Token): "call" # 180..184 - - SKIPPED (Token): "{arg: 1, missing_expr: , no_semicolon, , }()" # 184..228 - - Semicolon (Token): ";" # 228..229 - - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..247 " msg.sender.call" - - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" - - Expression (Rule): # 230..242 " msg.sender" - - MemberAccessExpression (Rule): # 230..242 " msg.sender" - - Expression (Rule): # 230..235 " msg" - - Identifier (Token): "msg" # 232..235 - - Period (Token): "." # 235..236 - - Identifier (Token): "sender" # 236..242 - - Period (Token): "." # 242..243 - - Identifier (Token): "call" # 243..247 - - SKIPPED (Token): "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." # 247..304 - - Semicolon (Token): ";" # 304..305 - - CloseBrace (Token): "}" # 307..308 - - FunctionDefinition (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." - - FunctionKeyword (Token): "function" # 310..318 - - Identifier (Token): "empty" # 319..324 - - ParametersDeclaration (Rule): # 324..326 "()" - - OpenParen (Token): "(" # 324..325 - - CloseParen (Token): ")" # 325..326 - - FunctionAttributes (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - ModifierInvocation (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - IdentifierPath (Rule): # 326..335 " override" - - Identifier (Token): "override" # 327..335 - - PositionalArgumentsDeclaration (Rule): # 335..386 "(some.ident, /* empty */, other.arg.here, and.here..." - - OpenParen (Token): "(" # 335..336 - - PositionalArguments (Rule): # 336..347 "some.ident," - - Expression (Rule): # 336..346 "some.ident" - - MemberAccessExpression (Rule): # 336..346 "some.ident" - - Expression (Rule): # 336..340 "some" - - Identifier (Token): "some" # 336..340 - - Period (Token): "." # 340..341 - - Identifier (Token): "ident" # 341..346 - - Comma (Token): "," # 346..347 - - LeadingTrivia (Rule): # 347..359 " /* empty */" - - MultilineComment (Trivia): "/* empty */" # 348..359 - - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 - - CloseParen (Token): ")" # 385..386 - - Semicolon (Token): ";" # 386..387 - - FunctionDefinition (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." - - FunctionKeyword (Token): "function" # 389..397 - - Identifier (Token): "nested_lists" # 398..410 - - ParametersDeclaration (Rule): # 410..412 "()" - - OpenParen (Token): "(" # 410..411 - - CloseParen (Token): ")" # 411..412 - - FunctionAttributes (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - ModifierInvocation (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - IdentifierPath (Rule): # 412..421 " override" - - Identifier (Token): "override" # 413..421 - - PositionalArgumentsDeclaration (Rule): # 421..487 "(some.ident, next.do.that, other.while, next.one, ..." - - OpenParen (Token): "(" # 421..422 - - PositionalArguments (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," - - Expression (Rule): # 422..432 "some.ident" - - MemberAccessExpression (Rule): # 422..432 "some.ident" - - Expression (Rule): # 422..426 "some" - - Identifier (Token): "some" # 422..426 - - Period (Token): "." # 426..427 - - Identifier (Token): "ident" # 427..432 - - Comma (Token): "," # 432..433 - - Expression (Rule): # 433..439 " next." - - Identifier (Token): "next" # 434..438 - - Period (Token): "." # 438..439 - - SKIPPED (Token): "do.that" # 439..446 - - Comma (Token): "," # 446..447 - - Expression (Rule): # 447..454 " other." - - Identifier (Token): "other" # 448..453 - - Period (Token): "." # 453..454 - - SKIPPED (Token): "while" # 454..459 - - Comma (Token): "," # 459..460 - - Expression (Rule): # 460..469 " next.one" - - MemberAccessExpression (Rule): # 460..469 " next.one" - - Expression (Rule): # 460..465 " next" - - Identifier (Token): "next" # 461..465 - - Period (Token): "." # 465..466 - - Identifier (Token): "one" # 466..469 - - Comma (Token): "," # 469..470 - - SKIPPED (Token): "final, ultimate" # 471..486 - - CloseParen (Token): ")" # 486..487 - - Semicolon (Token): ";" # 487..488 - - FunctionDefinition (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." - - FunctionKeyword (Token): "function" # 489..497 - - Identifier (Token): "nested_lists" # 498..510 - - ParametersDeclaration (Rule): # 510..512 "()" - - OpenParen (Token): "(" # 510..511 - - CloseParen (Token): ")" # 511..512 - - FunctionAttributes (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - ModifierInvocation (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - IdentifierPath (Rule): # 512..521 " override" - - Identifier (Token): "override" # 513..521 - - PositionalArgumentsDeclaration (Rule): # 521..558 "(some., next.arg, next.one, ultimate)" - - OpenParen (Token): "(" # 521..522 - - PositionalArguments (Rule): # 522..557 "some., next.arg, next.one, ultimate" - - Expression (Rule): # 522..527 "some." - - Identifier (Token): "some" # 522..526 - - Period (Token): "." # 526..527 - - SKIPPED (Token): "" # 527..527 - - Comma (Token): "," # 527..528 - - Expression (Rule): # 528..537 " next.arg" - - MemberAccessExpression (Rule): # 528..537 " next.arg" - - Expression (Rule): # 528..533 " next" - - Identifier (Token): "next" # 529..533 - - Period (Token): "." # 533..534 - - Identifier (Token): "arg" # 534..537 - - Comma (Token): "," # 537..538 - - Expression (Rule): # 538..547 " next.one" - - MemberAccessExpression (Rule): # 538..547 " next.one" - - Expression (Rule): # 538..543 " next" - - Identifier (Token): "next" # 539..543 - - Period (Token): "." # 543..544 - - Identifier (Token): "one" # 544..547 - - Comma (Token): "," # 547..548 - - Expression (Rule): # 548..557 " ultimate" - - Identifier (Token): "ultimate" # 549..557 - - CloseParen (Token): ")" # 557..558 - - Semicolon (Token): ";" # 558..559 + - ContractMember (Rule): # 0..309 "function all() override(some.ident unexpected toke..." + - FunctionDefinition (Rule): # 0..309 "function all() override(some.ident unexpected toke..." + - FunctionKeyword (Token): "function" # 0..8 + - FunctionName (Rule): # 8..12 " all" + - Identifier (Token): "all" # 9..12 + - ParametersDeclaration (Rule): # 12..14 "()" + - OpenParen (Token): "(" # 12..13 + - CloseParen (Token): ")" # 13..14 + - FunctionAttributes (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." + - FunctionAttribute (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - ModifierInvocation (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - IdentifierPath (Rule): # 14..23 " override" + - Identifier (Token): "override" # 15..23 + - ArgumentsDeclaration (Rule): # 23..76 "(some.ident unexpected tokens, ISomeInterface, Oth..." + - PositionalArgumentsDeclaration (Rule): # 23..76 "(some.ident unexpected tokens, ISomeInterface, Oth..." + - OpenParen (Token): "(" # 23..24 + - PositionalArguments (Rule): # 24..34 "some.ident" + - Expression (Rule): # 24..34 "some.ident" + - MemberAccessExpression (Rule): # 24..34 "some.ident" + - Expression (Rule): # 24..28 "some" + - Identifier (Token): "some" # 24..28 + - Period (Token): "." # 28..29 + - MemberAccess (Rule): # 29..34 "ident" + - Identifier (Token): "ident" # 29..34 + - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 + - CloseParen (Token): ")" # 75..76 + - FunctionAttribute (Rule): # 76..83 " public" + - PublicKeyword (Token): "public" # 77..83 + - FunctionBody (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - OpenBrace (Token): "{" # 84..85 + - Statements (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." + - Statement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - Expression (Rule): # 86..103 " msg.sender.call" + - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" + - Expression (Rule): # 86..98 " msg.sender" + - MemberAccessExpression (Rule): # 86..98 " msg.sender" + - Expression (Rule): # 86..91 " msg" + - Identifier (Token): "msg" # 88..91 + - Period (Token): "." # 91..92 + - MemberAccess (Rule): # 92..98 "sender" + - Identifier (Token): "sender" # 92..98 + - Period (Token): "." # 98..99 + - MemberAccess (Rule): # 99..103 "call" + - Identifier (Token): "call" # 99..103 + - SKIPPED (Token): "{do: 1, arg: 1 }()" # 103..121 + - Semicolon (Token): ";" # 121..122 + - Statement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - Expression (Rule): # 123..140 " msg.sender.call" + - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" + - Expression (Rule): # 123..135 " msg.sender" + - MemberAccessExpression (Rule): # 123..135 " msg.sender" + - Expression (Rule): # 123..128 " msg" + - Identifier (Token): "msg" # 125..128 + - Period (Token): "." # 128..129 + - MemberAccess (Rule): # 129..135 "sender" + - Identifier (Token): "sender" # 129..135 + - Period (Token): "." # 135..136 + - MemberAccess (Rule): # 136..140 "call" + - Identifier (Token): "call" # 136..140 + - SKIPPED (Token): "{, empty: 1, parse: 2 }()" # 140..165 + - Semicolon (Token): ";" # 165..166 + - Statement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - Expression (Rule): # 167..184 " msg.sender.call" + - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" + - Expression (Rule): # 167..179 " msg.sender" + - MemberAccessExpression (Rule): # 167..179 " msg.sender" + - Expression (Rule): # 167..172 " msg" + - Identifier (Token): "msg" # 169..172 + - Period (Token): "." # 172..173 + - MemberAccess (Rule): # 173..179 "sender" + - Identifier (Token): "sender" # 173..179 + - Period (Token): "." # 179..180 + - MemberAccess (Rule): # 180..184 "call" + - Identifier (Token): "call" # 180..184 + - SKIPPED (Token): "{arg: 1, missing_expr: , no_semicolon, , }()" # 184..228 + - Semicolon (Token): ";" # 228..229 + - Statement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - Expression (Rule): # 230..247 " msg.sender.call" + - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" + - Expression (Rule): # 230..242 " msg.sender" + - MemberAccessExpression (Rule): # 230..242 " msg.sender" + - Expression (Rule): # 230..235 " msg" + - Identifier (Token): "msg" # 232..235 + - Period (Token): "." # 235..236 + - MemberAccess (Rule): # 236..242 "sender" + - Identifier (Token): "sender" # 236..242 + - Period (Token): "." # 242..243 + - MemberAccess (Rule): # 243..247 "call" + - Identifier (Token): "call" # 243..247 + - SKIPPED (Token): "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." # 247..304 + - Semicolon (Token): ";" # 304..305 + - CloseBrace (Token): "}" # 307..308 + - ContractMember (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." + - FunctionDefinition (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." + - FunctionKeyword (Token): "function" # 310..318 + - FunctionName (Rule): # 318..324 " empty" + - Identifier (Token): "empty" # 319..324 + - ParametersDeclaration (Rule): # 324..326 "()" + - OpenParen (Token): "(" # 324..325 + - CloseParen (Token): ")" # 325..326 + - FunctionAttributes (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - FunctionAttribute (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - ModifierInvocation (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - IdentifierPath (Rule): # 326..335 " override" + - Identifier (Token): "override" # 327..335 + - ArgumentsDeclaration (Rule): # 335..386 "(some.ident, /* empty */, other.arg.here, and.here..." + - PositionalArgumentsDeclaration (Rule): # 335..386 "(some.ident, /* empty */, other.arg.here, and.here..." + - OpenParen (Token): "(" # 335..336 + - PositionalArguments (Rule): # 336..347 "some.ident," + - Expression (Rule): # 336..346 "some.ident" + - MemberAccessExpression (Rule): # 336..346 "some.ident" + - Expression (Rule): # 336..340 "some" + - Identifier (Token): "some" # 336..340 + - Period (Token): "." # 340..341 + - MemberAccess (Rule): # 341..346 "ident" + - Identifier (Token): "ident" # 341..346 + - Comma (Token): "," # 346..347 + - LeadingTrivia (Rule): # 347..359 " /* empty */" + - MultilineComment (Trivia): "/* empty */" # 348..359 + - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 + - CloseParen (Token): ")" # 385..386 + - FunctionBody (Rule): # 386..388 ";\n" + - Semicolon (Token): ";" # 386..387 + - ContractMember (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." + - FunctionDefinition (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." + - FunctionKeyword (Token): "function" # 389..397 + - FunctionName (Rule): # 397..410 " nested_lists" + - Identifier (Token): "nested_lists" # 398..410 + - ParametersDeclaration (Rule): # 410..412 "()" + - OpenParen (Token): "(" # 410..411 + - CloseParen (Token): ")" # 411..412 + - FunctionAttributes (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - FunctionAttribute (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - ModifierInvocation (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - IdentifierPath (Rule): # 412..421 " override" + - Identifier (Token): "override" # 413..421 + - ArgumentsDeclaration (Rule): # 421..487 "(some.ident, next.do.that, other.while, next.one, ..." + - PositionalArgumentsDeclaration (Rule): # 421..487 "(some.ident, next.do.that, other.while, next.one, ..." + - OpenParen (Token): "(" # 421..422 + - PositionalArguments (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," + - Expression (Rule): # 422..432 "some.ident" + - MemberAccessExpression (Rule): # 422..432 "some.ident" + - Expression (Rule): # 422..426 "some" + - Identifier (Token): "some" # 422..426 + - Period (Token): "." # 426..427 + - MemberAccess (Rule): # 427..432 "ident" + - Identifier (Token): "ident" # 427..432 + - Comma (Token): "," # 432..433 + - Expression (Rule): # 433..439 " next." + - Identifier (Token): "next" # 434..438 + - Period (Token): "." # 438..439 + - SKIPPED (Token): "do.that" # 439..446 + - Comma (Token): "," # 446..447 + - Expression (Rule): # 447..454 " other." + - Identifier (Token): "other" # 448..453 + - Period (Token): "." # 453..454 + - SKIPPED (Token): "while" # 454..459 + - Comma (Token): "," # 459..460 + - Expression (Rule): # 460..469 " next.one" + - MemberAccessExpression (Rule): # 460..469 " next.one" + - Expression (Rule): # 460..465 " next" + - Identifier (Token): "next" # 461..465 + - Period (Token): "." # 465..466 + - MemberAccess (Rule): # 466..469 "one" + - Identifier (Token): "one" # 466..469 + - Comma (Token): "," # 469..470 + - SKIPPED (Token): "final, ultimate" # 471..486 + - CloseParen (Token): ")" # 486..487 + - FunctionBody (Rule): # 487..489 ";\n" + - Semicolon (Token): ";" # 487..488 + - ContractMember (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." + - FunctionDefinition (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." + - FunctionKeyword (Token): "function" # 489..497 + - FunctionName (Rule): # 497..510 " nested_lists" + - Identifier (Token): "nested_lists" # 498..510 + - ParametersDeclaration (Rule): # 510..512 "()" + - OpenParen (Token): "(" # 510..511 + - CloseParen (Token): ")" # 511..512 + - FunctionAttributes (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - FunctionAttribute (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - ModifierInvocation (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - IdentifierPath (Rule): # 512..521 " override" + - Identifier (Token): "override" # 513..521 + - ArgumentsDeclaration (Rule): # 521..558 "(some., next.arg, next.one, ultimate)" + - PositionalArgumentsDeclaration (Rule): # 521..558 "(some., next.arg, next.one, ultimate)" + - OpenParen (Token): "(" # 521..522 + - PositionalArguments (Rule): # 522..557 "some., next.arg, next.one, ultimate" + - Expression (Rule): # 522..527 "some." + - Identifier (Token): "some" # 522..526 + - Period (Token): "." # 526..527 + - SKIPPED (Token): "" # 527..527 + - Comma (Token): "," # 527..528 + - Expression (Rule): # 528..537 " next.arg" + - MemberAccessExpression (Rule): # 528..537 " next.arg" + - Expression (Rule): # 528..533 " next" + - Identifier (Token): "next" # 529..533 + - Period (Token): "." # 533..534 + - MemberAccess (Rule): # 534..537 "arg" + - Identifier (Token): "arg" # 534..537 + - Comma (Token): "," # 537..538 + - Expression (Rule): # 538..547 " next.one" + - MemberAccessExpression (Rule): # 538..547 " next.one" + - Expression (Rule): # 538..543 " next" + - Identifier (Token): "next" # 539..543 + - Period (Token): "." # 543..544 + - MemberAccess (Rule): # 544..547 "one" + - Identifier (Token): "one" # 544..547 + - Comma (Token): "," # 547..548 + - Expression (Rule): # 548..557 " ultimate" + - Identifier (Token): "ultimate" # 549..557 + - CloseParen (Token): ")" # 557..558 + - FunctionBody (Rule): # 558..560 ";\n" + - Semicolon (Token): ";" # 558..559 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.5.0-failure.yml index 0d20c0e724..ad8ed6968b 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.5.0-failure.yml @@ -98,166 +98,195 @@ Errors: # 10 total Tree: - ContractMembers (Rule): # 0..560 "function all() override(some.ident unexpected toke..." - - FunctionDefinition (Rule): # 0..309 "function all() override(some.ident unexpected toke..." - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "all" # 9..12 - - ParametersDeclaration (Rule): # 12..14 "()" - - OpenParen (Token): "(" # 12..13 - - CloseParen (Token): ")" # 13..14 - - FunctionAttributes (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideKeyword (Token): "override" # 15..23 - - OverridePathsDeclaration (Rule): # 23..76 "(some.ident unexpected tokens, ISomeInterface, Oth..." - - OpenParen (Token): "(" # 23..24 - - OverridePaths (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 - - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 - - CloseParen (Token): ")" # 75..76 - - PublicKeyword (Token): "public" # 77..83 - - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." - - OpenBrace (Token): "{" # 84..85 - - Statements (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." - - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" - - Expression (Rule): # 86..103 " msg.sender.call" - - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" - - Expression (Rule): # 86..98 " msg.sender" - - MemberAccessExpression (Rule): # 86..98 " msg.sender" - - Expression (Rule): # 86..91 " msg" - - Identifier (Token): "msg" # 88..91 - - Period (Token): "." # 91..92 - - Identifier (Token): "sender" # 92..98 - - Period (Token): "." # 98..99 - - Identifier (Token): "call" # 99..103 - - SKIPPED (Token): "{do: 1, arg: 1 }()" # 103..121 - - Semicolon (Token): ";" # 121..122 - - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" - - Expression (Rule): # 123..140 " msg.sender.call" - - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" - - Expression (Rule): # 123..135 " msg.sender" - - MemberAccessExpression (Rule): # 123..135 " msg.sender" - - Expression (Rule): # 123..128 " msg" - - Identifier (Token): "msg" # 125..128 - - Period (Token): "." # 128..129 - - Identifier (Token): "sender" # 129..135 - - Period (Token): "." # 135..136 - - Identifier (Token): "call" # 136..140 - - SKIPPED (Token): "{, empty: 1, parse: 2 }()" # 140..165 - - Semicolon (Token): ";" # 165..166 - - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..184 " msg.sender.call" - - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" - - Expression (Rule): # 167..179 " msg.sender" - - MemberAccessExpression (Rule): # 167..179 " msg.sender" - - Expression (Rule): # 167..172 " msg" - - Identifier (Token): "msg" # 169..172 - - Period (Token): "." # 172..173 - - Identifier (Token): "sender" # 173..179 - - Period (Token): "." # 179..180 - - Identifier (Token): "call" # 180..184 - - SKIPPED (Token): "{arg: 1, missing_expr: , no_semicolon, , }()" # 184..228 - - Semicolon (Token): ";" # 228..229 - - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..247 " msg.sender.call" - - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" - - Expression (Rule): # 230..242 " msg.sender" - - MemberAccessExpression (Rule): # 230..242 " msg.sender" - - Expression (Rule): # 230..235 " msg" - - Identifier (Token): "msg" # 232..235 - - Period (Token): "." # 235..236 - - Identifier (Token): "sender" # 236..242 - - Period (Token): "." # 242..243 - - Identifier (Token): "call" # 243..247 - - SKIPPED (Token): "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." # 247..304 - - Semicolon (Token): ";" # 304..305 - - CloseBrace (Token): "}" # 307..308 - - FunctionDefinition (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." - - FunctionKeyword (Token): "function" # 310..318 - - Identifier (Token): "empty" # 319..324 - - ParametersDeclaration (Rule): # 324..326 "()" - - OpenParen (Token): "(" # 324..325 - - CloseParen (Token): ")" # 325..326 - - FunctionAttributes (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideKeyword (Token): "override" # 327..335 - - OverridePathsDeclaration (Rule): # 335..386 "(some.ident, /* empty */, other.arg.here, and.here..." - - OpenParen (Token): "(" # 335..336 - - OverridePaths (Rule): # 336..347 "some.ident," - - IdentifierPath (Rule): # 336..346 "some.ident" - - Identifier (Token): "some" # 336..340 - - Period (Token): "." # 340..341 - - Identifier (Token): "ident" # 341..346 - - Comma (Token): "," # 346..347 - - LeadingTrivia (Rule): # 347..359 " /* empty */" - - MultilineComment (Trivia): "/* empty */" # 348..359 - - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 - - CloseParen (Token): ")" # 385..386 - - Semicolon (Token): ";" # 386..387 - - FunctionDefinition (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." - - FunctionKeyword (Token): "function" # 389..397 - - Identifier (Token): "nested_lists" # 398..410 - - ParametersDeclaration (Rule): # 410..412 "()" - - OpenParen (Token): "(" # 410..411 - - CloseParen (Token): ")" # 411..412 - - FunctionAttributes (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideKeyword (Token): "override" # 413..421 - - OverridePathsDeclaration (Rule): # 421..487 "(some.ident, next.do.that, other.while, next.one, ..." - - OpenParen (Token): "(" # 421..422 - - OverridePaths (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," - - IdentifierPath (Rule): # 422..432 "some.ident" - - Identifier (Token): "some" # 422..426 - - Period (Token): "." # 426..427 - - Identifier (Token): "ident" # 427..432 - - Comma (Token): "," # 432..433 - - IdentifierPath (Rule): # 433..439 " next." - - Identifier (Token): "next" # 434..438 - - Period (Token): "." # 438..439 - - SKIPPED (Token): "do.that" # 439..446 - - Comma (Token): "," # 446..447 - - IdentifierPath (Rule): # 447..454 " other." - - Identifier (Token): "other" # 448..453 - - Period (Token): "." # 453..454 - - SKIPPED (Token): "while" # 454..459 - - Comma (Token): "," # 459..460 - - IdentifierPath (Rule): # 460..469 " next.one" - - Identifier (Token): "next" # 461..465 - - Period (Token): "." # 465..466 - - Identifier (Token): "one" # 466..469 - - Comma (Token): "," # 469..470 - - SKIPPED (Token): "final, ultimate" # 471..486 - - CloseParen (Token): ")" # 486..487 - - Semicolon (Token): ";" # 487..488 - - FunctionDefinition (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." - - FunctionKeyword (Token): "function" # 489..497 - - Identifier (Token): "nested_lists" # 498..510 - - ParametersDeclaration (Rule): # 510..512 "()" - - OpenParen (Token): "(" # 510..511 - - CloseParen (Token): ")" # 511..512 - - FunctionAttributes (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideKeyword (Token): "override" # 513..521 - - OverridePathsDeclaration (Rule): # 521..558 "(some., next.arg, next.one, ultimate)" - - OpenParen (Token): "(" # 521..522 - - OverridePaths (Rule): # 522..557 "some., next.arg, next.one, ultimate" - - IdentifierPath (Rule): # 522..527 "some." - - Identifier (Token): "some" # 522..526 - - Period (Token): "." # 526..527 - - SKIPPED (Token): "" # 527..527 - - Comma (Token): "," # 527..528 - - IdentifierPath (Rule): # 528..537 " next.arg" - - Identifier (Token): "next" # 529..533 - - Period (Token): "." # 533..534 - - Identifier (Token): "arg" # 534..537 - - Comma (Token): "," # 537..538 - - IdentifierPath (Rule): # 538..547 " next.one" - - Identifier (Token): "next" # 539..543 - - Period (Token): "." # 543..544 - - Identifier (Token): "one" # 544..547 - - Comma (Token): "," # 547..548 - - IdentifierPath (Rule): # 548..557 " ultimate" - - Identifier (Token): "ultimate" # 549..557 - - CloseParen (Token): ")" # 557..558 - - Semicolon (Token): ";" # 558..559 + - ContractMember (Rule): # 0..309 "function all() override(some.ident unexpected toke..." + - FunctionDefinition (Rule): # 0..309 "function all() override(some.ident unexpected toke..." + - FunctionKeyword (Token): "function" # 0..8 + - FunctionName (Rule): # 8..12 " all" + - Identifier (Token): "all" # 9..12 + - ParametersDeclaration (Rule): # 12..14 "()" + - OpenParen (Token): "(" # 12..13 + - CloseParen (Token): ")" # 13..14 + - FunctionAttributes (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." + - FunctionAttribute (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideKeyword (Token): "override" # 15..23 + - OverridePathsDeclaration (Rule): # 23..76 "(some.ident unexpected tokens, ISomeInterface, Oth..." + - OpenParen (Token): "(" # 23..24 + - OverridePaths (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 + - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 + - CloseParen (Token): ")" # 75..76 + - FunctionAttribute (Rule): # 76..83 " public" + - PublicKeyword (Token): "public" # 77..83 + - FunctionBody (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - OpenBrace (Token): "{" # 84..85 + - Statements (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." + - Statement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - Expression (Rule): # 86..103 " msg.sender.call" + - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" + - Expression (Rule): # 86..98 " msg.sender" + - MemberAccessExpression (Rule): # 86..98 " msg.sender" + - Expression (Rule): # 86..91 " msg" + - Identifier (Token): "msg" # 88..91 + - Period (Token): "." # 91..92 + - MemberAccess (Rule): # 92..98 "sender" + - Identifier (Token): "sender" # 92..98 + - Period (Token): "." # 98..99 + - MemberAccess (Rule): # 99..103 "call" + - Identifier (Token): "call" # 99..103 + - SKIPPED (Token): "{do: 1, arg: 1 }()" # 103..121 + - Semicolon (Token): ";" # 121..122 + - Statement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - Expression (Rule): # 123..140 " msg.sender.call" + - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" + - Expression (Rule): # 123..135 " msg.sender" + - MemberAccessExpression (Rule): # 123..135 " msg.sender" + - Expression (Rule): # 123..128 " msg" + - Identifier (Token): "msg" # 125..128 + - Period (Token): "." # 128..129 + - MemberAccess (Rule): # 129..135 "sender" + - Identifier (Token): "sender" # 129..135 + - Period (Token): "." # 135..136 + - MemberAccess (Rule): # 136..140 "call" + - Identifier (Token): "call" # 136..140 + - SKIPPED (Token): "{, empty: 1, parse: 2 }()" # 140..165 + - Semicolon (Token): ";" # 165..166 + - Statement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - Expression (Rule): # 167..184 " msg.sender.call" + - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" + - Expression (Rule): # 167..179 " msg.sender" + - MemberAccessExpression (Rule): # 167..179 " msg.sender" + - Expression (Rule): # 167..172 " msg" + - Identifier (Token): "msg" # 169..172 + - Period (Token): "." # 172..173 + - MemberAccess (Rule): # 173..179 "sender" + - Identifier (Token): "sender" # 173..179 + - Period (Token): "." # 179..180 + - MemberAccess (Rule): # 180..184 "call" + - Identifier (Token): "call" # 180..184 + - SKIPPED (Token): "{arg: 1, missing_expr: , no_semicolon, , }()" # 184..228 + - Semicolon (Token): ";" # 228..229 + - Statement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - Expression (Rule): # 230..247 " msg.sender.call" + - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" + - Expression (Rule): # 230..242 " msg.sender" + - MemberAccessExpression (Rule): # 230..242 " msg.sender" + - Expression (Rule): # 230..235 " msg" + - Identifier (Token): "msg" # 232..235 + - Period (Token): "." # 235..236 + - MemberAccess (Rule): # 236..242 "sender" + - Identifier (Token): "sender" # 236..242 + - Period (Token): "." # 242..243 + - MemberAccess (Rule): # 243..247 "call" + - Identifier (Token): "call" # 243..247 + - SKIPPED (Token): "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." # 247..304 + - Semicolon (Token): ";" # 304..305 + - CloseBrace (Token): "}" # 307..308 + - ContractMember (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." + - FunctionDefinition (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." + - FunctionKeyword (Token): "function" # 310..318 + - FunctionName (Rule): # 318..324 " empty" + - Identifier (Token): "empty" # 319..324 + - ParametersDeclaration (Rule): # 324..326 "()" + - OpenParen (Token): "(" # 324..325 + - CloseParen (Token): ")" # 325..326 + - FunctionAttributes (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - FunctionAttribute (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideKeyword (Token): "override" # 327..335 + - OverridePathsDeclaration (Rule): # 335..386 "(some.ident, /* empty */, other.arg.here, and.here..." + - OpenParen (Token): "(" # 335..336 + - OverridePaths (Rule): # 336..347 "some.ident," + - IdentifierPath (Rule): # 336..346 "some.ident" + - Identifier (Token): "some" # 336..340 + - Period (Token): "." # 340..341 + - Identifier (Token): "ident" # 341..346 + - Comma (Token): "," # 346..347 + - LeadingTrivia (Rule): # 347..359 " /* empty */" + - MultilineComment (Trivia): "/* empty */" # 348..359 + - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 + - CloseParen (Token): ")" # 385..386 + - FunctionBody (Rule): # 386..388 ";\n" + - Semicolon (Token): ";" # 386..387 + - ContractMember (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." + - FunctionDefinition (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." + - FunctionKeyword (Token): "function" # 389..397 + - FunctionName (Rule): # 397..410 " nested_lists" + - Identifier (Token): "nested_lists" # 398..410 + - ParametersDeclaration (Rule): # 410..412 "()" + - OpenParen (Token): "(" # 410..411 + - CloseParen (Token): ")" # 411..412 + - FunctionAttributes (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - FunctionAttribute (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideKeyword (Token): "override" # 413..421 + - OverridePathsDeclaration (Rule): # 421..487 "(some.ident, next.do.that, other.while, next.one, ..." + - OpenParen (Token): "(" # 421..422 + - OverridePaths (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," + - IdentifierPath (Rule): # 422..432 "some.ident" + - Identifier (Token): "some" # 422..426 + - Period (Token): "." # 426..427 + - Identifier (Token): "ident" # 427..432 + - Comma (Token): "," # 432..433 + - IdentifierPath (Rule): # 433..439 " next." + - Identifier (Token): "next" # 434..438 + - Period (Token): "." # 438..439 + - SKIPPED (Token): "do.that" # 439..446 + - Comma (Token): "," # 446..447 + - IdentifierPath (Rule): # 447..454 " other." + - Identifier (Token): "other" # 448..453 + - Period (Token): "." # 453..454 + - SKIPPED (Token): "while" # 454..459 + - Comma (Token): "," # 459..460 + - IdentifierPath (Rule): # 460..469 " next.one" + - Identifier (Token): "next" # 461..465 + - Period (Token): "." # 465..466 + - Identifier (Token): "one" # 466..469 + - Comma (Token): "," # 469..470 + - SKIPPED (Token): "final, ultimate" # 471..486 + - CloseParen (Token): ")" # 486..487 + - FunctionBody (Rule): # 487..489 ";\n" + - Semicolon (Token): ";" # 487..488 + - ContractMember (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." + - FunctionDefinition (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." + - FunctionKeyword (Token): "function" # 489..497 + - FunctionName (Rule): # 497..510 " nested_lists" + - Identifier (Token): "nested_lists" # 498..510 + - ParametersDeclaration (Rule): # 510..512 "()" + - OpenParen (Token): "(" # 510..511 + - CloseParen (Token): ")" # 511..512 + - FunctionAttributes (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - FunctionAttribute (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideKeyword (Token): "override" # 513..521 + - OverridePathsDeclaration (Rule): # 521..558 "(some., next.arg, next.one, ultimate)" + - OpenParen (Token): "(" # 521..522 + - OverridePaths (Rule): # 522..557 "some., next.arg, next.one, ultimate" + - IdentifierPath (Rule): # 522..527 "some." + - Identifier (Token): "some" # 522..526 + - Period (Token): "." # 526..527 + - SKIPPED (Token): "" # 527..527 + - Comma (Token): "," # 527..528 + - IdentifierPath (Rule): # 528..537 " next.arg" + - Identifier (Token): "next" # 529..533 + - Period (Token): "." # 533..534 + - Identifier (Token): "arg" # 534..537 + - Comma (Token): "," # 537..538 + - IdentifierPath (Rule): # 538..547 " next.one" + - Identifier (Token): "next" # 539..543 + - Period (Token): "." # 543..544 + - Identifier (Token): "one" # 544..547 + - Comma (Token): "," # 547..548 + - IdentifierPath (Rule): # 548..557 " ultimate" + - Identifier (Token): "ultimate" # 549..557 + - CloseParen (Token): ")" # 557..558 + - FunctionBody (Rule): # 558..560 ";\n" + - Semicolon (Token): ";" # 558..559 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.6.2-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.6.2-failure.yml index e71e12ef12..840b00089f 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.6.2-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.6.2-failure.yml @@ -114,226 +114,263 @@ Errors: # 12 total Tree: - ContractMembers (Rule): # 0..560 "function all() override(some.ident unexpected toke..." - - FunctionDefinition (Rule): # 0..309 "function all() override(some.ident unexpected toke..." - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "all" # 9..12 - - ParametersDeclaration (Rule): # 12..14 "()" - - OpenParen (Token): "(" # 12..13 - - CloseParen (Token): ")" # 13..14 - - FunctionAttributes (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideKeyword (Token): "override" # 15..23 - - OverridePathsDeclaration (Rule): # 23..76 "(some.ident unexpected tokens, ISomeInterface, Oth..." - - OpenParen (Token): "(" # 23..24 - - OverridePaths (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 - - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 - - CloseParen (Token): ")" # 75..76 - - PublicKeyword (Token): "public" # 77..83 - - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." - - OpenBrace (Token): "{" # 84..85 - - Statements (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." - - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" - - Expression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" - - FunctionCallExpression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" - - Expression (Rule): # 86..103 " msg.sender.call" - - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" - - Expression (Rule): # 86..98 " msg.sender" - - MemberAccessExpression (Rule): # 86..98 " msg.sender" - - Expression (Rule): # 86..91 " msg" - - Identifier (Token): "msg" # 88..91 - - Period (Token): "." # 91..92 - - Identifier (Token): "sender" # 92..98 - - Period (Token): "." # 98..99 - - Identifier (Token): "call" # 99..103 - - NamedArgumentGroups (Rule): # 103..119 "{do: 1, arg: 1 }" - - NamedArgumentGroup (Rule): # 103..119 "{do: 1, arg: 1 }" - - OpenBrace (Token): "{" # 103..104 - - SKIPPED (Token): "do: 1, arg: 1 " # 104..118 - - CloseBrace (Token): "}" # 118..119 - - PositionalArgumentsDeclaration (Rule): # 119..121 "()" - - OpenParen (Token): "(" # 119..120 - - CloseParen (Token): ")" # 120..121 - - Semicolon (Token): ";" # 121..122 - - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" - - Expression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" - - FunctionCallExpression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" - - Expression (Rule): # 123..140 " msg.sender.call" - - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" - - Expression (Rule): # 123..135 " msg.sender" - - MemberAccessExpression (Rule): # 123..135 " msg.sender" - - Expression (Rule): # 123..128 " msg" - - Identifier (Token): "msg" # 125..128 - - Period (Token): "." # 128..129 - - Identifier (Token): "sender" # 129..135 - - Period (Token): "." # 135..136 - - Identifier (Token): "call" # 136..140 - - NamedArgumentGroups (Rule): # 140..163 "{, empty: 1, parse: 2 }" - - NamedArgumentGroup (Rule): # 140..163 "{, empty: 1, parse: 2 }" - - OpenBrace (Token): "{" # 140..141 - - SKIPPED (Token): ", empty: 1, parse: 2 " # 141..162 - - CloseBrace (Token): "}" # 162..163 - - PositionalArgumentsDeclaration (Rule): # 163..165 "()" - - OpenParen (Token): "(" # 163..164 - - CloseParen (Token): ")" # 164..165 - - Semicolon (Token): ";" # 165..166 - - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - FunctionCallExpression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..184 " msg.sender.call" - - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" - - Expression (Rule): # 167..179 " msg.sender" - - MemberAccessExpression (Rule): # 167..179 " msg.sender" - - Expression (Rule): # 167..172 " msg" - - Identifier (Token): "msg" # 169..172 - - Period (Token): "." # 172..173 - - Identifier (Token): "sender" # 173..179 - - Period (Token): "." # 179..180 - - Identifier (Token): "call" # 180..184 - - NamedArgumentGroups (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" - - NamedArgumentGroup (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" - - OpenBrace (Token): "{" # 184..185 - - NamedArguments (Rule): # 185..222 "arg: 1, missing_expr: , no_semicolon," - - NamedArgument (Rule): # 185..191 "arg: 1" - - Identifier (Token): "arg" # 185..188 - - Colon (Token): ":" # 188..189 - - Expression (Rule): # 189..191 " 1" - - DecimalNumberExpression (Rule): # 189..191 " 1" - - DecimalLiteral (Token): "1" # 190..191 - - Comma (Token): "," # 191..192 - - NamedArgument (Rule): # 192..206 " missing_expr:" - - Identifier (Token): "missing_expr" # 193..205 - - Colon (Token): ":" # 205..206 - - SKIPPED (Token): " " # 206..207 - - Comma (Token): "," # 207..208 - - NamedArgument (Rule): # 208..221 " no_semicolon" - - Identifier (Token): "no_semicolon" # 209..221 - - SKIPPED (Token): "" # 221..221 - - Comma (Token): "," # 221..222 - - SKIPPED (Token): ", " # 223..225 - - CloseBrace (Token): "}" # 225..226 - - PositionalArgumentsDeclaration (Rule): # 226..228 "()" - - OpenParen (Token): "(" # 226..227 - - CloseParen (Token): ")" # 227..228 - - Semicolon (Token): ";" # 228..229 - - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - FunctionCallExpression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..247 " msg.sender.call" - - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" - - Expression (Rule): # 230..242 " msg.sender" - - MemberAccessExpression (Rule): # 230..242 " msg.sender" - - Expression (Rule): # 230..235 " msg" - - Identifier (Token): "msg" # 232..235 - - Period (Token): "." # 235..236 - - Identifier (Token): "sender" # 236..242 - - Period (Token): "." # 242..243 - - Identifier (Token): "call" # 243..247 - - NamedArgumentGroups (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - - NamedArgumentGroup (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - - OpenBrace (Token): "{" # 247..248 - - NamedArguments (Rule): # 248..254 "arg: 1" - - NamedArgument (Rule): # 248..254 "arg: 1" - - Identifier (Token): "arg" # 248..251 - - Colon (Token): ":" # 251..252 - - Expression (Rule): # 252..254 " 1" - - DecimalNumberExpression (Rule): # 252..254 " 1" - - DecimalLiteral (Token): "1" # 253..254 - - SKIPPED (Token): "unexpected tokens, not: 2, recovered, yet: 3, " # 255..301 - - CloseBrace (Token): "}" # 301..302 - - PositionalArgumentsDeclaration (Rule): # 302..304 "()" - - OpenParen (Token): "(" # 302..303 - - CloseParen (Token): ")" # 303..304 - - Semicolon (Token): ";" # 304..305 - - CloseBrace (Token): "}" # 307..308 - - FunctionDefinition (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." - - FunctionKeyword (Token): "function" # 310..318 - - Identifier (Token): "empty" # 319..324 - - ParametersDeclaration (Rule): # 324..326 "()" - - OpenParen (Token): "(" # 324..325 - - CloseParen (Token): ")" # 325..326 - - FunctionAttributes (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideKeyword (Token): "override" # 327..335 - - OverridePathsDeclaration (Rule): # 335..386 "(some.ident, /* empty */, other.arg.here, and.here..." - - OpenParen (Token): "(" # 335..336 - - OverridePaths (Rule): # 336..347 "some.ident," - - IdentifierPath (Rule): # 336..346 "some.ident" - - Identifier (Token): "some" # 336..340 - - Period (Token): "." # 340..341 - - Identifier (Token): "ident" # 341..346 - - Comma (Token): "," # 346..347 - - LeadingTrivia (Rule): # 347..359 " /* empty */" - - MultilineComment (Trivia): "/* empty */" # 348..359 - - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 - - CloseParen (Token): ")" # 385..386 - - Semicolon (Token): ";" # 386..387 - - FunctionDefinition (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." - - FunctionKeyword (Token): "function" # 389..397 - - Identifier (Token): "nested_lists" # 398..410 - - ParametersDeclaration (Rule): # 410..412 "()" - - OpenParen (Token): "(" # 410..411 - - CloseParen (Token): ")" # 411..412 - - FunctionAttributes (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideKeyword (Token): "override" # 413..421 - - OverridePathsDeclaration (Rule): # 421..487 "(some.ident, next.do.that, other.while, next.one, ..." - - OpenParen (Token): "(" # 421..422 - - OverridePaths (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," - - IdentifierPath (Rule): # 422..432 "some.ident" - - Identifier (Token): "some" # 422..426 - - Period (Token): "." # 426..427 - - Identifier (Token): "ident" # 427..432 - - Comma (Token): "," # 432..433 - - IdentifierPath (Rule): # 433..439 " next." - - Identifier (Token): "next" # 434..438 - - Period (Token): "." # 438..439 - - SKIPPED (Token): "do.that" # 439..446 - - Comma (Token): "," # 446..447 - - IdentifierPath (Rule): # 447..454 " other." - - Identifier (Token): "other" # 448..453 - - Period (Token): "." # 453..454 - - SKIPPED (Token): "while" # 454..459 - - Comma (Token): "," # 459..460 - - IdentifierPath (Rule): # 460..469 " next.one" - - Identifier (Token): "next" # 461..465 - - Period (Token): "." # 465..466 - - Identifier (Token): "one" # 466..469 - - Comma (Token): "," # 469..470 - - SKIPPED (Token): "final, ultimate" # 471..486 - - CloseParen (Token): ")" # 486..487 - - Semicolon (Token): ";" # 487..488 - - FunctionDefinition (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." - - FunctionKeyword (Token): "function" # 489..497 - - Identifier (Token): "nested_lists" # 498..510 - - ParametersDeclaration (Rule): # 510..512 "()" - - OpenParen (Token): "(" # 510..511 - - CloseParen (Token): ")" # 511..512 - - FunctionAttributes (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideKeyword (Token): "override" # 513..521 - - OverridePathsDeclaration (Rule): # 521..558 "(some., next.arg, next.one, ultimate)" - - OpenParen (Token): "(" # 521..522 - - OverridePaths (Rule): # 522..557 "some., next.arg, next.one, ultimate" - - IdentifierPath (Rule): # 522..527 "some." - - Identifier (Token): "some" # 522..526 - - Period (Token): "." # 526..527 - - SKIPPED (Token): "" # 527..527 - - Comma (Token): "," # 527..528 - - IdentifierPath (Rule): # 528..537 " next.arg" - - Identifier (Token): "next" # 529..533 - - Period (Token): "." # 533..534 - - Identifier (Token): "arg" # 534..537 - - Comma (Token): "," # 537..538 - - IdentifierPath (Rule): # 538..547 " next.one" - - Identifier (Token): "next" # 539..543 - - Period (Token): "." # 543..544 - - Identifier (Token): "one" # 544..547 - - Comma (Token): "," # 547..548 - - IdentifierPath (Rule): # 548..557 " ultimate" - - Identifier (Token): "ultimate" # 549..557 - - CloseParen (Token): ")" # 557..558 - - Semicolon (Token): ";" # 558..559 + - ContractMember (Rule): # 0..309 "function all() override(some.ident unexpected toke..." + - FunctionDefinition (Rule): # 0..309 "function all() override(some.ident unexpected toke..." + - FunctionKeyword (Token): "function" # 0..8 + - FunctionName (Rule): # 8..12 " all" + - Identifier (Token): "all" # 9..12 + - ParametersDeclaration (Rule): # 12..14 "()" + - OpenParen (Token): "(" # 12..13 + - CloseParen (Token): ")" # 13..14 + - FunctionAttributes (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." + - FunctionAttribute (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideKeyword (Token): "override" # 15..23 + - OverridePathsDeclaration (Rule): # 23..76 "(some.ident unexpected tokens, ISomeInterface, Oth..." + - OpenParen (Token): "(" # 23..24 + - OverridePaths (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 + - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 + - CloseParen (Token): ")" # 75..76 + - FunctionAttribute (Rule): # 76..83 " public" + - PublicKeyword (Token): "public" # 77..83 + - FunctionBody (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - OpenBrace (Token): "{" # 84..85 + - Statements (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." + - Statement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - Expression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" + - FunctionCallExpression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" + - Expression (Rule): # 86..103 " msg.sender.call" + - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" + - Expression (Rule): # 86..98 " msg.sender" + - MemberAccessExpression (Rule): # 86..98 " msg.sender" + - Expression (Rule): # 86..91 " msg" + - Identifier (Token): "msg" # 88..91 + - Period (Token): "." # 91..92 + - MemberAccess (Rule): # 92..98 "sender" + - Identifier (Token): "sender" # 92..98 + - Period (Token): "." # 98..99 + - MemberAccess (Rule): # 99..103 "call" + - Identifier (Token): "call" # 99..103 + - FunctionCallOptions (Rule): # 103..119 "{do: 1, arg: 1 }" + - NamedArgumentGroups (Rule): # 103..119 "{do: 1, arg: 1 }" + - NamedArgumentGroup (Rule): # 103..119 "{do: 1, arg: 1 }" + - OpenBrace (Token): "{" # 103..104 + - SKIPPED (Token): "do: 1, arg: 1 " # 104..118 + - CloseBrace (Token): "}" # 118..119 + - ArgumentsDeclaration (Rule): # 119..121 "()" + - PositionalArgumentsDeclaration (Rule): # 119..121 "()" + - OpenParen (Token): "(" # 119..120 + - CloseParen (Token): ")" # 120..121 + - Semicolon (Token): ";" # 121..122 + - Statement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - Expression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" + - FunctionCallExpression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" + - Expression (Rule): # 123..140 " msg.sender.call" + - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" + - Expression (Rule): # 123..135 " msg.sender" + - MemberAccessExpression (Rule): # 123..135 " msg.sender" + - Expression (Rule): # 123..128 " msg" + - Identifier (Token): "msg" # 125..128 + - Period (Token): "." # 128..129 + - MemberAccess (Rule): # 129..135 "sender" + - Identifier (Token): "sender" # 129..135 + - Period (Token): "." # 135..136 + - MemberAccess (Rule): # 136..140 "call" + - Identifier (Token): "call" # 136..140 + - FunctionCallOptions (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - NamedArgumentGroups (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - NamedArgumentGroup (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - OpenBrace (Token): "{" # 140..141 + - SKIPPED (Token): ", empty: 1, parse: 2 " # 141..162 + - CloseBrace (Token): "}" # 162..163 + - ArgumentsDeclaration (Rule): # 163..165 "()" + - PositionalArgumentsDeclaration (Rule): # 163..165 "()" + - OpenParen (Token): "(" # 163..164 + - CloseParen (Token): ")" # 164..165 + - Semicolon (Token): ";" # 165..166 + - Statement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - Expression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - FunctionCallExpression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - Expression (Rule): # 167..184 " msg.sender.call" + - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" + - Expression (Rule): # 167..179 " msg.sender" + - MemberAccessExpression (Rule): # 167..179 " msg.sender" + - Expression (Rule): # 167..172 " msg" + - Identifier (Token): "msg" # 169..172 + - Period (Token): "." # 172..173 + - MemberAccess (Rule): # 173..179 "sender" + - Identifier (Token): "sender" # 173..179 + - Period (Token): "." # 179..180 + - MemberAccess (Rule): # 180..184 "call" + - Identifier (Token): "call" # 180..184 + - FunctionCallOptions (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - NamedArgumentGroups (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - NamedArgumentGroup (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - OpenBrace (Token): "{" # 184..185 + - NamedArguments (Rule): # 185..222 "arg: 1, missing_expr: , no_semicolon," + - NamedArgument (Rule): # 185..191 "arg: 1" + - Identifier (Token): "arg" # 185..188 + - Colon (Token): ":" # 188..189 + - Expression (Rule): # 189..191 " 1" + - DecimalNumberExpression (Rule): # 189..191 " 1" + - DecimalLiteral (Token): "1" # 190..191 + - Comma (Token): "," # 191..192 + - NamedArgument (Rule): # 192..206 " missing_expr:" + - Identifier (Token): "missing_expr" # 193..205 + - Colon (Token): ":" # 205..206 + - SKIPPED (Token): " " # 206..207 + - Comma (Token): "," # 207..208 + - NamedArgument (Rule): # 208..221 " no_semicolon" + - Identifier (Token): "no_semicolon" # 209..221 + - SKIPPED (Token): "" # 221..221 + - Comma (Token): "," # 221..222 + - SKIPPED (Token): ", " # 223..225 + - CloseBrace (Token): "}" # 225..226 + - ArgumentsDeclaration (Rule): # 226..228 "()" + - PositionalArgumentsDeclaration (Rule): # 226..228 "()" + - OpenParen (Token): "(" # 226..227 + - CloseParen (Token): ")" # 227..228 + - Semicolon (Token): ";" # 228..229 + - Statement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - Expression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - FunctionCallExpression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - Expression (Rule): # 230..247 " msg.sender.call" + - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" + - Expression (Rule): # 230..242 " msg.sender" + - MemberAccessExpression (Rule): # 230..242 " msg.sender" + - Expression (Rule): # 230..235 " msg" + - Identifier (Token): "msg" # 232..235 + - Period (Token): "." # 235..236 + - MemberAccess (Rule): # 236..242 "sender" + - Identifier (Token): "sender" # 236..242 + - Period (Token): "." # 242..243 + - MemberAccess (Rule): # 243..247 "call" + - Identifier (Token): "call" # 243..247 + - FunctionCallOptions (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - NamedArgumentGroups (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - NamedArgumentGroup (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - OpenBrace (Token): "{" # 247..248 + - NamedArguments (Rule): # 248..254 "arg: 1" + - NamedArgument (Rule): # 248..254 "arg: 1" + - Identifier (Token): "arg" # 248..251 + - Colon (Token): ":" # 251..252 + - Expression (Rule): # 252..254 " 1" + - DecimalNumberExpression (Rule): # 252..254 " 1" + - DecimalLiteral (Token): "1" # 253..254 + - SKIPPED (Token): "unexpected tokens, not: 2, recovered, yet: 3, " # 255..301 + - CloseBrace (Token): "}" # 301..302 + - ArgumentsDeclaration (Rule): # 302..304 "()" + - PositionalArgumentsDeclaration (Rule): # 302..304 "()" + - OpenParen (Token): "(" # 302..303 + - CloseParen (Token): ")" # 303..304 + - Semicolon (Token): ";" # 304..305 + - CloseBrace (Token): "}" # 307..308 + - ContractMember (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." + - FunctionDefinition (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." + - FunctionKeyword (Token): "function" # 310..318 + - FunctionName (Rule): # 318..324 " empty" + - Identifier (Token): "empty" # 319..324 + - ParametersDeclaration (Rule): # 324..326 "()" + - OpenParen (Token): "(" # 324..325 + - CloseParen (Token): ")" # 325..326 + - FunctionAttributes (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - FunctionAttribute (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideKeyword (Token): "override" # 327..335 + - OverridePathsDeclaration (Rule): # 335..386 "(some.ident, /* empty */, other.arg.here, and.here..." + - OpenParen (Token): "(" # 335..336 + - OverridePaths (Rule): # 336..347 "some.ident," + - IdentifierPath (Rule): # 336..346 "some.ident" + - Identifier (Token): "some" # 336..340 + - Period (Token): "." # 340..341 + - Identifier (Token): "ident" # 341..346 + - Comma (Token): "," # 346..347 + - LeadingTrivia (Rule): # 347..359 " /* empty */" + - MultilineComment (Trivia): "/* empty */" # 348..359 + - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 + - CloseParen (Token): ")" # 385..386 + - FunctionBody (Rule): # 386..388 ";\n" + - Semicolon (Token): ";" # 386..387 + - ContractMember (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." + - FunctionDefinition (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." + - FunctionKeyword (Token): "function" # 389..397 + - FunctionName (Rule): # 397..410 " nested_lists" + - Identifier (Token): "nested_lists" # 398..410 + - ParametersDeclaration (Rule): # 410..412 "()" + - OpenParen (Token): "(" # 410..411 + - CloseParen (Token): ")" # 411..412 + - FunctionAttributes (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - FunctionAttribute (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideKeyword (Token): "override" # 413..421 + - OverridePathsDeclaration (Rule): # 421..487 "(some.ident, next.do.that, other.while, next.one, ..." + - OpenParen (Token): "(" # 421..422 + - OverridePaths (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," + - IdentifierPath (Rule): # 422..432 "some.ident" + - Identifier (Token): "some" # 422..426 + - Period (Token): "." # 426..427 + - Identifier (Token): "ident" # 427..432 + - Comma (Token): "," # 432..433 + - IdentifierPath (Rule): # 433..439 " next." + - Identifier (Token): "next" # 434..438 + - Period (Token): "." # 438..439 + - SKIPPED (Token): "do.that" # 439..446 + - Comma (Token): "," # 446..447 + - IdentifierPath (Rule): # 447..454 " other." + - Identifier (Token): "other" # 448..453 + - Period (Token): "." # 453..454 + - SKIPPED (Token): "while" # 454..459 + - Comma (Token): "," # 459..460 + - IdentifierPath (Rule): # 460..469 " next.one" + - Identifier (Token): "next" # 461..465 + - Period (Token): "." # 465..466 + - Identifier (Token): "one" # 466..469 + - Comma (Token): "," # 469..470 + - SKIPPED (Token): "final, ultimate" # 471..486 + - CloseParen (Token): ")" # 486..487 + - FunctionBody (Rule): # 487..489 ";\n" + - Semicolon (Token): ";" # 487..488 + - ContractMember (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." + - FunctionDefinition (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." + - FunctionKeyword (Token): "function" # 489..497 + - FunctionName (Rule): # 497..510 " nested_lists" + - Identifier (Token): "nested_lists" # 498..510 + - ParametersDeclaration (Rule): # 510..512 "()" + - OpenParen (Token): "(" # 510..511 + - CloseParen (Token): ")" # 511..512 + - FunctionAttributes (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - FunctionAttribute (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideKeyword (Token): "override" # 513..521 + - OverridePathsDeclaration (Rule): # 521..558 "(some., next.arg, next.one, ultimate)" + - OpenParen (Token): "(" # 521..522 + - OverridePaths (Rule): # 522..557 "some., next.arg, next.one, ultimate" + - IdentifierPath (Rule): # 522..527 "some." + - Identifier (Token): "some" # 522..526 + - Period (Token): "." # 526..527 + - SKIPPED (Token): "" # 527..527 + - Comma (Token): "," # 527..528 + - IdentifierPath (Rule): # 528..537 " next.arg" + - Identifier (Token): "next" # 529..533 + - Period (Token): "." # 533..534 + - Identifier (Token): "arg" # 534..537 + - Comma (Token): "," # 537..538 + - IdentifierPath (Rule): # 538..547 " next.one" + - Identifier (Token): "next" # 539..543 + - Period (Token): "." # 543..544 + - Identifier (Token): "one" # 544..547 + - Comma (Token): "," # 547..548 + - IdentifierPath (Rule): # 548..557 " ultimate" + - Identifier (Token): "ultimate" # 549..557 + - CloseParen (Token): ")" # 557..558 + - FunctionBody (Rule): # 558..560 ";\n" + - Semicolon (Token): ";" # 558..559 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.7.0-failure.yml index 5ea4dcef1c..a03fa3be54 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.7.0-failure.yml @@ -114,226 +114,263 @@ Errors: # 12 total Tree: - ContractMembers (Rule): # 0..560 "function all() override(some.ident unexpected toke..." - - FunctionDefinition (Rule): # 0..309 "function all() override(some.ident unexpected toke..." - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "all" # 9..12 - - ParametersDeclaration (Rule): # 12..14 "()" - - OpenParen (Token): "(" # 12..13 - - CloseParen (Token): ")" # 13..14 - - FunctionAttributes (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideKeyword (Token): "override" # 15..23 - - OverridePathsDeclaration (Rule): # 23..76 "(some.ident unexpected tokens, ISomeInterface, Oth..." - - OpenParen (Token): "(" # 23..24 - - OverridePaths (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 - - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 - - CloseParen (Token): ")" # 75..76 - - PublicKeyword (Token): "public" # 77..83 - - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." - - OpenBrace (Token): "{" # 84..85 - - Statements (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." - - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" - - Expression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" - - FunctionCallExpression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" - - Expression (Rule): # 86..103 " msg.sender.call" - - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" - - Expression (Rule): # 86..98 " msg.sender" - - MemberAccessExpression (Rule): # 86..98 " msg.sender" - - Expression (Rule): # 86..91 " msg" - - Identifier (Token): "msg" # 88..91 - - Period (Token): "." # 91..92 - - Identifier (Token): "sender" # 92..98 - - Period (Token): "." # 98..99 - - Identifier (Token): "call" # 99..103 - - NamedArgumentGroups (Rule): # 103..119 "{do: 1, arg: 1 }" - - NamedArgumentGroup (Rule): # 103..119 "{do: 1, arg: 1 }" - - OpenBrace (Token): "{" # 103..104 - - SKIPPED (Token): "do: 1, arg: 1 " # 104..118 - - CloseBrace (Token): "}" # 118..119 - - PositionalArgumentsDeclaration (Rule): # 119..121 "()" - - OpenParen (Token): "(" # 119..120 - - CloseParen (Token): ")" # 120..121 - - Semicolon (Token): ";" # 121..122 - - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" - - Expression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" - - FunctionCallExpression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" - - Expression (Rule): # 123..140 " msg.sender.call" - - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" - - Expression (Rule): # 123..135 " msg.sender" - - MemberAccessExpression (Rule): # 123..135 " msg.sender" - - Expression (Rule): # 123..128 " msg" - - Identifier (Token): "msg" # 125..128 - - Period (Token): "." # 128..129 - - Identifier (Token): "sender" # 129..135 - - Period (Token): "." # 135..136 - - Identifier (Token): "call" # 136..140 - - NamedArgumentGroups (Rule): # 140..163 "{, empty: 1, parse: 2 }" - - NamedArgumentGroup (Rule): # 140..163 "{, empty: 1, parse: 2 }" - - OpenBrace (Token): "{" # 140..141 - - SKIPPED (Token): ", empty: 1, parse: 2 " # 141..162 - - CloseBrace (Token): "}" # 162..163 - - PositionalArgumentsDeclaration (Rule): # 163..165 "()" - - OpenParen (Token): "(" # 163..164 - - CloseParen (Token): ")" # 164..165 - - Semicolon (Token): ";" # 165..166 - - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - FunctionCallExpression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..184 " msg.sender.call" - - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" - - Expression (Rule): # 167..179 " msg.sender" - - MemberAccessExpression (Rule): # 167..179 " msg.sender" - - Expression (Rule): # 167..172 " msg" - - Identifier (Token): "msg" # 169..172 - - Period (Token): "." # 172..173 - - Identifier (Token): "sender" # 173..179 - - Period (Token): "." # 179..180 - - Identifier (Token): "call" # 180..184 - - NamedArgumentGroups (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" - - NamedArgumentGroup (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" - - OpenBrace (Token): "{" # 184..185 - - NamedArguments (Rule): # 185..222 "arg: 1, missing_expr: , no_semicolon," - - NamedArgument (Rule): # 185..191 "arg: 1" - - Identifier (Token): "arg" # 185..188 - - Colon (Token): ":" # 188..189 - - Expression (Rule): # 189..191 " 1" - - DecimalNumberExpression (Rule): # 189..191 " 1" - - DecimalLiteral (Token): "1" # 190..191 - - Comma (Token): "," # 191..192 - - NamedArgument (Rule): # 192..206 " missing_expr:" - - Identifier (Token): "missing_expr" # 193..205 - - Colon (Token): ":" # 205..206 - - SKIPPED (Token): " " # 206..207 - - Comma (Token): "," # 207..208 - - NamedArgument (Rule): # 208..221 " no_semicolon" - - Identifier (Token): "no_semicolon" # 209..221 - - SKIPPED (Token): "" # 221..221 - - Comma (Token): "," # 221..222 - - SKIPPED (Token): ", " # 223..225 - - CloseBrace (Token): "}" # 225..226 - - PositionalArgumentsDeclaration (Rule): # 226..228 "()" - - OpenParen (Token): "(" # 226..227 - - CloseParen (Token): ")" # 227..228 - - Semicolon (Token): ";" # 228..229 - - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - FunctionCallExpression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..247 " msg.sender.call" - - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" - - Expression (Rule): # 230..242 " msg.sender" - - MemberAccessExpression (Rule): # 230..242 " msg.sender" - - Expression (Rule): # 230..235 " msg" - - Identifier (Token): "msg" # 232..235 - - Period (Token): "." # 235..236 - - Identifier (Token): "sender" # 236..242 - - Period (Token): "." # 242..243 - - Identifier (Token): "call" # 243..247 - - NamedArgumentGroups (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - - NamedArgumentGroup (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - - OpenBrace (Token): "{" # 247..248 - - NamedArguments (Rule): # 248..254 "arg: 1" - - NamedArgument (Rule): # 248..254 "arg: 1" - - Identifier (Token): "arg" # 248..251 - - Colon (Token): ":" # 251..252 - - Expression (Rule): # 252..254 " 1" - - DecimalNumberExpression (Rule): # 252..254 " 1" - - DecimalLiteral (Token): "1" # 253..254 - - SKIPPED (Token): "unexpected tokens, not: 2, recovered, yet: 3, " # 255..301 - - CloseBrace (Token): "}" # 301..302 - - PositionalArgumentsDeclaration (Rule): # 302..304 "()" - - OpenParen (Token): "(" # 302..303 - - CloseParen (Token): ")" # 303..304 - - Semicolon (Token): ";" # 304..305 - - CloseBrace (Token): "}" # 307..308 - - FunctionDefinition (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." - - FunctionKeyword (Token): "function" # 310..318 - - Identifier (Token): "empty" # 319..324 - - ParametersDeclaration (Rule): # 324..326 "()" - - OpenParen (Token): "(" # 324..325 - - CloseParen (Token): ")" # 325..326 - - FunctionAttributes (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideKeyword (Token): "override" # 327..335 - - OverridePathsDeclaration (Rule): # 335..386 "(some.ident, /* empty */, other.arg.here, and.here..." - - OpenParen (Token): "(" # 335..336 - - OverridePaths (Rule): # 336..347 "some.ident," - - IdentifierPath (Rule): # 336..346 "some.ident" - - Identifier (Token): "some" # 336..340 - - Period (Token): "." # 340..341 - - Identifier (Token): "ident" # 341..346 - - Comma (Token): "," # 346..347 - - LeadingTrivia (Rule): # 347..359 " /* empty */" - - MultilineComment (Trivia): "/* empty */" # 348..359 - - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 - - CloseParen (Token): ")" # 385..386 - - Semicolon (Token): ";" # 386..387 - - FunctionDefinition (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." - - FunctionKeyword (Token): "function" # 389..397 - - Identifier (Token): "nested_lists" # 398..410 - - ParametersDeclaration (Rule): # 410..412 "()" - - OpenParen (Token): "(" # 410..411 - - CloseParen (Token): ")" # 411..412 - - FunctionAttributes (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideKeyword (Token): "override" # 413..421 - - OverridePathsDeclaration (Rule): # 421..487 "(some.ident, next.do.that, other.while, next.one, ..." - - OpenParen (Token): "(" # 421..422 - - OverridePaths (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," - - IdentifierPath (Rule): # 422..432 "some.ident" - - Identifier (Token): "some" # 422..426 - - Period (Token): "." # 426..427 - - Identifier (Token): "ident" # 427..432 - - Comma (Token): "," # 432..433 - - IdentifierPath (Rule): # 433..439 " next." - - Identifier (Token): "next" # 434..438 - - Period (Token): "." # 438..439 - - SKIPPED (Token): "do.that" # 439..446 - - Comma (Token): "," # 446..447 - - IdentifierPath (Rule): # 447..454 " other." - - Identifier (Token): "other" # 448..453 - - Period (Token): "." # 453..454 - - SKIPPED (Token): "while" # 454..459 - - Comma (Token): "," # 459..460 - - IdentifierPath (Rule): # 460..469 " next.one" - - Identifier (Token): "next" # 461..465 - - Period (Token): "." # 465..466 - - Identifier (Token): "one" # 466..469 - - Comma (Token): "," # 469..470 - - SKIPPED (Token): "final, ultimate" # 471..486 - - CloseParen (Token): ")" # 486..487 - - Semicolon (Token): ";" # 487..488 - - FunctionDefinition (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." - - FunctionKeyword (Token): "function" # 489..497 - - Identifier (Token): "nested_lists" # 498..510 - - ParametersDeclaration (Rule): # 510..512 "()" - - OpenParen (Token): "(" # 510..511 - - CloseParen (Token): ")" # 511..512 - - FunctionAttributes (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideKeyword (Token): "override" # 513..521 - - OverridePathsDeclaration (Rule): # 521..558 "(some., next.arg, next.one, ultimate)" - - OpenParen (Token): "(" # 521..522 - - OverridePaths (Rule): # 522..557 "some., next.arg, next.one, ultimate" - - IdentifierPath (Rule): # 522..527 "some." - - Identifier (Token): "some" # 522..526 - - Period (Token): "." # 526..527 - - SKIPPED (Token): "" # 527..527 - - Comma (Token): "," # 527..528 - - IdentifierPath (Rule): # 528..537 " next.arg" - - Identifier (Token): "next" # 529..533 - - Period (Token): "." # 533..534 - - Identifier (Token): "arg" # 534..537 - - Comma (Token): "," # 537..538 - - IdentifierPath (Rule): # 538..547 " next.one" - - Identifier (Token): "next" # 539..543 - - Period (Token): "." # 543..544 - - Identifier (Token): "one" # 544..547 - - Comma (Token): "," # 547..548 - - IdentifierPath (Rule): # 548..557 " ultimate" - - Identifier (Token): "ultimate" # 549..557 - - CloseParen (Token): ")" # 557..558 - - Semicolon (Token): ";" # 558..559 + - ContractMember (Rule): # 0..309 "function all() override(some.ident unexpected toke..." + - FunctionDefinition (Rule): # 0..309 "function all() override(some.ident unexpected toke..." + - FunctionKeyword (Token): "function" # 0..8 + - FunctionName (Rule): # 8..12 " all" + - Identifier (Token): "all" # 9..12 + - ParametersDeclaration (Rule): # 12..14 "()" + - OpenParen (Token): "(" # 12..13 + - CloseParen (Token): ")" # 13..14 + - FunctionAttributes (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." + - FunctionAttribute (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideKeyword (Token): "override" # 15..23 + - OverridePathsDeclaration (Rule): # 23..76 "(some.ident unexpected tokens, ISomeInterface, Oth..." + - OpenParen (Token): "(" # 23..24 + - OverridePaths (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 + - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 + - CloseParen (Token): ")" # 75..76 + - FunctionAttribute (Rule): # 76..83 " public" + - PublicKeyword (Token): "public" # 77..83 + - FunctionBody (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - OpenBrace (Token): "{" # 84..85 + - Statements (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." + - Statement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - Expression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" + - FunctionCallExpression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" + - Expression (Rule): # 86..103 " msg.sender.call" + - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" + - Expression (Rule): # 86..98 " msg.sender" + - MemberAccessExpression (Rule): # 86..98 " msg.sender" + - Expression (Rule): # 86..91 " msg" + - Identifier (Token): "msg" # 88..91 + - Period (Token): "." # 91..92 + - MemberAccess (Rule): # 92..98 "sender" + - Identifier (Token): "sender" # 92..98 + - Period (Token): "." # 98..99 + - MemberAccess (Rule): # 99..103 "call" + - Identifier (Token): "call" # 99..103 + - FunctionCallOptions (Rule): # 103..119 "{do: 1, arg: 1 }" + - NamedArgumentGroups (Rule): # 103..119 "{do: 1, arg: 1 }" + - NamedArgumentGroup (Rule): # 103..119 "{do: 1, arg: 1 }" + - OpenBrace (Token): "{" # 103..104 + - SKIPPED (Token): "do: 1, arg: 1 " # 104..118 + - CloseBrace (Token): "}" # 118..119 + - ArgumentsDeclaration (Rule): # 119..121 "()" + - PositionalArgumentsDeclaration (Rule): # 119..121 "()" + - OpenParen (Token): "(" # 119..120 + - CloseParen (Token): ")" # 120..121 + - Semicolon (Token): ";" # 121..122 + - Statement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - Expression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" + - FunctionCallExpression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" + - Expression (Rule): # 123..140 " msg.sender.call" + - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" + - Expression (Rule): # 123..135 " msg.sender" + - MemberAccessExpression (Rule): # 123..135 " msg.sender" + - Expression (Rule): # 123..128 " msg" + - Identifier (Token): "msg" # 125..128 + - Period (Token): "." # 128..129 + - MemberAccess (Rule): # 129..135 "sender" + - Identifier (Token): "sender" # 129..135 + - Period (Token): "." # 135..136 + - MemberAccess (Rule): # 136..140 "call" + - Identifier (Token): "call" # 136..140 + - FunctionCallOptions (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - NamedArgumentGroups (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - NamedArgumentGroup (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - OpenBrace (Token): "{" # 140..141 + - SKIPPED (Token): ", empty: 1, parse: 2 " # 141..162 + - CloseBrace (Token): "}" # 162..163 + - ArgumentsDeclaration (Rule): # 163..165 "()" + - PositionalArgumentsDeclaration (Rule): # 163..165 "()" + - OpenParen (Token): "(" # 163..164 + - CloseParen (Token): ")" # 164..165 + - Semicolon (Token): ";" # 165..166 + - Statement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - Expression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - FunctionCallExpression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - Expression (Rule): # 167..184 " msg.sender.call" + - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" + - Expression (Rule): # 167..179 " msg.sender" + - MemberAccessExpression (Rule): # 167..179 " msg.sender" + - Expression (Rule): # 167..172 " msg" + - Identifier (Token): "msg" # 169..172 + - Period (Token): "." # 172..173 + - MemberAccess (Rule): # 173..179 "sender" + - Identifier (Token): "sender" # 173..179 + - Period (Token): "." # 179..180 + - MemberAccess (Rule): # 180..184 "call" + - Identifier (Token): "call" # 180..184 + - FunctionCallOptions (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - NamedArgumentGroups (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - NamedArgumentGroup (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - OpenBrace (Token): "{" # 184..185 + - NamedArguments (Rule): # 185..222 "arg: 1, missing_expr: , no_semicolon," + - NamedArgument (Rule): # 185..191 "arg: 1" + - Identifier (Token): "arg" # 185..188 + - Colon (Token): ":" # 188..189 + - Expression (Rule): # 189..191 " 1" + - DecimalNumberExpression (Rule): # 189..191 " 1" + - DecimalLiteral (Token): "1" # 190..191 + - Comma (Token): "," # 191..192 + - NamedArgument (Rule): # 192..206 " missing_expr:" + - Identifier (Token): "missing_expr" # 193..205 + - Colon (Token): ":" # 205..206 + - SKIPPED (Token): " " # 206..207 + - Comma (Token): "," # 207..208 + - NamedArgument (Rule): # 208..221 " no_semicolon" + - Identifier (Token): "no_semicolon" # 209..221 + - SKIPPED (Token): "" # 221..221 + - Comma (Token): "," # 221..222 + - SKIPPED (Token): ", " # 223..225 + - CloseBrace (Token): "}" # 225..226 + - ArgumentsDeclaration (Rule): # 226..228 "()" + - PositionalArgumentsDeclaration (Rule): # 226..228 "()" + - OpenParen (Token): "(" # 226..227 + - CloseParen (Token): ")" # 227..228 + - Semicolon (Token): ";" # 228..229 + - Statement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - Expression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - FunctionCallExpression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - Expression (Rule): # 230..247 " msg.sender.call" + - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" + - Expression (Rule): # 230..242 " msg.sender" + - MemberAccessExpression (Rule): # 230..242 " msg.sender" + - Expression (Rule): # 230..235 " msg" + - Identifier (Token): "msg" # 232..235 + - Period (Token): "." # 235..236 + - MemberAccess (Rule): # 236..242 "sender" + - Identifier (Token): "sender" # 236..242 + - Period (Token): "." # 242..243 + - MemberAccess (Rule): # 243..247 "call" + - Identifier (Token): "call" # 243..247 + - FunctionCallOptions (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - NamedArgumentGroups (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - NamedArgumentGroup (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - OpenBrace (Token): "{" # 247..248 + - NamedArguments (Rule): # 248..254 "arg: 1" + - NamedArgument (Rule): # 248..254 "arg: 1" + - Identifier (Token): "arg" # 248..251 + - Colon (Token): ":" # 251..252 + - Expression (Rule): # 252..254 " 1" + - DecimalNumberExpression (Rule): # 252..254 " 1" + - DecimalLiteral (Token): "1" # 253..254 + - SKIPPED (Token): "unexpected tokens, not: 2, recovered, yet: 3, " # 255..301 + - CloseBrace (Token): "}" # 301..302 + - ArgumentsDeclaration (Rule): # 302..304 "()" + - PositionalArgumentsDeclaration (Rule): # 302..304 "()" + - OpenParen (Token): "(" # 302..303 + - CloseParen (Token): ")" # 303..304 + - Semicolon (Token): ";" # 304..305 + - CloseBrace (Token): "}" # 307..308 + - ContractMember (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." + - FunctionDefinition (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." + - FunctionKeyword (Token): "function" # 310..318 + - FunctionName (Rule): # 318..324 " empty" + - Identifier (Token): "empty" # 319..324 + - ParametersDeclaration (Rule): # 324..326 "()" + - OpenParen (Token): "(" # 324..325 + - CloseParen (Token): ")" # 325..326 + - FunctionAttributes (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - FunctionAttribute (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideKeyword (Token): "override" # 327..335 + - OverridePathsDeclaration (Rule): # 335..386 "(some.ident, /* empty */, other.arg.here, and.here..." + - OpenParen (Token): "(" # 335..336 + - OverridePaths (Rule): # 336..347 "some.ident," + - IdentifierPath (Rule): # 336..346 "some.ident" + - Identifier (Token): "some" # 336..340 + - Period (Token): "." # 340..341 + - Identifier (Token): "ident" # 341..346 + - Comma (Token): "," # 346..347 + - LeadingTrivia (Rule): # 347..359 " /* empty */" + - MultilineComment (Trivia): "/* empty */" # 348..359 + - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 + - CloseParen (Token): ")" # 385..386 + - FunctionBody (Rule): # 386..388 ";\n" + - Semicolon (Token): ";" # 386..387 + - ContractMember (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." + - FunctionDefinition (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." + - FunctionKeyword (Token): "function" # 389..397 + - FunctionName (Rule): # 397..410 " nested_lists" + - Identifier (Token): "nested_lists" # 398..410 + - ParametersDeclaration (Rule): # 410..412 "()" + - OpenParen (Token): "(" # 410..411 + - CloseParen (Token): ")" # 411..412 + - FunctionAttributes (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - FunctionAttribute (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideKeyword (Token): "override" # 413..421 + - OverridePathsDeclaration (Rule): # 421..487 "(some.ident, next.do.that, other.while, next.one, ..." + - OpenParen (Token): "(" # 421..422 + - OverridePaths (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," + - IdentifierPath (Rule): # 422..432 "some.ident" + - Identifier (Token): "some" # 422..426 + - Period (Token): "." # 426..427 + - Identifier (Token): "ident" # 427..432 + - Comma (Token): "," # 432..433 + - IdentifierPath (Rule): # 433..439 " next." + - Identifier (Token): "next" # 434..438 + - Period (Token): "." # 438..439 + - SKIPPED (Token): "do.that" # 439..446 + - Comma (Token): "," # 446..447 + - IdentifierPath (Rule): # 447..454 " other." + - Identifier (Token): "other" # 448..453 + - Period (Token): "." # 453..454 + - SKIPPED (Token): "while" # 454..459 + - Comma (Token): "," # 459..460 + - IdentifierPath (Rule): # 460..469 " next.one" + - Identifier (Token): "next" # 461..465 + - Period (Token): "." # 465..466 + - Identifier (Token): "one" # 466..469 + - Comma (Token): "," # 469..470 + - SKIPPED (Token): "final, ultimate" # 471..486 + - CloseParen (Token): ")" # 486..487 + - FunctionBody (Rule): # 487..489 ";\n" + - Semicolon (Token): ";" # 487..488 + - ContractMember (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." + - FunctionDefinition (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." + - FunctionKeyword (Token): "function" # 489..497 + - FunctionName (Rule): # 497..510 " nested_lists" + - Identifier (Token): "nested_lists" # 498..510 + - ParametersDeclaration (Rule): # 510..512 "()" + - OpenParen (Token): "(" # 510..511 + - CloseParen (Token): ")" # 511..512 + - FunctionAttributes (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - FunctionAttribute (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideKeyword (Token): "override" # 513..521 + - OverridePathsDeclaration (Rule): # 521..558 "(some., next.arg, next.one, ultimate)" + - OpenParen (Token): "(" # 521..522 + - OverridePaths (Rule): # 522..557 "some., next.arg, next.one, ultimate" + - IdentifierPath (Rule): # 522..527 "some." + - Identifier (Token): "some" # 522..526 + - Period (Token): "." # 526..527 + - SKIPPED (Token): "" # 527..527 + - Comma (Token): "," # 527..528 + - IdentifierPath (Rule): # 528..537 " next.arg" + - Identifier (Token): "next" # 529..533 + - Period (Token): "." # 533..534 + - Identifier (Token): "arg" # 534..537 + - Comma (Token): "," # 537..538 + - IdentifierPath (Rule): # 538..547 " next.one" + - Identifier (Token): "next" # 539..543 + - Period (Token): "." # 543..544 + - Identifier (Token): "one" # 544..547 + - Comma (Token): "," # 547..548 + - IdentifierPath (Rule): # 548..557 " ultimate" + - Identifier (Token): "ultimate" # 549..557 + - CloseParen (Token): ")" # 557..558 + - FunctionBody (Rule): # 558..560 ";\n" + - Semicolon (Token): ";" # 558..559 diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.8.0-failure.yml index 7627917e88..45a910762c 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.8.0-failure.yml @@ -114,222 +114,259 @@ Errors: # 12 total Tree: - ContractMembers (Rule): # 0..560 "function all() override(some.ident unexpected toke..." - - FunctionDefinition (Rule): # 0..309 "function all() override(some.ident unexpected toke..." - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "all" # 9..12 - - ParametersDeclaration (Rule): # 12..14 "()" - - OpenParen (Token): "(" # 12..13 - - CloseParen (Token): ")" # 13..14 - - FunctionAttributes (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." - - OverrideKeyword (Token): "override" # 15..23 - - OverridePathsDeclaration (Rule): # 23..76 "(some.ident unexpected tokens, ISomeInterface, Oth..." - - OpenParen (Token): "(" # 23..24 - - OverridePaths (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 - - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 - - CloseParen (Token): ")" # 75..76 - - PublicKeyword (Token): "public" # 77..83 - - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." - - OpenBrace (Token): "{" # 84..85 - - Statements (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." - - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" - - Expression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" - - FunctionCallExpression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" - - Expression (Rule): # 86..103 " msg.sender.call" - - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" - - Expression (Rule): # 86..98 " msg.sender" - - MemberAccessExpression (Rule): # 86..98 " msg.sender" - - Expression (Rule): # 86..91 " msg" - - Identifier (Token): "msg" # 88..91 - - Period (Token): "." # 91..92 - - Identifier (Token): "sender" # 92..98 - - Period (Token): "." # 98..99 - - Identifier (Token): "call" # 99..103 - - NamedArgumentGroup (Rule): # 103..119 "{do: 1, arg: 1 }" - - OpenBrace (Token): "{" # 103..104 - - SKIPPED (Token): "do: 1, arg: 1 " # 104..118 - - CloseBrace (Token): "}" # 118..119 - - PositionalArgumentsDeclaration (Rule): # 119..121 "()" - - OpenParen (Token): "(" # 119..120 - - CloseParen (Token): ")" # 120..121 - - Semicolon (Token): ";" # 121..122 - - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" - - Expression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" - - FunctionCallExpression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" - - Expression (Rule): # 123..140 " msg.sender.call" - - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" - - Expression (Rule): # 123..135 " msg.sender" - - MemberAccessExpression (Rule): # 123..135 " msg.sender" - - Expression (Rule): # 123..128 " msg" - - Identifier (Token): "msg" # 125..128 - - Period (Token): "." # 128..129 - - Identifier (Token): "sender" # 129..135 - - Period (Token): "." # 135..136 - - Identifier (Token): "call" # 136..140 - - NamedArgumentGroup (Rule): # 140..163 "{, empty: 1, parse: 2 }" - - OpenBrace (Token): "{" # 140..141 - - SKIPPED (Token): ", empty: 1, parse: 2 " # 141..162 - - CloseBrace (Token): "}" # 162..163 - - PositionalArgumentsDeclaration (Rule): # 163..165 "()" - - OpenParen (Token): "(" # 163..164 - - CloseParen (Token): ")" # 164..165 - - Semicolon (Token): ";" # 165..166 - - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - FunctionCallExpression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." - - Expression (Rule): # 167..184 " msg.sender.call" - - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" - - Expression (Rule): # 167..179 " msg.sender" - - MemberAccessExpression (Rule): # 167..179 " msg.sender" - - Expression (Rule): # 167..172 " msg" - - Identifier (Token): "msg" # 169..172 - - Period (Token): "." # 172..173 - - Identifier (Token): "sender" # 173..179 - - Period (Token): "." # 179..180 - - Identifier (Token): "call" # 180..184 - - NamedArgumentGroup (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" - - OpenBrace (Token): "{" # 184..185 - - NamedArguments (Rule): # 185..222 "arg: 1, missing_expr: , no_semicolon," - - NamedArgument (Rule): # 185..191 "arg: 1" - - Identifier (Token): "arg" # 185..188 - - Colon (Token): ":" # 188..189 - - Expression (Rule): # 189..191 " 1" - - DecimalNumberExpression (Rule): # 189..191 " 1" - - DecimalLiteral (Token): "1" # 190..191 - - Comma (Token): "," # 191..192 - - NamedArgument (Rule): # 192..206 " missing_expr:" - - Identifier (Token): "missing_expr" # 193..205 - - Colon (Token): ":" # 205..206 - - SKIPPED (Token): " " # 206..207 - - Comma (Token): "," # 207..208 - - NamedArgument (Rule): # 208..221 " no_semicolon" - - Identifier (Token): "no_semicolon" # 209..221 - - SKIPPED (Token): "" # 221..221 - - Comma (Token): "," # 221..222 - - SKIPPED (Token): ", " # 223..225 - - CloseBrace (Token): "}" # 225..226 - - PositionalArgumentsDeclaration (Rule): # 226..228 "()" - - OpenParen (Token): "(" # 226..227 - - CloseParen (Token): ")" # 227..228 - - Semicolon (Token): ";" # 228..229 - - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - FunctionCallExpression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." - - Expression (Rule): # 230..247 " msg.sender.call" - - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" - - Expression (Rule): # 230..242 " msg.sender" - - MemberAccessExpression (Rule): # 230..242 " msg.sender" - - Expression (Rule): # 230..235 " msg" - - Identifier (Token): "msg" # 232..235 - - Period (Token): "." # 235..236 - - Identifier (Token): "sender" # 236..242 - - Period (Token): "." # 242..243 - - Identifier (Token): "call" # 243..247 - - NamedArgumentGroup (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." - - OpenBrace (Token): "{" # 247..248 - - NamedArguments (Rule): # 248..254 "arg: 1" - - NamedArgument (Rule): # 248..254 "arg: 1" - - Identifier (Token): "arg" # 248..251 - - Colon (Token): ":" # 251..252 - - Expression (Rule): # 252..254 " 1" - - DecimalNumberExpression (Rule): # 252..254 " 1" - - DecimalLiteral (Token): "1" # 253..254 - - SKIPPED (Token): "unexpected tokens, not: 2, recovered, yet: 3, " # 255..301 - - CloseBrace (Token): "}" # 301..302 - - PositionalArgumentsDeclaration (Rule): # 302..304 "()" - - OpenParen (Token): "(" # 302..303 - - CloseParen (Token): ")" # 303..304 - - Semicolon (Token): ";" # 304..305 - - CloseBrace (Token): "}" # 307..308 - - FunctionDefinition (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." - - FunctionKeyword (Token): "function" # 310..318 - - Identifier (Token): "empty" # 319..324 - - ParametersDeclaration (Rule): # 324..326 "()" - - OpenParen (Token): "(" # 324..325 - - CloseParen (Token): ")" # 325..326 - - FunctionAttributes (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." - - OverrideKeyword (Token): "override" # 327..335 - - OverridePathsDeclaration (Rule): # 335..386 "(some.ident, /* empty */, other.arg.here, and.here..." - - OpenParen (Token): "(" # 335..336 - - OverridePaths (Rule): # 336..347 "some.ident," - - IdentifierPath (Rule): # 336..346 "some.ident" - - Identifier (Token): "some" # 336..340 - - Period (Token): "." # 340..341 - - Identifier (Token): "ident" # 341..346 - - Comma (Token): "," # 346..347 - - LeadingTrivia (Rule): # 347..359 " /* empty */" - - MultilineComment (Trivia): "/* empty */" # 348..359 - - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 - - CloseParen (Token): ")" # 385..386 - - Semicolon (Token): ";" # 386..387 - - FunctionDefinition (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." - - FunctionKeyword (Token): "function" # 389..397 - - Identifier (Token): "nested_lists" # 398..410 - - ParametersDeclaration (Rule): # 410..412 "()" - - OpenParen (Token): "(" # 410..411 - - CloseParen (Token): ")" # 411..412 - - FunctionAttributes (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." - - OverrideKeyword (Token): "override" # 413..421 - - OverridePathsDeclaration (Rule): # 421..487 "(some.ident, next.do.that, other.while, next.one, ..." - - OpenParen (Token): "(" # 421..422 - - OverridePaths (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," - - IdentifierPath (Rule): # 422..432 "some.ident" - - Identifier (Token): "some" # 422..426 - - Period (Token): "." # 426..427 - - Identifier (Token): "ident" # 427..432 - - Comma (Token): "," # 432..433 - - IdentifierPath (Rule): # 433..439 " next." - - Identifier (Token): "next" # 434..438 - - Period (Token): "." # 438..439 - - SKIPPED (Token): "do.that" # 439..446 - - Comma (Token): "," # 446..447 - - IdentifierPath (Rule): # 447..454 " other." - - Identifier (Token): "other" # 448..453 - - Period (Token): "." # 453..454 - - SKIPPED (Token): "while" # 454..459 - - Comma (Token): "," # 459..460 - - IdentifierPath (Rule): # 460..469 " next.one" - - Identifier (Token): "next" # 461..465 - - Period (Token): "." # 465..466 - - Identifier (Token): "one" # 466..469 - - Comma (Token): "," # 469..470 - - SKIPPED (Token): "final, ultimate" # 471..486 - - CloseParen (Token): ")" # 486..487 - - Semicolon (Token): ";" # 487..488 - - FunctionDefinition (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." - - FunctionKeyword (Token): "function" # 489..497 - - Identifier (Token): "nested_lists" # 498..510 - - ParametersDeclaration (Rule): # 510..512 "()" - - OpenParen (Token): "(" # 510..511 - - CloseParen (Token): ")" # 511..512 - - FunctionAttributes (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" - - OverrideKeyword (Token): "override" # 513..521 - - OverridePathsDeclaration (Rule): # 521..558 "(some., next.arg, next.one, ultimate)" - - OpenParen (Token): "(" # 521..522 - - OverridePaths (Rule): # 522..557 "some., next.arg, next.one, ultimate" - - IdentifierPath (Rule): # 522..527 "some." - - Identifier (Token): "some" # 522..526 - - Period (Token): "." # 526..527 - - SKIPPED (Token): "" # 527..527 - - Comma (Token): "," # 527..528 - - IdentifierPath (Rule): # 528..537 " next.arg" - - Identifier (Token): "next" # 529..533 - - Period (Token): "." # 533..534 - - Identifier (Token): "arg" # 534..537 - - Comma (Token): "," # 537..538 - - IdentifierPath (Rule): # 538..547 " next.one" - - Identifier (Token): "next" # 539..543 - - Period (Token): "." # 543..544 - - Identifier (Token): "one" # 544..547 - - Comma (Token): "," # 547..548 - - IdentifierPath (Rule): # 548..557 " ultimate" - - Identifier (Token): "ultimate" # 549..557 - - CloseParen (Token): ")" # 557..558 - - Semicolon (Token): ";" # 558..559 + - ContractMember (Rule): # 0..309 "function all() override(some.ident unexpected toke..." + - FunctionDefinition (Rule): # 0..309 "function all() override(some.ident unexpected toke..." + - FunctionKeyword (Token): "function" # 0..8 + - FunctionName (Rule): # 8..12 " all" + - Identifier (Token): "all" # 9..12 + - ParametersDeclaration (Rule): # 12..14 "()" + - OpenParen (Token): "(" # 12..13 + - CloseParen (Token): ")" # 13..14 + - FunctionAttributes (Rule): # 14..83 " override(some.ident unexpected tokens, ISomeInter..." + - FunctionAttribute (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideSpecifier (Rule): # 14..76 " override(some.ident unexpected tokens, ISomeInter..." + - OverrideKeyword (Token): "override" # 15..23 + - OverridePathsDeclaration (Rule): # 23..76 "(some.ident unexpected tokens, ISomeInterface, Oth..." + - OpenParen (Token): "(" # 23..24 + - OverridePaths (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 + - SKIPPED (Token): "unexpected tokens, ISomeInterface, Other" # 35..75 + - CloseParen (Token): ")" # 75..76 + - FunctionAttribute (Rule): # 76..83 " public" + - PublicKeyword (Token): "public" # 77..83 + - FunctionBody (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - Block (Rule): # 83..309 " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." + - OpenBrace (Token): "{" # 84..85 + - Statements (Rule): # 86..306 " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." + - Statement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - ExpressionStatement (Rule): # 86..123 " msg.sender.call{do: 1, arg: 1 }();\n" + - Expression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" + - FunctionCallExpression (Rule): # 86..121 " msg.sender.call{do: 1, arg: 1 }()" + - Expression (Rule): # 86..103 " msg.sender.call" + - MemberAccessExpression (Rule): # 86..103 " msg.sender.call" + - Expression (Rule): # 86..98 " msg.sender" + - MemberAccessExpression (Rule): # 86..98 " msg.sender" + - Expression (Rule): # 86..91 " msg" + - Identifier (Token): "msg" # 88..91 + - Period (Token): "." # 91..92 + - MemberAccess (Rule): # 92..98 "sender" + - Identifier (Token): "sender" # 92..98 + - Period (Token): "." # 98..99 + - MemberAccess (Rule): # 99..103 "call" + - Identifier (Token): "call" # 99..103 + - FunctionCallOptions (Rule): # 103..119 "{do: 1, arg: 1 }" + - NamedArgumentGroup (Rule): # 103..119 "{do: 1, arg: 1 }" + - OpenBrace (Token): "{" # 103..104 + - SKIPPED (Token): "do: 1, arg: 1 " # 104..118 + - CloseBrace (Token): "}" # 118..119 + - ArgumentsDeclaration (Rule): # 119..121 "()" + - PositionalArgumentsDeclaration (Rule): # 119..121 "()" + - OpenParen (Token): "(" # 119..120 + - CloseParen (Token): ")" # 120..121 + - Semicolon (Token): ";" # 121..122 + - Statement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - ExpressionStatement (Rule): # 123..167 " msg.sender.call{, empty: 1, parse: 2 }();\n" + - Expression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" + - FunctionCallExpression (Rule): # 123..165 " msg.sender.call{, empty: 1, parse: 2 }()" + - Expression (Rule): # 123..140 " msg.sender.call" + - MemberAccessExpression (Rule): # 123..140 " msg.sender.call" + - Expression (Rule): # 123..135 " msg.sender" + - MemberAccessExpression (Rule): # 123..135 " msg.sender" + - Expression (Rule): # 123..128 " msg" + - Identifier (Token): "msg" # 125..128 + - Period (Token): "." # 128..129 + - MemberAccess (Rule): # 129..135 "sender" + - Identifier (Token): "sender" # 129..135 + - Period (Token): "." # 135..136 + - MemberAccess (Rule): # 136..140 "call" + - Identifier (Token): "call" # 136..140 + - FunctionCallOptions (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - NamedArgumentGroup (Rule): # 140..163 "{, empty: 1, parse: 2 }" + - OpenBrace (Token): "{" # 140..141 + - SKIPPED (Token): ", empty: 1, parse: 2 " # 141..162 + - CloseBrace (Token): "}" # 162..163 + - ArgumentsDeclaration (Rule): # 163..165 "()" + - PositionalArgumentsDeclaration (Rule): # 163..165 "()" + - OpenParen (Token): "(" # 163..164 + - CloseParen (Token): ")" # 164..165 + - Semicolon (Token): ";" # 165..166 + - Statement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - ExpressionStatement (Rule): # 167..230 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - Expression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - FunctionCallExpression (Rule): # 167..228 " msg.sender.call{arg: 1, missing_expr: , no_semic..." + - Expression (Rule): # 167..184 " msg.sender.call" + - MemberAccessExpression (Rule): # 167..184 " msg.sender.call" + - Expression (Rule): # 167..179 " msg.sender" + - MemberAccessExpression (Rule): # 167..179 " msg.sender" + - Expression (Rule): # 167..172 " msg" + - Identifier (Token): "msg" # 169..172 + - Period (Token): "." # 172..173 + - MemberAccess (Rule): # 173..179 "sender" + - Identifier (Token): "sender" # 173..179 + - Period (Token): "." # 179..180 + - MemberAccess (Rule): # 180..184 "call" + - Identifier (Token): "call" # 180..184 + - FunctionCallOptions (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - NamedArgumentGroup (Rule): # 184..226 "{arg: 1, missing_expr: , no_semicolon, , }" + - OpenBrace (Token): "{" # 184..185 + - NamedArguments (Rule): # 185..222 "arg: 1, missing_expr: , no_semicolon," + - NamedArgument (Rule): # 185..191 "arg: 1" + - Identifier (Token): "arg" # 185..188 + - Colon (Token): ":" # 188..189 + - Expression (Rule): # 189..191 " 1" + - DecimalNumberExpression (Rule): # 189..191 " 1" + - DecimalLiteral (Token): "1" # 190..191 + - Comma (Token): "," # 191..192 + - NamedArgument (Rule): # 192..206 " missing_expr:" + - Identifier (Token): "missing_expr" # 193..205 + - Colon (Token): ":" # 205..206 + - SKIPPED (Token): " " # 206..207 + - Comma (Token): "," # 207..208 + - NamedArgument (Rule): # 208..221 " no_semicolon" + - Identifier (Token): "no_semicolon" # 209..221 + - SKIPPED (Token): "" # 221..221 + - Comma (Token): "," # 221..222 + - SKIPPED (Token): ", " # 223..225 + - CloseBrace (Token): "}" # 225..226 + - ArgumentsDeclaration (Rule): # 226..228 "()" + - PositionalArgumentsDeclaration (Rule): # 226..228 "()" + - OpenParen (Token): "(" # 226..227 + - CloseParen (Token): ")" # 227..228 + - Semicolon (Token): ";" # 228..229 + - Statement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - ExpressionStatement (Rule): # 230..306 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - Expression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - FunctionCallExpression (Rule): # 230..304 " msg.sender.call{arg: 1 unexpected tokens, not: 2..." + - Expression (Rule): # 230..247 " msg.sender.call" + - MemberAccessExpression (Rule): # 230..247 " msg.sender.call" + - Expression (Rule): # 230..242 " msg.sender" + - MemberAccessExpression (Rule): # 230..242 " msg.sender" + - Expression (Rule): # 230..235 " msg" + - Identifier (Token): "msg" # 232..235 + - Period (Token): "." # 235..236 + - MemberAccess (Rule): # 236..242 "sender" + - Identifier (Token): "sender" # 236..242 + - Period (Token): "." # 242..243 + - MemberAccess (Rule): # 243..247 "call" + - Identifier (Token): "call" # 243..247 + - FunctionCallOptions (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - NamedArgumentGroup (Rule): # 247..302 "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." + - OpenBrace (Token): "{" # 247..248 + - NamedArguments (Rule): # 248..254 "arg: 1" + - NamedArgument (Rule): # 248..254 "arg: 1" + - Identifier (Token): "arg" # 248..251 + - Colon (Token): ":" # 251..252 + - Expression (Rule): # 252..254 " 1" + - DecimalNumberExpression (Rule): # 252..254 " 1" + - DecimalLiteral (Token): "1" # 253..254 + - SKIPPED (Token): "unexpected tokens, not: 2, recovered, yet: 3, " # 255..301 + - CloseBrace (Token): "}" # 301..302 + - ArgumentsDeclaration (Rule): # 302..304 "()" + - PositionalArgumentsDeclaration (Rule): # 302..304 "()" + - OpenParen (Token): "(" # 302..303 + - CloseParen (Token): ")" # 303..304 + - Semicolon (Token): ";" # 304..305 + - CloseBrace (Token): "}" # 307..308 + - ContractMember (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." + - FunctionDefinition (Rule): # 309..388 "\nfunction empty() override(some.ident, /* empty */..." + - FunctionKeyword (Token): "function" # 310..318 + - FunctionName (Rule): # 318..324 " empty" + - Identifier (Token): "empty" # 319..324 + - ParametersDeclaration (Rule): # 324..326 "()" + - OpenParen (Token): "(" # 324..325 + - CloseParen (Token): ")" # 325..326 + - FunctionAttributes (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - FunctionAttribute (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideSpecifier (Rule): # 326..386 " override(some.ident, /* empty */, other.arg.here,..." + - OverrideKeyword (Token): "override" # 327..335 + - OverridePathsDeclaration (Rule): # 335..386 "(some.ident, /* empty */, other.arg.here, and.here..." + - OpenParen (Token): "(" # 335..336 + - OverridePaths (Rule): # 336..347 "some.ident," + - IdentifierPath (Rule): # 336..346 "some.ident" + - Identifier (Token): "some" # 336..340 + - Period (Token): "." # 340..341 + - Identifier (Token): "ident" # 341..346 + - Comma (Token): "," # 346..347 + - LeadingTrivia (Rule): # 347..359 " /* empty */" + - MultilineComment (Trivia): "/* empty */" # 348..359 + - SKIPPED (Token): ", other.arg.here, and.here" # 359..385 + - CloseParen (Token): ")" # 385..386 + - FunctionBody (Rule): # 386..388 ";\n" + - Semicolon (Token): ";" # 386..387 + - ContractMember (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." + - FunctionDefinition (Rule): # 388..489 "\nfunction nested_lists() override(some.ident, next..." + - FunctionKeyword (Token): "function" # 389..397 + - FunctionName (Rule): # 397..410 " nested_lists" + - Identifier (Token): "nested_lists" # 398..410 + - ParametersDeclaration (Rule): # 410..412 "()" + - OpenParen (Token): "(" # 410..411 + - CloseParen (Token): ")" # 411..412 + - FunctionAttributes (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - FunctionAttribute (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideSpecifier (Rule): # 412..487 " override(some.ident, next.do.that, other.while, n..." + - OverrideKeyword (Token): "override" # 413..421 + - OverridePathsDeclaration (Rule): # 421..487 "(some.ident, next.do.that, other.while, next.one, ..." + - OpenParen (Token): "(" # 421..422 + - OverridePaths (Rule): # 422..470 "some.ident, next.do.that, other.while, next.one," + - IdentifierPath (Rule): # 422..432 "some.ident" + - Identifier (Token): "some" # 422..426 + - Period (Token): "." # 426..427 + - Identifier (Token): "ident" # 427..432 + - Comma (Token): "," # 432..433 + - IdentifierPath (Rule): # 433..439 " next." + - Identifier (Token): "next" # 434..438 + - Period (Token): "." # 438..439 + - SKIPPED (Token): "do.that" # 439..446 + - Comma (Token): "," # 446..447 + - IdentifierPath (Rule): # 447..454 " other." + - Identifier (Token): "other" # 448..453 + - Period (Token): "." # 453..454 + - SKIPPED (Token): "while" # 454..459 + - Comma (Token): "," # 459..460 + - IdentifierPath (Rule): # 460..469 " next.one" + - Identifier (Token): "next" # 461..465 + - Period (Token): "." # 465..466 + - Identifier (Token): "one" # 466..469 + - Comma (Token): "," # 469..470 + - SKIPPED (Token): "final, ultimate" # 471..486 + - CloseParen (Token): ")" # 486..487 + - FunctionBody (Rule): # 487..489 ";\n" + - Semicolon (Token): ";" # 487..488 + - ContractMember (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." + - FunctionDefinition (Rule): # 489..560 "function nested_lists() override(some., next.arg, ..." + - FunctionKeyword (Token): "function" # 489..497 + - FunctionName (Rule): # 497..510 " nested_lists" + - Identifier (Token): "nested_lists" # 498..510 + - ParametersDeclaration (Rule): # 510..512 "()" + - OpenParen (Token): "(" # 510..511 + - CloseParen (Token): ")" # 511..512 + - FunctionAttributes (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - FunctionAttribute (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideSpecifier (Rule): # 512..558 " override(some., next.arg, next.one, ultimate)" + - OverrideKeyword (Token): "override" # 513..521 + - OverridePathsDeclaration (Rule): # 521..558 "(some., next.arg, next.one, ultimate)" + - OpenParen (Token): "(" # 521..522 + - OverridePaths (Rule): # 522..557 "some., next.arg, next.one, ultimate" + - IdentifierPath (Rule): # 522..527 "some." + - Identifier (Token): "some" # 522..526 + - Period (Token): "." # 526..527 + - SKIPPED (Token): "" # 527..527 + - Comma (Token): "," # 527..528 + - IdentifierPath (Rule): # 528..537 " next.arg" + - Identifier (Token): "next" # 529..533 + - Period (Token): "." # 533..534 + - Identifier (Token): "arg" # 534..537 + - Comma (Token): "," # 537..538 + - IdentifierPath (Rule): # 538..547 " next.one" + - Identifier (Token): "next" # 539..543 + - Period (Token): "." # 543..544 + - Identifier (Token): "one" # 544..547 + - Comma (Token): "," # 547..548 + - IdentifierPath (Rule): # 548..557 " ultimate" + - Identifier (Token): "ultimate" # 549..557 + - CloseParen (Token): ")" # 557..558 + - FunctionBody (Rule): # 558..560 ";\n" + - Semicolon (Token): ";" # 558..559 diff --git a/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/days_unit/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/days_unit/generated/0.4.11-success.yml index c75cfbf2de..5d1ba362aa 100644 --- a/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/days_unit/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/days_unit/generated/0.4.11-success.yml @@ -8,4 +8,5 @@ Errors: [] Tree: - DecimalNumberExpression (Rule): # 0..7 "10 days" - DecimalLiteral (Token): "10" # 0..2 - - DaysKeyword (Token): "days" # 3..7 + - NumberUnit (Rule): # 2..7 " days" + - DaysKeyword (Token): "days" # 3..7 diff --git a/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/ether_unit/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/ether_unit/generated/0.4.11-success.yml index f405d08bca..2b944604b5 100644 --- a/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/ether_unit/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/ether_unit/generated/0.4.11-success.yml @@ -8,4 +8,5 @@ Errors: [] Tree: - DecimalNumberExpression (Rule): # 0..8 "10 ether" - DecimalLiteral (Token): "10" # 0..2 - - EtherKeyword (Token): "ether" # 3..8 + - NumberUnit (Rule): # 2..8 " ether" + - EtherKeyword (Token): "ether" # 3..8 diff --git a/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/years_unit/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/years_unit/generated/0.4.11-success.yml index 5268035f29..9b8061fc58 100644 --- a/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/years_unit/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/years_unit/generated/0.4.11-success.yml @@ -8,4 +8,5 @@ Errors: [] Tree: - DecimalNumberExpression (Rule): # 0..9 "10 years\n" - DecimalLiteral (Token): "10" # 0..2 - - YearsKeyword (Token): "years" # 3..8 + - NumberUnit (Rule): # 2..9 " years\n" + - YearsKeyword (Token): "years" # 3..8 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 8b365413d9..1eb444f926 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 @@ -22,8 +22,9 @@ Tree: - EventParameters (Rule): # 15..30 "address indexed" - EventParameter (Rule): # 15..30 "address indexed" - TypeName (Rule): # 15..22 "address" - - AddressType (Rule): # 15..22 "address" - - AddressKeyword (Token): "address" # 15..22 + - ElementaryType (Rule): # 15..22 "address" + - AddressType (Rule): # 15..22 "address" + - AddressKeyword (Token): "address" # 15..22 - IndexedKeyword (Token): "indexed" # 23..30 - SKIPPED (Token): "from, address indexed to, uint256 value" # 31..70 - CloseParen (Token): ")" # 70..71 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/address_call/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/address_call/generated/0.4.11-success.yml index 35bc7bff61..efd2ffc2b8 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/address_call/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/address_call/generated/0.4.11-success.yml @@ -9,11 +9,13 @@ Tree: - Expression (Rule): # 0..14 "address(value)" - FunctionCallExpression (Rule): # 0..14 "address(value)" - Expression (Rule): # 0..7 "address" - - AddressType (Rule): # 0..7 "address" - - AddressKeyword (Token): "address" # 0..7 - - PositionalArgumentsDeclaration (Rule): # 7..14 "(value)" - - OpenParen (Token): "(" # 7..8 - - PositionalArguments (Rule): # 8..13 "value" - - Expression (Rule): # 8..13 "value" - - Identifier (Token): "value" # 8..13 - - CloseParen (Token): ")" # 13..14 + - ElementaryType (Rule): # 0..7 "address" + - AddressType (Rule): # 0..7 "address" + - AddressKeyword (Token): "address" # 0..7 + - ArgumentsDeclaration (Rule): # 7..14 "(value)" + - PositionalArgumentsDeclaration (Rule): # 7..14 "(value)" + - OpenParen (Token): "(" # 7..8 + - PositionalArguments (Rule): # 8..13 "value" + - Expression (Rule): # 8..13 "value" + - Identifier (Token): "value" # 8..13 + - CloseParen (Token): ")" # 13..14 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/address_payable_call/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/address_payable_call/generated/0.4.11-success.yml index 5ef1ecf5a3..a251949d96 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/address_payable_call/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/address_payable_call/generated/0.4.11-success.yml @@ -9,12 +9,14 @@ Tree: - Expression (Rule): # 0..22 "address payable(value)" - FunctionCallExpression (Rule): # 0..22 "address payable(value)" - Expression (Rule): # 0..15 "address payable" - - AddressType (Rule): # 0..15 "address payable" - - AddressKeyword (Token): "address" # 0..7 - - PayableKeyword (Token): "payable" # 8..15 - - PositionalArgumentsDeclaration (Rule): # 15..22 "(value)" - - OpenParen (Token): "(" # 15..16 - - PositionalArguments (Rule): # 16..21 "value" - - Expression (Rule): # 16..21 "value" - - Identifier (Token): "value" # 16..21 - - CloseParen (Token): ")" # 21..22 + - ElementaryType (Rule): # 0..15 "address payable" + - AddressType (Rule): # 0..15 "address payable" + - AddressKeyword (Token): "address" # 0..7 + - PayableKeyword (Token): "payable" # 8..15 + - ArgumentsDeclaration (Rule): # 15..22 "(value)" + - PositionalArgumentsDeclaration (Rule): # 15..22 "(value)" + - OpenParen (Token): "(" # 15..16 + - PositionalArguments (Rule): # 16..21 "value" + - Expression (Rule): # 16..21 "value" + - Identifier (Token): "value" # 16..21 + - CloseParen (Token): ")" # 21..22 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call/generated/0.4.11-success.yml index b443a641a2..37b13962bd 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call/generated/0.4.11-success.yml @@ -10,14 +10,15 @@ Tree: - FunctionCallExpression (Rule): # 0..7 "x(1, 2)" - Expression (Rule): # 0..1 "x" - Identifier (Token): "x" # 0..1 - - PositionalArgumentsDeclaration (Rule): # 1..7 "(1, 2)" - - OpenParen (Token): "(" # 1..2 - - PositionalArguments (Rule): # 2..6 "1, 2" - - Expression (Rule): # 2..3 "1" - - DecimalNumberExpression (Rule): # 2..3 "1" - - DecimalLiteral (Token): "1" # 2..3 - - Comma (Token): "," # 3..4 - - Expression (Rule): # 4..6 " 2" - - DecimalNumberExpression (Rule): # 4..6 " 2" - - DecimalLiteral (Token): "2" # 5..6 - - CloseParen (Token): ")" # 6..7 + - ArgumentsDeclaration (Rule): # 1..7 "(1, 2)" + - PositionalArgumentsDeclaration (Rule): # 1..7 "(1, 2)" + - OpenParen (Token): "(" # 1..2 + - PositionalArguments (Rule): # 2..6 "1, 2" + - Expression (Rule): # 2..3 "1" + - DecimalNumberExpression (Rule): # 2..3 "1" + - DecimalLiteral (Token): "1" # 2..3 + - Comma (Token): "," # 3..4 + - Expression (Rule): # 4..6 " 2" + - DecimalNumberExpression (Rule): # 4..6 " 2" + - DecimalLiteral (Token): "2" # 5..6 + - CloseParen (Token): ")" # 6..7 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_argument_has_type_name_as_prefix/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_argument_has_type_name_as_prefix/generated/0.4.11-success.yml index 06512d33ed..8bacf17bce 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_argument_has_type_name_as_prefix/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_argument_has_type_name_as_prefix/generated/0.4.11-success.yml @@ -10,9 +10,10 @@ Tree: - FunctionCallExpression (Rule): # 0..13 "x(interested)" - Expression (Rule): # 0..1 "x" - Identifier (Token): "x" # 0..1 - - PositionalArgumentsDeclaration (Rule): # 1..13 "(interested)" - - OpenParen (Token): "(" # 1..2 - - PositionalArguments (Rule): # 2..12 "interested" - - Expression (Rule): # 2..12 "interested" - - Identifier (Token): "interested" # 2..12 - - CloseParen (Token): ")" # 12..13 + - ArgumentsDeclaration (Rule): # 1..13 "(interested)" + - PositionalArgumentsDeclaration (Rule): # 1..13 "(interested)" + - OpenParen (Token): "(" # 1..2 + - PositionalArguments (Rule): # 2..12 "interested" + - Expression (Rule): # 2..12 "interested" + - Identifier (Token): "interested" # 2..12 + - CloseParen (Token): ")" # 12..13 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_chain/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_chain/generated/0.4.11-success.yml index 905a53b354..085d3bfe5a 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_chain/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_chain/generated/0.4.11-success.yml @@ -12,9 +12,11 @@ Tree: - FunctionCallExpression (Rule): # 0..3 "x()" - Expression (Rule): # 0..1 "x" - Identifier (Token): "x" # 0..1 - - PositionalArgumentsDeclaration (Rule): # 1..3 "()" - - OpenParen (Token): "(" # 1..2 - - CloseParen (Token): ")" # 2..3 - - PositionalArgumentsDeclaration (Rule): # 3..5 "()" - - OpenParen (Token): "(" # 3..4 - - CloseParen (Token): ")" # 4..5 + - ArgumentsDeclaration (Rule): # 1..3 "()" + - PositionalArgumentsDeclaration (Rule): # 1..3 "()" + - OpenParen (Token): "(" # 1..2 + - CloseParen (Token): ")" # 2..3 + - ArgumentsDeclaration (Rule): # 3..5 "()" + - PositionalArgumentsDeclaration (Rule): # 3..5 "()" + - OpenParen (Token): "(" # 3..4 + - CloseParen (Token): ")" # 4..5 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_member_access/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_member_access/generated/0.4.11-success.yml index fad51c97bf..0268041f5d 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_member_access/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_member_access/generated/0.4.11-success.yml @@ -12,8 +12,10 @@ Tree: - FunctionCallExpression (Rule): # 0..3 "x()" - Expression (Rule): # 0..1 "x" - Identifier (Token): "x" # 0..1 - - PositionalArgumentsDeclaration (Rule): # 1..3 "()" - - OpenParen (Token): "(" # 1..2 - - CloseParen (Token): ")" # 2..3 + - ArgumentsDeclaration (Rule): # 1..3 "()" + - PositionalArgumentsDeclaration (Rule): # 1..3 "()" + - OpenParen (Token): "(" # 1..2 + - CloseParen (Token): ")" # 2..3 - Period (Token): "." # 3..4 - - Identifier (Token): "y" # 4..5 + - MemberAccess (Rule): # 4..5 "y" + - Identifier (Token): "y" # 4..5 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.4.11-failure.yml index dc93cdb87c..9a77720ff4 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.4.11-failure.yml @@ -19,5 +19,6 @@ Tree: - Expression (Rule): # 0..1 "a" - Identifier (Token): "a" # 0..1 - Period (Token): "." # 1..2 - - Identifier (Token): "b" # 2..3 + - MemberAccess (Rule): # 2..3 "b" + - Identifier (Token): "b" # 2..3 - SKIPPED (Token): '{value: 0, gas: 1}("")' # 3..25 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.6.2-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.6.2-success.yml index b1a3b15b7c..56bdf7aa45 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.6.2-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.6.2-success.yml @@ -13,29 +13,33 @@ Tree: - Expression (Rule): # 0..1 "a" - Identifier (Token): "a" # 0..1 - Period (Token): "." # 1..2 - - Identifier (Token): "b" # 2..3 - - NamedArgumentGroups (Rule): # 3..21 "{value: 0, gas: 1}" - - NamedArgumentGroup (Rule): # 3..21 "{value: 0, gas: 1}" - - OpenBrace (Token): "{" # 3..4 - - NamedArguments (Rule): # 4..20 "value: 0, gas: 1" - - NamedArgument (Rule): # 4..12 "value: 0" - - Identifier (Token): "value" # 4..9 - - Colon (Token): ":" # 9..10 - - Expression (Rule): # 10..12 " 0" - - DecimalNumberExpression (Rule): # 10..12 " 0" - - DecimalLiteral (Token): "0" # 11..12 - - Comma (Token): "," # 12..13 - - NamedArgument (Rule): # 13..20 " gas: 1" - - Identifier (Token): "gas" # 14..17 - - Colon (Token): ":" # 17..18 - - Expression (Rule): # 18..20 " 1" - - DecimalNumberExpression (Rule): # 18..20 " 1" - - DecimalLiteral (Token): "1" # 19..20 - - CloseBrace (Token): "}" # 20..21 - - PositionalArgumentsDeclaration (Rule): # 21..25 '("")' - - OpenParen (Token): "(" # 21..22 - - PositionalArguments (Rule): # 22..24 '""' - - Expression (Rule): # 22..24 '""' - - AsciiStringLiterals (Rule): # 22..24 '""' - - AsciiStringLiteral (Token): '""' # 22..24 - - CloseParen (Token): ")" # 24..25 + - MemberAccess (Rule): # 2..3 "b" + - Identifier (Token): "b" # 2..3 + - FunctionCallOptions (Rule): # 3..21 "{value: 0, gas: 1}" + - NamedArgumentGroups (Rule): # 3..21 "{value: 0, gas: 1}" + - NamedArgumentGroup (Rule): # 3..21 "{value: 0, gas: 1}" + - OpenBrace (Token): "{" # 3..4 + - NamedArguments (Rule): # 4..20 "value: 0, gas: 1" + - NamedArgument (Rule): # 4..12 "value: 0" + - Identifier (Token): "value" # 4..9 + - Colon (Token): ":" # 9..10 + - Expression (Rule): # 10..12 " 0" + - DecimalNumberExpression (Rule): # 10..12 " 0" + - DecimalLiteral (Token): "0" # 11..12 + - Comma (Token): "," # 12..13 + - NamedArgument (Rule): # 13..20 " gas: 1" + - Identifier (Token): "gas" # 14..17 + - Colon (Token): ":" # 17..18 + - Expression (Rule): # 18..20 " 1" + - DecimalNumberExpression (Rule): # 18..20 " 1" + - DecimalLiteral (Token): "1" # 19..20 + - CloseBrace (Token): "}" # 20..21 + - ArgumentsDeclaration (Rule): # 21..25 '("")' + - PositionalArgumentsDeclaration (Rule): # 21..25 '("")' + - OpenParen (Token): "(" # 21..22 + - PositionalArguments (Rule): # 22..24 '""' + - Expression (Rule): # 22..24 '""' + - StringExpression (Rule): # 22..24 '""' + - AsciiStringLiterals (Rule): # 22..24 '""' + - AsciiStringLiteral (Token): '""' # 22..24 + - CloseParen (Token): ")" # 24..25 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.8.0-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.8.0-success.yml index 7f0b4ef80d..a368f2fba5 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.8.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options/generated/0.8.0-success.yml @@ -13,28 +13,32 @@ Tree: - Expression (Rule): # 0..1 "a" - Identifier (Token): "a" # 0..1 - Period (Token): "." # 1..2 - - Identifier (Token): "b" # 2..3 - - NamedArgumentGroup (Rule): # 3..21 "{value: 0, gas: 1}" - - OpenBrace (Token): "{" # 3..4 - - NamedArguments (Rule): # 4..20 "value: 0, gas: 1" - - NamedArgument (Rule): # 4..12 "value: 0" - - Identifier (Token): "value" # 4..9 - - Colon (Token): ":" # 9..10 - - Expression (Rule): # 10..12 " 0" - - DecimalNumberExpression (Rule): # 10..12 " 0" - - DecimalLiteral (Token): "0" # 11..12 - - Comma (Token): "," # 12..13 - - NamedArgument (Rule): # 13..20 " gas: 1" - - Identifier (Token): "gas" # 14..17 - - Colon (Token): ":" # 17..18 - - Expression (Rule): # 18..20 " 1" - - DecimalNumberExpression (Rule): # 18..20 " 1" - - DecimalLiteral (Token): "1" # 19..20 - - CloseBrace (Token): "}" # 20..21 - - PositionalArgumentsDeclaration (Rule): # 21..25 '("")' - - OpenParen (Token): "(" # 21..22 - - PositionalArguments (Rule): # 22..24 '""' - - Expression (Rule): # 22..24 '""' - - AsciiStringLiterals (Rule): # 22..24 '""' - - AsciiStringLiteral (Token): '""' # 22..24 - - CloseParen (Token): ")" # 24..25 + - MemberAccess (Rule): # 2..3 "b" + - Identifier (Token): "b" # 2..3 + - FunctionCallOptions (Rule): # 3..21 "{value: 0, gas: 1}" + - NamedArgumentGroup (Rule): # 3..21 "{value: 0, gas: 1}" + - OpenBrace (Token): "{" # 3..4 + - NamedArguments (Rule): # 4..20 "value: 0, gas: 1" + - NamedArgument (Rule): # 4..12 "value: 0" + - Identifier (Token): "value" # 4..9 + - Colon (Token): ":" # 9..10 + - Expression (Rule): # 10..12 " 0" + - DecimalNumberExpression (Rule): # 10..12 " 0" + - DecimalLiteral (Token): "0" # 11..12 + - Comma (Token): "," # 12..13 + - NamedArgument (Rule): # 13..20 " gas: 1" + - Identifier (Token): "gas" # 14..17 + - Colon (Token): ":" # 17..18 + - Expression (Rule): # 18..20 " 1" + - DecimalNumberExpression (Rule): # 18..20 " 1" + - DecimalLiteral (Token): "1" # 19..20 + - CloseBrace (Token): "}" # 20..21 + - ArgumentsDeclaration (Rule): # 21..25 '("")' + - PositionalArgumentsDeclaration (Rule): # 21..25 '("")' + - OpenParen (Token): "(" # 21..22 + - PositionalArguments (Rule): # 22..24 '""' + - Expression (Rule): # 22..24 '""' + - StringExpression (Rule): # 22..24 '""' + - AsciiStringLiterals (Rule): # 22..24 '""' + - AsciiStringLiteral (Token): '""' # 22..24 + - CloseParen (Token): ")" # 24..25 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.4.11-failure.yml index a2b88edcb6..e1724ef1ec 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.4.11-failure.yml @@ -19,5 +19,6 @@ Tree: - Expression (Rule): # 0..1 "a" - Identifier (Token): "a" # 0..1 - Period (Token): "." # 1..2 - - Identifier (Token): "b" # 2..3 + - MemberAccess (Rule): # 2..3 "b" + - Identifier (Token): "b" # 2..3 - SKIPPED (Token): '{value: 0}{gas: 1}("")' # 3..25 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.6.2-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.6.2-success.yml index 19fdf2f6de..3a0ad1f9a0 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.6.2-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.6.2-success.yml @@ -13,32 +13,36 @@ Tree: - Expression (Rule): # 0..1 "a" - Identifier (Token): "a" # 0..1 - Period (Token): "." # 1..2 - - Identifier (Token): "b" # 2..3 - - NamedArgumentGroups (Rule): # 3..21 "{value: 0}{gas: 1}" - - NamedArgumentGroup (Rule): # 3..13 "{value: 0}" - - OpenBrace (Token): "{" # 3..4 - - NamedArguments (Rule): # 4..12 "value: 0" - - NamedArgument (Rule): # 4..12 "value: 0" - - Identifier (Token): "value" # 4..9 - - Colon (Token): ":" # 9..10 - - Expression (Rule): # 10..12 " 0" - - DecimalNumberExpression (Rule): # 10..12 " 0" - - DecimalLiteral (Token): "0" # 11..12 - - CloseBrace (Token): "}" # 12..13 - - NamedArgumentGroup (Rule): # 13..21 "{gas: 1}" - - OpenBrace (Token): "{" # 13..14 - - NamedArguments (Rule): # 14..20 "gas: 1" - - NamedArgument (Rule): # 14..20 "gas: 1" - - Identifier (Token): "gas" # 14..17 - - Colon (Token): ":" # 17..18 - - Expression (Rule): # 18..20 " 1" - - DecimalNumberExpression (Rule): # 18..20 " 1" - - DecimalLiteral (Token): "1" # 19..20 - - CloseBrace (Token): "}" # 20..21 - - PositionalArgumentsDeclaration (Rule): # 21..25 '("")' - - OpenParen (Token): "(" # 21..22 - - PositionalArguments (Rule): # 22..24 '""' - - Expression (Rule): # 22..24 '""' - - AsciiStringLiterals (Rule): # 22..24 '""' - - AsciiStringLiteral (Token): '""' # 22..24 - - CloseParen (Token): ")" # 24..25 + - MemberAccess (Rule): # 2..3 "b" + - Identifier (Token): "b" # 2..3 + - FunctionCallOptions (Rule): # 3..21 "{value: 0}{gas: 1}" + - NamedArgumentGroups (Rule): # 3..21 "{value: 0}{gas: 1}" + - NamedArgumentGroup (Rule): # 3..13 "{value: 0}" + - OpenBrace (Token): "{" # 3..4 + - NamedArguments (Rule): # 4..12 "value: 0" + - NamedArgument (Rule): # 4..12 "value: 0" + - Identifier (Token): "value" # 4..9 + - Colon (Token): ":" # 9..10 + - Expression (Rule): # 10..12 " 0" + - DecimalNumberExpression (Rule): # 10..12 " 0" + - DecimalLiteral (Token): "0" # 11..12 + - CloseBrace (Token): "}" # 12..13 + - NamedArgumentGroup (Rule): # 13..21 "{gas: 1}" + - OpenBrace (Token): "{" # 13..14 + - NamedArguments (Rule): # 14..20 "gas: 1" + - NamedArgument (Rule): # 14..20 "gas: 1" + - Identifier (Token): "gas" # 14..17 + - Colon (Token): ":" # 17..18 + - Expression (Rule): # 18..20 " 1" + - DecimalNumberExpression (Rule): # 18..20 " 1" + - DecimalLiteral (Token): "1" # 19..20 + - CloseBrace (Token): "}" # 20..21 + - ArgumentsDeclaration (Rule): # 21..25 '("")' + - PositionalArgumentsDeclaration (Rule): # 21..25 '("")' + - OpenParen (Token): "(" # 21..22 + - PositionalArguments (Rule): # 22..24 '""' + - Expression (Rule): # 22..24 '""' + - StringExpression (Rule): # 22..24 '""' + - AsciiStringLiterals (Rule): # 22..24 '""' + - AsciiStringLiteral (Token): '""' # 22..24 + - CloseParen (Token): ")" # 24..25 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.8.0-failure.yml index a2b88edcb6..e1724ef1ec 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/function_call_options_split/generated/0.8.0-failure.yml @@ -19,5 +19,6 @@ Tree: - Expression (Rule): # 0..1 "a" - Identifier (Token): "a" # 0..1 - Period (Token): "." # 1..2 - - Identifier (Token): "b" # 2..3 + - MemberAccess (Rule): # 2..3 "b" + - Identifier (Token): "b" # 2..3 - SKIPPED (Token): '{value: 0}{gas: 1}("")' # 3..25 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/identifier_call/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/identifier_call/generated/0.4.11-success.yml index 22338ddf4f..1e98e959e8 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/identifier_call/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/identifier_call/generated/0.4.11-success.yml @@ -10,9 +10,10 @@ Tree: - FunctionCallExpression (Rule): # 0..20 "function_name(value)" - Expression (Rule): # 0..13 "function_name" - Identifier (Token): "function_name" # 0..13 - - PositionalArgumentsDeclaration (Rule): # 13..20 "(value)" - - OpenParen (Token): "(" # 13..14 - - PositionalArguments (Rule): # 14..19 "value" - - Expression (Rule): # 14..19 "value" - - Identifier (Token): "value" # 14..19 - - CloseParen (Token): ")" # 19..20 + - ArgumentsDeclaration (Rule): # 13..20 "(value)" + - PositionalArgumentsDeclaration (Rule): # 13..20 "(value)" + - OpenParen (Token): "(" # 13..14 + - PositionalArguments (Rule): # 14..19 "value" + - Expression (Rule): # 14..19 "value" + - Identifier (Token): "value" # 14..19 + - CloseParen (Token): ")" # 19..20 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/member_access/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/member_access/generated/0.4.11-success.yml index 287cf7e9be..d890c4f6d3 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/member_access/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/member_access/generated/0.4.11-success.yml @@ -11,4 +11,5 @@ Tree: - Expression (Rule): # 0..1 "x" - Identifier (Token): "x" # 0..1 - Period (Token): "." # 1..2 - - Identifier (Token): "y" # 2..3 + - MemberAccess (Rule): # 2..3 "y" + - Identifier (Token): "y" # 2..3 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_chain/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_chain/generated/0.4.11-success.yml index c94bd7e6d1..ef732377d2 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_chain/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_chain/generated/0.4.11-success.yml @@ -13,6 +13,8 @@ Tree: - Expression (Rule): # 0..1 "x" - Identifier (Token): "x" # 0..1 - Period (Token): "." # 1..2 - - Identifier (Token): "y" # 2..3 + - MemberAccess (Rule): # 2..3 "y" + - Identifier (Token): "y" # 2..3 - Period (Token): "." # 3..4 - - Identifier (Token): "z" # 4..5 + - MemberAccess (Rule): # 4..5 "z" + - Identifier (Token): "z" # 4..5 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_function_call/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_function_call/generated/0.4.11-success.yml index 4e0de2ed3b..ad49d2bdf4 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_function_call/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_function_call/generated/0.4.11-success.yml @@ -13,7 +13,9 @@ Tree: - Expression (Rule): # 0..1 "x" - Identifier (Token): "x" # 0..1 - Period (Token): "." # 1..2 - - Identifier (Token): "y" # 2..3 - - PositionalArgumentsDeclaration (Rule): # 3..5 "()" - - OpenParen (Token): "(" # 3..4 - - CloseParen (Token): ")" # 4..5 + - MemberAccess (Rule): # 2..3 "y" + - Identifier (Token): "y" # 2..3 + - ArgumentsDeclaration (Rule): # 3..5 "()" + - PositionalArgumentsDeclaration (Rule): # 3..5 "()" + - OpenParen (Token): "(" # 3..4 + - CloseParen (Token): ")" # 4..5 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_index_access/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_index_access/generated/0.4.11-success.yml index a97880c4cc..40c661ed53 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/member_access_index_access/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/member_access_index_access/generated/0.4.11-success.yml @@ -13,7 +13,8 @@ Tree: - Expression (Rule): # 0..1 "x" - Identifier (Token): "x" # 0..1 - Period (Token): "." # 1..2 - - Identifier (Token): "y" # 2..3 + - MemberAccess (Rule): # 2..3 "y" + - Identifier (Token): "y" # 2..3 - OpenBracket (Token): "[" # 3..4 - Expression (Rule): # 4..9 "index" - Identifier (Token): "index" # 4..9 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/payable_call/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/payable_call/generated/0.4.11-success.yml index adc4be29f4..7b91b0dfd2 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/payable_call/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/payable_call/generated/0.4.11-success.yml @@ -9,10 +9,12 @@ Tree: - Expression (Rule): # 0..14 "payable(value)" - FunctionCallExpression (Rule): # 0..14 "payable(value)" - Expression (Rule): # 0..7 "payable" - - PayableKeyword (Token): "payable" # 0..7 - - PositionalArgumentsDeclaration (Rule): # 7..14 "(value)" - - OpenParen (Token): "(" # 7..8 - - PositionalArguments (Rule): # 8..13 "value" - - Expression (Rule): # 8..13 "value" - - Identifier (Token): "value" # 8..13 - - CloseParen (Token): ")" # 13..14 + - ElementaryType (Rule): # 0..7 "payable" + - PayableKeyword (Token): "payable" # 0..7 + - ArgumentsDeclaration (Rule): # 7..14 "(value)" + - PositionalArgumentsDeclaration (Rule): # 7..14 "(value)" + - OpenParen (Token): "(" # 7..8 + - PositionalArguments (Rule): # 8..13 "value" + - Expression (Rule): # 8..13 "value" + - Identifier (Token): "value" # 8..13 + - CloseParen (Token): ")" # 13..14 diff --git a/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.7.0-success.yml b/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.7.0-success.yml index d739846e79..66f24a295e 100644 --- a/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.7.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Expression/unicode_string_literal/generated/0.7.0-success.yml @@ -7,5 +7,6 @@ Errors: [] Tree: - Expression (Rule): # 0..25 'unicode"This Emoji: 😃"' - - UnicodeStringLiterals (Rule): # 0..25 'unicode"This Emoji: 😃"' - - UnicodeStringLiteral (Token): 'unicode"This Emoji: 😃"' # 0..25 + - StringExpression (Rule): # 0..25 'unicode"This Emoji: 😃"' + - UnicodeStringLiterals (Rule): # 0..25 'unicode"This Emoji: 😃"' + - UnicodeStringLiteral (Token): 'unicode"This Emoji: 😃"' # 0..25 diff --git a/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.6.0-success.yml b/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.6.0-success.yml index 29c55ce289..b8ca3a1077 100644 --- a/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.6.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/FallbackFunctionDefinition/simple/generated/0.6.0-success.yml @@ -11,6 +11,7 @@ Tree: - ParametersDeclaration (Rule): # 8..11 " ()" - OpenParen (Token): "(" # 9..10 - CloseParen (Token): ")" # 10..11 - - Block (Rule): # 11..14 " {}" - - OpenBrace (Token): "{" # 12..13 - - CloseBrace (Token): "}" # 13..14 + - FunctionBody (Rule): # 11..14 " {}" + - Block (Rule): # 11..14 " {}" + - OpenBrace (Token): "{" # 12..13 + - CloseBrace (Token): "}" # 13..14 diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.4.11-success.yml index c36f3f21d3..759d7a0ffa 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.4.11-success.yml @@ -8,12 +8,15 @@ Errors: [] Tree: - FunctionDefinition (Rule): # 0..24 "function a() constant {}" - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "a" # 9..10 + - FunctionName (Rule): # 8..10 " a" + - Identifier (Token): "a" # 9..10 - ParametersDeclaration (Rule): # 10..12 "()" - OpenParen (Token): "(" # 10..11 - CloseParen (Token): ")" # 11..12 - FunctionAttributes (Rule): # 12..21 " constant" - - ConstantKeyword (Token): "constant" # 13..21 - - Block (Rule): # 21..24 " {}" - - OpenBrace (Token): "{" # 22..23 - - CloseBrace (Token): "}" # 23..24 + - FunctionAttribute (Rule): # 12..21 " constant" + - ConstantKeyword (Token): "constant" # 13..21 + - FunctionBody (Rule): # 21..24 " {}" + - Block (Rule): # 21..24 " {}" + - OpenBrace (Token): "{" # 22..23 + - CloseBrace (Token): "}" # 23..24 diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.5.0-failure.yml index 3224b8e0a1..394c200fbb 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/constant_state_mutability/generated/0.5.0-failure.yml @@ -16,7 +16,8 @@ Errors: # 1 total Tree: - FunctionDefinition (Rule): # 0..24 "function a() constant {}" - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "a" # 9..10 + - FunctionName (Rule): # 8..10 " a" + - Identifier (Token): "a" # 9..10 - ParametersDeclaration (Rule): # 10..12 "()" - OpenParen (Token): "(" # 10..11 - CloseParen (Token): ")" # 11..12 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 c7ce64ee1c..33db0713f7 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 @@ -16,18 +16,21 @@ Errors: # 1 total Tree: - FunctionDefinition (Rule): # 0..89 "function transferFrom(address from, address to, ui..." - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "transferFrom" # 9..21 + - FunctionName (Rule): # 8..21 " transferFrom" + - Identifier (Token): "transferFrom" # 9..21 - ParametersDeclaration (Rule): # 21..63 "(address from, address to, uint256 amount)" - OpenParen (Token): "(" # 21..22 - Parameters (Rule): # 22..29 "address" - Parameter (Rule): # 22..29 "address" - TypeName (Rule): # 22..29 "address" - - AddressType (Rule): # 22..29 "address" - - AddressKeyword (Token): "address" # 22..29 + - ElementaryType (Rule): # 22..29 "address" + - AddressType (Rule): # 22..29 "address" + - AddressKeyword (Token): "address" # 22..29 - SKIPPED (Token): "from, address to, uint256 amount" # 30..62 - CloseParen (Token): ")" # 62..63 - FunctionAttributes (Rule): # 63..72 " external" - - ExternalKeyword (Token): "external" # 64..72 + - FunctionAttribute (Rule): # 63..72 " external" + - ExternalKeyword (Token): "external" # 64..72 - ReturnsDeclaration (Rule): # 72..87 " returns (bool)" - ReturnsKeyword (Token): "returns" # 73..80 - ParametersDeclaration (Rule): # 80..87 " (bool)" @@ -35,6 +38,8 @@ Tree: - Parameters (Rule): # 82..86 "bool" - Parameter (Rule): # 82..86 "bool" - TypeName (Rule): # 82..86 "bool" - - BoolKeyword (Token): "bool" # 82..86 + - ElementaryType (Rule): # 82..86 "bool" + - BoolKeyword (Token): "bool" # 82..86 - CloseParen (Token): ")" # 86..87 - - Semicolon (Token): ";" # 87..88 + - FunctionBody (Rule): # 87..89 ";\n" + - Semicolon (Token): ";" # 87..88 diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.4.11-success.yml index a33d2168ca..0749331a6c 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.4.11-success.yml @@ -10,18 +10,22 @@ Errors: [] Tree: - FunctionDefinition (Rule): # 0..73 "function some() public virtual override returns (u..." - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "some" # 9..13 + - FunctionName (Rule): # 8..13 " some" + - Identifier (Token): "some" # 9..13 - ParametersDeclaration (Rule): # 13..15 "()" - OpenParen (Token): "(" # 13..14 - CloseParen (Token): ")" # 14..15 - FunctionAttributes (Rule): # 15..39 " public virtual override" - - PublicKeyword (Token): "public" # 16..22 - - ModifierInvocation (Rule): # 22..30 " virtual" - - IdentifierPath (Rule): # 22..30 " virtual" - - Identifier (Token): "virtual" # 23..30 - - ModifierInvocation (Rule): # 30..39 " override" - - IdentifierPath (Rule): # 30..39 " override" - - Identifier (Token): "override" # 31..39 + - FunctionAttribute (Rule): # 15..22 " public" + - PublicKeyword (Token): "public" # 16..22 + - FunctionAttribute (Rule): # 22..30 " virtual" + - ModifierInvocation (Rule): # 22..30 " virtual" + - IdentifierPath (Rule): # 22..30 " virtual" + - Identifier (Token): "virtual" # 23..30 + - FunctionAttribute (Rule): # 30..39 " override" + - ModifierInvocation (Rule): # 30..39 " override" + - IdentifierPath (Rule): # 30..39 " override" + - Identifier (Token): "override" # 31..39 - ReturnsDeclaration (Rule): # 39..57 " returns (uint256)" - ReturnsKeyword (Token): "returns" # 40..47 - ParametersDeclaration (Rule): # 47..57 " (uint256)" @@ -29,15 +33,18 @@ Tree: - Parameters (Rule): # 49..56 "uint256" - Parameter (Rule): # 49..56 "uint256" - TypeName (Rule): # 49..56 "uint256" - - UintKeyword (Token): "uint256" # 49..56 + - ElementaryType (Rule): # 49..56 "uint256" + - UintKeyword (Token): "uint256" # 49..56 - CloseParen (Token): ")" # 56..57 - - Block (Rule): # 57..73 " {\n\treturn 1;\n}\n" - - OpenBrace (Token): "{" # 58..59 - - Statements (Rule): # 60..71 "\treturn 1;\n" - - ReturnStatement (Rule): # 60..71 "\treturn 1;\n" - - ReturnKeyword (Token): "return" # 61..67 - - Expression (Rule): # 67..69 " 1" - - DecimalNumberExpression (Rule): # 67..69 " 1" - - DecimalLiteral (Token): "1" # 68..69 - - Semicolon (Token): ";" # 69..70 - - CloseBrace (Token): "}" # 71..72 + - FunctionBody (Rule): # 57..73 " {\n\treturn 1;\n}\n" + - Block (Rule): # 57..73 " {\n\treturn 1;\n}\n" + - OpenBrace (Token): "{" # 58..59 + - Statements (Rule): # 60..71 "\treturn 1;\n" + - Statement (Rule): # 60..71 "\treturn 1;\n" + - ReturnStatement (Rule): # 60..71 "\treturn 1;\n" + - ReturnKeyword (Token): "return" # 61..67 + - Expression (Rule): # 67..69 " 1" + - DecimalNumberExpression (Rule): # 67..69 " 1" + - DecimalLiteral (Token): "1" # 68..69 + - Semicolon (Token): ";" # 69..70 + - CloseBrace (Token): "}" # 71..72 diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.5.0-success.yml b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.5.0-success.yml index 5251653a74..7706f0a714 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.5.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.5.0-success.yml @@ -10,17 +10,21 @@ Errors: [] Tree: - FunctionDefinition (Rule): # 0..73 "function some() public virtual override returns (u..." - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "some" # 9..13 + - FunctionName (Rule): # 8..13 " some" + - Identifier (Token): "some" # 9..13 - ParametersDeclaration (Rule): # 13..15 "()" - OpenParen (Token): "(" # 13..14 - CloseParen (Token): ")" # 14..15 - FunctionAttributes (Rule): # 15..39 " public virtual override" - - PublicKeyword (Token): "public" # 16..22 - - ModifierInvocation (Rule): # 22..30 " virtual" - - IdentifierPath (Rule): # 22..30 " virtual" - - Identifier (Token): "virtual" # 23..30 - - OverrideSpecifier (Rule): # 30..39 " override" - - OverrideKeyword (Token): "override" # 31..39 + - FunctionAttribute (Rule): # 15..22 " public" + - PublicKeyword (Token): "public" # 16..22 + - FunctionAttribute (Rule): # 22..30 " virtual" + - ModifierInvocation (Rule): # 22..30 " virtual" + - IdentifierPath (Rule): # 22..30 " virtual" + - Identifier (Token): "virtual" # 23..30 + - FunctionAttribute (Rule): # 30..39 " override" + - OverrideSpecifier (Rule): # 30..39 " override" + - OverrideKeyword (Token): "override" # 31..39 - ReturnsDeclaration (Rule): # 39..57 " returns (uint256)" - ReturnsKeyword (Token): "returns" # 40..47 - ParametersDeclaration (Rule): # 47..57 " (uint256)" @@ -28,15 +32,18 @@ Tree: - Parameters (Rule): # 49..56 "uint256" - Parameter (Rule): # 49..56 "uint256" - TypeName (Rule): # 49..56 "uint256" - - UintKeyword (Token): "uint256" # 49..56 + - ElementaryType (Rule): # 49..56 "uint256" + - UintKeyword (Token): "uint256" # 49..56 - CloseParen (Token): ")" # 56..57 - - Block (Rule): # 57..73 " {\n\treturn 1;\n}\n" - - OpenBrace (Token): "{" # 58..59 - - Statements (Rule): # 60..71 "\treturn 1;\n" - - ReturnStatement (Rule): # 60..71 "\treturn 1;\n" - - ReturnKeyword (Token): "return" # 61..67 - - Expression (Rule): # 67..69 " 1" - - DecimalNumberExpression (Rule): # 67..69 " 1" - - DecimalLiteral (Token): "1" # 68..69 - - Semicolon (Token): ";" # 69..70 - - CloseBrace (Token): "}" # 71..72 + - FunctionBody (Rule): # 57..73 " {\n\treturn 1;\n}\n" + - Block (Rule): # 57..73 " {\n\treturn 1;\n}\n" + - OpenBrace (Token): "{" # 58..59 + - Statements (Rule): # 60..71 "\treturn 1;\n" + - Statement (Rule): # 60..71 "\treturn 1;\n" + - ReturnStatement (Rule): # 60..71 "\treturn 1;\n" + - ReturnKeyword (Token): "return" # 61..67 + - Expression (Rule): # 67..69 " 1" + - DecimalNumberExpression (Rule): # 67..69 " 1" + - DecimalLiteral (Token): "1" # 68..69 + - Semicolon (Token): ";" # 69..70 + - CloseBrace (Token): "}" # 71..72 diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.6.0-success.yml b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.6.0-success.yml index af203a42ed..4161e59a5d 100644 --- a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.6.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.6.0-success.yml @@ -10,15 +10,19 @@ Errors: [] Tree: - FunctionDefinition (Rule): # 0..73 "function some() public virtual override returns (u..." - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "some" # 9..13 + - FunctionName (Rule): # 8..13 " some" + - Identifier (Token): "some" # 9..13 - ParametersDeclaration (Rule): # 13..15 "()" - OpenParen (Token): "(" # 13..14 - CloseParen (Token): ")" # 14..15 - FunctionAttributes (Rule): # 15..39 " public virtual override" - - PublicKeyword (Token): "public" # 16..22 - - VirtualKeyword (Token): "virtual" # 23..30 - - OverrideSpecifier (Rule): # 30..39 " override" - - OverrideKeyword (Token): "override" # 31..39 + - FunctionAttribute (Rule): # 15..22 " public" + - PublicKeyword (Token): "public" # 16..22 + - FunctionAttribute (Rule): # 22..30 " virtual" + - VirtualKeyword (Token): "virtual" # 23..30 + - FunctionAttribute (Rule): # 30..39 " override" + - OverrideSpecifier (Rule): # 30..39 " override" + - OverrideKeyword (Token): "override" # 31..39 - ReturnsDeclaration (Rule): # 39..57 " returns (uint256)" - ReturnsKeyword (Token): "returns" # 40..47 - ParametersDeclaration (Rule): # 47..57 " (uint256)" @@ -26,15 +30,18 @@ Tree: - Parameters (Rule): # 49..56 "uint256" - Parameter (Rule): # 49..56 "uint256" - TypeName (Rule): # 49..56 "uint256" - - UintKeyword (Token): "uint256" # 49..56 + - ElementaryType (Rule): # 49..56 "uint256" + - UintKeyword (Token): "uint256" # 49..56 - CloseParen (Token): ")" # 56..57 - - Block (Rule): # 57..73 " {\n\treturn 1;\n}\n" - - OpenBrace (Token): "{" # 58..59 - - Statements (Rule): # 60..71 "\treturn 1;\n" - - ReturnStatement (Rule): # 60..71 "\treturn 1;\n" - - ReturnKeyword (Token): "return" # 61..67 - - Expression (Rule): # 67..69 " 1" - - DecimalNumberExpression (Rule): # 67..69 " 1" - - DecimalLiteral (Token): "1" # 68..69 - - Semicolon (Token): ";" # 69..70 - - CloseBrace (Token): "}" # 71..72 + - FunctionBody (Rule): # 57..73 " {\n\treturn 1;\n}\n" + - Block (Rule): # 57..73 " {\n\treturn 1;\n}\n" + - OpenBrace (Token): "{" # 58..59 + - Statements (Rule): # 60..71 "\treturn 1;\n" + - Statement (Rule): # 60..71 "\treturn 1;\n" + - ReturnStatement (Rule): # 60..71 "\treturn 1;\n" + - ReturnKeyword (Token): "return" # 61..67 + - Expression (Rule): # 67..69 " 1" + - DecimalNumberExpression (Rule): # 67..69 " 1" + - DecimalLiteral (Token): "1" # 68..69 + - Semicolon (Token): ";" # 69..70 + - CloseBrace (Token): "}" # 71..72 diff --git a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_unit/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_unit/generated/0.4.11-success.yml index 59b13b1649..29b97a7990 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_unit/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexNumberExpression/hex_unit/generated/0.4.11-success.yml @@ -8,4 +8,5 @@ Errors: [] Tree: - HexNumberExpression (Rule): # 0..7 "0x1 wei" - HexLiteral (Token): "0x1" # 0..3 - - WeiKeyword (Token): "wei" # 4..7 + - NumberUnit (Rule): # 3..7 " wei" + - WeiKeyword (Token): "wei" # 4..7 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_empty/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_empty/generated/0.4.11-failure.yml index 7bb104f74e..55e59d2e76 100644 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_empty/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/destructure_import_empty/generated/0.4.11-failure.yml @@ -19,10 +19,11 @@ Tree: - LeadingTrivia (Rule): # 0..31 "// Empty imports are not valid\n" - SingleLineComment (Trivia): "// Empty imports are not valid" # 0..30 - ImportKeyword (Token): "import" # 31..37 - - ImportDeconstruction (Rule): # 37..51 ' {} from "foo"' - - OpenBrace (Token): "{" # 38..39 - - SKIPPED (Token): "" # 39..39 - - CloseBrace (Token): "}" # 39..40 - - FromKeyword (Token): "from" # 41..45 - - AsciiStringLiteral (Token): '"foo"' # 46..51 + - ImportClause (Rule): # 37..51 ' {} from "foo"' + - ImportDeconstruction (Rule): # 37..51 ' {} from "foo"' + - OpenBrace (Token): "{" # 38..39 + - SKIPPED (Token): "" # 39..39 + - CloseBrace (Token): "}" # 39..40 + - FromKeyword (Token): "from" # 41..45 + - AsciiStringLiteral (Token): '"foo"' # 46..51 - Semicolon (Token): ";" # 51..52 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 df047bbc0d..167e7b723d 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 @@ -8,24 +8,25 @@ Errors: [] Tree: - ImportDirective (Rule): # 0..45 'import { A1 as A2, B1, C1 as C2 } from "foo";' - ImportKeyword (Token): "import" # 0..6 - - ImportDeconstruction (Rule): # 6..44 ' { A1 as A2, B1, C1 as C2 } from "foo"' - - OpenBrace (Token): "{" # 7..8 - - ImportDeconstructionSymbols (Rule): # 8..31 " A1 as A2, B1, C1 as C2" - - ImportDeconstructionSymbol (Rule): # 8..17 " A1 as A2" - - Identifier (Token): "A1" # 9..11 - - ImportAlias (Rule): # 11..17 " as A2" - - AsKeyword (Token): "as" # 12..14 - - Identifier (Token): "A2" # 15..17 - - Comma (Token): "," # 17..18 - - ImportDeconstructionSymbol (Rule): # 18..21 " B1" - - Identifier (Token): "B1" # 19..21 - - Comma (Token): "," # 21..22 - - ImportDeconstructionSymbol (Rule): # 22..31 " C1 as C2" - - Identifier (Token): "C1" # 23..25 - - ImportAlias (Rule): # 25..31 " as C2" - - AsKeyword (Token): "as" # 26..28 - - Identifier (Token): "C2" # 29..31 - - CloseBrace (Token): "}" # 32..33 - - FromKeyword (Token): "from" # 34..38 - - AsciiStringLiteral (Token): '"foo"' # 39..44 + - ImportClause (Rule): # 6..44 ' { A1 as A2, B1, C1 as C2 } from "foo"' + - ImportDeconstruction (Rule): # 6..44 ' { A1 as A2, B1, C1 as C2 } from "foo"' + - OpenBrace (Token): "{" # 7..8 + - ImportDeconstructionSymbols (Rule): # 8..31 " A1 as A2, B1, C1 as C2" + - ImportDeconstructionSymbol (Rule): # 8..17 " A1 as A2" + - Identifier (Token): "A1" # 9..11 + - ImportAlias (Rule): # 11..17 " as A2" + - AsKeyword (Token): "as" # 12..14 + - Identifier (Token): "A2" # 15..17 + - Comma (Token): "," # 17..18 + - ImportDeconstructionSymbol (Rule): # 18..21 " B1" + - Identifier (Token): "B1" # 19..21 + - Comma (Token): "," # 21..22 + - ImportDeconstructionSymbol (Rule): # 22..31 " C1 as C2" + - Identifier (Token): "C1" # 23..25 + - ImportAlias (Rule): # 25..31 " as C2" + - AsKeyword (Token): "as" # 26..28 + - Identifier (Token): "C2" # 29..31 + - CloseBrace (Token): "}" # 32..33 + - FromKeyword (Token): "from" # 34..38 + - AsciiStringLiteral (Token): '"foo"' # 39..44 - Semicolon (Token): ";" # 44..45 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 580d8d55bd..52bf3b464a 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 @@ -8,15 +8,16 @@ Errors: [] Tree: - ImportDirective (Rule): # 0..29 'import { x as y } from "foo";' - ImportKeyword (Token): "import" # 0..6 - - ImportDeconstruction (Rule): # 6..28 ' { x as y } from "foo"' - - OpenBrace (Token): "{" # 7..8 - - ImportDeconstructionSymbols (Rule): # 8..15 " x as y" - - ImportDeconstructionSymbol (Rule): # 8..15 " x as y" - - Identifier (Token): "x" # 9..10 - - ImportAlias (Rule): # 10..15 " as y" - - AsKeyword (Token): "as" # 11..13 - - Identifier (Token): "y" # 14..15 - - CloseBrace (Token): "}" # 16..17 - - FromKeyword (Token): "from" # 18..22 - - AsciiStringLiteral (Token): '"foo"' # 23..28 + - ImportClause (Rule): # 6..28 ' { x as y } from "foo"' + - ImportDeconstruction (Rule): # 6..28 ' { x as y } from "foo"' + - OpenBrace (Token): "{" # 7..8 + - ImportDeconstructionSymbols (Rule): # 8..15 " x as y" + - ImportDeconstructionSymbol (Rule): # 8..15 " x as y" + - Identifier (Token): "x" # 9..10 + - ImportAlias (Rule): # 10..15 " as y" + - AsKeyword (Token): "as" # 11..13 + - Identifier (Token): "y" # 14..15 + - CloseBrace (Token): "}" # 16..17 + - FromKeyword (Token): "from" # 18..22 + - AsciiStringLiteral (Token): '"foo"' # 23..28 - Semicolon (Token): ";" # 28..29 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/named_import/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/named_import/generated/0.4.11-success.yml index b0338d5bbb..acdc844e16 100644 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/named_import/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/named_import/generated/0.4.11-success.yml @@ -8,11 +8,12 @@ Errors: [] Tree: - ImportDirective (Rule): # 0..27 'import * as foo from "bar";' - ImportKeyword (Token): "import" # 0..6 - - NamedImport (Rule): # 6..26 ' * as foo from "bar"' - - Asterisk (Token): "*" # 7..8 - - ImportAlias (Rule): # 8..15 " as foo" - - AsKeyword (Token): "as" # 9..11 - - Identifier (Token): "foo" # 12..15 - - FromKeyword (Token): "from" # 16..20 - - AsciiStringLiteral (Token): '"bar"' # 21..26 + - ImportClause (Rule): # 6..26 ' * as foo from "bar"' + - NamedImport (Rule): # 6..26 ' * as foo from "bar"' + - Asterisk (Token): "*" # 7..8 + - ImportAlias (Rule): # 8..15 " as foo" + - AsKeyword (Token): "as" # 9..11 + - Identifier (Token): "foo" # 12..15 + - FromKeyword (Token): "from" # 16..20 + - AsciiStringLiteral (Token): '"bar"' # 21..26 - Semicolon (Token): ";" # 26..27 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import/generated/0.4.11-success.yml index 9052382ab0..8f52e23d8d 100644 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import/generated/0.4.11-success.yml @@ -8,6 +8,7 @@ Errors: [] Tree: - ImportDirective (Rule): # 0..13 'import "foo";' - ImportKeyword (Token): "import" # 0..6 - - PathImport (Rule): # 6..12 ' "foo"' - - AsciiStringLiteral (Token): '"foo"' # 7..12 + - ImportClause (Rule): # 6..12 ' "foo"' + - PathImport (Rule): # 6..12 ' "foo"' + - AsciiStringLiteral (Token): '"foo"' # 7..12 - Semicolon (Token): ";" # 12..13 diff --git a/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import_with_alias/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import_with_alias/generated/0.4.11-success.yml index f61f91b142..fab54bc205 100644 --- a/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import_with_alias/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ImportDirective/path_import_with_alias/generated/0.4.11-success.yml @@ -8,9 +8,10 @@ Errors: [] Tree: - ImportDirective (Rule): # 0..20 'import "foo" as bar;' - ImportKeyword (Token): "import" # 0..6 - - PathImport (Rule): # 6..19 ' "foo" as bar' - - AsciiStringLiteral (Token): '"foo"' # 7..12 - - ImportAlias (Rule): # 12..19 " as bar" - - AsKeyword (Token): "as" # 13..15 - - Identifier (Token): "bar" # 16..19 + - ImportClause (Rule): # 6..19 ' "foo" as bar' + - PathImport (Rule): # 6..19 ' "foo" as bar' + - AsciiStringLiteral (Token): '"foo"' # 7..12 + - ImportAlias (Rule): # 12..19 " as bar" + - AsKeyword (Token): "as" # 13..15 + - Identifier (Token): "bar" # 16..19 - Semicolon (Token): ";" # 19..20 diff --git a/crates/solidity/testing/snapshots/cst_output/InterfaceDefinition/sample_counter/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/InterfaceDefinition/sample_counter/generated/0.4.11-success.yml index 07ea1e8251..03bbe358da 100644 --- a/crates/solidity/testing/snapshots/cst_output/InterfaceDefinition/sample_counter/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/InterfaceDefinition/sample_counter/generated/0.4.11-success.yml @@ -17,36 +17,46 @@ Tree: - Identifier (Token): "ICounter" # 10..18 - OpenBrace (Token): "{" # 19..20 - InterfaceMembers (Rule): # 21..171 " // returns the current count\n function coun..." - - FunctionDefinition (Rule): # 21..105 " // returns the current count\n function coun..." - - LeadingTrivia (Rule): # 21..58 " // returns the current count\n " - - SingleLineComment (Trivia): "// returns the current count" # 25..53 - - FunctionKeyword (Token): "function" # 58..66 - - Identifier (Token): "count" # 67..72 - - ParametersDeclaration (Rule): # 72..74 "()" - - OpenParen (Token): "(" # 72..73 - - CloseParen (Token): ")" # 73..74 - - FunctionAttributes (Rule): # 74..88 " external view" - - ExternalKeyword (Token): "external" # 75..83 - - ViewKeyword (Token): "view" # 84..88 - - ReturnsDeclaration (Rule): # 88..103 " returns (uint)" - - ReturnsKeyword (Token): "returns" # 89..96 - - ParametersDeclaration (Rule): # 96..103 " (uint)" - - OpenParen (Token): "(" # 97..98 - - Parameters (Rule): # 98..102 "uint" - - Parameter (Rule): # 98..102 "uint" - - TypeName (Rule): # 98..102 "uint" - - UintKeyword (Token): "uint" # 98..102 - - CloseParen (Token): ")" # 102..103 - - Semicolon (Token): ";" # 103..104 - - FunctionDefinition (Rule): # 105..171 "\n // increments the counter\n function increm..." - - LeadingTrivia (Rule): # 105..140 "\n // increments the counter\n " - - SingleLineComment (Trivia): "// increments the counter" # 110..135 - - FunctionKeyword (Token): "function" # 140..148 - - Identifier (Token): "increment" # 149..158 - - ParametersDeclaration (Rule): # 158..160 "()" - - OpenParen (Token): "(" # 158..159 - - CloseParen (Token): ")" # 159..160 - - FunctionAttributes (Rule): # 160..169 " external" - - ExternalKeyword (Token): "external" # 161..169 - - Semicolon (Token): ";" # 169..170 + - ContractMember (Rule): # 21..105 " // returns the current count\n function coun..." + - FunctionDefinition (Rule): # 21..105 " // returns the current count\n function coun..." + - LeadingTrivia (Rule): # 21..58 " // returns the current count\n " + - SingleLineComment (Trivia): "// returns the current count" # 25..53 + - FunctionKeyword (Token): "function" # 58..66 + - FunctionName (Rule): # 66..72 " count" + - Identifier (Token): "count" # 67..72 + - ParametersDeclaration (Rule): # 72..74 "()" + - OpenParen (Token): "(" # 72..73 + - CloseParen (Token): ")" # 73..74 + - FunctionAttributes (Rule): # 74..88 " external view" + - FunctionAttribute (Rule): # 74..83 " external" + - ExternalKeyword (Token): "external" # 75..83 + - FunctionAttribute (Rule): # 83..88 " view" + - ViewKeyword (Token): "view" # 84..88 + - ReturnsDeclaration (Rule): # 88..103 " returns (uint)" + - ReturnsKeyword (Token): "returns" # 89..96 + - ParametersDeclaration (Rule): # 96..103 " (uint)" + - OpenParen (Token): "(" # 97..98 + - Parameters (Rule): # 98..102 "uint" + - Parameter (Rule): # 98..102 "uint" + - TypeName (Rule): # 98..102 "uint" + - ElementaryType (Rule): # 98..102 "uint" + - UintKeyword (Token): "uint" # 98..102 + - CloseParen (Token): ")" # 102..103 + - FunctionBody (Rule): # 103..105 ";\n" + - Semicolon (Token): ";" # 103..104 + - ContractMember (Rule): # 105..171 "\n // increments the counter\n function increm..." + - FunctionDefinition (Rule): # 105..171 "\n // increments the counter\n function increm..." + - LeadingTrivia (Rule): # 105..140 "\n // increments the counter\n " + - SingleLineComment (Trivia): "// increments the counter" # 110..135 + - FunctionKeyword (Token): "function" # 140..148 + - FunctionName (Rule): # 148..158 " increment" + - Identifier (Token): "increment" # 149..158 + - ParametersDeclaration (Rule): # 158..160 "()" + - OpenParen (Token): "(" # 158..159 + - CloseParen (Token): ")" # 159..160 + - FunctionAttributes (Rule): # 160..169 " external" + - FunctionAttribute (Rule): # 160..169 " external" + - ExternalKeyword (Token): "external" # 161..169 + - FunctionBody (Rule): # 169..171 ";\n" + - Semicolon (Token): ";" # 169..170 - CloseBrace (Token): "}" # 171..172 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.4.11-failure.yml index 7cef59751f..611e2bda9e 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.4.11-failure.yml @@ -18,6 +18,8 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKey (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - SKIPPED (Token): "Foo => bytes32 Bar" # 15..33 - CloseParen (Token): ")" # 33..34 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.8.18-success.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.8.18-success.yml index 8bc144cf25..b169874b39 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.8.18-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_both/generated/0.8.18-success.yml @@ -10,11 +10,14 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKey (Rule): # 8..18 "string Foo" - - StringKeyword (Token): "string" # 8..14 + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - Identifier (Token): "Foo" # 15..18 - EqualGreaterThan (Token): "=>" # 19..21 - MappingValue (Rule): # 21..33 " bytes32 Bar" - TypeName (Rule): # 21..29 " bytes32" - - BytesKeyword (Token): "bytes32" # 22..29 + - ElementaryType (Rule): # 21..29 " bytes32" + - BytesKeyword (Token): "bytes32" # 22..29 - Identifier (Token): "Bar" # 30..33 - CloseParen (Token): ")" # 33..34 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.4.11-failure.yml index 63eff7ca3e..1dd051615d 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.4.11-failure.yml @@ -18,6 +18,8 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKey (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - SKIPPED (Token): "Foo => bytes32" # 15..29 - CloseParen (Token): ")" # 29..30 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.8.18-success.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.8.18-success.yml index 50b71185df..1494214225 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.8.18-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_key/generated/0.8.18-success.yml @@ -10,10 +10,13 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKey (Rule): # 8..18 "string Foo" - - StringKeyword (Token): "string" # 8..14 + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - Identifier (Token): "Foo" # 15..18 - EqualGreaterThan (Token): "=>" # 19..21 - MappingValue (Rule): # 21..29 " bytes32" - TypeName (Rule): # 21..29 " bytes32" - - BytesKeyword (Token): "bytes32" # 22..29 + - ElementaryType (Rule): # 21..29 " bytes32" + - BytesKeyword (Token): "bytes32" # 22..29 - CloseParen (Token): ")" # 29..30 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.4.11-failure.yml index 7cd1faca8b..ea84e86f37 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.4.11-failure.yml @@ -18,10 +18,13 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKey (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - EqualGreaterThan (Token): "=>" # 15..17 - MappingValue (Rule): # 17..25 " bytes32" - TypeName (Rule): # 17..25 " bytes32" - - BytesKeyword (Token): "bytes32" # 18..25 + - ElementaryType (Rule): # 17..25 " bytes32" + - BytesKeyword (Token): "bytes32" # 18..25 - SKIPPED (Token): "Bar" # 26..29 - CloseParen (Token): ")" # 29..30 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.8.18-success.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.8.18-success.yml index b86e4b017e..f5b5db9edc 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.8.18-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/named_value/generated/0.8.18-success.yml @@ -10,10 +10,13 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKey (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - EqualGreaterThan (Token): "=>" # 15..17 - MappingValue (Rule): # 17..29 " bytes32 Bar" - TypeName (Rule): # 17..25 " bytes32" - - BytesKeyword (Token): "bytes32" # 18..25 + - ElementaryType (Rule): # 17..25 " bytes32" + - BytesKeyword (Token): "bytes32" # 18..25 - Identifier (Token): "Bar" # 26..29 - CloseParen (Token): ")" # 29..30 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.4.11-failure.yml index 2c791730d9..966863fc40 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.4.11-failure.yml @@ -18,10 +18,13 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKey (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - EqualGreaterThan (Token): "=>" # 15..17 - MappingValue (Rule): # 17..25 " bytes32" - TypeName (Rule): # 17..25 " bytes32" - - BytesKeyword (Token): "bytes32" # 18..25 + - ElementaryType (Rule): # 17..25 " bytes32" + - BytesKeyword (Token): "bytes32" # 18..25 - SKIPPED (Token): "] arg" # 25..30 - CloseParen (Token): ")" # 30..31 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.8.18-failure.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.8.18-failure.yml index a7ea185b8b..39175e0ef4 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.8.18-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/stray_delimiter/generated/0.8.18-failure.yml @@ -18,10 +18,13 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKey (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - EqualGreaterThan (Token): "=>" # 15..17 - MappingValue (Rule): # 17..25 " bytes32" - TypeName (Rule): # 17..25 " bytes32" - - BytesKeyword (Token): "bytes32" # 18..25 + - ElementaryType (Rule): # 17..25 " bytes32" + - BytesKeyword (Token): "bytes32" # 18..25 - SKIPPED (Token): "] arg" # 25..30 - CloseParen (Token): ")" # 30..31 diff --git a/crates/solidity/testing/snapshots/cst_output/MappingType/unnamed/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/MappingType/unnamed/generated/0.4.11-success.yml index d53fbb4225..e7f2a2deb0 100644 --- a/crates/solidity/testing/snapshots/cst_output/MappingType/unnamed/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/MappingType/unnamed/generated/0.4.11-success.yml @@ -10,9 +10,12 @@ Tree: - MappingKeyword (Token): "mapping" # 0..7 - OpenParen (Token): "(" # 7..8 - MappingKey (Rule): # 8..14 "string" - - StringKeyword (Token): "string" # 8..14 + - MappingKeyType (Rule): # 8..14 "string" + - ElementaryType (Rule): # 8..14 "string" + - StringKeyword (Token): "string" # 8..14 - EqualGreaterThan (Token): "=>" # 15..17 - MappingValue (Rule): # 17..25 " bytes32" - TypeName (Rule): # 17..25 " bytes32" - - BytesKeyword (Token): "bytes32" # 18..25 + - ElementaryType (Rule): # 17..25 " bytes32" + - BytesKeyword (Token): "bytes32" # 18..25 - CloseParen (Token): ")" # 25..26 diff --git a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/abi_coder/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/abi_coder/generated/0.4.11-success.yml index a962905b2b..5d155752db 100644 --- a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/abi_coder/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/abi_coder/generated/0.4.11-success.yml @@ -8,7 +8,8 @@ Errors: [] Tree: - PragmaDirective (Rule): # 0..20 "pragma abicoder foo;" - PragmaKeyword (Token): "pragma" # 0..6 - - ABICoderPragma (Rule): # 6..19 " abicoder foo" - - AbicoderKeyword (Token): "abicoder" # 7..15 - - Identifier (Token): "foo" # 16..19 + - Pragma (Rule): # 6..19 " abicoder foo" + - ABICoderPragma (Rule): # 6..19 " abicoder foo" + - AbicoderKeyword (Token): "abicoder" # 7..15 + - Identifier (Token): "foo" # 16..19 - Semicolon (Token): ";" # 19..20 diff --git a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental/generated/0.4.11-success.yml index cdb0e5ce6f..33c59374af 100644 --- a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental/generated/0.4.11-success.yml @@ -8,7 +8,9 @@ Errors: [] Tree: - PragmaDirective (Rule): # 0..24 "pragma experimental foo;" - PragmaKeyword (Token): "pragma" # 0..6 - - ExperimentalPragma (Rule): # 6..23 " experimental foo" - - ExperimentalKeyword (Token): "experimental" # 7..19 - - Identifier (Token): "foo" # 20..23 + - Pragma (Rule): # 6..23 " experimental foo" + - ExperimentalPragma (Rule): # 6..23 " experimental foo" + - ExperimentalKeyword (Token): "experimental" # 7..19 + - ExperimentalFeature (Rule): # 19..23 " foo" + - Identifier (Token): "foo" # 20..23 - Semicolon (Token): ";" # 23..24 diff --git a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental_string/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental_string/generated/0.4.11-success.yml index 678215f877..c46544ad5d 100644 --- a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental_string/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/experimental_string/generated/0.4.11-success.yml @@ -8,7 +8,9 @@ Errors: [] Tree: - PragmaDirective (Rule): # 0..36 'pragma experimental "ABIEncoderV2";\n' - PragmaKeyword (Token): "pragma" # 0..6 - - ExperimentalPragma (Rule): # 6..34 ' experimental "ABIEncoderV2"' - - ExperimentalKeyword (Token): "experimental" # 7..19 - - AsciiStringLiteral (Token): '"ABIEncoderV2"' # 20..34 + - Pragma (Rule): # 6..34 ' experimental "ABIEncoderV2"' + - ExperimentalPragma (Rule): # 6..34 ' experimental "ABIEncoderV2"' + - ExperimentalKeyword (Token): "experimental" # 7..19 + - ExperimentalFeature (Rule): # 19..34 ' "ABIEncoderV2"' + - AsciiStringLiteral (Token): '"ABIEncoderV2"' # 20..34 - Semicolon (Token): ";" # 34..35 diff --git a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/version/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/version/generated/0.4.11-success.yml index a19426e713..3c1ba86aaf 100644 --- a/crates/solidity/testing/snapshots/cst_output/PragmaDirective/version/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/PragmaDirective/version/generated/0.4.11-success.yml @@ -8,14 +8,15 @@ Errors: [] Tree: - PragmaDirective (Rule): # 0..22 "pragma solidity 1.0.0;" - PragmaKeyword (Token): "pragma" # 0..6 - - VersionPragma (Rule): # 6..21 " solidity 1.0.0" - - SolidityKeyword (Token): "solidity" # 7..15 - - VersionPragmaExpressions (Rule): # 15..21 " 1.0.0" - - VersionPragmaExpression (Rule): # 15..21 " 1.0.0" - - VersionPragmaSpecifier (Rule): # 15..21 " 1.0.0" - - VersionPragmaValue (Token): "1" # 16..17 - - Period (Token): "." # 17..18 - - VersionPragmaValue (Token): "0" # 18..19 - - Period (Token): "." # 19..20 - - VersionPragmaValue (Token): "0" # 20..21 + - Pragma (Rule): # 6..21 " solidity 1.0.0" + - VersionPragma (Rule): # 6..21 " solidity 1.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressions (Rule): # 15..21 " 1.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 1.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 1.0.0" + - VersionPragmaValue (Token): "1" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 - Semicolon (Token): ";" # 21..22 diff --git a/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.6.0-success.yml b/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.6.0-success.yml index 2431c16c35..993f1c9277 100644 --- a/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.6.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/ReceiveFunctionDefinition/simple/generated/0.6.0-success.yml @@ -11,6 +11,7 @@ Tree: - ParametersDeclaration (Rule): # 7..10 " ()" - OpenParen (Token): "(" # 8..9 - CloseParen (Token): ")" # 9..10 - - Block (Rule): # 10..13 " {}" - - OpenBrace (Token): "{" # 11..12 - - CloseBrace (Token): "}" # 12..13 + - FunctionBody (Rule): # 10..13 " {}" + - Block (Rule): # 10..13 " {}" + - OpenBrace (Token): "{" # 11..12 + - CloseBrace (Token): "}" # 12..13 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.4.11-failure.yml index 2b643f3f69..00fc16863a 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.4.11-failure.yml @@ -26,49 +26,60 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - SourceUnitMembers (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryKeyword (Token): "library" # 0..7 - - Identifier (Token): "SafeMath" # 8..16 - - OpenBrace (Token): "{" # 17..18 - - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "tryAdd" # 30..36 - - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" - - OpenParen (Token): "(" # 36..37 - - Parameters (Rule): # 37..57 "uint256 a, uint256 b" - - Parameter (Rule): # 37..46 "uint256 a" - - TypeName (Rule): # 37..44 "uint256" - - UintKeyword (Token): "uint256" # 37..44 - - Identifier (Token): "a" # 45..46 - - Comma (Token): "," # 46..47 - - Parameter (Rule): # 47..57 " uint256 b" - - TypeName (Rule): # 47..55 " uint256" - - UintKeyword (Token): "uint256" # 48..55 - - Identifier (Token): "b" # 56..57 - - CloseParen (Token): ")" # 57..58 - - FunctionAttributes (Rule): # 58..72 " internal pure" - - InternalKeyword (Token): "internal" # 59..67 - - PureKeyword (Token): "pure" # 68..72 - - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" - - ReturnsKeyword (Token): "returns" # 73..80 - - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" - - OpenParen (Token): "(" # 81..82 - - Parameters (Rule): # 82..95 "bool, uint256" - - Parameter (Rule): # 82..86 "bool" - - TypeName (Rule): # 82..86 "bool" - - BoolKeyword (Token): "bool" # 82..86 - - Comma (Token): "," # 86..87 - - Parameter (Rule): # 87..95 " uint256" - - TypeName (Rule): # 87..95 " uint256" - - UintKeyword (Token): "uint256" # 88..95 - - CloseParen (Token): ")" # 95..96 - - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." - - OpenBrace (Token): "{" # 97..98 - - Statements (Rule): # 99..113 " unchecked " - - ExpressionStatement (Rule): # 99..113 " unchecked " - - Expression (Rule): # 99..112 " unchecked" - - Identifier (Token): "unchecked" # 103..112 - - SKIPPED (Token): "{\n uint256 c = a + b;\n if (c < a) return..." # 113..208 - - CloseBrace (Token): "}" # 208..209 - - CloseBrace (Token): "}" # 210..211 + - SourceUnitMember (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryKeyword (Token): "library" # 0..7 + - Identifier (Token): "SafeMath" # 8..16 + - OpenBrace (Token): "{" # 17..18 + - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - ContractMember (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionKeyword (Token): "function" # 21..29 + - FunctionName (Rule): # 29..36 " tryAdd" + - Identifier (Token): "tryAdd" # 30..36 + - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" + - OpenParen (Token): "(" # 36..37 + - Parameters (Rule): # 37..57 "uint256 a, uint256 b" + - Parameter (Rule): # 37..46 "uint256 a" + - TypeName (Rule): # 37..44 "uint256" + - ElementaryType (Rule): # 37..44 "uint256" + - UintKeyword (Token): "uint256" # 37..44 + - Identifier (Token): "a" # 45..46 + - Comma (Token): "," # 46..47 + - Parameter (Rule): # 47..57 " uint256 b" + - TypeName (Rule): # 47..55 " uint256" + - ElementaryType (Rule): # 47..55 " uint256" + - UintKeyword (Token): "uint256" # 48..55 + - Identifier (Token): "b" # 56..57 + - CloseParen (Token): ")" # 57..58 + - FunctionAttributes (Rule): # 58..72 " internal pure" + - FunctionAttribute (Rule): # 58..67 " internal" + - InternalKeyword (Token): "internal" # 59..67 + - FunctionAttribute (Rule): # 67..72 " pure" + - PureKeyword (Token): "pure" # 68..72 + - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" + - ReturnsKeyword (Token): "returns" # 73..80 + - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" + - OpenParen (Token): "(" # 81..82 + - Parameters (Rule): # 82..95 "bool, uint256" + - Parameter (Rule): # 82..86 "bool" + - TypeName (Rule): # 82..86 "bool" + - ElementaryType (Rule): # 82..86 "bool" + - BoolKeyword (Token): "bool" # 82..86 + - Comma (Token): "," # 86..87 + - Parameter (Rule): # 87..95 " uint256" + - TypeName (Rule): # 87..95 " uint256" + - ElementaryType (Rule): # 87..95 " uint256" + - UintKeyword (Token): "uint256" # 88..95 + - CloseParen (Token): ")" # 95..96 + - FunctionBody (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - OpenBrace (Token): "{" # 97..98 + - Statements (Rule): # 99..113 " unchecked " + - Statement (Rule): # 99..113 " unchecked " + - ExpressionStatement (Rule): # 99..113 " unchecked " + - Expression (Rule): # 99..112 " unchecked" + - Identifier (Token): "unchecked" # 103..112 + - SKIPPED (Token): "{\n uint256 c = a + b;\n if (c < a) return..." # 113..208 + - CloseBrace (Token): "}" # 208..209 + - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.0-failure.yml index 02c449f609..08de14e0fe 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.0-failure.yml @@ -26,45 +26,55 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - SourceUnitMembers (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryKeyword (Token): "library" # 0..7 - - Identifier (Token): "SafeMath" # 8..16 - - OpenBrace (Token): "{" # 17..18 - - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "tryAdd" # 30..36 - - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" - - OpenParen (Token): "(" # 36..37 - - Parameters (Rule): # 37..57 "uint256 a, uint256 b" - - Parameter (Rule): # 37..46 "uint256 a" - - TypeName (Rule): # 37..44 "uint256" - - UintKeyword (Token): "uint256" # 37..44 - - Identifier (Token): "a" # 45..46 - - Comma (Token): "," # 46..47 - - Parameter (Rule): # 47..57 " uint256 b" - - TypeName (Rule): # 47..55 " uint256" - - UintKeyword (Token): "uint256" # 48..55 - - Identifier (Token): "b" # 56..57 - - CloseParen (Token): ")" # 57..58 - - FunctionAttributes (Rule): # 58..72 " internal pure" - - InternalKeyword (Token): "internal" # 59..67 - - PureKeyword (Token): "pure" # 68..72 - - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" - - ReturnsKeyword (Token): "returns" # 73..80 - - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" - - OpenParen (Token): "(" # 81..82 - - Parameters (Rule): # 82..95 "bool, uint256" - - Parameter (Rule): # 82..86 "bool" - - TypeName (Rule): # 82..86 "bool" - - BoolKeyword (Token): "bool" # 82..86 - - Comma (Token): "," # 86..87 - - Parameter (Rule): # 87..95 " uint256" - - TypeName (Rule): # 87..95 " uint256" - - UintKeyword (Token): "uint256" # 88..95 - - CloseParen (Token): ")" # 95..96 - - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." - - OpenBrace (Token): "{" # 97..98 - - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 - - CloseBrace (Token): "}" # 208..209 - - CloseBrace (Token): "}" # 210..211 + - SourceUnitMember (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryKeyword (Token): "library" # 0..7 + - Identifier (Token): "SafeMath" # 8..16 + - OpenBrace (Token): "{" # 17..18 + - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - ContractMember (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionKeyword (Token): "function" # 21..29 + - FunctionName (Rule): # 29..36 " tryAdd" + - Identifier (Token): "tryAdd" # 30..36 + - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" + - OpenParen (Token): "(" # 36..37 + - Parameters (Rule): # 37..57 "uint256 a, uint256 b" + - Parameter (Rule): # 37..46 "uint256 a" + - TypeName (Rule): # 37..44 "uint256" + - ElementaryType (Rule): # 37..44 "uint256" + - UintKeyword (Token): "uint256" # 37..44 + - Identifier (Token): "a" # 45..46 + - Comma (Token): "," # 46..47 + - Parameter (Rule): # 47..57 " uint256 b" + - TypeName (Rule): # 47..55 " uint256" + - ElementaryType (Rule): # 47..55 " uint256" + - UintKeyword (Token): "uint256" # 48..55 + - Identifier (Token): "b" # 56..57 + - CloseParen (Token): ")" # 57..58 + - FunctionAttributes (Rule): # 58..72 " internal pure" + - FunctionAttribute (Rule): # 58..67 " internal" + - InternalKeyword (Token): "internal" # 59..67 + - FunctionAttribute (Rule): # 67..72 " pure" + - PureKeyword (Token): "pure" # 68..72 + - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" + - ReturnsKeyword (Token): "returns" # 73..80 + - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" + - OpenParen (Token): "(" # 81..82 + - Parameters (Rule): # 82..95 "bool, uint256" + - Parameter (Rule): # 82..86 "bool" + - TypeName (Rule): # 82..86 "bool" + - ElementaryType (Rule): # 82..86 "bool" + - BoolKeyword (Token): "bool" # 82..86 + - Comma (Token): "," # 86..87 + - Parameter (Rule): # 87..95 " uint256" + - TypeName (Rule): # 87..95 " uint256" + - ElementaryType (Rule): # 87..95 " uint256" + - UintKeyword (Token): "uint256" # 88..95 + - CloseParen (Token): ")" # 95..96 + - FunctionBody (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - OpenBrace (Token): "{" # 97..98 + - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 + - CloseBrace (Token): "}" # 208..209 + - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.3-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.3-failure.yml index eb145cc63c..56d2881d42 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.3-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.5.3-failure.yml @@ -26,45 +26,55 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - SourceUnitMembers (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryKeyword (Token): "library" # 0..7 - - Identifier (Token): "SafeMath" # 8..16 - - OpenBrace (Token): "{" # 17..18 - - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "tryAdd" # 30..36 - - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" - - OpenParen (Token): "(" # 36..37 - - Parameters (Rule): # 37..57 "uint256 a, uint256 b" - - Parameter (Rule): # 37..46 "uint256 a" - - TypeName (Rule): # 37..44 "uint256" - - UintKeyword (Token): "uint256" # 37..44 - - Identifier (Token): "a" # 45..46 - - Comma (Token): "," # 46..47 - - Parameter (Rule): # 47..57 " uint256 b" - - TypeName (Rule): # 47..55 " uint256" - - UintKeyword (Token): "uint256" # 48..55 - - Identifier (Token): "b" # 56..57 - - CloseParen (Token): ")" # 57..58 - - FunctionAttributes (Rule): # 58..72 " internal pure" - - InternalKeyword (Token): "internal" # 59..67 - - PureKeyword (Token): "pure" # 68..72 - - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" - - ReturnsKeyword (Token): "returns" # 73..80 - - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" - - OpenParen (Token): "(" # 81..82 - - Parameters (Rule): # 82..95 "bool, uint256" - - Parameter (Rule): # 82..86 "bool" - - TypeName (Rule): # 82..86 "bool" - - BoolKeyword (Token): "bool" # 82..86 - - Comma (Token): "," # 86..87 - - Parameter (Rule): # 87..95 " uint256" - - TypeName (Rule): # 87..95 " uint256" - - UintKeyword (Token): "uint256" # 88..95 - - CloseParen (Token): ")" # 95..96 - - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." - - OpenBrace (Token): "{" # 97..98 - - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 - - CloseBrace (Token): "}" # 208..209 - - CloseBrace (Token): "}" # 210..211 + - SourceUnitMember (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryKeyword (Token): "library" # 0..7 + - Identifier (Token): "SafeMath" # 8..16 + - OpenBrace (Token): "{" # 17..18 + - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - ContractMember (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionKeyword (Token): "function" # 21..29 + - FunctionName (Rule): # 29..36 " tryAdd" + - Identifier (Token): "tryAdd" # 30..36 + - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" + - OpenParen (Token): "(" # 36..37 + - Parameters (Rule): # 37..57 "uint256 a, uint256 b" + - Parameter (Rule): # 37..46 "uint256 a" + - TypeName (Rule): # 37..44 "uint256" + - ElementaryType (Rule): # 37..44 "uint256" + - UintKeyword (Token): "uint256" # 37..44 + - Identifier (Token): "a" # 45..46 + - Comma (Token): "," # 46..47 + - Parameter (Rule): # 47..57 " uint256 b" + - TypeName (Rule): # 47..55 " uint256" + - ElementaryType (Rule): # 47..55 " uint256" + - UintKeyword (Token): "uint256" # 48..55 + - Identifier (Token): "b" # 56..57 + - CloseParen (Token): ")" # 57..58 + - FunctionAttributes (Rule): # 58..72 " internal pure" + - FunctionAttribute (Rule): # 58..67 " internal" + - InternalKeyword (Token): "internal" # 59..67 + - FunctionAttribute (Rule): # 67..72 " pure" + - PureKeyword (Token): "pure" # 68..72 + - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" + - ReturnsKeyword (Token): "returns" # 73..80 + - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" + - OpenParen (Token): "(" # 81..82 + - Parameters (Rule): # 82..95 "bool, uint256" + - Parameter (Rule): # 82..86 "bool" + - TypeName (Rule): # 82..86 "bool" + - ElementaryType (Rule): # 82..86 "bool" + - BoolKeyword (Token): "bool" # 82..86 + - Comma (Token): "," # 86..87 + - Parameter (Rule): # 87..95 " uint256" + - TypeName (Rule): # 87..95 " uint256" + - ElementaryType (Rule): # 87..95 " uint256" + - UintKeyword (Token): "uint256" # 88..95 + - CloseParen (Token): ")" # 95..96 + - FunctionBody (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - OpenBrace (Token): "{" # 97..98 + - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 + - CloseBrace (Token): "}" # 208..209 + - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.6.0-failure.yml index 591b0e0efd..72330839f6 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.6.0-failure.yml @@ -26,45 +26,55 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - SourceUnitMembers (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryKeyword (Token): "library" # 0..7 - - Identifier (Token): "SafeMath" # 8..16 - - OpenBrace (Token): "{" # 17..18 - - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "tryAdd" # 30..36 - - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" - - OpenParen (Token): "(" # 36..37 - - Parameters (Rule): # 37..57 "uint256 a, uint256 b" - - Parameter (Rule): # 37..46 "uint256 a" - - TypeName (Rule): # 37..44 "uint256" - - UintKeyword (Token): "uint256" # 37..44 - - Identifier (Token): "a" # 45..46 - - Comma (Token): "," # 46..47 - - Parameter (Rule): # 47..57 " uint256 b" - - TypeName (Rule): # 47..55 " uint256" - - UintKeyword (Token): "uint256" # 48..55 - - Identifier (Token): "b" # 56..57 - - CloseParen (Token): ")" # 57..58 - - FunctionAttributes (Rule): # 58..72 " internal pure" - - InternalKeyword (Token): "internal" # 59..67 - - PureKeyword (Token): "pure" # 68..72 - - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" - - ReturnsKeyword (Token): "returns" # 73..80 - - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" - - OpenParen (Token): "(" # 81..82 - - Parameters (Rule): # 82..95 "bool, uint256" - - Parameter (Rule): # 82..86 "bool" - - TypeName (Rule): # 82..86 "bool" - - BoolKeyword (Token): "bool" # 82..86 - - Comma (Token): "," # 86..87 - - Parameter (Rule): # 87..95 " uint256" - - TypeName (Rule): # 87..95 " uint256" - - UintKeyword (Token): "uint256" # 88..95 - - CloseParen (Token): ")" # 95..96 - - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." - - OpenBrace (Token): "{" # 97..98 - - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 - - CloseBrace (Token): "}" # 208..209 - - CloseBrace (Token): "}" # 210..211 + - SourceUnitMember (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryKeyword (Token): "library" # 0..7 + - Identifier (Token): "SafeMath" # 8..16 + - OpenBrace (Token): "{" # 17..18 + - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - ContractMember (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionKeyword (Token): "function" # 21..29 + - FunctionName (Rule): # 29..36 " tryAdd" + - Identifier (Token): "tryAdd" # 30..36 + - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" + - OpenParen (Token): "(" # 36..37 + - Parameters (Rule): # 37..57 "uint256 a, uint256 b" + - Parameter (Rule): # 37..46 "uint256 a" + - TypeName (Rule): # 37..44 "uint256" + - ElementaryType (Rule): # 37..44 "uint256" + - UintKeyword (Token): "uint256" # 37..44 + - Identifier (Token): "a" # 45..46 + - Comma (Token): "," # 46..47 + - Parameter (Rule): # 47..57 " uint256 b" + - TypeName (Rule): # 47..55 " uint256" + - ElementaryType (Rule): # 47..55 " uint256" + - UintKeyword (Token): "uint256" # 48..55 + - Identifier (Token): "b" # 56..57 + - CloseParen (Token): ")" # 57..58 + - FunctionAttributes (Rule): # 58..72 " internal pure" + - FunctionAttribute (Rule): # 58..67 " internal" + - InternalKeyword (Token): "internal" # 59..67 + - FunctionAttribute (Rule): # 67..72 " pure" + - PureKeyword (Token): "pure" # 68..72 + - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" + - ReturnsKeyword (Token): "returns" # 73..80 + - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" + - OpenParen (Token): "(" # 81..82 + - Parameters (Rule): # 82..95 "bool, uint256" + - Parameter (Rule): # 82..86 "bool" + - TypeName (Rule): # 82..86 "bool" + - ElementaryType (Rule): # 82..86 "bool" + - BoolKeyword (Token): "bool" # 82..86 + - Comma (Token): "," # 86..87 + - Parameter (Rule): # 87..95 " uint256" + - TypeName (Rule): # 87..95 " uint256" + - ElementaryType (Rule): # 87..95 " uint256" + - UintKeyword (Token): "uint256" # 88..95 + - CloseParen (Token): ")" # 95..96 + - FunctionBody (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - OpenBrace (Token): "{" # 97..98 + - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 + - CloseBrace (Token): "}" # 208..209 + - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.7.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.7.0-failure.yml index 1913b747b2..c3548ac345 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.7.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.7.0-failure.yml @@ -26,45 +26,55 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - SourceUnitMembers (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryKeyword (Token): "library" # 0..7 - - Identifier (Token): "SafeMath" # 8..16 - - OpenBrace (Token): "{" # 17..18 - - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "tryAdd" # 30..36 - - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" - - OpenParen (Token): "(" # 36..37 - - Parameters (Rule): # 37..57 "uint256 a, uint256 b" - - Parameter (Rule): # 37..46 "uint256 a" - - TypeName (Rule): # 37..44 "uint256" - - UintKeyword (Token): "uint256" # 37..44 - - Identifier (Token): "a" # 45..46 - - Comma (Token): "," # 46..47 - - Parameter (Rule): # 47..57 " uint256 b" - - TypeName (Rule): # 47..55 " uint256" - - UintKeyword (Token): "uint256" # 48..55 - - Identifier (Token): "b" # 56..57 - - CloseParen (Token): ")" # 57..58 - - FunctionAttributes (Rule): # 58..72 " internal pure" - - InternalKeyword (Token): "internal" # 59..67 - - PureKeyword (Token): "pure" # 68..72 - - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" - - ReturnsKeyword (Token): "returns" # 73..80 - - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" - - OpenParen (Token): "(" # 81..82 - - Parameters (Rule): # 82..95 "bool, uint256" - - Parameter (Rule): # 82..86 "bool" - - TypeName (Rule): # 82..86 "bool" - - BoolKeyword (Token): "bool" # 82..86 - - Comma (Token): "," # 86..87 - - Parameter (Rule): # 87..95 " uint256" - - TypeName (Rule): # 87..95 " uint256" - - UintKeyword (Token): "uint256" # 88..95 - - CloseParen (Token): ")" # 95..96 - - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." - - OpenBrace (Token): "{" # 97..98 - - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 - - CloseBrace (Token): "}" # 208..209 - - CloseBrace (Token): "}" # 210..211 + - SourceUnitMember (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryKeyword (Token): "library" # 0..7 + - Identifier (Token): "SafeMath" # 8..16 + - OpenBrace (Token): "{" # 17..18 + - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - ContractMember (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionKeyword (Token): "function" # 21..29 + - FunctionName (Rule): # 29..36 " tryAdd" + - Identifier (Token): "tryAdd" # 30..36 + - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" + - OpenParen (Token): "(" # 36..37 + - Parameters (Rule): # 37..57 "uint256 a, uint256 b" + - Parameter (Rule): # 37..46 "uint256 a" + - TypeName (Rule): # 37..44 "uint256" + - ElementaryType (Rule): # 37..44 "uint256" + - UintKeyword (Token): "uint256" # 37..44 + - Identifier (Token): "a" # 45..46 + - Comma (Token): "," # 46..47 + - Parameter (Rule): # 47..57 " uint256 b" + - TypeName (Rule): # 47..55 " uint256" + - ElementaryType (Rule): # 47..55 " uint256" + - UintKeyword (Token): "uint256" # 48..55 + - Identifier (Token): "b" # 56..57 + - CloseParen (Token): ")" # 57..58 + - FunctionAttributes (Rule): # 58..72 " internal pure" + - FunctionAttribute (Rule): # 58..67 " internal" + - InternalKeyword (Token): "internal" # 59..67 + - FunctionAttribute (Rule): # 67..72 " pure" + - PureKeyword (Token): "pure" # 68..72 + - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" + - ReturnsKeyword (Token): "returns" # 73..80 + - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" + - OpenParen (Token): "(" # 81..82 + - Parameters (Rule): # 82..95 "bool, uint256" + - Parameter (Rule): # 82..86 "bool" + - TypeName (Rule): # 82..86 "bool" + - ElementaryType (Rule): # 82..86 "bool" + - BoolKeyword (Token): "bool" # 82..86 + - Comma (Token): "," # 86..87 + - Parameter (Rule): # 87..95 " uint256" + - TypeName (Rule): # 87..95 " uint256" + - ElementaryType (Rule): # 87..95 " uint256" + - UintKeyword (Token): "uint256" # 88..95 + - CloseParen (Token): ")" # 95..96 + - FunctionBody (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - OpenBrace (Token): "{" # 97..98 + - SKIPPED (Token): "unchecked {\n uint256 c = a + b;\n if (c <..." # 103..208 + - CloseBrace (Token): "}" # 208..209 + - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.8.0-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.8.0-success.yml index 333c68b909..c49ace0c34 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.8.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/SafeMath/generated/0.8.0-success.yml @@ -16,107 +16,124 @@ Errors: [] Tree: - SourceUnit (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - SourceUnitMembers (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." - - LibraryKeyword (Token): "library" # 0..7 - - Identifier (Token): "SafeMath" # 8..16 - - OpenBrace (Token): "{" # 17..18 - - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." - - FunctionKeyword (Token): "function" # 21..29 - - Identifier (Token): "tryAdd" # 30..36 - - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" - - OpenParen (Token): "(" # 36..37 - - Parameters (Rule): # 37..57 "uint256 a, uint256 b" - - Parameter (Rule): # 37..46 "uint256 a" - - TypeName (Rule): # 37..44 "uint256" - - UintKeyword (Token): "uint256" # 37..44 - - Identifier (Token): "a" # 45..46 - - Comma (Token): "," # 46..47 - - Parameter (Rule): # 47..57 " uint256 b" - - TypeName (Rule): # 47..55 " uint256" - - UintKeyword (Token): "uint256" # 48..55 - - Identifier (Token): "b" # 56..57 - - CloseParen (Token): ")" # 57..58 - - FunctionAttributes (Rule): # 58..72 " internal pure" - - InternalKeyword (Token): "internal" # 59..67 - - PureKeyword (Token): "pure" # 68..72 - - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" - - ReturnsKeyword (Token): "returns" # 73..80 - - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" - - OpenParen (Token): "(" # 81..82 - - Parameters (Rule): # 82..95 "bool, uint256" - - Parameter (Rule): # 82..86 "bool" - - TypeName (Rule): # 82..86 "bool" - - BoolKeyword (Token): "bool" # 82..86 - - Comma (Token): "," # 86..87 - - Parameter (Rule): # 87..95 " uint256" - - TypeName (Rule): # 87..95 " uint256" - - UintKeyword (Token): "uint256" # 88..95 - - CloseParen (Token): ")" # 95..96 - - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." - - OpenBrace (Token): "{" # 97..98 - - Statements (Rule): # 99..206 " unchecked {\n uint256 c = a + b;\n if ..." - - UncheckedBlock (Rule): # 99..206 " unchecked {\n uint256 c = a + b;\n if ..." - - UncheckedKeyword (Token): "unchecked" # 103..112 - - Block (Rule): # 112..206 " {\n uint256 c = a + b;\n if (c < a) retur..." - - OpenBrace (Token): "{" # 113..114 - - Statements (Rule): # 115..200 " uint256 c = a + b;\n if (c < a) return (..." - - VariableDeclarationStatement (Rule): # 115..140 " uint256 c = a + b;\n" - - TypeName (Rule): # 115..128 " uint256" - - UintKeyword (Token): "uint256" # 121..128 - - Identifier (Token): "c" # 129..130 - - VariableDeclarationValue (Rule): # 130..138 " = a + b" - - Equal (Token): "=" # 131..132 - - Expression (Rule): # 132..138 " a + b" - - BinaryExpression (Rule): # 132..138 " a + b" - - Expression (Rule): # 132..134 " a" - - Identifier (Token): "a" # 133..134 - - Plus (Token): "+" # 135..136 - - Expression (Rule): # 136..138 " b" - - Identifier (Token): "b" # 137..138 - - Semicolon (Token): ";" # 138..139 - - IfStatement (Rule): # 140..176 " if (c < a) return (false, 0);\n" - - IfKeyword (Token): "if" # 146..148 - - OpenParen (Token): "(" # 149..150 - - Expression (Rule): # 150..155 "c < a" - - BinaryExpression (Rule): # 150..155 "c < a" - - Expression (Rule): # 150..151 "c" - - Identifier (Token): "c" # 150..151 - - LessThan (Token): "<" # 152..153 - - Expression (Rule): # 153..155 " a" - - Identifier (Token): "a" # 154..155 - - CloseParen (Token): ")" # 155..156 - - ReturnStatement (Rule): # 156..176 " return (false, 0);\n" - - ReturnKeyword (Token): "return" # 157..163 - - Expression (Rule): # 163..174 " (false, 0)" - - TupleExpression (Rule): # 163..174 " (false, 0)" - - OpenParen (Token): "(" # 164..165 - - TupleValues (Rule): # 165..173 "false, 0" - - TupleValue (Rule): # 165..170 "false" - - Expression (Rule): # 165..170 "false" - - FalseKeyword (Token): "false" # 165..170 - - Comma (Token): "," # 170..171 - - TupleValue (Rule): # 171..173 " 0" - - Expression (Rule): # 171..173 " 0" - - DecimalNumberExpression (Rule): # 171..173 " 0" - - DecimalLiteral (Token): "0" # 172..173 - - CloseParen (Token): ")" # 173..174 - - Semicolon (Token): ";" # 174..175 - - ReturnStatement (Rule): # 176..200 " return (true, c);\n" - - ReturnKeyword (Token): "return" # 182..188 - - Expression (Rule): # 188..198 " (true, c)" - - TupleExpression (Rule): # 188..198 " (true, c)" - - OpenParen (Token): "(" # 189..190 - - TupleValues (Rule): # 190..197 "true, c" - - TupleValue (Rule): # 190..194 "true" - - Expression (Rule): # 190..194 "true" - - TrueKeyword (Token): "true" # 190..194 - - Comma (Token): "," # 194..195 - - TupleValue (Rule): # 195..197 " c" - - Expression (Rule): # 195..197 " c" - - Identifier (Token): "c" # 196..197 - - CloseParen (Token): ")" # 197..198 - - Semicolon (Token): ";" # 198..199 - - CloseBrace (Token): "}" # 204..205 - - CloseBrace (Token): "}" # 208..209 - - CloseBrace (Token): "}" # 210..211 + - SourceUnitMember (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryDefinition (Rule): # 0..212 "library SafeMath {\n function tryAdd(uint256 a, ui..." + - LibraryKeyword (Token): "library" # 0..7 + - Identifier (Token): "SafeMath" # 8..16 + - OpenBrace (Token): "{" # 17..18 + - LibraryMembers (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - ContractMember (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionDefinition (Rule): # 19..210 " function tryAdd(uint256 a, uint256 b) internal p..." + - FunctionKeyword (Token): "function" # 21..29 + - FunctionName (Rule): # 29..36 " tryAdd" + - Identifier (Token): "tryAdd" # 30..36 + - ParametersDeclaration (Rule): # 36..58 "(uint256 a, uint256 b)" + - OpenParen (Token): "(" # 36..37 + - Parameters (Rule): # 37..57 "uint256 a, uint256 b" + - Parameter (Rule): # 37..46 "uint256 a" + - TypeName (Rule): # 37..44 "uint256" + - ElementaryType (Rule): # 37..44 "uint256" + - UintKeyword (Token): "uint256" # 37..44 + - Identifier (Token): "a" # 45..46 + - Comma (Token): "," # 46..47 + - Parameter (Rule): # 47..57 " uint256 b" + - TypeName (Rule): # 47..55 " uint256" + - ElementaryType (Rule): # 47..55 " uint256" + - UintKeyword (Token): "uint256" # 48..55 + - Identifier (Token): "b" # 56..57 + - CloseParen (Token): ")" # 57..58 + - FunctionAttributes (Rule): # 58..72 " internal pure" + - FunctionAttribute (Rule): # 58..67 " internal" + - InternalKeyword (Token): "internal" # 59..67 + - FunctionAttribute (Rule): # 67..72 " pure" + - PureKeyword (Token): "pure" # 68..72 + - ReturnsDeclaration (Rule): # 72..96 " returns (bool, uint256)" + - ReturnsKeyword (Token): "returns" # 73..80 + - ParametersDeclaration (Rule): # 80..96 " (bool, uint256)" + - OpenParen (Token): "(" # 81..82 + - Parameters (Rule): # 82..95 "bool, uint256" + - Parameter (Rule): # 82..86 "bool" + - TypeName (Rule): # 82..86 "bool" + - ElementaryType (Rule): # 82..86 "bool" + - BoolKeyword (Token): "bool" # 82..86 + - Comma (Token): "," # 86..87 + - Parameter (Rule): # 87..95 " uint256" + - TypeName (Rule): # 87..95 " uint256" + - ElementaryType (Rule): # 87..95 " uint256" + - UintKeyword (Token): "uint256" # 88..95 + - CloseParen (Token): ")" # 95..96 + - FunctionBody (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - Block (Rule): # 96..210 " {\n unchecked {\n uint256 c = a + b;\n ..." + - OpenBrace (Token): "{" # 97..98 + - Statements (Rule): # 99..206 " unchecked {\n uint256 c = a + b;\n if ..." + - Statement (Rule): # 99..206 " unchecked {\n uint256 c = a + b;\n if ..." + - UncheckedBlock (Rule): # 99..206 " unchecked {\n uint256 c = a + b;\n if ..." + - UncheckedKeyword (Token): "unchecked" # 103..112 + - Block (Rule): # 112..206 " {\n uint256 c = a + b;\n if (c < a) retur..." + - OpenBrace (Token): "{" # 113..114 + - Statements (Rule): # 115..200 " uint256 c = a + b;\n if (c < a) return (..." + - Statement (Rule): # 115..140 " uint256 c = a + b;\n" + - VariableDeclarationStatement (Rule): # 115..140 " uint256 c = a + b;\n" + - VariableDeclarationType (Rule): # 115..128 " uint256" + - TypeName (Rule): # 115..128 " uint256" + - ElementaryType (Rule): # 115..128 " uint256" + - UintKeyword (Token): "uint256" # 121..128 + - Identifier (Token): "c" # 129..130 + - VariableDeclarationValue (Rule): # 130..138 " = a + b" + - Equal (Token): "=" # 131..132 + - Expression (Rule): # 132..138 " a + b" + - BinaryExpression (Rule): # 132..138 " a + b" + - Expression (Rule): # 132..134 " a" + - Identifier (Token): "a" # 133..134 + - Plus (Token): "+" # 135..136 + - Expression (Rule): # 136..138 " b" + - Identifier (Token): "b" # 137..138 + - Semicolon (Token): ";" # 138..139 + - Statement (Rule): # 140..176 " if (c < a) return (false, 0);\n" + - IfStatement (Rule): # 140..176 " if (c < a) return (false, 0);\n" + - IfKeyword (Token): "if" # 146..148 + - OpenParen (Token): "(" # 149..150 + - Expression (Rule): # 150..155 "c < a" + - BinaryExpression (Rule): # 150..155 "c < a" + - Expression (Rule): # 150..151 "c" + - Identifier (Token): "c" # 150..151 + - LessThan (Token): "<" # 152..153 + - Expression (Rule): # 153..155 " a" + - Identifier (Token): "a" # 154..155 + - CloseParen (Token): ")" # 155..156 + - Statement (Rule): # 156..176 " return (false, 0);\n" + - ReturnStatement (Rule): # 156..176 " return (false, 0);\n" + - ReturnKeyword (Token): "return" # 157..163 + - Expression (Rule): # 163..174 " (false, 0)" + - TupleExpression (Rule): # 163..174 " (false, 0)" + - OpenParen (Token): "(" # 164..165 + - TupleValues (Rule): # 165..173 "false, 0" + - TupleValue (Rule): # 165..170 "false" + - Expression (Rule): # 165..170 "false" + - FalseKeyword (Token): "false" # 165..170 + - Comma (Token): "," # 170..171 + - TupleValue (Rule): # 171..173 " 0" + - Expression (Rule): # 171..173 " 0" + - DecimalNumberExpression (Rule): # 171..173 " 0" + - DecimalLiteral (Token): "0" # 172..173 + - CloseParen (Token): ")" # 173..174 + - Semicolon (Token): ";" # 174..175 + - Statement (Rule): # 176..200 " return (true, c);\n" + - ReturnStatement (Rule): # 176..200 " return (true, c);\n" + - ReturnKeyword (Token): "return" # 182..188 + - Expression (Rule): # 188..198 " (true, c)" + - TupleExpression (Rule): # 188..198 " (true, c)" + - OpenParen (Token): "(" # 189..190 + - TupleValues (Rule): # 190..197 "true, c" + - TupleValue (Rule): # 190..194 "true" + - Expression (Rule): # 190..194 "true" + - TrueKeyword (Token): "true" # 190..194 + - Comma (Token): "," # 194..195 + - TupleValue (Rule): # 195..197 " c" + - Expression (Rule): # 195..197 " c" + - Identifier (Token): "c" # 196..197 + - CloseParen (Token): ")" # 197..198 + - Semicolon (Token): ";" # 198..199 + - CloseBrace (Token): "}" # 204..205 + - CloseBrace (Token): "}" # 208..209 + - CloseBrace (Token): "}" # 210..211 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11-success.yml index ef22e77008..cc92016f46 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/end_of_file_trivia/generated/0.4.11-success.yml @@ -13,11 +13,12 @@ Errors: [] Tree: - SourceUnit (Rule): # 0..71 "contract X { }\n \n// spaces before this\n\n/* new ..." - SourceUnitMembers (Rule): # 0..15 "contract X { }\n" - - ContractDefinition (Rule): # 0..15 "contract X { }\n" - - ContractKeyword (Token): "contract" # 0..8 - - Identifier (Token): "X" # 9..10 - - OpenBrace (Token): "{" # 11..12 - - CloseBrace (Token): "}" # 13..14 + - SourceUnitMember (Rule): # 0..15 "contract X { }\n" + - ContractDefinition (Rule): # 0..15 "contract X { }\n" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "X" # 9..10 + - OpenBrace (Token): "{" # 11..12 + - CloseBrace (Token): "}" # 13..14 - EndOfFileTrivia (Rule): # 15..71 " \n// spaces before this\n\n/* new lines after thi..." - SingleLineComment (Trivia): "// spaces before this" # 20..41 - MultilineComment (Trivia): "/* new lines after this */" # 43..69 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.4.11-failure.yml index d3b761085a..b416714557 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.4.11-failure.yml @@ -42,22 +42,26 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..243 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' - SourceUnitMembers (Rule): # 0..42 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n' - - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" - - PragmaKeyword (Token): "pragma" # 0..6 - - VersionPragma (Rule): # 6..21 " solidity 0.0.0" - - SolidityKeyword (Token): "solidity" # 7..15 - - VersionPragmaExpressions (Rule): # 15..21 " 0.0.0" - - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" - - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" - - VersionPragmaValue (Token): "0" # 16..17 - - Period (Token): "." # 17..18 - - VersionPragmaValue (Token): "0" # 18..19 - - Period (Token): "." # 19..20 - - VersionPragmaValue (Token): "0" # 20..21 - - Semicolon (Token): ";" # 21..22 - - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' - - ImportKeyword (Token): "import" # 24..30 - - PathImport (Rule): # 30..40 ' "foo.sol"' - - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 - - Semicolon (Token): ";" # 40..41 + - SourceUnitMember (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaKeyword (Token): "pragma" # 0..6 + - Pragma (Rule): # 6..21 " solidity 0.0.0" + - VersionPragma (Rule): # 6..21 " solidity 0.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressions (Rule): # 15..21 " 0.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" + - VersionPragmaValue (Token): "0" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 + - Semicolon (Token): ";" # 21..22 + - SourceUnitMember (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportKeyword (Token): "import" # 24..30 + - ImportClause (Rule): # 30..40 ' "foo.sol"' + - PathImport (Rule): # 30..40 ' "foo.sol"' + - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 + - Semicolon (Token): ";" # 40..41 - SKIPPED (Token): "using A for B;\n\ncontract C { }\n\ninterface I { }\n\nl..." # 43..243 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.13-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.13-failure.yml index b5f3429150..d06ced5305 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.13-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.13-failure.yml @@ -40,94 +40,116 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..243 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' - SourceUnitMembers (Rule): # 0..217 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' - - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" - - PragmaKeyword (Token): "pragma" # 0..6 - - VersionPragma (Rule): # 6..21 " solidity 0.0.0" - - SolidityKeyword (Token): "solidity" # 7..15 - - VersionPragmaExpressions (Rule): # 15..21 " 0.0.0" - - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" - - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" - - VersionPragmaValue (Token): "0" # 16..17 - - Period (Token): "." # 17..18 - - VersionPragmaValue (Token): "0" # 18..19 - - Period (Token): "." # 19..20 - - VersionPragmaValue (Token): "0" # 20..21 - - Semicolon (Token): ";" # 21..22 - - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' - - ImportKeyword (Token): "import" # 24..30 - - PathImport (Rule): # 30..40 ' "foo.sol"' - - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 - - Semicolon (Token): ";" # 40..41 - - UsingDirective (Rule): # 42..58 "\nusing A for B;\n" - - UsingKeyword (Token): "using" # 43..48 - - IdentifierPath (Rule): # 48..50 " A" - - Identifier (Token): "A" # 49..50 - - ForKeyword (Token): "for" # 51..54 - - TypeName (Rule): # 54..56 " B" - - IdentifierPath (Rule): # 54..56 " B" - - Identifier (Token): "B" # 55..56 - - Semicolon (Token): ";" # 56..57 - - ContractDefinition (Rule): # 58..74 "\ncontract C { }\n" - - ContractKeyword (Token): "contract" # 59..67 - - Identifier (Token): "C" # 68..69 - - OpenBrace (Token): "{" # 70..71 - - CloseBrace (Token): "}" # 72..73 - - InterfaceDefinition (Rule): # 74..91 "\ninterface I { }\n" - - InterfaceKeyword (Token): "interface" # 75..84 - - Identifier (Token): "I" # 85..86 - - OpenBrace (Token): "{" # 87..88 - - CloseBrace (Token): "}" # 89..90 - - LibraryDefinition (Rule): # 91..106 "\nlibrary L { }\n" - - LibraryKeyword (Token): "library" # 92..99 - - Identifier (Token): "L" # 100..101 - - OpenBrace (Token): "{" # 102..103 - - CloseBrace (Token): "}" # 104..105 - - StructDefinition (Rule): # 106..120 "\nstruct S { }\n" - - StructKeyword (Token): "struct" # 107..113 - - Identifier (Token): "S" # 114..115 - - OpenBrace (Token): "{" # 116..117 - - CloseBrace (Token): "}" # 118..119 - - EnumDefinition (Rule): # 120..132 "\nenum E { }\n" - - EnumKeyword (Token): "enum" # 121..125 - - Identifier (Token): "E" # 126..127 - - OpenBrace (Token): "{" # 128..129 - - CloseBrace (Token): "}" # 130..131 - - ConstantDefinition (Rule): # 132..156 "\nuint32 constant x = 0;\n" - - TypeName (Rule): # 132..139 "\nuint32" - - UintKeyword (Token): "uint32" # 133..139 - - ConstantKeyword (Token): "constant" # 140..148 - - Identifier (Token): "x" # 149..150 - - Equal (Token): "=" # 151..152 - - Expression (Rule): # 152..154 " 0" - - DecimalNumberExpression (Rule): # 152..154 " 0" - - DecimalLiteral (Token): "0" # 153..154 - - Semicolon (Token): ";" # 154..155 - - FunctionDefinition (Rule): # 156..181 "\nfunction f() public { }\n" - - FunctionKeyword (Token): "function" # 157..165 - - Identifier (Token): "f" # 166..167 - - ParametersDeclaration (Rule): # 167..169 "()" - - OpenParen (Token): "(" # 167..168 - - CloseParen (Token): ")" # 168..169 - - FunctionAttributes (Rule): # 169..176 " public" - - PublicKeyword (Token): "public" # 170..176 - - Block (Rule): # 176..181 " { }\n" - - OpenBrace (Token): "{" # 177..178 - - CloseBrace (Token): "}" # 179..180 - - ErrorDefinition (Rule): # 181..200 "\nerror E1(string);\n" - - ErrorKeyword (Token): "error" # 182..187 - - Identifier (Token): "E1" # 188..190 - - ErrorParametersDeclaration (Rule): # 190..198 "(string)" - - OpenParen (Token): "(" # 190..191 - - ErrorParameters (Rule): # 191..197 "string" - - ErrorParameter (Rule): # 191..197 "string" - - TypeName (Rule): # 191..197 "string" - - StringKeyword (Token): "string" # 191..197 - - CloseParen (Token): ")" # 197..198 - - Semicolon (Token): ";" # 198..199 - - UserDefinedValueTypeDefinition (Rule): # 200..217 "\ntype T is bool;\n" - - TypeKeyword (Token): "type" # 201..205 - - Identifier (Token): "T" # 206..207 - - IsKeyword (Token): "is" # 208..210 - - BoolKeyword (Token): "bool" # 211..215 - - Semicolon (Token): ";" # 215..216 + - SourceUnitMember (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaKeyword (Token): "pragma" # 0..6 + - Pragma (Rule): # 6..21 " solidity 0.0.0" + - VersionPragma (Rule): # 6..21 " solidity 0.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressions (Rule): # 15..21 " 0.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" + - VersionPragmaValue (Token): "0" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 + - Semicolon (Token): ";" # 21..22 + - SourceUnitMember (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportKeyword (Token): "import" # 24..30 + - ImportClause (Rule): # 30..40 ' "foo.sol"' + - PathImport (Rule): # 30..40 ' "foo.sol"' + - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 + - Semicolon (Token): ";" # 40..41 + - SourceUnitMember (Rule): # 42..58 "\nusing A for B;\n" + - UsingDirective (Rule): # 42..58 "\nusing A for B;\n" + - UsingKeyword (Token): "using" # 43..48 + - UsingClause (Rule): # 48..50 " A" + - IdentifierPath (Rule): # 48..50 " A" + - Identifier (Token): "A" # 49..50 + - ForKeyword (Token): "for" # 51..54 + - UsingTarget (Rule): # 54..56 " B" + - TypeName (Rule): # 54..56 " B" + - IdentifierPath (Rule): # 54..56 " B" + - Identifier (Token): "B" # 55..56 + - Semicolon (Token): ";" # 56..57 + - SourceUnitMember (Rule): # 58..74 "\ncontract C { }\n" + - ContractDefinition (Rule): # 58..74 "\ncontract C { }\n" + - ContractKeyword (Token): "contract" # 59..67 + - Identifier (Token): "C" # 68..69 + - OpenBrace (Token): "{" # 70..71 + - CloseBrace (Token): "}" # 72..73 + - SourceUnitMember (Rule): # 74..91 "\ninterface I { }\n" + - InterfaceDefinition (Rule): # 74..91 "\ninterface I { }\n" + - InterfaceKeyword (Token): "interface" # 75..84 + - Identifier (Token): "I" # 85..86 + - OpenBrace (Token): "{" # 87..88 + - CloseBrace (Token): "}" # 89..90 + - SourceUnitMember (Rule): # 91..106 "\nlibrary L { }\n" + - LibraryDefinition (Rule): # 91..106 "\nlibrary L { }\n" + - LibraryKeyword (Token): "library" # 92..99 + - Identifier (Token): "L" # 100..101 + - OpenBrace (Token): "{" # 102..103 + - CloseBrace (Token): "}" # 104..105 + - SourceUnitMember (Rule): # 106..120 "\nstruct S { }\n" + - StructDefinition (Rule): # 106..120 "\nstruct S { }\n" + - StructKeyword (Token): "struct" # 107..113 + - Identifier (Token): "S" # 114..115 + - OpenBrace (Token): "{" # 116..117 + - CloseBrace (Token): "}" # 118..119 + - SourceUnitMember (Rule): # 120..132 "\nenum E { }\n" + - EnumDefinition (Rule): # 120..132 "\nenum E { }\n" + - EnumKeyword (Token): "enum" # 121..125 + - Identifier (Token): "E" # 126..127 + - OpenBrace (Token): "{" # 128..129 + - CloseBrace (Token): "}" # 130..131 + - SourceUnitMember (Rule): # 132..156 "\nuint32 constant x = 0;\n" + - ConstantDefinition (Rule): # 132..156 "\nuint32 constant x = 0;\n" + - TypeName (Rule): # 132..139 "\nuint32" + - ElementaryType (Rule): # 132..139 "\nuint32" + - UintKeyword (Token): "uint32" # 133..139 + - ConstantKeyword (Token): "constant" # 140..148 + - Identifier (Token): "x" # 149..150 + - Equal (Token): "=" # 151..152 + - Expression (Rule): # 152..154 " 0" + - DecimalNumberExpression (Rule): # 152..154 " 0" + - DecimalLiteral (Token): "0" # 153..154 + - Semicolon (Token): ";" # 154..155 + - SourceUnitMember (Rule): # 156..181 "\nfunction f() public { }\n" + - FunctionDefinition (Rule): # 156..181 "\nfunction f() public { }\n" + - FunctionKeyword (Token): "function" # 157..165 + - FunctionName (Rule): # 165..167 " f" + - Identifier (Token): "f" # 166..167 + - ParametersDeclaration (Rule): # 167..169 "()" + - OpenParen (Token): "(" # 167..168 + - CloseParen (Token): ")" # 168..169 + - FunctionAttributes (Rule): # 169..176 " public" + - FunctionAttribute (Rule): # 169..176 " public" + - PublicKeyword (Token): "public" # 170..176 + - FunctionBody (Rule): # 176..181 " { }\n" + - Block (Rule): # 176..181 " { }\n" + - OpenBrace (Token): "{" # 177..178 + - CloseBrace (Token): "}" # 179..180 + - SourceUnitMember (Rule): # 181..200 "\nerror E1(string);\n" + - ErrorDefinition (Rule): # 181..200 "\nerror E1(string);\n" + - ErrorKeyword (Token): "error" # 182..187 + - Identifier (Token): "E1" # 188..190 + - ErrorParametersDeclaration (Rule): # 190..198 "(string)" + - OpenParen (Token): "(" # 190..191 + - ErrorParameters (Rule): # 191..197 "string" + - ErrorParameter (Rule): # 191..197 "string" + - TypeName (Rule): # 191..197 "string" + - ElementaryType (Rule): # 191..197 "string" + - StringKeyword (Token): "string" # 191..197 + - CloseParen (Token): ")" # 197..198 + - Semicolon (Token): ";" # 198..199 + - SourceUnitMember (Rule): # 200..217 "\ntype T is bool;\n" + - UserDefinedValueTypeDefinition (Rule): # 200..217 "\ntype T is bool;\n" + - TypeKeyword (Token): "type" # 201..205 + - Identifier (Token): "T" # 206..207 + - IsKeyword (Token): "is" # 208..210 + - ElementaryType (Rule): # 210..215 " bool" + - BoolKeyword (Token): "bool" # 211..215 + - Semicolon (Token): ";" # 215..216 - SKIPPED (Token): "event E1(uint256 value);\n" # 218..243 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.22-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.22-success.yml index 0930c84f2e..bf3d39c6f9 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.22-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/everything/generated/0.8.22-success.yml @@ -32,105 +32,129 @@ Errors: [] Tree: - SourceUnit (Rule): # 0..243 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' - SourceUnitMembers (Rule): # 0..243 'pragma solidity 0.0.0;\n\nimport "foo.sol";\n\nusing A...' - - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" - - PragmaKeyword (Token): "pragma" # 0..6 - - VersionPragma (Rule): # 6..21 " solidity 0.0.0" - - SolidityKeyword (Token): "solidity" # 7..15 - - VersionPragmaExpressions (Rule): # 15..21 " 0.0.0" - - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" - - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" - - VersionPragmaValue (Token): "0" # 16..17 - - Period (Token): "." # 17..18 - - VersionPragmaValue (Token): "0" # 18..19 - - Period (Token): "." # 19..20 - - VersionPragmaValue (Token): "0" # 20..21 - - Semicolon (Token): ";" # 21..22 - - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' - - ImportKeyword (Token): "import" # 24..30 - - PathImport (Rule): # 30..40 ' "foo.sol"' - - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 - - Semicolon (Token): ";" # 40..41 - - UsingDirective (Rule): # 42..58 "\nusing A for B;\n" - - UsingKeyword (Token): "using" # 43..48 - - IdentifierPath (Rule): # 48..50 " A" - - Identifier (Token): "A" # 49..50 - - ForKeyword (Token): "for" # 51..54 - - TypeName (Rule): # 54..56 " B" - - IdentifierPath (Rule): # 54..56 " B" - - Identifier (Token): "B" # 55..56 - - Semicolon (Token): ";" # 56..57 - - ContractDefinition (Rule): # 58..74 "\ncontract C { }\n" - - ContractKeyword (Token): "contract" # 59..67 - - Identifier (Token): "C" # 68..69 - - OpenBrace (Token): "{" # 70..71 - - CloseBrace (Token): "}" # 72..73 - - InterfaceDefinition (Rule): # 74..91 "\ninterface I { }\n" - - InterfaceKeyword (Token): "interface" # 75..84 - - Identifier (Token): "I" # 85..86 - - OpenBrace (Token): "{" # 87..88 - - CloseBrace (Token): "}" # 89..90 - - LibraryDefinition (Rule): # 91..106 "\nlibrary L { }\n" - - LibraryKeyword (Token): "library" # 92..99 - - Identifier (Token): "L" # 100..101 - - OpenBrace (Token): "{" # 102..103 - - CloseBrace (Token): "}" # 104..105 - - StructDefinition (Rule): # 106..120 "\nstruct S { }\n" - - StructKeyword (Token): "struct" # 107..113 - - Identifier (Token): "S" # 114..115 - - OpenBrace (Token): "{" # 116..117 - - CloseBrace (Token): "}" # 118..119 - - EnumDefinition (Rule): # 120..132 "\nenum E { }\n" - - EnumKeyword (Token): "enum" # 121..125 - - Identifier (Token): "E" # 126..127 - - OpenBrace (Token): "{" # 128..129 - - CloseBrace (Token): "}" # 130..131 - - ConstantDefinition (Rule): # 132..156 "\nuint32 constant x = 0;\n" - - TypeName (Rule): # 132..139 "\nuint32" - - UintKeyword (Token): "uint32" # 133..139 - - ConstantKeyword (Token): "constant" # 140..148 - - Identifier (Token): "x" # 149..150 - - Equal (Token): "=" # 151..152 - - Expression (Rule): # 152..154 " 0" - - DecimalNumberExpression (Rule): # 152..154 " 0" - - DecimalLiteral (Token): "0" # 153..154 - - Semicolon (Token): ";" # 154..155 - - FunctionDefinition (Rule): # 156..181 "\nfunction f() public { }\n" - - FunctionKeyword (Token): "function" # 157..165 - - Identifier (Token): "f" # 166..167 - - ParametersDeclaration (Rule): # 167..169 "()" - - OpenParen (Token): "(" # 167..168 - - CloseParen (Token): ")" # 168..169 - - FunctionAttributes (Rule): # 169..176 " public" - - PublicKeyword (Token): "public" # 170..176 - - Block (Rule): # 176..181 " { }\n" - - OpenBrace (Token): "{" # 177..178 - - CloseBrace (Token): "}" # 179..180 - - ErrorDefinition (Rule): # 181..200 "\nerror E1(string);\n" - - ErrorKeyword (Token): "error" # 182..187 - - Identifier (Token): "E1" # 188..190 - - ErrorParametersDeclaration (Rule): # 190..198 "(string)" - - OpenParen (Token): "(" # 190..191 - - ErrorParameters (Rule): # 191..197 "string" - - ErrorParameter (Rule): # 191..197 "string" - - TypeName (Rule): # 191..197 "string" - - StringKeyword (Token): "string" # 191..197 - - CloseParen (Token): ")" # 197..198 - - Semicolon (Token): ";" # 198..199 - - UserDefinedValueTypeDefinition (Rule): # 200..217 "\ntype T is bool;\n" - - TypeKeyword (Token): "type" # 201..205 - - Identifier (Token): "T" # 206..207 - - IsKeyword (Token): "is" # 208..210 - - BoolKeyword (Token): "bool" # 211..215 - - Semicolon (Token): ";" # 215..216 - - EventDefinition (Rule): # 217..243 "\nevent E1(uint256 value);\n" - - EventKeyword (Token): "event" # 218..223 - - Identifier (Token): "E1" # 224..226 - - EventParametersDeclaration (Rule): # 226..241 "(uint256 value)" - - OpenParen (Token): "(" # 226..227 - - EventParameters (Rule): # 227..240 "uint256 value" - - EventParameter (Rule): # 227..240 "uint256 value" - - TypeName (Rule): # 227..234 "uint256" - - UintKeyword (Token): "uint256" # 227..234 - - Identifier (Token): "value" # 235..240 - - CloseParen (Token): ")" # 240..241 - - Semicolon (Token): ";" # 241..242 + - SourceUnitMember (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaDirective (Rule): # 0..23 "pragma solidity 0.0.0;\n" + - PragmaKeyword (Token): "pragma" # 0..6 + - Pragma (Rule): # 6..21 " solidity 0.0.0" + - VersionPragma (Rule): # 6..21 " solidity 0.0.0" + - SolidityKeyword (Token): "solidity" # 7..15 + - VersionPragmaExpressions (Rule): # 15..21 " 0.0.0" + - VersionPragmaExpression (Rule): # 15..21 " 0.0.0" + - VersionPragmaSpecifier (Rule): # 15..21 " 0.0.0" + - VersionPragmaValue (Token): "0" # 16..17 + - Period (Token): "." # 17..18 + - VersionPragmaValue (Token): "0" # 18..19 + - Period (Token): "." # 19..20 + - VersionPragmaValue (Token): "0" # 20..21 + - Semicolon (Token): ";" # 21..22 + - SourceUnitMember (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportDirective (Rule): # 23..42 '\nimport "foo.sol";\n' + - ImportKeyword (Token): "import" # 24..30 + - ImportClause (Rule): # 30..40 ' "foo.sol"' + - PathImport (Rule): # 30..40 ' "foo.sol"' + - AsciiStringLiteral (Token): '"foo.sol"' # 31..40 + - Semicolon (Token): ";" # 40..41 + - SourceUnitMember (Rule): # 42..58 "\nusing A for B;\n" + - UsingDirective (Rule): # 42..58 "\nusing A for B;\n" + - UsingKeyword (Token): "using" # 43..48 + - UsingClause (Rule): # 48..50 " A" + - IdentifierPath (Rule): # 48..50 " A" + - Identifier (Token): "A" # 49..50 + - ForKeyword (Token): "for" # 51..54 + - UsingTarget (Rule): # 54..56 " B" + - TypeName (Rule): # 54..56 " B" + - IdentifierPath (Rule): # 54..56 " B" + - Identifier (Token): "B" # 55..56 + - Semicolon (Token): ";" # 56..57 + - SourceUnitMember (Rule): # 58..74 "\ncontract C { }\n" + - ContractDefinition (Rule): # 58..74 "\ncontract C { }\n" + - ContractKeyword (Token): "contract" # 59..67 + - Identifier (Token): "C" # 68..69 + - OpenBrace (Token): "{" # 70..71 + - CloseBrace (Token): "}" # 72..73 + - SourceUnitMember (Rule): # 74..91 "\ninterface I { }\n" + - InterfaceDefinition (Rule): # 74..91 "\ninterface I { }\n" + - InterfaceKeyword (Token): "interface" # 75..84 + - Identifier (Token): "I" # 85..86 + - OpenBrace (Token): "{" # 87..88 + - CloseBrace (Token): "}" # 89..90 + - SourceUnitMember (Rule): # 91..106 "\nlibrary L { }\n" + - LibraryDefinition (Rule): # 91..106 "\nlibrary L { }\n" + - LibraryKeyword (Token): "library" # 92..99 + - Identifier (Token): "L" # 100..101 + - OpenBrace (Token): "{" # 102..103 + - CloseBrace (Token): "}" # 104..105 + - SourceUnitMember (Rule): # 106..120 "\nstruct S { }\n" + - StructDefinition (Rule): # 106..120 "\nstruct S { }\n" + - StructKeyword (Token): "struct" # 107..113 + - Identifier (Token): "S" # 114..115 + - OpenBrace (Token): "{" # 116..117 + - CloseBrace (Token): "}" # 118..119 + - SourceUnitMember (Rule): # 120..132 "\nenum E { }\n" + - EnumDefinition (Rule): # 120..132 "\nenum E { }\n" + - EnumKeyword (Token): "enum" # 121..125 + - Identifier (Token): "E" # 126..127 + - OpenBrace (Token): "{" # 128..129 + - CloseBrace (Token): "}" # 130..131 + - SourceUnitMember (Rule): # 132..156 "\nuint32 constant x = 0;\n" + - ConstantDefinition (Rule): # 132..156 "\nuint32 constant x = 0;\n" + - TypeName (Rule): # 132..139 "\nuint32" + - ElementaryType (Rule): # 132..139 "\nuint32" + - UintKeyword (Token): "uint32" # 133..139 + - ConstantKeyword (Token): "constant" # 140..148 + - Identifier (Token): "x" # 149..150 + - Equal (Token): "=" # 151..152 + - Expression (Rule): # 152..154 " 0" + - DecimalNumberExpression (Rule): # 152..154 " 0" + - DecimalLiteral (Token): "0" # 153..154 + - Semicolon (Token): ";" # 154..155 + - SourceUnitMember (Rule): # 156..181 "\nfunction f() public { }\n" + - FunctionDefinition (Rule): # 156..181 "\nfunction f() public { }\n" + - FunctionKeyword (Token): "function" # 157..165 + - FunctionName (Rule): # 165..167 " f" + - Identifier (Token): "f" # 166..167 + - ParametersDeclaration (Rule): # 167..169 "()" + - OpenParen (Token): "(" # 167..168 + - CloseParen (Token): ")" # 168..169 + - FunctionAttributes (Rule): # 169..176 " public" + - FunctionAttribute (Rule): # 169..176 " public" + - PublicKeyword (Token): "public" # 170..176 + - FunctionBody (Rule): # 176..181 " { }\n" + - Block (Rule): # 176..181 " { }\n" + - OpenBrace (Token): "{" # 177..178 + - CloseBrace (Token): "}" # 179..180 + - SourceUnitMember (Rule): # 181..200 "\nerror E1(string);\n" + - ErrorDefinition (Rule): # 181..200 "\nerror E1(string);\n" + - ErrorKeyword (Token): "error" # 182..187 + - Identifier (Token): "E1" # 188..190 + - ErrorParametersDeclaration (Rule): # 190..198 "(string)" + - OpenParen (Token): "(" # 190..191 + - ErrorParameters (Rule): # 191..197 "string" + - ErrorParameter (Rule): # 191..197 "string" + - TypeName (Rule): # 191..197 "string" + - ElementaryType (Rule): # 191..197 "string" + - StringKeyword (Token): "string" # 191..197 + - CloseParen (Token): ")" # 197..198 + - Semicolon (Token): ";" # 198..199 + - SourceUnitMember (Rule): # 200..217 "\ntype T is bool;\n" + - UserDefinedValueTypeDefinition (Rule): # 200..217 "\ntype T is bool;\n" + - TypeKeyword (Token): "type" # 201..205 + - Identifier (Token): "T" # 206..207 + - IsKeyword (Token): "is" # 208..210 + - ElementaryType (Rule): # 210..215 " bool" + - BoolKeyword (Token): "bool" # 211..215 + - Semicolon (Token): ";" # 215..216 + - SourceUnitMember (Rule): # 217..243 "\nevent E1(uint256 value);\n" + - EventDefinition (Rule): # 217..243 "\nevent E1(uint256 value);\n" + - EventKeyword (Token): "event" # 218..223 + - Identifier (Token): "E1" # 224..226 + - EventParametersDeclaration (Rule): # 226..241 "(uint256 value)" + - OpenParen (Token): "(" # 226..227 + - EventParameters (Rule): # 227..240 "uint256 value" + - EventParameter (Rule): # 227..240 "uint256 value" + - TypeName (Rule): # 227..234 "uint256" + - ElementaryType (Rule): # 227..234 "uint256" + - UintKeyword (Token): "uint256" # 227..234 + - Identifier (Token): "value" # 235..240 + - CloseParen (Token): ")" # 240..241 + - Semicolon (Token): ";" # 241..242 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/partial_definition/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/partial_definition/generated/0.4.11-failure.yml index d7ec2df0ec..a4a4b58e1c 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/partial_definition/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/partial_definition/generated/0.4.11-failure.yml @@ -17,11 +17,13 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..28 "contract Sample {\n function" - SourceUnitMembers (Rule): # 0..28 "contract Sample {\n function" - - ContractDefinition (Rule): # 0..28 "contract Sample {\n function" - - ContractKeyword (Token): "contract" # 0..8 - - Identifier (Token): "Sample" # 9..15 - - OpenBrace (Token): "{" # 16..17 - - ContractMembers (Rule): # 18..28 " function" - - FunctionDefinition (Rule): # 18..28 " function" - - FunctionKeyword (Token): "function" # 20..28 + - SourceUnitMember (Rule): # 0..28 "contract Sample {\n function" + - ContractDefinition (Rule): # 0..28 "contract Sample {\n function" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "Sample" # 9..15 + - OpenBrace (Token): "{" # 16..17 + - ContractMembers (Rule): # 18..28 " function" + - ContractMember (Rule): # 18..28 " function" + - FunctionDefinition (Rule): # 18..28 " function" + - FunctionKeyword (Token): "function" # 20..28 - SKIPPED (Token): "" # 28..28 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.22-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.22-success.yml index 83db6c0d2d..81a26a495b 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.22-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_event/generated/0.8.22-success.yml @@ -8,15 +8,17 @@ Errors: [] Tree: - SourceUnit (Rule): # 0..25 "event E1(uint256 value);\n" - SourceUnitMembers (Rule): # 0..25 "event E1(uint256 value);\n" - - EventDefinition (Rule): # 0..25 "event E1(uint256 value);\n" - - EventKeyword (Token): "event" # 0..5 - - Identifier (Token): "E1" # 6..8 - - EventParametersDeclaration (Rule): # 8..23 "(uint256 value)" - - OpenParen (Token): "(" # 8..9 - - EventParameters (Rule): # 9..22 "uint256 value" - - EventParameter (Rule): # 9..22 "uint256 value" - - TypeName (Rule): # 9..16 "uint256" - - UintKeyword (Token): "uint256" # 9..16 - - Identifier (Token): "value" # 17..22 - - CloseParen (Token): ")" # 22..23 - - Semicolon (Token): ";" # 23..24 + - SourceUnitMember (Rule): # 0..25 "event E1(uint256 value);\n" + - EventDefinition (Rule): # 0..25 "event E1(uint256 value);\n" + - EventKeyword (Token): "event" # 0..5 + - Identifier (Token): "E1" # 6..8 + - EventParametersDeclaration (Rule): # 8..23 "(uint256 value)" + - OpenParen (Token): "(" # 8..9 + - EventParameters (Rule): # 9..22 "uint256 value" + - EventParameter (Rule): # 9..22 "uint256 value" + - TypeName (Rule): # 9..16 "uint256" + - ElementaryType (Rule): # 9..16 "uint256" + - UintKeyword (Token): "uint256" # 9..16 + - Identifier (Token): "value" # 17..22 + - CloseParen (Token): ")" # 22..23 + - Semicolon (Token): ";" # 23..24 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.7.1-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.7.1-success.yml index be79fb484a..18d1f6308f 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.7.1-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/top_level_function/generated/0.7.1-success.yml @@ -8,12 +8,15 @@ Errors: [] Tree: - SourceUnit (Rule): # 0..18 "function foo() { }" - SourceUnitMembers (Rule): # 0..18 "function foo() { }" - - FunctionDefinition (Rule): # 0..18 "function foo() { }" - - FunctionKeyword (Token): "function" # 0..8 - - Identifier (Token): "foo" # 9..12 - - ParametersDeclaration (Rule): # 12..14 "()" - - OpenParen (Token): "(" # 12..13 - - CloseParen (Token): ")" # 13..14 - - Block (Rule): # 14..18 " { }" - - OpenBrace (Token): "{" # 15..16 - - CloseBrace (Token): "}" # 17..18 + - SourceUnitMember (Rule): # 0..18 "function foo() { }" + - FunctionDefinition (Rule): # 0..18 "function foo() { }" + - FunctionKeyword (Token): "function" # 0..8 + - FunctionName (Rule): # 8..12 " foo" + - Identifier (Token): "foo" # 9..12 + - ParametersDeclaration (Rule): # 12..14 "()" + - OpenParen (Token): "(" # 12..13 + - CloseParen (Token): ")" # 13..14 + - FunctionBody (Rule): # 14..18 " { }" + - Block (Rule): # 14..18 " { }" + - OpenBrace (Token): "{" # 15..16 + - CloseBrace (Token): "}" # 17..18 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/trailing_trivia/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/trailing_trivia/generated/0.4.11-success.yml index d78e9d3149..5a6e522564 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/trailing_trivia/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/trailing_trivia/generated/0.4.11-success.yml @@ -15,16 +15,18 @@ Errors: [] Tree: - SourceUnit (Rule): # 0..148 "contract First {}\n\n\n// Newlines both before and af..." - SourceUnitMembers (Rule): # 0..148 "contract First {}\n\n\n// Newlines both before and af..." - - ContractDefinition (Rule): # 0..18 "contract First {}\n" - - ContractKeyword (Token): "contract" # 0..8 - - Identifier (Token): "First" # 9..14 - - OpenBrace (Token): "{" # 15..16 - - CloseBrace (Token): "}" # 16..17 - - ContractDefinition (Rule): # 18..148 "\n\n// Newlines both before and after this comment s..." - - LeadingTrivia (Rule): # 18..129 "\n\n// Newlines both before and after this comment s..." - - SingleLineComment (Trivia): "// Newlines both before and after this comment sho..." # 20..73 - - SingleLineComment (Trivia): "// be included in the trivia of the second contrac..." # 74..126 - - ContractKeyword (Token): "contract" # 129..137 - - Identifier (Token): "Second" # 138..144 - - OpenBrace (Token): "{" # 145..146 - - CloseBrace (Token): "}" # 146..147 + - SourceUnitMember (Rule): # 0..18 "contract First {}\n" + - ContractDefinition (Rule): # 0..18 "contract First {}\n" + - ContractKeyword (Token): "contract" # 0..8 + - Identifier (Token): "First" # 9..14 + - OpenBrace (Token): "{" # 15..16 + - CloseBrace (Token): "}" # 16..17 + - SourceUnitMember (Rule): # 18..148 "\n\n// Newlines both before and after this comment s..." + - ContractDefinition (Rule): # 18..148 "\n\n// Newlines both before and after this comment s..." + - LeadingTrivia (Rule): # 18..129 "\n\n// Newlines both before and after this comment s..." + - SingleLineComment (Trivia): "// Newlines both before and after this comment sho..." # 20..73 + - SingleLineComment (Trivia): "// be included in the trivia of the second contrac..." # 74..126 + - ContractKeyword (Token): "contract" # 129..137 + - Identifier (Token): "Second" # 138..144 + - OpenBrace (Token): "{" # 145..146 + - CloseBrace (Token): "}" # 146..147 diff --git a/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.4.11-failure.yml index 9d36bfff85..d4a72b3797 100644 --- a/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/SourceUnit/using_directive/generated/0.4.11-failure.yml @@ -40,22 +40,24 @@ Errors: # 1 total Tree: - SourceUnit (Rule): # 0..793 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." - SourceUnitMembers (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." - - PragmaDirective (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." - - LeadingTrivia (Rule): # 0..32 "// SPDX-License-Identifier: MIT\n" - - SingleLineComment (Trivia): "// SPDX-License-Identifier: MIT" # 0..31 - - PragmaKeyword (Token): "pragma" # 32..38 - - VersionPragma (Rule): # 38..54 " solidity ^0.8.0" - - SolidityKeyword (Token): "solidity" # 39..47 - - VersionPragmaExpressions (Rule): # 47..54 " ^0.8.0" - - VersionPragmaExpression (Rule): # 47..54 " ^0.8.0" - - VersionPragmaUnaryExpression (Rule): # 47..54 " ^0.8.0" - - Caret (Token): "^" # 48..49 - - VersionPragmaExpression (Rule): # 49..54 "0.8.0" - - VersionPragmaSpecifier (Rule): # 49..54 "0.8.0" - - VersionPragmaValue (Token): "0" # 49..50 - - Period (Token): "." # 50..51 - - VersionPragmaValue (Token): "8" # 51..52 - - Period (Token): "." # 52..53 - - VersionPragmaValue (Token): "0" # 53..54 - - Semicolon (Token): ";" # 54..55 + - SourceUnitMember (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - PragmaDirective (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - LeadingTrivia (Rule): # 0..32 "// SPDX-License-Identifier: MIT\n" + - SingleLineComment (Trivia): "// SPDX-License-Identifier: MIT" # 0..31 + - PragmaKeyword (Token): "pragma" # 32..38 + - Pragma (Rule): # 38..54 " solidity ^0.8.0" + - VersionPragma (Rule): # 38..54 " solidity ^0.8.0" + - SolidityKeyword (Token): "solidity" # 39..47 + - VersionPragmaExpressions (Rule): # 47..54 " ^0.8.0" + - VersionPragmaExpression (Rule): # 47..54 " ^0.8.0" + - VersionPragmaUnaryExpression (Rule): # 47..54 " ^0.8.0" + - Caret (Token): "^" # 48..49 + - VersionPragmaExpression (Rule): # 49..54 "0.8.0" + - VersionPragmaSpecifier (Rule): # 49..54 "0.8.0" + - VersionPragmaValue (Token): "0" # 49..50 + - Period (Token): "." # 50..51 + - VersionPragmaValue (Token): "8" # 51..52 + - Period (Token): "." # 52..53 + - VersionPragmaValue (Token): "0" # 53..54 + - Semicolon (Token): ";" # 54..55 - SKIPPED (Token): "using EnvelopeUtils for Envelope global;\nusing Tra..." # 57..793 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 17d0d20388..0ef1dc5c7c 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 @@ -30,81 +30,96 @@ Errors: [] Tree: - SourceUnit (Rule): # 0..793 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." - SourceUnitMembers (Rule): # 0..793 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." - - PragmaDirective (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." - - LeadingTrivia (Rule): # 0..32 "// SPDX-License-Identifier: MIT\n" - - SingleLineComment (Trivia): "// SPDX-License-Identifier: MIT" # 0..31 - - PragmaKeyword (Token): "pragma" # 32..38 - - VersionPragma (Rule): # 38..54 " solidity ^0.8.0" - - SolidityKeyword (Token): "solidity" # 39..47 - - VersionPragmaExpressions (Rule): # 47..54 " ^0.8.0" - - VersionPragmaExpression (Rule): # 47..54 " ^0.8.0" - - VersionPragmaUnaryExpression (Rule): # 47..54 " ^0.8.0" - - Caret (Token): "^" # 48..49 - - VersionPragmaExpression (Rule): # 49..54 "0.8.0" - - VersionPragmaSpecifier (Rule): # 49..54 "0.8.0" - - VersionPragmaValue (Token): "0" # 49..50 - - Period (Token): "." # 50..51 - - VersionPragmaValue (Token): "8" # 51..52 - - Period (Token): "." # 52..53 - - VersionPragmaValue (Token): "0" # 53..54 - - Semicolon (Token): ";" # 54..55 - - UsingDirective (Rule): # 56..98 "\nusing EnvelopeUtils for Envelope global;\n" - - UsingKeyword (Token): "using" # 57..62 - - IdentifierPath (Rule): # 62..76 " EnvelopeUtils" - - Identifier (Token): "EnvelopeUtils" # 63..76 - - ForKeyword (Token): "for" # 77..80 - - 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 - - IdentifierPath (Rule): # 103..120 " TransactionUtils" - - Identifier (Token): "TransactionUtils" # 104..120 - - ForKeyword (Token): "for" # 121..124 - - TypeName (Rule): # 124..136 " Transaction" - - IdentifierPath (Rule): # 124..136 " Transaction" - - Identifier (Token): "Transaction" # 125..136 - - GlobalKeyword (Token): "global" # 137..143 - - Semicolon (Token): ";" # 143..144 - - StructDefinition (Rule): # 145..793 "\n/**\n * @notice Object with the necessary informat..." - - LeadingTrivia (Rule): # 145..643 "\n/**\n * @notice Object with the necessary informat..." - - MultilineComment (Trivia): "/**\n * @notice Object with the necessary informati..." # 146..642 - - StructKeyword (Token): "struct" # 643..649 - - Identifier (Token): "Envelope" # 650..658 - - OpenBrace (Token): "{" # 659..660 - - StructMembers (Rule): # 661..791 " uint256 nonce;\n address origin;\n address desti..." - - StructMember (Rule): # 661..678 " uint256 nonce;\n" - - TypeName (Rule): # 661..670 " uint256" - - UintKeyword (Token): "uint256" # 663..670 - - Identifier (Token): "nonce" # 671..676 - - Semicolon (Token): ";" # 676..677 - - StructMember (Rule): # 678..696 " address origin;\n" - - TypeName (Rule): # 678..687 " address" - - AddressType (Rule): # 678..687 " address" - - AddressKeyword (Token): "address" # 680..687 - - Identifier (Token): "origin" # 688..694 - - Semicolon (Token): ";" # 694..695 - - StructMember (Rule): # 696..719 " address destination;\n" - - TypeName (Rule): # 696..705 " address" - - AddressType (Rule): # 696..705 " address" - - AddressKeyword (Token): "address" # 698..705 - - Identifier (Token): "destination" # 706..717 - - Semicolon (Token): ";" # 717..718 - - StructMember (Rule): # 719..744 " uint256 originChainId;\n" - - TypeName (Rule): # 719..728 " uint256" - - UintKeyword (Token): "uint256" # 721..728 - - Identifier (Token): "originChainId" # 729..742 - - Semicolon (Token): ";" # 742..743 - - StructMember (Rule): # 744..774 " uint256 destinationChainId;\n" - - TypeName (Rule): # 744..753 " uint256" - - UintKeyword (Token): "uint256" # 746..753 - - Identifier (Token): "destinationChainId" # 754..772 - - Semicolon (Token): ";" # 772..773 - - StructMember (Rule): # 774..791 " bytes message;\n" - - TypeName (Rule): # 774..781 " bytes" - - BytesKeyword (Token): "bytes" # 776..781 - - Identifier (Token): "message" # 782..789 - - Semicolon (Token): ";" # 789..790 - - CloseBrace (Token): "}" # 791..792 + - SourceUnitMember (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - PragmaDirective (Rule): # 0..56 "// SPDX-License-Identifier: MIT\npragma solidity ^0..." + - LeadingTrivia (Rule): # 0..32 "// SPDX-License-Identifier: MIT\n" + - SingleLineComment (Trivia): "// SPDX-License-Identifier: MIT" # 0..31 + - PragmaKeyword (Token): "pragma" # 32..38 + - Pragma (Rule): # 38..54 " solidity ^0.8.0" + - VersionPragma (Rule): # 38..54 " solidity ^0.8.0" + - SolidityKeyword (Token): "solidity" # 39..47 + - VersionPragmaExpressions (Rule): # 47..54 " ^0.8.0" + - VersionPragmaExpression (Rule): # 47..54 " ^0.8.0" + - VersionPragmaUnaryExpression (Rule): # 47..54 " ^0.8.0" + - Caret (Token): "^" # 48..49 + - VersionPragmaExpression (Rule): # 49..54 "0.8.0" + - VersionPragmaSpecifier (Rule): # 49..54 "0.8.0" + - VersionPragmaValue (Token): "0" # 49..50 + - Period (Token): "." # 50..51 + - VersionPragmaValue (Token): "8" # 51..52 + - Period (Token): "." # 52..53 + - VersionPragmaValue (Token): "0" # 53..54 + - Semicolon (Token): ";" # 54..55 + - SourceUnitMember (Rule): # 56..98 "\nusing EnvelopeUtils for Envelope global;\n" + - UsingDirective (Rule): # 56..98 "\nusing EnvelopeUtils for Envelope global;\n" + - UsingKeyword (Token): "using" # 57..62 + - UsingClause (Rule): # 62..76 " EnvelopeUtils" + - IdentifierPath (Rule): # 62..76 " EnvelopeUtils" + - Identifier (Token): "EnvelopeUtils" # 63..76 + - ForKeyword (Token): "for" # 77..80 + - UsingTarget (Rule): # 80..89 " 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 + - SourceUnitMember (Rule): # 98..145 "using TransactionUtils for Transaction global;\n" + - UsingDirective (Rule): # 98..145 "using TransactionUtils for Transaction global;\n" + - UsingKeyword (Token): "using" # 98..103 + - UsingClause (Rule): # 103..120 " TransactionUtils" + - IdentifierPath (Rule): # 103..120 " TransactionUtils" + - Identifier (Token): "TransactionUtils" # 104..120 + - ForKeyword (Token): "for" # 121..124 + - UsingTarget (Rule): # 124..136 " 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 + - SourceUnitMember (Rule): # 145..793 "\n/**\n * @notice Object with the necessary informat..." + - StructDefinition (Rule): # 145..793 "\n/**\n * @notice Object with the necessary informat..." + - LeadingTrivia (Rule): # 145..643 "\n/**\n * @notice Object with the necessary informat..." + - MultilineComment (Trivia): "/**\n * @notice Object with the necessary informati..." # 146..642 + - StructKeyword (Token): "struct" # 643..649 + - Identifier (Token): "Envelope" # 650..658 + - OpenBrace (Token): "{" # 659..660 + - StructMembers (Rule): # 661..791 " uint256 nonce;\n address origin;\n address desti..." + - StructMember (Rule): # 661..678 " uint256 nonce;\n" + - TypeName (Rule): # 661..670 " uint256" + - ElementaryType (Rule): # 661..670 " uint256" + - UintKeyword (Token): "uint256" # 663..670 + - Identifier (Token): "nonce" # 671..676 + - Semicolon (Token): ";" # 676..677 + - StructMember (Rule): # 678..696 " address origin;\n" + - TypeName (Rule): # 678..687 " address" + - ElementaryType (Rule): # 678..687 " address" + - AddressType (Rule): # 678..687 " address" + - AddressKeyword (Token): "address" # 680..687 + - Identifier (Token): "origin" # 688..694 + - Semicolon (Token): ";" # 694..695 + - StructMember (Rule): # 696..719 " address destination;\n" + - TypeName (Rule): # 696..705 " address" + - ElementaryType (Rule): # 696..705 " address" + - AddressType (Rule): # 696..705 " address" + - AddressKeyword (Token): "address" # 698..705 + - Identifier (Token): "destination" # 706..717 + - Semicolon (Token): ";" # 717..718 + - StructMember (Rule): # 719..744 " uint256 originChainId;\n" + - TypeName (Rule): # 719..728 " uint256" + - ElementaryType (Rule): # 719..728 " uint256" + - UintKeyword (Token): "uint256" # 721..728 + - Identifier (Token): "originChainId" # 729..742 + - Semicolon (Token): ";" # 742..743 + - StructMember (Rule): # 744..774 " uint256 destinationChainId;\n" + - TypeName (Rule): # 744..753 " uint256" + - ElementaryType (Rule): # 744..753 " uint256" + - UintKeyword (Token): "uint256" # 746..753 + - Identifier (Token): "destinationChainId" # 754..772 + - Semicolon (Token): ";" # 772..773 + - StructMember (Rule): # 774..791 " bytes message;\n" + - TypeName (Rule): # 774..781 " bytes" + - ElementaryType (Rule): # 774..781 " bytes" + - BytesKeyword (Token): "bytes" # 776..781 + - Identifier (Token): "message" # 782..789 + - Semicolon (Token): ";" # 789..790 + - CloseBrace (Token): "}" # 791..792 diff --git a/crates/solidity/testing/snapshots/cst_output/Statements/compound_tokens/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/Statements/compound_tokens/generated/0.4.11-success.yml index 7726a65ce5..018534db86 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statements/compound_tokens/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statements/compound_tokens/generated/0.4.11-success.yml @@ -19,120 +19,133 @@ Errors: [] Tree: - Statements (Rule): # 0..106 "a && b;\na &= b;\na || b;\na |= b;\na / b;\na /= b;\na >..." - - ExpressionStatement (Rule): # 0..8 "a && b;\n" - - Expression (Rule): # 0..6 "a && b" - - BinaryExpression (Rule): # 0..6 "a && b" - - Expression (Rule): # 0..1 "a" - - Identifier (Token): "a" # 0..1 - - AmpersandAmpersand (Token): "&&" # 2..4 - - Expression (Rule): # 4..6 " b" - - Identifier (Token): "b" # 5..6 - - Semicolon (Token): ";" # 6..7 - - ExpressionStatement (Rule): # 8..16 "a &= b;\n" - - Expression (Rule): # 8..14 "a &= b" - - BinaryExpression (Rule): # 8..14 "a &= b" - - Expression (Rule): # 8..9 "a" - - Identifier (Token): "a" # 8..9 - - AmpersandEqual (Token): "&=" # 10..12 - - Expression (Rule): # 12..14 " b" - - Identifier (Token): "b" # 13..14 - - Semicolon (Token): ";" # 14..15 - - ExpressionStatement (Rule): # 16..24 "a || b;\n" - - Expression (Rule): # 16..22 "a || b" - - BinaryExpression (Rule): # 16..22 "a || b" - - Expression (Rule): # 16..17 "a" - - Identifier (Token): "a" # 16..17 - - BarBar (Token): "||" # 18..20 - - Expression (Rule): # 20..22 " b" - - Identifier (Token): "b" # 21..22 - - Semicolon (Token): ";" # 22..23 - - ExpressionStatement (Rule): # 24..32 "a |= b;\n" - - Expression (Rule): # 24..30 "a |= b" - - BinaryExpression (Rule): # 24..30 "a |= b" - - Expression (Rule): # 24..25 "a" - - Identifier (Token): "a" # 24..25 - - BarEqual (Token): "|=" # 26..28 - - Expression (Rule): # 28..30 " b" - - Identifier (Token): "b" # 29..30 - - Semicolon (Token): ";" # 30..31 - - ExpressionStatement (Rule): # 32..39 "a / b;\n" - - Expression (Rule): # 32..37 "a / b" - - BinaryExpression (Rule): # 32..37 "a / b" - - Expression (Rule): # 32..33 "a" - - Identifier (Token): "a" # 32..33 - - Slash (Token): "/" # 34..35 - - Expression (Rule): # 35..37 " b" - - Identifier (Token): "b" # 36..37 - - Semicolon (Token): ";" # 37..38 - - ExpressionStatement (Rule): # 39..47 "a /= b;\n" - - Expression (Rule): # 39..45 "a /= b" - - BinaryExpression (Rule): # 39..45 "a /= b" - - Expression (Rule): # 39..40 "a" - - Identifier (Token): "a" # 39..40 - - SlashEqual (Token): "/=" # 41..43 - - Expression (Rule): # 43..45 " b" - - Identifier (Token): "b" # 44..45 - - Semicolon (Token): ";" # 45..46 - - ExpressionStatement (Rule): # 47..54 "a > b;\n" - - Expression (Rule): # 47..52 "a > b" - - BinaryExpression (Rule): # 47..52 "a > b" - - Expression (Rule): # 47..48 "a" - - Identifier (Token): "a" # 47..48 - - GreaterThan (Token): ">" # 49..50 - - Expression (Rule): # 50..52 " b" - - Identifier (Token): "b" # 51..52 - - Semicolon (Token): ";" # 52..53 - - ExpressionStatement (Rule): # 54..62 "a >= b;\n" - - Expression (Rule): # 54..60 "a >= b" - - BinaryExpression (Rule): # 54..60 "a >= b" - - Expression (Rule): # 54..55 "a" - - Identifier (Token): "a" # 54..55 - - GreaterThanEqual (Token): ">=" # 56..58 - - Expression (Rule): # 58..60 " b" - - Identifier (Token): "b" # 59..60 - - Semicolon (Token): ";" # 60..61 - - ExpressionStatement (Rule): # 62..70 "a >> b;\n" - - Expression (Rule): # 62..68 "a >> b" - - BinaryExpression (Rule): # 62..68 "a >> b" - - Expression (Rule): # 62..63 "a" - - Identifier (Token): "a" # 62..63 - - GreaterThanGreaterThan (Token): ">>" # 64..66 - - Expression (Rule): # 66..68 " b" - - Identifier (Token): "b" # 67..68 - - Semicolon (Token): ";" # 68..69 - - ExpressionStatement (Rule): # 70..79 "a >>= b;\n" - - Expression (Rule): # 70..77 "a >>= b" - - BinaryExpression (Rule): # 70..77 "a >>= b" - - Expression (Rule): # 70..71 "a" - - Identifier (Token): "a" # 70..71 - - GreaterThanGreaterThanEqual (Token): ">>=" # 72..75 - - Expression (Rule): # 75..77 " b" - - Identifier (Token): "b" # 76..77 - - Semicolon (Token): ";" # 77..78 - - ExpressionStatement (Rule): # 79..89 "a >>>= b;\n" - - Expression (Rule): # 79..87 "a >>>= b" - - BinaryExpression (Rule): # 79..87 "a >>>= b" - - Expression (Rule): # 79..80 "a" - - Identifier (Token): "a" # 79..80 - - GreaterThanGreaterThanGreaterThanEqual (Token): ">>>=" # 81..85 - - Expression (Rule): # 85..87 " b" - - Identifier (Token): "b" # 86..87 - - Semicolon (Token): ";" # 87..88 - - ExpressionStatement (Rule): # 89..97 "a << b;\n" - - Expression (Rule): # 89..95 "a << b" - - BinaryExpression (Rule): # 89..95 "a << b" - - Expression (Rule): # 89..90 "a" - - Identifier (Token): "a" # 89..90 - - LessThanLessThan (Token): "<<" # 91..93 - - Expression (Rule): # 93..95 " b" - - Identifier (Token): "b" # 94..95 - - Semicolon (Token): ";" # 95..96 - - ExpressionStatement (Rule): # 97..106 "a <<= b;\n" - - Expression (Rule): # 97..104 "a <<= b" - - BinaryExpression (Rule): # 97..104 "a <<= b" - - Expression (Rule): # 97..98 "a" - - Identifier (Token): "a" # 97..98 - - LessThanLessThanEqual (Token): "<<=" # 99..102 - - Expression (Rule): # 102..104 " b" - - Identifier (Token): "b" # 103..104 - - Semicolon (Token): ";" # 104..105 + - Statement (Rule): # 0..8 "a && b;\n" + - ExpressionStatement (Rule): # 0..8 "a && b;\n" + - Expression (Rule): # 0..6 "a && b" + - BinaryExpression (Rule): # 0..6 "a && b" + - Expression (Rule): # 0..1 "a" + - Identifier (Token): "a" # 0..1 + - AmpersandAmpersand (Token): "&&" # 2..4 + - Expression (Rule): # 4..6 " b" + - Identifier (Token): "b" # 5..6 + - Semicolon (Token): ";" # 6..7 + - Statement (Rule): # 8..16 "a &= b;\n" + - ExpressionStatement (Rule): # 8..16 "a &= b;\n" + - Expression (Rule): # 8..14 "a &= b" + - BinaryExpression (Rule): # 8..14 "a &= b" + - Expression (Rule): # 8..9 "a" + - Identifier (Token): "a" # 8..9 + - AmpersandEqual (Token): "&=" # 10..12 + - Expression (Rule): # 12..14 " b" + - Identifier (Token): "b" # 13..14 + - Semicolon (Token): ";" # 14..15 + - Statement (Rule): # 16..24 "a || b;\n" + - ExpressionStatement (Rule): # 16..24 "a || b;\n" + - Expression (Rule): # 16..22 "a || b" + - BinaryExpression (Rule): # 16..22 "a || b" + - Expression (Rule): # 16..17 "a" + - Identifier (Token): "a" # 16..17 + - BarBar (Token): "||" # 18..20 + - Expression (Rule): # 20..22 " b" + - Identifier (Token): "b" # 21..22 + - Semicolon (Token): ";" # 22..23 + - Statement (Rule): # 24..32 "a |= b;\n" + - ExpressionStatement (Rule): # 24..32 "a |= b;\n" + - Expression (Rule): # 24..30 "a |= b" + - BinaryExpression (Rule): # 24..30 "a |= b" + - Expression (Rule): # 24..25 "a" + - Identifier (Token): "a" # 24..25 + - BarEqual (Token): "|=" # 26..28 + - Expression (Rule): # 28..30 " b" + - Identifier (Token): "b" # 29..30 + - Semicolon (Token): ";" # 30..31 + - Statement (Rule): # 32..39 "a / b;\n" + - ExpressionStatement (Rule): # 32..39 "a / b;\n" + - Expression (Rule): # 32..37 "a / b" + - BinaryExpression (Rule): # 32..37 "a / b" + - Expression (Rule): # 32..33 "a" + - Identifier (Token): "a" # 32..33 + - Slash (Token): "/" # 34..35 + - Expression (Rule): # 35..37 " b" + - Identifier (Token): "b" # 36..37 + - Semicolon (Token): ";" # 37..38 + - Statement (Rule): # 39..47 "a /= b;\n" + - ExpressionStatement (Rule): # 39..47 "a /= b;\n" + - Expression (Rule): # 39..45 "a /= b" + - BinaryExpression (Rule): # 39..45 "a /= b" + - Expression (Rule): # 39..40 "a" + - Identifier (Token): "a" # 39..40 + - SlashEqual (Token): "/=" # 41..43 + - Expression (Rule): # 43..45 " b" + - Identifier (Token): "b" # 44..45 + - Semicolon (Token): ";" # 45..46 + - Statement (Rule): # 47..54 "a > b;\n" + - ExpressionStatement (Rule): # 47..54 "a > b;\n" + - Expression (Rule): # 47..52 "a > b" + - BinaryExpression (Rule): # 47..52 "a > b" + - Expression (Rule): # 47..48 "a" + - Identifier (Token): "a" # 47..48 + - GreaterThan (Token): ">" # 49..50 + - Expression (Rule): # 50..52 " b" + - Identifier (Token): "b" # 51..52 + - Semicolon (Token): ";" # 52..53 + - Statement (Rule): # 54..62 "a >= b;\n" + - ExpressionStatement (Rule): # 54..62 "a >= b;\n" + - Expression (Rule): # 54..60 "a >= b" + - BinaryExpression (Rule): # 54..60 "a >= b" + - Expression (Rule): # 54..55 "a" + - Identifier (Token): "a" # 54..55 + - GreaterThanEqual (Token): ">=" # 56..58 + - Expression (Rule): # 58..60 " b" + - Identifier (Token): "b" # 59..60 + - Semicolon (Token): ";" # 60..61 + - Statement (Rule): # 62..70 "a >> b;\n" + - ExpressionStatement (Rule): # 62..70 "a >> b;\n" + - Expression (Rule): # 62..68 "a >> b" + - BinaryExpression (Rule): # 62..68 "a >> b" + - Expression (Rule): # 62..63 "a" + - Identifier (Token): "a" # 62..63 + - GreaterThanGreaterThan (Token): ">>" # 64..66 + - Expression (Rule): # 66..68 " b" + - Identifier (Token): "b" # 67..68 + - Semicolon (Token): ";" # 68..69 + - Statement (Rule): # 70..79 "a >>= b;\n" + - ExpressionStatement (Rule): # 70..79 "a >>= b;\n" + - Expression (Rule): # 70..77 "a >>= b" + - BinaryExpression (Rule): # 70..77 "a >>= b" + - Expression (Rule): # 70..71 "a" + - Identifier (Token): "a" # 70..71 + - GreaterThanGreaterThanEqual (Token): ">>=" # 72..75 + - Expression (Rule): # 75..77 " b" + - Identifier (Token): "b" # 76..77 + - Semicolon (Token): ";" # 77..78 + - Statement (Rule): # 79..89 "a >>>= b;\n" + - ExpressionStatement (Rule): # 79..89 "a >>>= b;\n" + - Expression (Rule): # 79..87 "a >>>= b" + - BinaryExpression (Rule): # 79..87 "a >>>= b" + - Expression (Rule): # 79..80 "a" + - Identifier (Token): "a" # 79..80 + - GreaterThanGreaterThanGreaterThanEqual (Token): ">>>=" # 81..85 + - Expression (Rule): # 85..87 " b" + - Identifier (Token): "b" # 86..87 + - Semicolon (Token): ";" # 87..88 + - Statement (Rule): # 89..97 "a << b;\n" + - ExpressionStatement (Rule): # 89..97 "a << b;\n" + - Expression (Rule): # 89..95 "a << b" + - BinaryExpression (Rule): # 89..95 "a << b" + - Expression (Rule): # 89..90 "a" + - Identifier (Token): "a" # 89..90 + - LessThanLessThan (Token): "<<" # 91..93 + - Expression (Rule): # 93..95 " b" + - Identifier (Token): "b" # 94..95 + - Semicolon (Token): ";" # 95..96 + - Statement (Rule): # 97..106 "a <<= b;\n" + - ExpressionStatement (Rule): # 97..106 "a <<= b;\n" + - Expression (Rule): # 97..104 "a <<= b" + - BinaryExpression (Rule): # 97..104 "a <<= b" + - Expression (Rule): # 97..98 "a" + - Identifier (Token): "a" # 97..98 + - LessThanLessThanEqual (Token): "<<=" # 99..102 + - Expression (Rule): # 102..104 " b" + - Identifier (Token): "b" # 103..104 + - Semicolon (Token): ";" # 104..105 diff --git a/crates/solidity/testing/snapshots/cst_output/Statements/invalid_termination/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/Statements/invalid_termination/generated/0.4.11-failure.yml index c9109d3fce..04dc3166d6 100644 --- a/crates/solidity/testing/snapshots/cst_output/Statements/invalid_termination/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/Statements/invalid_termination/generated/0.4.11-failure.yml @@ -25,33 +25,37 @@ Errors: # 2 total Tree: - Statements (Rule): # 0..43 "\nthrow invalid ;\n{ 1 * 2; 3 * b invalid; }\n" - - ThrowStatement (Rule): # 0..17 "\nthrow invalid ;\n" - - ThrowKeyword (Token): "throw" # 1..6 - - SKIPPED (Token): "invalid " # 7..15 - - Semicolon (Token): ";" # 15..16 - - Block (Rule): # 17..43 "{ 1 * 2; 3 * b invalid; }\n" - - OpenBrace (Token): "{" # 17..18 - - Statements (Rule): # 18..40 " 1 * 2; 3 * b invalid;" - - ExpressionStatement (Rule): # 18..25 " 1 * 2;" - - Expression (Rule): # 18..24 " 1 * 2" - - BinaryExpression (Rule): # 18..24 " 1 * 2" - - Expression (Rule): # 18..20 " 1" - - DecimalNumberExpression (Rule): # 18..20 " 1" - - DecimalLiteral (Token): "1" # 19..20 - - Asterisk (Token): "*" # 21..22 - - Expression (Rule): # 22..24 " 2" - - DecimalNumberExpression (Rule): # 22..24 " 2" - - DecimalLiteral (Token): "2" # 23..24 - - Semicolon (Token): ";" # 24..25 - - ExpressionStatement (Rule): # 25..40 " 3 * b invalid;" - - Expression (Rule): # 25..31 " 3 * b" - - BinaryExpression (Rule): # 25..31 " 3 * b" - - Expression (Rule): # 25..27 " 3" - - DecimalNumberExpression (Rule): # 25..27 " 3" - - DecimalLiteral (Token): "3" # 26..27 - - Asterisk (Token): "*" # 28..29 - - Expression (Rule): # 29..31 " b" - - Identifier (Token): "b" # 30..31 - - SKIPPED (Token): "invalid" # 32..39 - - Semicolon (Token): ";" # 39..40 - - CloseBrace (Token): "}" # 41..42 + - Statement (Rule): # 0..17 "\nthrow invalid ;\n" + - ThrowStatement (Rule): # 0..17 "\nthrow invalid ;\n" + - ThrowKeyword (Token): "throw" # 1..6 + - SKIPPED (Token): "invalid " # 7..15 + - Semicolon (Token): ";" # 15..16 + - Statement (Rule): # 17..43 "{ 1 * 2; 3 * b invalid; }\n" + - Block (Rule): # 17..43 "{ 1 * 2; 3 * b invalid; }\n" + - OpenBrace (Token): "{" # 17..18 + - Statements (Rule): # 18..40 " 1 * 2; 3 * b invalid;" + - Statement (Rule): # 18..25 " 1 * 2;" + - ExpressionStatement (Rule): # 18..25 " 1 * 2;" + - Expression (Rule): # 18..24 " 1 * 2" + - BinaryExpression (Rule): # 18..24 " 1 * 2" + - Expression (Rule): # 18..20 " 1" + - DecimalNumberExpression (Rule): # 18..20 " 1" + - DecimalLiteral (Token): "1" # 19..20 + - Asterisk (Token): "*" # 21..22 + - Expression (Rule): # 22..24 " 2" + - DecimalNumberExpression (Rule): # 22..24 " 2" + - DecimalLiteral (Token): "2" # 23..24 + - Semicolon (Token): ";" # 24..25 + - Statement (Rule): # 25..40 " 3 * b invalid;" + - ExpressionStatement (Rule): # 25..40 " 3 * b invalid;" + - Expression (Rule): # 25..31 " 3 * b" + - BinaryExpression (Rule): # 25..31 " 3 * b" + - Expression (Rule): # 25..27 " 3" + - DecimalNumberExpression (Rule): # 25..27 " 3" + - DecimalLiteral (Token): "3" # 26..27 + - Asterisk (Token): "*" # 28..29 + - Expression (Rule): # 29..31 " b" + - Identifier (Token): "b" # 30..31 + - SKIPPED (Token): "invalid" # 32..39 + - Semicolon (Token): ";" # 39..40 + - CloseBrace (Token): "}" # 41..42 diff --git a/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch/generated/0.6.0-success.yml b/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch/generated/0.6.0-success.yml index f5c1d43d93..6fbed487ba 100644 --- a/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch/generated/0.6.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TryStatement/try_catch/generated/0.6.0-success.yml @@ -15,10 +15,12 @@ Tree: - Expression (Rule): # 3..5 " a" - Identifier (Token): "a" # 4..5 - Period (Token): "." # 5..6 - - Identifier (Token): "b" # 6..7 - - PositionalArgumentsDeclaration (Rule): # 7..9 "()" - - OpenParen (Token): "(" # 7..8 - - CloseParen (Token): ")" # 8..9 + - MemberAccess (Rule): # 6..7 "b" + - Identifier (Token): "b" # 6..7 + - ArgumentsDeclaration (Rule): # 7..9 "()" + - PositionalArgumentsDeclaration (Rule): # 7..9 "()" + - OpenParen (Token): "(" # 7..8 + - CloseParen (Token): ")" # 8..9 - Block (Rule): # 9..12 " {}" - OpenBrace (Token): "{" # 10..11 - CloseBrace (Token): "}" # 11..12 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 3733963a12..5a8b9b873e 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 @@ -10,21 +10,26 @@ Tree: - OpenParen (Token): "(" # 0..1 - 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 + - TupleMember (Rule): # 1..9 "uint32 a" + - TypedTupleMember (Rule): # 1..9 "uint32 a" + - TypeName (Rule): # 1..7 "uint32" + - ElementaryType (Rule): # 1..7 "uint32" + - UintKeyword (Token): "uint32" # 1..7 + - Identifier (Token): "a" # 8..9 - Comma (Token): "," # 9..10 - 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 + - TupleMember (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" + - ElementaryType (Rule): # 10..17 " uint32" + - UintKeyword (Token): "uint32" # 11..17 + - OpenBracket (Token): "[" # 17..18 + - CloseBracket (Token): "]" # 18..19 + - StorageLocation (Rule): # 19..26 " memory" + - 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[]))" @@ -34,28 +39,32 @@ Tree: - Expression (Rule): # 31..35 " abi" - Identifier (Token): "abi" # 32..35 - Period (Token): "." # 35..36 - - Identifier (Token): "decode" # 36..42 - - PositionalArgumentsDeclaration (Rule): # 42..68 "(data, (uint32, uint32[]))" - - OpenParen (Token): "(" # 42..43 - - PositionalArguments (Rule): # 43..67 "data, (uint32, uint32[])" - - Expression (Rule): # 43..47 "data" - - Identifier (Token): "data" # 43..47 - - Comma (Token): "," # 47..48 - - Expression (Rule): # 48..67 " (uint32, uint32[])" - - TupleExpression (Rule): # 48..67 " (uint32, uint32[])" - - OpenParen (Token): "(" # 49..50 - - TupleValues (Rule): # 50..66 "uint32, uint32[]" - - TupleValue (Rule): # 50..56 "uint32" - - Expression (Rule): # 50..56 "uint32" - - UintKeyword (Token): "uint32" # 50..56 - - Comma (Token): "," # 56..57 - - TupleValue (Rule): # 57..66 " uint32[]" - - Expression (Rule): # 57..66 " uint32[]" - - IndexAccessExpression (Rule): # 57..66 " uint32[]" - - Expression (Rule): # 57..64 " uint32" - - UintKeyword (Token): "uint32" # 58..64 - - OpenBracket (Token): "[" # 64..65 - - CloseBracket (Token): "]" # 65..66 - - CloseParen (Token): ")" # 66..67 - - CloseParen (Token): ")" # 67..68 + - MemberAccess (Rule): # 36..42 "decode" + - Identifier (Token): "decode" # 36..42 + - ArgumentsDeclaration (Rule): # 42..68 "(data, (uint32, uint32[]))" + - PositionalArgumentsDeclaration (Rule): # 42..68 "(data, (uint32, uint32[]))" + - OpenParen (Token): "(" # 42..43 + - PositionalArguments (Rule): # 43..67 "data, (uint32, uint32[])" + - Expression (Rule): # 43..47 "data" + - Identifier (Token): "data" # 43..47 + - Comma (Token): "," # 47..48 + - Expression (Rule): # 48..67 " (uint32, uint32[])" + - TupleExpression (Rule): # 48..67 " (uint32, uint32[])" + - OpenParen (Token): "(" # 49..50 + - TupleValues (Rule): # 50..66 "uint32, uint32[]" + - TupleValue (Rule): # 50..56 "uint32" + - Expression (Rule): # 50..56 "uint32" + - ElementaryType (Rule): # 50..56 "uint32" + - UintKeyword (Token): "uint32" # 50..56 + - Comma (Token): "," # 56..57 + - TupleValue (Rule): # 57..66 " uint32[]" + - Expression (Rule): # 57..66 " uint32[]" + - IndexAccessExpression (Rule): # 57..66 " uint32[]" + - Expression (Rule): # 57..64 " uint32" + - ElementaryType (Rule): # 57..64 " uint32" + - UintKeyword (Token): "uint32" # 58..64 + - OpenBracket (Token): "[" # 64..65 + - CloseBracket (Token): "]" # 65..66 + - CloseParen (Token): ")" # 66..67 + - CloseParen (Token): ")" # 67..68 - Semicolon (Token): ";" # 68..69 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 6aee2231bf..a08e64e8e7 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 @@ -10,16 +10,20 @@ Tree: - OpenParen (Token): "(" # 0..1 - 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 + - TupleMember (Rule): # 1..9 "uint32 a" + - TypedTupleMember (Rule): # 1..9 "uint32 a" + - TypeName (Rule): # 1..7 "uint32" + - ElementaryType (Rule): # 1..7 "uint32" + - UintKeyword (Token): "uint32" # 1..7 + - Identifier (Token): "a" # 8..9 - Comma (Token): "," # 9..10 - 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 + - TupleMember (Rule): # 10..19 " uint32 b" + - TypedTupleMember (Rule): # 10..19 " uint32 b" + - TypeName (Rule): # 10..17 " uint32" + - ElementaryType (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))" @@ -29,24 +33,28 @@ Tree: - Expression (Rule): # 22..26 " abi" - Identifier (Token): "abi" # 23..26 - Period (Token): "." # 26..27 - - Identifier (Token): "decode" # 27..33 - - PositionalArgumentsDeclaration (Rule): # 33..57 "(data, (uint32, uint32))" - - OpenParen (Token): "(" # 33..34 - - PositionalArguments (Rule): # 34..56 "data, (uint32, uint32)" - - Expression (Rule): # 34..38 "data" - - Identifier (Token): "data" # 34..38 - - Comma (Token): "," # 38..39 - - Expression (Rule): # 39..56 " (uint32, uint32)" - - TupleExpression (Rule): # 39..56 " (uint32, uint32)" - - OpenParen (Token): "(" # 40..41 - - TupleValues (Rule): # 41..55 "uint32, uint32" - - TupleValue (Rule): # 41..47 "uint32" - - Expression (Rule): # 41..47 "uint32" - - UintKeyword (Token): "uint32" # 41..47 - - Comma (Token): "," # 47..48 - - TupleValue (Rule): # 48..55 " uint32" - - Expression (Rule): # 48..55 " uint32" - - UintKeyword (Token): "uint32" # 49..55 - - CloseParen (Token): ")" # 55..56 - - CloseParen (Token): ")" # 56..57 + - MemberAccess (Rule): # 27..33 "decode" + - Identifier (Token): "decode" # 27..33 + - ArgumentsDeclaration (Rule): # 33..57 "(data, (uint32, uint32))" + - PositionalArgumentsDeclaration (Rule): # 33..57 "(data, (uint32, uint32))" + - OpenParen (Token): "(" # 33..34 + - PositionalArguments (Rule): # 34..56 "data, (uint32, uint32)" + - Expression (Rule): # 34..38 "data" + - Identifier (Token): "data" # 34..38 + - Comma (Token): "," # 38..39 + - Expression (Rule): # 39..56 " (uint32, uint32)" + - TupleExpression (Rule): # 39..56 " (uint32, uint32)" + - OpenParen (Token): "(" # 40..41 + - TupleValues (Rule): # 41..55 "uint32, uint32" + - TupleValue (Rule): # 41..47 "uint32" + - Expression (Rule): # 41..47 "uint32" + - ElementaryType (Rule): # 41..47 "uint32" + - UintKeyword (Token): "uint32" # 41..47 + - Comma (Token): "," # 47..48 + - TupleValue (Rule): # 48..55 " uint32" + - Expression (Rule): # 48..55 " uint32" + - ElementaryType (Rule): # 48..55 " uint32" + - UintKeyword (Token): "uint32" # 49..55 + - CloseParen (Token): ")" # 55..56 + - CloseParen (Token): ")" # 56..57 - Semicolon (Token): ";" # 57..58 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 536bbf8352..45e3ba4182 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 @@ -12,14 +12,16 @@ Tree: - TupleDeconstructionElement (Rule): [] # 1..1 - Comma (Token): "," # 1..2 - TupleDeconstructionElement (Rule): # 2..9 " second" - - UntypedTupleMember (Rule): # 2..9 " second" - - Identifier (Token): "second" # 3..9 + - TupleMember (Rule): # 2..9 " second" + - UntypedTupleMember (Rule): # 2..9 " second" + - Identifier (Token): "second" # 3..9 - Comma (Token): "," # 9..10 - TupleDeconstructionElement (Rule): [] # 10..10 - Comma (Token): "," # 11..12 - TupleDeconstructionElement (Rule): # 12..19 " fourth" - - UntypedTupleMember (Rule): # 12..19 " fourth" - - Identifier (Token): "fourth" # 13..19 + - TupleMember (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 31ca1acaca..16d021b23e 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 @@ -21,12 +21,14 @@ Tree: - OpenParen (Token): "(" # 0..1 - TupleDeconstructionElements (Rule): # 1..5 "a, b" - TupleDeconstructionElement (Rule): # 1..2 "a" - - UntypedTupleMember (Rule): # 1..2 "a" - - Identifier (Token): "a" # 1..2 + - TupleMember (Rule): # 1..2 "a" + - UntypedTupleMember (Rule): # 1..2 "a" + - Identifier (Token): "a" # 1..2 - Comma (Token): "," # 2..3 - TupleDeconstructionElement (Rule): # 3..5 " b" - - UntypedTupleMember (Rule): # 3..5 " b" - - Identifier (Token): "b" # 4..5 + - TupleMember (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 a84c184fb0..a4b80bd30b 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 @@ -20,12 +20,14 @@ Tree: - OpenParen (Token): "(" # 0..1 - TupleDeconstructionElements (Rule): # 1..5 "a, b" - TupleDeconstructionElement (Rule): # 1..2 "a" - - UntypedTupleMember (Rule): # 1..2 "a" - - Identifier (Token): "a" # 1..2 + - TupleMember (Rule): # 1..2 "a" + - UntypedTupleMember (Rule): # 1..2 "a" + - Identifier (Token): "a" # 1..2 - Comma (Token): "," # 2..3 - TupleDeconstructionElement (Rule): # 3..5 " b" - - UntypedTupleMember (Rule): # 3..5 " b" - - Identifier (Token): "b" # 4..5 + - TupleMember (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{" @@ -42,10 +44,11 @@ Tree: - DecimalNumberExpression (Rule): # 14..18 " 135" - DecimalLiteral (Token): "135" # 15..18 - CloseParen (Token): ")" # 18..19 - - NamedArgumentGroups (Rule): # 20..26 "/**/\n{" - - NamedArgumentGroup (Rule): # 20..26 "/**/\n{" - - LeadingTrivia (Rule): # 20..25 "/**/\n" - - MultilineComment (Trivia): "/**/" # 20..24 - - OpenBrace (Token): "{" # 25..26 + - FunctionCallOptions (Rule): # 20..26 "/**/\n{" + - NamedArgumentGroups (Rule): # 20..26 "/**/\n{" + - NamedArgumentGroup (Rule): # 20..26 "/**/\n{" + - LeadingTrivia (Rule): # 20..25 "/**/\n" + - MultilineComment (Trivia): "/**/" # 20..24 + - OpenBrace (Token): "{" # 25..26 - SKIPPED (Token): "throw" # 27..32 - Semicolon (Token): ";" # 32..33 diff --git a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.8.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.8.0-failure.yml index e53f2a106c..61032a7128 100644 --- a/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.8.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.8.0-failure.yml @@ -20,12 +20,14 @@ Tree: - OpenParen (Token): "(" # 0..1 - TupleDeconstructionElements (Rule): # 1..5 "a, b" - TupleDeconstructionElement (Rule): # 1..2 "a" - - UntypedTupleMember (Rule): # 1..2 "a" - - Identifier (Token): "a" # 1..2 + - TupleMember (Rule): # 1..2 "a" + - UntypedTupleMember (Rule): # 1..2 "a" + - Identifier (Token): "a" # 1..2 - Comma (Token): "," # 2..3 - TupleDeconstructionElement (Rule): # 3..5 " b" - - UntypedTupleMember (Rule): # 3..5 " b" - - Identifier (Token): "b" # 4..5 + - TupleMember (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{" @@ -42,9 +44,10 @@ Tree: - DecimalNumberExpression (Rule): # 14..18 " 135" - DecimalLiteral (Token): "135" # 15..18 - CloseParen (Token): ")" # 18..19 - - NamedArgumentGroup (Rule): # 20..26 "/**/\n{" - - LeadingTrivia (Rule): # 20..25 "/**/\n" - - MultilineComment (Trivia): "/**/" # 20..24 - - OpenBrace (Token): "{" # 25..26 + - FunctionCallOptions (Rule): # 20..26 "/**/\n{" + - NamedArgumentGroup (Rule): # 20..26 "/**/\n{" + - LeadingTrivia (Rule): # 20..25 "/**/\n" + - MultilineComment (Trivia): "/**/" # 20..24 + - OpenBrace (Token): "{" # 25..26 - SKIPPED (Token): "throw" # 27..32 - Semicolon (Token): ";" # 32..33 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 3b9178e9ff..fb4937f65c 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 @@ -10,13 +10,16 @@ Tree: - OpenParen (Token): "(" # 0..1 - 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 + - TupleMember (Rule): # 1..21 "memory with_location" + - UntypedTupleMember (Rule): # 1..21 "memory with_location" + - StorageLocation (Rule): # 1..7 "memory" + - MemoryKeyword (Token): "memory" # 1..7 + - Identifier (Token): "with_location" # 8..21 - Comma (Token): "," # 21..22 - TupleDeconstructionElement (Rule): # 22..39 " without_location" - - UntypedTupleMember (Rule): # 22..39 " without_location" - - Identifier (Token): "without_location" # 23..39 + - TupleMember (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 f195ebfec9..999a1903e5 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 @@ -10,14 +10,17 @@ Tree: - OpenParen (Token): "(" # 0..1 - 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 + - TupleMember (Rule): # 1..15 "bool with_type" + - TypedTupleMember (Rule): # 1..15 "bool with_type" + - TypeName (Rule): # 1..5 "bool" + - ElementaryType (Rule): # 1..5 "bool" + - BoolKeyword (Token): "bool" # 1..5 + - Identifier (Token): "with_type" # 6..15 - Comma (Token): "," # 15..16 - TupleDeconstructionElement (Rule): # 16..29 " without_type" - - UntypedTupleMember (Rule): # 16..29 " without_type" - - Identifier (Token): "without_type" # 17..29 + - TupleMember (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 c57efe3e09..7bfc6a71ea 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 @@ -10,18 +10,24 @@ Tree: - OpenParen (Token): "(" # 0..1 - 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 + - TupleMember (Rule): # 1..14 "bool memory x" + - TypedTupleMember (Rule): # 1..14 "bool memory x" + - TypeName (Rule): # 1..5 "bool" + - ElementaryType (Rule): # 1..5 "bool" + - BoolKeyword (Token): "bool" # 1..5 + - StorageLocation (Rule): # 5..12 " memory" + - MemoryKeyword (Token): "memory" # 6..12 + - Identifier (Token): "x" # 13..14 - Comma (Token): "," # 14..15 - 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 + - TupleMember (Rule): # 15..30 " bool storage y" + - TypedTupleMember (Rule): # 15..30 " bool storage y" + - TypeName (Rule): # 15..20 " bool" + - ElementaryType (Rule): # 15..20 " bool" + - BoolKeyword (Token): "bool" # 16..20 + - StorageLocation (Rule): # 20..28 " storage" + - StorageKeyword (Token): "storage" # 21..28 + - Identifier (Token): "y" # 29..30 - CloseParen (Token): ")" # 30..31 - Equal (Token): "=" # 32..33 - Expression (Rule): # 33..37 " rhs" diff --git a/crates/solidity/testing/snapshots/cst_output/TypeName/byte/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TypeName/byte/generated/0.4.11-success.yml index 349896152d..4d54514645 100644 --- a/crates/solidity/testing/snapshots/cst_output/TypeName/byte/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TypeName/byte/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - TypeName (Rule): # 0..4 "byte" - - ByteKeyword (Token): "byte" # 0..4 + - ElementaryType (Rule): # 0..4 "byte" + - ByteKeyword (Token): "byte" # 0..4 diff --git a/crates/solidity/testing/snapshots/cst_output/TypeName/bytes_no_size_reserved/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TypeName/bytes_no_size_reserved/generated/0.4.11-success.yml index d2104042ad..4dfe1b91cd 100644 --- a/crates/solidity/testing/snapshots/cst_output/TypeName/bytes_no_size_reserved/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TypeName/bytes_no_size_reserved/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - TypeName (Rule): # 0..5 "bytes" - - BytesKeyword (Token): "bytes" # 0..5 + - ElementaryType (Rule): # 0..5 "bytes" + - BytesKeyword (Token): "bytes" # 0..5 diff --git a/crates/solidity/testing/snapshots/cst_output/TypeName/bytes_valid_size/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TypeName/bytes_valid_size/generated/0.4.11-success.yml index f332aaf055..15e8ad46af 100644 --- a/crates/solidity/testing/snapshots/cst_output/TypeName/bytes_valid_size/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TypeName/bytes_valid_size/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - TypeName (Rule): # 0..7 "bytes32" - - BytesKeyword (Token): "bytes32" # 0..7 + - ElementaryType (Rule): # 0..7 "bytes32" + - BytesKeyword (Token): "bytes32" # 0..7 diff --git a/crates/solidity/testing/snapshots/cst_output/TypeName/int_no_size/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TypeName/int_no_size/generated/0.4.11-success.yml index a7bd0cb4ce..71a6c6e371 100644 --- a/crates/solidity/testing/snapshots/cst_output/TypeName/int_no_size/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TypeName/int_no_size/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - TypeName (Rule): # 0..3 "int" - - IntKeyword (Token): "int" # 0..3 + - ElementaryType (Rule): # 0..3 "int" + - IntKeyword (Token): "int" # 0..3 diff --git a/crates/solidity/testing/snapshots/cst_output/TypeName/int_valid_size/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TypeName/int_valid_size/generated/0.4.11-success.yml index bde0767e7e..e004f89e6c 100644 --- a/crates/solidity/testing/snapshots/cst_output/TypeName/int_valid_size/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TypeName/int_valid_size/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - TypeName (Rule): # 0..5 "int32" - - IntKeyword (Token): "int32" # 0..5 + - ElementaryType (Rule): # 0..5 "int32" + - IntKeyword (Token): "int32" # 0..5 diff --git a/crates/solidity/testing/snapshots/cst_output/TypeName/uint_no_size/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TypeName/uint_no_size/generated/0.4.11-success.yml index f55d90cfd8..bb46c78ef2 100644 --- a/crates/solidity/testing/snapshots/cst_output/TypeName/uint_no_size/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TypeName/uint_no_size/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - TypeName (Rule): # 0..4 "uint" - - UintKeyword (Token): "uint" # 0..4 + - ElementaryType (Rule): # 0..4 "uint" + - UintKeyword (Token): "uint" # 0..4 diff --git a/crates/solidity/testing/snapshots/cst_output/TypeName/uint_valid_size/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/TypeName/uint_valid_size/generated/0.4.11-success.yml index 0899cbfad2..aa0d6c91c6 100644 --- a/crates/solidity/testing/snapshots/cst_output/TypeName/uint_valid_size/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/TypeName/uint_valid_size/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - TypeName (Rule): # 0..6 "uint32" - - UintKeyword (Token): "uint32" # 0..6 + - ElementaryType (Rule): # 0..6 "uint32" + - UintKeyword (Token): "uint32" # 0..6 diff --git a/crates/solidity/testing/snapshots/cst_output/UserDefinedValueTypeDefinition/bool/generated/0.8.8-success.yml b/crates/solidity/testing/snapshots/cst_output/UserDefinedValueTypeDefinition/bool/generated/0.8.8-success.yml index 64bc7a0ee4..ac07956a3b 100644 --- a/crates/solidity/testing/snapshots/cst_output/UserDefinedValueTypeDefinition/bool/generated/0.8.8-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UserDefinedValueTypeDefinition/bool/generated/0.8.8-success.yml @@ -10,5 +10,6 @@ Tree: - TypeKeyword (Token): "type" # 0..4 - Identifier (Token): "Foo" # 5..8 - IsKeyword (Token): "is" # 9..11 - - BoolKeyword (Token): "bool" # 12..16 + - ElementaryType (Rule): # 11..16 " bool" + - BoolKeyword (Token): "bool" # 12..16 - Semicolon (Token): ";" # 16..17 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/identifier_path_as_operator/generated/0.8.19-success.yml b/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/identifier_path_as_operator/generated/0.8.19-success.yml index 31f4a4da8f..eb06592ca9 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/identifier_path_as_operator/generated/0.8.19-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/identifier_path_as_operator/generated/0.8.19-success.yml @@ -13,4 +13,5 @@ Tree: - Identifier (Token): "bar" # 4..7 - UsingAlias (Rule): # 7..12 " as /" - AsKeyword (Token): "as" # 8..10 - - Slash (Token): "/" # 11..12 + - UsingOperator (Rule): # 10..12 " /" + - Slash (Token): "/" # 11..12 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/single_id_as_operator/generated/0.8.19-success.yml b/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/single_id_as_operator/generated/0.8.19-success.yml index 8af521e6c8..47fe959931 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/single_id_as_operator/generated/0.8.19-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDeconstructionSymbol/single_id_as_operator/generated/0.8.19-success.yml @@ -11,4 +11,5 @@ Tree: - Identifier (Token): "foo" # 0..3 - UsingAlias (Rule): # 3..8 " as /" - AsKeyword (Token): "as" # 4..6 - - Slash (Token): "/" # 7..8 + - UsingOperator (Rule): # 6..8 " /" + - Slash (Token): "/" # 7..8 diff --git a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_empty/generated/0.8.13-failure.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_empty/generated/0.8.13-failure.yml index 3ea734487c..fc0c451adc 100644 --- a/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_empty/generated/0.8.13-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_empty/generated/0.8.13-failure.yml @@ -19,10 +19,12 @@ Tree: - LeadingTrivia (Rule): # 0..41 "// Empty using symbols list is not valid\n" - SingleLineComment (Trivia): "// Empty using symbols list is not valid" # 0..40 - UsingKeyword (Token): "using" # 41..46 - - UsingDeconstruction (Rule): # 46..49 " {}" - - OpenBrace (Token): "{" # 47..48 - - SKIPPED (Token): "" # 48..48 - - CloseBrace (Token): "}" # 48..49 + - UsingClause (Rule): # 46..49 " {}" + - UsingDeconstruction (Rule): # 46..49 " {}" + - OpenBrace (Token): "{" # 47..48 + - SKIPPED (Token): "" # 48..48 + - CloseBrace (Token): "}" # 48..49 - ForKeyword (Token): "for" # 50..53 - - Asterisk (Token): "*" # 54..55 + - UsingTarget (Rule): # 53..55 " *" + - Asterisk (Token): "*" # 54..55 - Semicolon (Token): ";" # 55..56 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 83cf7e00ba..47fbb72754 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 @@ -16,17 +16,19 @@ Errors: # 1 total Tree: - UsingDirective (Rule): # 0..52 "using {add as +, sub, mul, div as /} for Int globa..." - UsingKeyword (Token): "using" # 0..5 - - UsingDeconstruction (Rule): # 5..36 " {add as +, sub, mul, div as /}" - - OpenBrace (Token): "{" # 6..7 - - UsingDeconstructionSymbols (Rule): # 7..10 "add" - - UsingDeconstructionSymbol (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 + - UsingClause (Rule): # 5..36 " {add as +, sub, mul, div as /}" + - UsingDeconstruction (Rule): # 5..36 " {add as +, sub, mul, div as /}" + - OpenBrace (Token): "{" # 6..7 + - UsingDeconstructionSymbols (Rule): # 7..10 "add" + - UsingDeconstructionSymbol (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..44 " Int" - - IdentifierPath (Rule): # 40..44 " Int" - - Identifier (Token): "Int" # 41..44 + - UsingTarget (Rule): # 40..44 " 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 d6cfb58268..d1482820ee 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 @@ -8,34 +8,38 @@ Errors: [] Tree: - UsingDirective (Rule): # 0..52 "using {add as +, sub, mul, div as /} for Int globa..." - UsingKeyword (Token): "using" # 0..5 - - UsingDeconstruction (Rule): # 5..36 " {add as +, sub, mul, div as /}" - - OpenBrace (Token): "{" # 6..7 - - UsingDeconstructionSymbols (Rule): # 7..35 "add as +, sub, mul, div as /" - - UsingDeconstructionSymbol (Rule): # 7..15 "add as +" - - IdentifierPath (Rule): # 7..10 "add" - - Identifier (Token): "add" # 7..10 - - UsingAlias (Rule): # 10..15 " as +" - - AsKeyword (Token): "as" # 11..13 - - Plus (Token): "+" # 14..15 - - Comma (Token): "," # 15..16 - - UsingDeconstructionSymbol (Rule): # 16..20 " sub" - - IdentifierPath (Rule): # 16..20 " sub" - - Identifier (Token): "sub" # 17..20 - - Comma (Token): "," # 20..21 - - UsingDeconstructionSymbol (Rule): # 21..25 " mul" - - IdentifierPath (Rule): # 21..25 " mul" - - Identifier (Token): "mul" # 22..25 - - Comma (Token): "," # 25..26 - - UsingDeconstructionSymbol (Rule): # 26..35 " div as /" - - IdentifierPath (Rule): # 26..30 " div" - - Identifier (Token): "div" # 27..30 - - UsingAlias (Rule): # 30..35 " as /" - - AsKeyword (Token): "as" # 31..33 - - Slash (Token): "/" # 34..35 - - CloseBrace (Token): "}" # 35..36 + - UsingClause (Rule): # 5..36 " {add as +, sub, mul, div as /}" + - UsingDeconstruction (Rule): # 5..36 " {add as +, sub, mul, div as /}" + - OpenBrace (Token): "{" # 6..7 + - UsingDeconstructionSymbols (Rule): # 7..35 "add as +, sub, mul, div as /" + - UsingDeconstructionSymbol (Rule): # 7..15 "add as +" + - IdentifierPath (Rule): # 7..10 "add" + - Identifier (Token): "add" # 7..10 + - UsingAlias (Rule): # 10..15 " as +" + - AsKeyword (Token): "as" # 11..13 + - UsingOperator (Rule): # 13..15 " +" + - Plus (Token): "+" # 14..15 + - Comma (Token): "," # 15..16 + - UsingDeconstructionSymbol (Rule): # 16..20 " sub" + - IdentifierPath (Rule): # 16..20 " sub" + - Identifier (Token): "sub" # 17..20 + - Comma (Token): "," # 20..21 + - UsingDeconstructionSymbol (Rule): # 21..25 " mul" + - IdentifierPath (Rule): # 21..25 " mul" + - Identifier (Token): "mul" # 22..25 + - Comma (Token): "," # 25..26 + - UsingDeconstructionSymbol (Rule): # 26..35 " div as /" + - IdentifierPath (Rule): # 26..30 " div" + - Identifier (Token): "div" # 27..30 + - UsingAlias (Rule): # 30..35 " as /" + - AsKeyword (Token): "as" # 31..33 + - UsingOperator (Rule): # 33..35 " /" + - Slash (Token): "/" # 34..35 + - CloseBrace (Token): "}" # 35..36 - ForKeyword (Token): "for" # 37..40 - - TypeName (Rule): # 40..44 " Int" - - IdentifierPath (Rule): # 40..44 " Int" - - Identifier (Token): "Int" # 41..44 + - UsingTarget (Rule): # 40..44 " 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.8.13-success.yml b/crates/solidity/testing/snapshots/cst_output/UsingDirective/destructure_single/generated/0.8.13-success.yml index cb007836a0..d419fd6f12 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 @@ -8,16 +8,18 @@ Errors: [] Tree: - UsingDirective (Rule): # 0..27 "using {add} for Int global;" - UsingKeyword (Token): "using" # 0..5 - - UsingDeconstruction (Rule): # 5..11 " {add}" - - OpenBrace (Token): "{" # 6..7 - - UsingDeconstructionSymbols (Rule): # 7..10 "add" - - UsingDeconstructionSymbol (Rule): # 7..10 "add" - - IdentifierPath (Rule): # 7..10 "add" - - Identifier (Token): "add" # 7..10 - - CloseBrace (Token): "}" # 10..11 + - UsingClause (Rule): # 5..11 " {add}" + - UsingDeconstruction (Rule): # 5..11 " {add}" + - OpenBrace (Token): "{" # 6..7 + - UsingDeconstructionSymbols (Rule): # 7..10 "add" + - UsingDeconstructionSymbol (Rule): # 7..10 "add" + - IdentifierPath (Rule): # 7..10 "add" + - Identifier (Token): "add" # 7..10 + - CloseBrace (Token): "}" # 10..11 - ForKeyword (Token): "for" # 12..15 - - TypeName (Rule): # 15..19 " Int" - - IdentifierPath (Rule): # 15..19 " Int" - - Identifier (Token): "Int" # 16..19 + - UsingTarget (Rule): # 15..19 " 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 018c4d3271..e11be1cebc 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,11 +16,13 @@ Errors: # 1 total Tree: - UsingDirective (Rule): # 0..25 "using foo for bar global;" - UsingKeyword (Token): "using" # 0..5 - - IdentifierPath (Rule): # 5..9 " foo" - - Identifier (Token): "foo" # 6..9 + - UsingClause (Rule): # 5..9 " foo" + - IdentifierPath (Rule): # 5..9 " foo" + - Identifier (Token): "foo" # 6..9 - ForKeyword (Token): "for" # 10..13 - - TypeName (Rule): # 13..17 " bar" - - IdentifierPath (Rule): # 13..17 " bar" - - Identifier (Token): "bar" # 14..17 + - UsingTarget (Rule): # 13..17 " 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 89d625eca2..97b81766ce 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,11 +8,13 @@ Errors: [] Tree: - UsingDirective (Rule): # 0..25 "using foo for bar global;" - UsingKeyword (Token): "using" # 0..5 - - IdentifierPath (Rule): # 5..9 " foo" - - Identifier (Token): "foo" # 6..9 + - UsingClause (Rule): # 5..9 " foo" + - IdentifierPath (Rule): # 5..9 " foo" + - Identifier (Token): "foo" # 6..9 - ForKeyword (Token): "for" # 10..13 - - TypeName (Rule): # 13..17 " bar" - - IdentifierPath (Rule): # 13..17 " bar" - - Identifier (Token): "bar" # 14..17 + - UsingTarget (Rule): # 13..17 " 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 87bf1887eb..a50e0e3dba 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,10 @@ Errors: [] Tree: - UsingDirective (Rule): # 0..16 "using foo for *;" - UsingKeyword (Token): "using" # 0..5 - - IdentifierPath (Rule): # 5..9 " foo" - - Identifier (Token): "foo" # 6..9 + - UsingClause (Rule): # 5..9 " foo" + - IdentifierPath (Rule): # 5..9 " foo" + - Identifier (Token): "foo" # 6..9 - ForKeyword (Token): "for" # 10..13 - - Asterisk (Token): "*" # 14..15 + - UsingTarget (Rule): # 13..15 " *" + - Asterisk (Token): "*" # 14..15 - Semicolon (Token): ";" # 15..16 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 1ef9b4501a..e6eaae9f47 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 @@ -16,17 +16,19 @@ Errors: # 1 total Tree: - UsingDirective (Rule): # 0..32 "using {div as /} for Int global;" - UsingKeyword (Token): "using" # 0..5 - - UsingDeconstruction (Rule): # 5..16 " {div as /}" - - OpenBrace (Token): "{" # 6..7 - - UsingDeconstructionSymbols (Rule): # 7..10 "div" - - UsingDeconstructionSymbol (Rule): # 7..10 "div" - - IdentifierPath (Rule): # 7..10 "div" - - Identifier (Token): "div" # 7..10 - - SKIPPED (Token): "as /" # 11..15 - - CloseBrace (Token): "}" # 15..16 + - UsingClause (Rule): # 5..16 " {div as /}" + - UsingDeconstruction (Rule): # 5..16 " {div as /}" + - OpenBrace (Token): "{" # 6..7 + - UsingDeconstructionSymbols (Rule): # 7..10 "div" + - UsingDeconstructionSymbol (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..24 " Int" - - IdentifierPath (Rule): # 20..24 " Int" - - Identifier (Token): "Int" # 21..24 + - UsingTarget (Rule): # 20..24 " 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 b8933b0136..d0194e65c5 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 @@ -8,19 +8,22 @@ Errors: [] Tree: - UsingDirective (Rule): # 0..32 "using {div as /} for Int global;" - UsingKeyword (Token): "using" # 0..5 - - UsingDeconstruction (Rule): # 5..16 " {div as /}" - - OpenBrace (Token): "{" # 6..7 - - UsingDeconstructionSymbols (Rule): # 7..15 "div as /" - - UsingDeconstructionSymbol (Rule): # 7..15 "div as /" - - IdentifierPath (Rule): # 7..10 "div" - - Identifier (Token): "div" # 7..10 - - UsingAlias (Rule): # 10..15 " as /" - - AsKeyword (Token): "as" # 11..13 - - Slash (Token): "/" # 14..15 - - CloseBrace (Token): "}" # 15..16 + - UsingClause (Rule): # 5..16 " {div as /}" + - UsingDeconstruction (Rule): # 5..16 " {div as /}" + - OpenBrace (Token): "{" # 6..7 + - UsingDeconstructionSymbols (Rule): # 7..15 "div as /" + - UsingDeconstructionSymbol (Rule): # 7..15 "div as /" + - IdentifierPath (Rule): # 7..10 "div" + - Identifier (Token): "div" # 7..10 + - UsingAlias (Rule): # 10..15 " as /" + - AsKeyword (Token): "as" # 11..13 + - UsingOperator (Rule): # 13..15 " /" + - Slash (Token): "/" # 14..15 + - CloseBrace (Token): "}" # 15..16 - ForKeyword (Token): "for" # 17..20 - - TypeName (Rule): # 20..24 " Int" - - IdentifierPath (Rule): # 20..24 " Int" - - Identifier (Token): "Int" # 21..24 + - UsingTarget (Rule): # 20..24 " 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/VariableDeclarationStatement/var/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.4.11-success.yml index ce501c55f2..616357ba3f 100644 --- a/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/VariableDeclarationStatement/var/generated/0.4.11-success.yml @@ -7,7 +7,8 @@ Errors: [] Tree: - VariableDeclarationStatement (Rule): # 0..10 "var z = 0;" - - VarKeyword (Token): "var" # 0..3 + - VariableDeclarationType (Rule): # 0..3 "var" + - VarKeyword (Token): "var" # 0..3 - Identifier (Token): "z" # 4..5 - VariableDeclarationValue (Rule): # 5..9 " = 0" - Equal (Token): "=" # 6..7 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 b57d8f9200..662d3692dc 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 @@ -13,42 +13,44 @@ Tree: - YulBlock (Rule): # 0..62 "{\n\tfunction mult(a, b) -> result {\n\t\tresult := mul..." - OpenBrace (Token): "{" # 0..1 - YulStatements (Rule): # 2..60 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." - - YulFunctionDefinition (Rule): # 2..60 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." - - YulFunctionKeyword (Token): "function" # 3..11 - - YulIdentifier (Token): "mult" # 12..16 - - YulParametersDeclaration (Rule): # 16..22 "(a, b)" - - OpenParen (Token): "(" # 16..17 - - YulParameters (Rule): # 17..21 "a, b" - - YulIdentifier (Token): "a" # 17..18 - - Comma (Token): "," # 18..19 - - YulIdentifier (Token): "b" # 20..21 - - CloseParen (Token): ")" # 21..22 - - YulReturnsDeclaration (Rule): # 22..32 " -> result" - - MinusGreaterThan (Token): "->" # 23..25 - - YulReturnVariables (Rule): # 25..32 " result" - - YulIdentifier (Token): "result" # 26..32 - - YulBlock (Rule): # 32..60 " {\n\t\tresult := mul(a, b)\n\t}\n" - - OpenBrace (Token): "{" # 33..34 - - YulStatements (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - - YulAssignmentStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - - YulIdentifierPaths (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" - - YulFunctionCallExpression (Rule): # 46..57 " mul(a, b)\n" - - YulExpression (Rule): # 46..50 " mul" - - YulIdentifierPath (Rule): # 46..50 " mul" - - YulIdentifier (Token): "mul" # 47..50 - - OpenParen (Token): "(" # 50..51 - - YulArguments (Rule): # 51..55 "a, b" - - YulExpression (Rule): # 51..52 "a" - - YulIdentifierPath (Rule): # 51..52 "a" - - YulIdentifier (Token): "a" # 51..52 - - Comma (Token): "," # 52..53 - - YulExpression (Rule): # 53..55 " b" - - YulIdentifierPath (Rule): # 53..55 " b" - - YulIdentifier (Token): "b" # 54..55 - - CloseParen (Token): ")" # 55..56 - - CloseBrace (Token): "}" # 58..59 + - YulStatement (Rule): # 2..60 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." + - YulFunctionDefinition (Rule): # 2..60 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." + - YulFunctionKeyword (Token): "function" # 3..11 + - YulIdentifier (Token): "mult" # 12..16 + - YulParametersDeclaration (Rule): # 16..22 "(a, b)" + - OpenParen (Token): "(" # 16..17 + - YulParameters (Rule): # 17..21 "a, b" + - YulIdentifier (Token): "a" # 17..18 + - Comma (Token): "," # 18..19 + - YulIdentifier (Token): "b" # 20..21 + - CloseParen (Token): ")" # 21..22 + - YulReturnsDeclaration (Rule): # 22..32 " -> result" + - MinusGreaterThan (Token): "->" # 23..25 + - YulReturnVariables (Rule): # 25..32 " result" + - YulIdentifier (Token): "result" # 26..32 + - YulBlock (Rule): # 32..60 " {\n\t\tresult := mul(a, b)\n\t}\n" + - OpenBrace (Token): "{" # 33..34 + - YulStatements (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" + - YulIdentifierPaths (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" + - YulFunctionCallExpression (Rule): # 46..57 " mul(a, b)\n" + - YulExpression (Rule): # 46..50 " mul" + - YulIdentifierPath (Rule): # 46..50 " mul" + - YulIdentifier (Token): "mul" # 47..50 + - OpenParen (Token): "(" # 50..51 + - YulArguments (Rule): # 51..55 "a, b" + - YulExpression (Rule): # 51..52 "a" + - YulIdentifierPath (Rule): # 51..52 "a" + - YulIdentifier (Token): "a" # 51..52 + - Comma (Token): "," # 52..53 + - YulExpression (Rule): # 53..55 " b" + - YulIdentifierPath (Rule): # 53..55 " b" + - YulIdentifier (Token): "b" # 54..55 + - CloseParen (Token): ")" # 55..56 + - CloseBrace (Token): "}" # 58..59 - CloseBrace (Token): "}" # 60..61 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 9ff24e440d..0665c54004 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 @@ -23,46 +23,49 @@ Tree: - YulBlock (Rule): # 0..85 "{\n\tfunction mult(a, b) -> result {\n\t\tresult := mul..." - OpenBrace (Token): "{" # 0..1 - YulStatements (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." - - YulFunctionDefinition (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." - - YulFunctionKeyword (Token): "function" # 3..11 - - YulIdentifier (Token): "mult" # 12..16 - - YulParametersDeclaration (Rule): # 16..22 "(a, b)" - - OpenParen (Token): "(" # 16..17 - - YulParameters (Rule): # 17..21 "a, b" - - YulIdentifier (Token): "a" # 17..18 - - Comma (Token): "," # 18..19 - - YulIdentifier (Token): "b" # 20..21 - - CloseParen (Token): ")" # 21..22 - - YulReturnsDeclaration (Rule): # 22..32 " -> result" - - MinusGreaterThan (Token): "->" # 23..25 - - YulReturnVariables (Rule): # 25..32 " result" - - YulIdentifier (Token): "result" # 26..32 - - YulBlock (Rule): # 32..83 " {\n\t\tresult := mul(a, b)\n\t\tresult := [mul(a, b)\n\t}..." - - OpenBrace (Token): "{" # 33..34 - - YulStatements (Rule): # 35..65 "\t\tresult := mul(a, b)\n\t\tresult" - - YulAssignmentStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - - YulIdentifierPaths (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" - - YulFunctionCallExpression (Rule): # 46..57 " mul(a, b)\n" - - YulExpression (Rule): # 46..50 " mul" - - YulIdentifierPath (Rule): # 46..50 " mul" - - YulIdentifier (Token): "mul" # 47..50 - - OpenParen (Token): "(" # 50..51 - - YulArguments (Rule): # 51..55 "a, b" - - YulExpression (Rule): # 51..52 "a" - - YulIdentifierPath (Rule): # 51..52 "a" - - YulIdentifier (Token): "a" # 51..52 - - Comma (Token): "," # 52..53 - - YulExpression (Rule): # 53..55 " b" - - YulIdentifierPath (Rule): # 53..55 " b" - - YulIdentifier (Token): "b" # 54..55 - - CloseParen (Token): ")" # 55..56 - - 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 + - YulStatement (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." + - YulFunctionDefinition (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." + - YulFunctionKeyword (Token): "function" # 3..11 + - YulIdentifier (Token): "mult" # 12..16 + - YulParametersDeclaration (Rule): # 16..22 "(a, b)" + - OpenParen (Token): "(" # 16..17 + - YulParameters (Rule): # 17..21 "a, b" + - YulIdentifier (Token): "a" # 17..18 + - Comma (Token): "," # 18..19 + - YulIdentifier (Token): "b" # 20..21 + - CloseParen (Token): ")" # 21..22 + - YulReturnsDeclaration (Rule): # 22..32 " -> result" + - MinusGreaterThan (Token): "->" # 23..25 + - YulReturnVariables (Rule): # 25..32 " result" + - YulIdentifier (Token): "result" # 26..32 + - YulBlock (Rule): # 32..83 " {\n\t\tresult := mul(a, b)\n\t\tresult := [mul(a, b)\n\t}..." + - OpenBrace (Token): "{" # 33..34 + - YulStatements (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" + - YulIdentifierPaths (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" + - YulFunctionCallExpression (Rule): # 46..57 " mul(a, b)\n" + - YulExpression (Rule): # 46..50 " mul" + - YulIdentifierPath (Rule): # 46..50 " mul" + - YulIdentifier (Token): "mul" # 47..50 + - OpenParen (Token): "(" # 50..51 + - YulArguments (Rule): # 51..55 "a, b" + - YulExpression (Rule): # 51..52 "a" + - YulIdentifierPath (Rule): # 51..52 "a" + - YulIdentifier (Token): "a" # 51..52 + - Comma (Token): "," # 52..53 + - YulExpression (Rule): # 53..55 " b" + - YulIdentifierPath (Rule): # 53..55 " b" + - YulIdentifier (Token): "b" # 54..55 + - CloseParen (Token): ")" # 55..56 + - 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 - CloseBrace (Token): "}" # 83..84 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 61c967ad17..06cf8c300b 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 @@ -23,46 +23,49 @@ Tree: - YulBlock (Rule): # 0..85 "{\n\tfunction mult(a, b) -> result {\n\t\tresult := mul..." - OpenBrace (Token): "{" # 0..1 - YulStatements (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." - - YulFunctionDefinition (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." - - YulFunctionKeyword (Token): "function" # 3..11 - - YulIdentifier (Token): "mult" # 12..16 - - YulParametersDeclaration (Rule): # 16..22 "(a, b)" - - OpenParen (Token): "(" # 16..17 - - YulParameters (Rule): # 17..21 "a, b" - - YulIdentifier (Token): "a" # 17..18 - - Comma (Token): "," # 18..19 - - YulIdentifier (Token): "b" # 20..21 - - CloseParen (Token): ")" # 21..22 - - YulReturnsDeclaration (Rule): # 22..32 " -> result" - - MinusGreaterThan (Token): "->" # 23..25 - - YulReturnVariables (Rule): # 25..32 " result" - - YulIdentifier (Token): "result" # 26..32 - - YulBlock (Rule): # 32..83 " {\n\t\tresult := mul(a, b)\n\t\tresult := [mul(a, b)\n\t}..." - - OpenBrace (Token): "{" # 33..34 - - YulStatements (Rule): # 35..65 "\t\tresult := mul(a, b)\n\t\tresult" - - YulAssignmentStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n" - - YulIdentifierPaths (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" - - YulFunctionCallExpression (Rule): # 46..57 " mul(a, b)\n" - - YulExpression (Rule): # 46..50 " mul" - - YulIdentifierPath (Rule): # 46..50 " mul" - - YulIdentifier (Token): "mul" # 47..50 - - OpenParen (Token): "(" # 50..51 - - YulArguments (Rule): # 51..55 "a, b" - - YulExpression (Rule): # 51..52 "a" - - YulIdentifierPath (Rule): # 51..52 "a" - - YulIdentifier (Token): "a" # 51..52 - - Comma (Token): "," # 52..53 - - YulExpression (Rule): # 53..55 " b" - - YulIdentifierPath (Rule): # 53..55 " b" - - YulIdentifier (Token): "b" # 54..55 - - CloseParen (Token): ")" # 55..56 - - 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 + - YulStatement (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." + - YulFunctionDefinition (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..." + - YulFunctionKeyword (Token): "function" # 3..11 + - YulIdentifier (Token): "mult" # 12..16 + - YulParametersDeclaration (Rule): # 16..22 "(a, b)" + - OpenParen (Token): "(" # 16..17 + - YulParameters (Rule): # 17..21 "a, b" + - YulIdentifier (Token): "a" # 17..18 + - Comma (Token): "," # 18..19 + - YulIdentifier (Token): "b" # 20..21 + - CloseParen (Token): ")" # 21..22 + - YulReturnsDeclaration (Rule): # 22..32 " -> result" + - MinusGreaterThan (Token): "->" # 23..25 + - YulReturnVariables (Rule): # 25..32 " result" + - YulIdentifier (Token): "result" # 26..32 + - YulBlock (Rule): # 32..83 " {\n\t\tresult := mul(a, b)\n\t\tresult := [mul(a, b)\n\t}..." + - OpenBrace (Token): "{" # 33..34 + - YulStatements (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" + - YulIdentifierPaths (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" + - YulFunctionCallExpression (Rule): # 46..57 " mul(a, b)\n" + - YulExpression (Rule): # 46..50 " mul" + - YulIdentifierPath (Rule): # 46..50 " mul" + - YulIdentifier (Token): "mul" # 47..50 + - OpenParen (Token): "(" # 50..51 + - YulArguments (Rule): # 51..55 "a, b" + - YulExpression (Rule): # 51..52 "a" + - YulIdentifierPath (Rule): # 51..52 "a" + - YulIdentifier (Token): "a" # 51..52 + - Comma (Token): "," # 52..53 + - YulExpression (Rule): # 53..55 " b" + - YulIdentifierPath (Rule): # 53..55 " b" + - YulIdentifier (Token): "b" # 54..55 + - CloseParen (Token): ")" # 55..56 + - 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 - CloseBrace (Token): "}" # 83..84 diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_literal/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_literal/generated/0.4.11-success.yml index 8ee9e709b6..c4f3af5ae1 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_literal/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/decimal_literal/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - YulExpression (Rule): # 0..3 "123" - - YulDecimalLiteral (Token): "123" # 0..3 + - YulLiteral (Rule): # 0..3 "123" + - YulDecimalLiteral (Token): "123" # 0..3 diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/function_call/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/function_call/generated/0.4.11-success.yml index d20030d342..6a2d7aa0a2 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/function_call/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/function_call/generated/0.4.11-success.yml @@ -14,5 +14,6 @@ Tree: - OpenParen (Token): "(" # 3..4 - YulArguments (Rule): # 4..5 "1" - YulExpression (Rule): # 4..5 "1" - - YulDecimalLiteral (Token): "1" # 4..5 + - YulLiteral (Rule): # 4..5 "1" + - YulDecimalLiteral (Token): "1" # 4..5 - CloseParen (Token): ")" # 5..6 diff --git a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_literal/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_literal/generated/0.4.11-success.yml index 83d6f442e8..ed01ee87f1 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_literal/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulExpression/hex_literal/generated/0.4.11-success.yml @@ -7,4 +7,5 @@ Errors: [] Tree: - YulExpression (Rule): # 0..5 "0x123" - - YulHexLiteral (Token): "0x123" # 0..5 + - YulLiteral (Rule): # 0..5 "0x123" + - YulHexLiteral (Token): "0x123" # 0..5